Sindbad~EG File Manager
!function($,t,i){"use strict";var e,n,c,o=[],a="";function s(i=t.body){let e=i.getElementsByClassName("themify_cm_loader")[0];e||(e=t.createElement("div"),e.className="themify_cm_loader",i.prepend(e)),e.classList.add("busy")}function m(i=t.body){const e=i.getElementsByClassName("themify_cm_loader")[0];e&&e.classList.remove("busy")}function l(t){t||(t=n);const i=t.querySelectorAll('input[type="checkbox"]');for(let t=0;t<i.length;t++)i[t].checked=a.includes(i[t].name+"=on")}function r(){var i=t;return Math.max(Math.max(i.body.scrollHeight,i.documentElement.scrollHeight),Math.max(i.body.offsetHeight,i.documentElement.offsetHeight),Math.max(i.body.clientHeight,i.documentElement.clientHeight))}function y(t,e,n,c){var a=t.clone().removeClass("cm-location");a.find(".menu-location-title").empty();var s=a.find("select").attr("name").match(/menu-locations\[(.*)\]/)[1];null==e&&(void 0===o[s]&&(o[s]=parseInt($(function(t){var i=[];for(var e in t)t.hasOwnProperty(e)&&i.push(e);return i}(i.options[s])).last()[0]),$.isNumeric(o[s])||(o[s]=1)),e=o[s]++),a.find("select").find('option[value="0"]').text(i.lang.disable_menu).before('<option value=""></option>').end().val(n).attr("name","themify_cm["+s+"]["+e+"][menu]"),(a=function(t,e,n,c){return c=c||"",t.find(".locations-row-links").empty().html('<input type="hidden" data-id="'+n+'" name="'+e+"\" value='"+c+'\' /><a href="#" class="themify-cm-conditions">'+i.lang.conditions+'</a> <a class="themify-cm-remove" href="#">x</a>'),t}(a,"themify_cm["+s+"]["+e+"][condition]",e,c)).insertBefore(jQuery('.menu-locations tr[data-menu="'+s+'"]'));var m=$(".menu-location-menus select").length,l=$(".cm-replacement-button").length+1;a.find(".menu-location-menus").attr("data-item",s+e),m===l&&$(".themify-cm-conditions-container:first").addClass("themify-cm-conditions-container-"+s+e).data("item",s+e),m>l&&$(".themify-cm-conditions-container:first").clone().removeClass().addClass("themify-cm-conditions-container themify-admin-lightbox tf_clearfix themify-cm-conditions-container-"+s+e).data("item",s+e).insertAfter(".themify-cm-conditions-container:last")}$(".menu-locations .locations-row-links").empty(),$("body").on("click",".themify-cm-conditions",(function(o){o.preventDefault(),a=decodeURI((e=this.previousElementSibling).value);var y=$(t).scrollTop()+80;return n||(s(),$.ajax({type:"POST",url:ajaxurl,async:!1,data:{action:"themify_cm_get_conditions",nonce:i.nonce},success(i){m();const e=t.createElement("template");e.innerHTML=i,t.body.appendChild(e.content)}}),n=t.getElementById("themify-cm-conditions"),c=t.getElementById("themify-cm-overlay")),l(),c.style.display="block",$(n).show().css("top",r()).animate({top:y},800),$("#visibility-tabs",n).tabs(),$("#visibility-tabs .themify-visibility-inner-tabs",n).tabs(),!1})).on("click","#visibility-tabs .themify_cm_load_ajax, #visibility-tabs .inline-tabs a",(function(t){let e=this.dataset.type,c=n.querySelector(this.getAttribute("href"));e?c.getElementsByClassName("themify-visibility-items-page-1")[0]||$.ajax({url:ajaxurl,type:"post",data:{action:"themify_cm_create_inner_page",nonce:i.nonce,type:e},beforeSend(){s()},success(t){m(),c.firstElementChild.innerHTML=t,l(c)}}):c.querySelector(".inline-tabs .ui-tabs-active a").click()})).on("click",".themify-visibility-pagination a.page-numbers",(function(e){e.preventDefault();const c=parseInt(this.getAttribute("href")),o=this.closest(".themify-visibility-items-inner"),a=o.getElementsByClassName("themify-visibility-items-page");o.getElementsByClassName("themify-visibility-items-page-"+c)[0]||$.ajax({url:ajaxurl,async:!1,type:"post",data:{action:"themify_cm_create_inner_page",type:(this.closest(".themify-visibility-inner-tab")?this.closest(".themify-visibility-inner-tabs"):n).querySelector(".ui-tabs-active a").dataset.type,paged:c,nonce:i.nonce},beforeSend(){s()},success(i){m();const e=t.createElement("template");e.innerHTML=i,l(e.content),o.appendChild(e.content)}});for(let t=0;t<a.length;t++)a[t].style.display=a[t].classList.contains("themify-visibility-items-page-"+c)?"block":"none"})).on("change",'.themify-cm-conditions-container input[type="checkbox"]',(function(){this.checked?a+="&"+this.name+"=on":a=a.replace(this.name+"=on","")})).on("click",".themify-cm-close, #themify-cm-overlay",(t=>(t.preventDefault(),$(n).animate({top:r()},800,(()=>{c.style.display="none",n.style.display="none",a="",l()})),!1))).on("click",".themify-mc-add-assignment",(function(){return y($("#locations-"+$(this).closest("tr").attr("data-menu")).closest("tr")),!1})).on("click",".themify-cm-save",(()=>(e.value=a,$(".menu-location-menus[data-item="+e.dataset.id+"]").val(a),c.click(),!1))).on("click",".themify-cm-remove",(function(){return $(this).closest("tr").fadeOut((function(){$(this).remove()})),!1})).on("click",".themify-cm-conditions-container .uncheck-all",(t=>{t.preventDefault(),a="",l()})).on("click",".themify-cm-conditions-container .themify_apply_all_conditions",(()=>{})),window.addEventListener("load",(()=>{$.each(i.nav_menus,((t,e)=>{$("#locations-"+e).closest("tr").after('<tr class="cm-replacement-button" data-menu="'+e+'"><td> </td><td><a href="#" class="themify-mc-add-assignment">'+i.lang.add_assignment+"</a></td></tr>")})),$.each(i.options,((t,i)=>{"object"==typeof i&&$.each(i,((i,e)=>{y($("#locations-"+t).closest("tr"),i,e.menu,e.condition),o[t]=++i}))}))}))}(jQuery,document,themify_cm);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists