Sindbad~EG File Manager
!function(o){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.background=redux.field_objects.background||{},redux.field_objects.background.init=function(e){e=o.redux.getSelector(e,"background"),o(e).each(function(){const t=o(this);let e=t;(e=t.hasClass("redux-field-container")?e:t.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),t.find(".redux-remove-background").off("click").on("click",function(e){return e.preventDefault(),redux.field_objects.background.removeImage(o(this).parents(".redux-container-background:first")),redux.field_objects.background.preview(o(this)),!1}),t.find(".redux-background-upload").off().on("click",function(e){redux.field_objects.background.addImage(e,o(this).parents(".redux-container-background:first"))}),t.find(".redux-background-input").on("change",function(){redux.field_objects.background.preview(o(this))}),t.find(".redux-color").wpColorPicker({change:function(e,i){o(this).val(i.color.toString()),redux_change(o(this)),o("#"+e.target.id+"-transparency").prop("checked",!1),redux.field_objects.background.preview(o(this))},clear:function(e){redux_change(o(this).parent().find(".redux-color-init")),redux.field_objects.background.preview(o(this))}}),t.find(".redux-color").on("blur",function(){var e=o(this).val(),i="#"+o(this).attr("id");"transparent"===e?(o(this).parent().parent().find(".wp-color-result").css("background-color","transparent"),t.find(i+"-transparency").prop("checked",!0)):(colorValidate(this)===e&&0!==e.indexOf("#")&&o(this).val(o(this).data("oldcolor")),t.find(i+"-transparency").prop("checked",!1))}),t.find(".redux-color").on("focus",function(){o(this).data("oldcolor",o(this).val())}),t.find(".redux-color").on("keyup",function(){var e=o(this).val(),i=colorValidate(this),r="#"+o(this).attr("id");"transparent"===e?(o(this).parent().parent().find(".wp-color-result").css("background-color","transparent"),t.find(r+"-transparency").prop("checked",!0)):(t.find(r+"-transparency").prop("checked",!1),i&&i!==o(this).val()&&o(this).val(i))}),t.find(".color-transparency").on("click",function(){let e;o(this).is(":checked")?(t.find(".redux-saved-color").val(o("#"+o(this).data("id")).val()),t.find("#"+o(this).data("id")).val("transparent"),t.find("#"+o(this).data("id")).parents(".redux-field-container").find(".wp-color-result").css("background-color","transparent")):(""===(e=o(this).parents(".redux-field-container").find(".redux-saved-color").val())&&(e=o("#"+o(this).data("id")).data("default-color")),t.find("#"+o(this).data("id")).parents(".redux-field-container").find(".wp-color-result").css("background-color",e),t.find("#"+o(this).data("id")).val(e)),redux_change(o(this))}),t.find(" .redux-background-repeat, .redux-background-clip, .redux-background-origin, .redux-background-size, .redux-background-attachment, .redux-background-position").select2())})},redux.field_objects.background.preview=function(e){let i,r=!0;var e=o(e).parents(".redux-container-background:first"),t=o(e).find(".background-preview");t&&(i="height:"+t.height()+"px;",o(e).find(".redux-background-input").each(function(){var e=o(this).serializeArray();(e=e[0])&&-1!==e.name.indexOf("[background-")&&""!==e.value&&(r=!1,e.name=e.name.split("[background-"),e.name="background-"+e.name[1].replace("]",""),"background-image"===e.name?i+=e.name+':url("'+e.value+'");':i+=e.name+":"+e.value+";")}),r?t.slideUp():t.attr("style",i).fadeIn())},redux.field_objects.background.addImage=function(e,a){let n;var i=o(this);e.preventDefault(),n,(n=wp.media({multiple:!1,library:{},title:i.data("choose"),button:{text:i.data("update")}})).on("select",function(){let e,i,r;var t,d=n.state().get("selection").first();if(n.close(),"image"===d.attributes.type){if(a.find(".upload").val(d.attributes.url),a.find(".upload-id").val(d.attributes.id),a.find(".upload-height").val(d.attributes.height),a.find(".upload-width").val(d.attributes.width),redux_change(o(a).find(".upload-id")),e=d.attributes.url,void 0!==d.attributes.sizes&&void 0!==d.attributes.sizes.thumbnail)e=d.attributes.sizes.thumbnail.url;else if(void 0!==d.attributes.sizes)for(r in i=d.attributes.height,d.attributes.sizes)d.attributes.sizes.hasOwnProperty(r)&&(t=d.attributes.sizes[r]).height<i&&(i=t.height,e=t.url);else e=d.attributes.icon;a.find(".upload-thumbnail").val(e),a.find(".upload").hasClass("noPreview")||a.find(".screenshot").empty().hide().append('<img alt="" class="redux-option-image" src="'+e+'">').slideDown("fast"),a.find(".redux-remove-background").removeClass("hide"),a.find(".redux-background-input-properties").slideDown(),redux.field_objects.background.preview(a.find(".upload"))}}),n.open()},redux.field_objects.background.removeImage=function(e){e.find(".redux-remove-background").addClass("hide")&&(e.find(".redux-remove-background").addClass("hide"),e.find(".upload").val(""),e.find(".upload-id").val(""),e.find(".upload-height").val(""),e.find(".upload-width").val(""),redux_change(o(e).find(".upload-id")),e.find(".redux-background-input-properties").hide(),e.find(".screenshot").slideUp(),e.find(".remove-file").off(),0<o(".section-upload .upload-notice").length)&&o(".redux-background-upload").remove()}}(jQuery);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists