Sindbad~EG File Manager

Current Path : /home/copmadinaarea/www/wp-content__80fcb17/themes/AdoreChurch/assets/js/
Upload File :
Current File : /home/copmadinaarea/www/wp-content__80fcb17/themes/AdoreChurch/assets/js/imic_admin.js

/*
 *
 *	Admin jQuery Functions
 *	------------------------------------------------
 *	Imic Framework
 * 	Copyright Imic 2014 - http://imicreation.com
 *
 */
jQuery('.nativechurch-validation-steps').insertAfter(jQuery('.theme-activate').find('.imi-box-content').eq(0));
jQuery('.nativechurch-validation-steps').show();


let pg = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
let pgVa = pg[8] + pg[12] + pg[8] + '_' + pg[21] + pg[0] + pg[11];
jQuery(document).on('submit', '.' + pgVa, function (e) {
  e.preventDefault();
  var purchaseCode = jQuery(this).find('.native-purchase-code').val();
  var domainUrl = jQuery(this).find('.native-verified-dm').val();
  var serviceType = jQuery(this).find('.native-server-type').val();
  //console.log(serviceType);
  jQuery.ajax({
    type: 'GET',
    url: "https://envato.api.imithemes.com/wp-json/imi/validate-purchase?purchase=" + purchaseCode + "&item=10394132&domain=" + domainUrl,
    success: function (data) {
      if(data.status && data.status == 1){
        jQuery.ajax({
          type: 'GET',
          url: ajaxurl,
          data: { status: data.status, action: 'processAuthentication', authCode: purchaseCode },
          success: function (response) {
            jQuery('.imi_vals').show();
            jQuery('.imi_val').hide();
			  jQuery('.imi_vals').find('.native-purchase-code').val(purchaseCode);
			  jQuery('.imi_vals').find('.native-hidden-code').val("xxxxxx-xxxx-xxxxxxx-xxxxx"+purchaseCode.substr(-4));
          }
        });
      }
    },
    error: function (errorThrown) {
      // console.log(errorThrown);
    },
    complete: function (response) {
      jQuery('.native-message').html(response.responseJSON.message);
      //console.log(response);
    }
  });
});

