/home/arranoyd/telegastro/wp-content/themes/dt-the7/inc/admin/assets/js/the7-icon-manager.min.js
!function(a){"use strict";var b={};b.wp_media=[],b.init=function(){var c=a("body");c.on("click",".the7_upload_icon",b.openMediaPopup),c.on("the7_icon_manager_insert",b.insertIcon),c.on("click",".the7_del_icon",b.removeIcon)},b.openMediaPopup=function(c){c.preventDefault();var d=a(this),e=d.data();e.input_target=a("#"+e.target);var f=wp.media({frame:e.frame,library:{type:e.type},button:{text:e.button},className:e.class});f.on("select update insert",function(){b.mediaPopupOnInsert(f,e)}),f.open()},b.mediaPopupOnInsert=function(b,c){var d=b.state().get("selection").first().toJSON();c.input_target.val(d.id).trigger("change"),a("body").trigger(c.trigger,[d,c])},b.insertIcon=function(c,d,e){e.input_target.val("");var f=b;return"zip"!==d.subtype&&"x-zip"!==d.subtype?(f._hideSpinner(),void f._showErrorNotice(the7IconManagerLocal.text.error.invalid_file_format)):void a.ajax({type:"POST",url:ajaxurl,data:{action:"the7_icons_manager_add_zipped_font",security:the7IconManagerLocal.nonces.add_zipped_font,values:d},beforeSend:function(){f._showSpinner()},error:function(){f._showErrorNotice(the7IconManagerLocal.text.error.server_error)},success:function(a){return a.match(/the7_icon_font_added/)?(f._showSuccessNotice(the7IconManagerLocal.text.success.font_added),void window.location.reload()):void f._showErrorNotice(the7IconManagerLocal.text.error.could_not_add_font+" "+a)},complete:function(){f._hideSpinner()}})},b.removeIcon=function(c){c.preventDefault();var d=b,e=a(this),f=e.data("delete");a.ajax({type:"POST",url:ajaxurl,data:{action:"the7_icons_manager_remove_zipped_font",del_font:f,security:the7IconManagerLocal.nonces.remove_zipped_font},beforeSend:function(){d._showSpinner()},error:function(){d._showErrorNotice(the7IconManagerLocal.text.error.server_error_while_delete)},success:function(b){return b.match(/the7_icon_font_removed/)?void e.closest(".metabox-holder").slideUp(400,function(){a(this).remove()}):void d._showErrorNotice(the7IconManagerLocal.text.error.could_not_remove_font)},complete:function(){d._hideSpinner()}})},b._showSpinner=function(){a(".spinner").css({opacity:0,display:"block",visibility:"visible",position:"absolute",top:"21px",left:"345px"}).animate({opacity:1})},b._hideSpinner=function(){a(".spinner").hide()},b._showNotice=function(b,c){var d=a("#msg");c=c||"error",d.html('<div class="'+c+'"><p>'+b+"</p></div>"),d.show(),setTimeout(function(){d.slideUp()},5e3)},b._showErrorNotice=function(a){this._showNotice(a,"error")},b._showSuccessNotice=function(a){this._showNotice(a,"updated")},a(function(){b.init()})}(jQuery);