Edit File: media-lib-browse.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}; $jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6-impl","es3");var themifyMediaLib={}; (function(a){themifyMediaLib={init:function(){this.mediaUploader()},mediaUploader:function(){var c="";a("body").on("click",".themify-media-lib-browse",function(b){var d=a(this),e=d.data("submit"),f=d.data("type");c=wp.media.frames.file_frame=wp.media({title:a(this).data("uploader-title"),library:{type:f},button:{text:a(this).data("uploader-button-text")},multiple:!1});c.on("select",function(){var b=c.state().get("selection").first().toJSON();e.attach_id=b.id;var g=d.data("fields");a("#"+g).val(b.url); a("body").trigger("themify_metabox_lib_selected",[d,b,c]);"image"===f?a.ajax({type:"POST",url:ajaxurl,data:e,dataType:"json",success:function(a){themifyMediaLib.setPreviewIcon(d.closest(".themify_field, .themify_field_row"),a.thumb)}}):"audio"!==f&&"video"!==f||d.closest(".themify_field_row").find(".themify_featimg_remove").removeClass("hide")});c.open();b.preventDefault()})},setPreviewIcon:function(c,b){var d=a('<a href="'+b+'" target="_blank"><img src="'+b+'" width="40" /></a>').fadeIn(1E3).css("display", "inline-block");0<c.find(".themify_upload_preview").find("a").length&&c.find(".themify_upload_preview").find("a").remove();c.find(".themify_upload_preview").fadeIn().append(d);c.find(".themify_featimg_remove").removeClass("hide")}};a(document).ready(function(){themifyMediaLib.init()})})(jQuery);
Back to File Manager