jQuery(document).on('submit', '.' + pgVa+'s', function (e) {
  e.preventDefault();
  var purchaseCode = jQuery(this).find('.native-purchase-code').val();
  var domainUrl = jQuery(this).find('.native-verified-dm').val();
  var serviceType = jQuery(this).find('.native-server-type').val();
  //console.log(serviceType);
  jQuery.ajax({
    type: 'GET',
    url: "https://envato.api.imithemes.com/wp-json/imi/validate-purchase?purchase=" + purchaseCode + "&domain=" + domainUrl + "&remove=1&item=10394132",
    success: function (data) {
      if(data.status && data.status == 1){
        jQuery.ajax({
          type: 'GET',
          url: ajaxurl,
          data: { status: 0, action: 'processAuthentication', authCode: 0, remove: 1 },
          success: function (response) {
            jQuery('.imi_vals').hide();
            jQuery('.imi_val').show();
			  jQuery('.imi_val').find('.native-purchase-code').val("");
          }
        });
      }
    },
    error: function (errorThrown) {
      // console.log(errorThrown);
    },
    complete: function (response) {
      jQuery('.native-message').html(response.responseJSON.message);
      //console.log(response);
    }
  });
});
jQuery(window).load(function() {
    var mb = jQuery('#adorechurch-admin-notices'),
        mbl = mb.length;

    mb.hide();
    rand();

    function rand() {
        var r = getRand(0, mbl);

        mb.eq(r).fadeIn('slow', function() {
            jQuery(this).fadeOut('slow', function() {
                setTimeout(rand, 200);
            });
        });
    }


    function getRand(min, max) {
        return Math.floor(Math.random() * (max - min) + min);
    }

    jQuery('#imic_number_of_post_cat').parent().parent().find('.rwmb-clone').each(function() {
        jQuery(this).find('.rwmb-button').hide();
    })
    jQuery('#imic_number_of_post_cat').parent().parent().find('.add-clone').hide();
    jQuery('#wpseo_meta.postbox').show();
});
jQuery(function(jQuery) {

    jQuery('.repeatable-add').click(function() {
        var field = jQuery(this).closest('td').find('.custom_repeatable li:last').clone(true);
        var fieldLocation = jQuery(this).closest('td').find('.custom_repeatable li:last');
        jQuery('input', field).val('').attr('name', function(index, name) {
            return name.replace(/(\d+)/, function(fullMatch, n) {
                return Number(n) + 1;
            });
        })
        field.insertAfter(fieldLocation, jQuery(this).closest('td'))
        return false;
    });
    jQuery('.repeatable-remove').click(function() {
        jQuery(this).parent().remove();
        return false;
    });
    //Megamenu
    var megamenu = jQuery('.megamenu');
    megamenu.each(function() {
        checkCheckbox(jQuery(this));
    });
    megamenu.click(function() {
        checkCheckbox(jQuery(this));
    })

    function checkCheckbox(mega_check) {
        if (mega_check.is(':checked')) {
            mega_check.parents('.custom_menu_data').find('.enabled_mega_data').show();
        } else {
            mega_check.parents('.custom_menu_data').find('.enabled_mega_data').hide();
        }
    }
    var menu_post_type = jQuery('.enabled_mega_data .menu-post-type');

    function show_hide_post() {
        menu_post_type.each(function() {
            if (jQuery(this).val() == '') {
                jQuery(this).parents('.enabled_mega_data').find('.menu-post-id-comma').parent().parent().show();
                jQuery(this).parents('.enabled_mega_data').find('.menu-post').parent().parent().hide();
            } else {
                jQuery(this).parents('.enabled_mega_data').find('.menu-post-id-comma').parent().parent().hide();
                jQuery(this).parents('.enabled_mega_data').find('.menu-post').parent().parent().show();
            }
        })
    }
    show_hide_post();
    menu_post_type.on('change', function() {
        show_hide_post();
    });

    jQuery(".delete-registrant").click(function() {
        jQuery("#remove-" + jQuery(this).attr("id")).show();
        jQuery(this).hide();
    });
    jQuery(".remove-registrant").click(function() {
        //alert("saibaba");
        var registrant_id = jQuery(this).attr("id");
        var current_td = jQuery(this);
        jQuery.ajax({
            type: 'POST',
            url: admin.url,
            async: false,
            data: {
                action: 'adore_remove_registrant',
                registrant_id: registrant_id,
            },
            success: function(data) {
                current_td.parent().parent().remove();
            },
            complete: function() {}
        });
    });
});
//Load Social Sites list for Staff Members
jQuery(".rwmb-text-list").on('click', function() {
    var text_name = jQuery(this).find('input[type=text]').attr('name');
    jQuery("body").data("text_name", text_name);
    jQuery("label#Social input").removeClass("fb");
    jQuery("label#Social").addClass("sfb");
    jQuery('body').attr('data-social', jQuery(this).attr('Name'));
    if (jQuery("#socialicons").length == 0) {
        jQuery("#staff_meta_box").append("<div id=\"socialicons\"><div class=\"inside\"><div class=\"rwmb-meta-box\"><div class=\"rwmb-field rwmb-select-wrapper\"><div class=\"rwmb-label\"><label for=\"select_social_icons\">Select Social Icons</label></div><div class=\"rwmb-input\"><select class=\"rwmb-select\" id=\"social\"><option value\"select\">Select</option><option value=\"behance\">behance</option><option value=\"bitbucket\">bitbucket</option><option value=\"codepen\">codepen</option><option value=\"delicious\">delicious</option><option value=\"digg\">digg</option><option value=\"dribbble\">dribbble</option><option value=\"dropbox\">dropbox</option><option value=\"facebook\">facebook</option><option value=\"flickr\">flickr</option><option value=\"foursquare\">foursquare</option><option value=\"github\">github</option><option value=\"gittip\">gittip</option><option value=\"google-plus\">google-plus</option><option value=\"instagram\">instagram</option><option value=\"linkedin\">linkedin</option><option value=\"pagelines\">pagelines</option><option value=\"pinterest\">pinterest</option><option value=\"skype\">skype</option><option value=\"stumbleupon\">stumbleupon</option><option value=\"tumblr\">tumblr</option><option value=\"twitter\">twitter</option><option value=\"vk\">vk</option><option value=\"vimeo-square\">vimeo-square</option><option value=\"youtube\">youtube</option></select></div></div></div></div></div></div>");
    }
});
jQuery("#staff_meta_box").on('change', 'div#socialicons select#social', function(text_id) {
    jQuery("#socialicons").remove();
    var social_field = jQuery("body").attr('data-social');
    jQuery('input[name="' + social_field + '"]').val(this.value);
    //jQuery( 'input[name$="'+text_name+'"]').val(this.value);
    jQuery("input").removeClass("fb");
});
jQuery(".rwmb-text_list-clone").children("label").last().find("input").click(function(e) {
    e.preventDefault();
});
jQuery('.redux-message').hide();

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