Sindbad~EG File Manager

Current Path : /home/julesbu/www/wp-content/plugins/kk-star-ratings/src/core/public/js/
Upload File :
Current File : /home/julesbu/www/wp-content/plugins/kk-star-ratings/src/core/public/js/kksr-migrations.js

/**
 * kk Star Ratings
 * @see https://github.com/kamalkhan/kk-star-ratings
 */

"use strict";

jQuery(document).ready(function ($) {
  function ajax(successCallback, errorCallback) {
    $.ajax({
      type: "POST",
      url: kksr_migrations.endpoint,
      data: {
        nonce: kksr_migrations.nonce,
        action: kksr_migrations.action,
      },
      error: errorCallback,
      success: successCallback,
    });
  }

  function migrate() {
    ajax(
      function (response, status, xhr) {
        if (response && response.data) {
          if (response.data.status == "pending") {
            migrate();
          } else if (response.data.status == "busy") {
            setTimeout(migrate, 5000);
          }
        }
      },
      function (xhr, status, err) {
        if (xhr.responseJSON && xhr.responseJSON.error) {
          console.error(xhr.responseJSON.error);
          setTimeout(migrate, 5000);
        }
      }
    );
  }

  migrate();
});

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists