Edit File: gallery-shortcode.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,d){a instanceof String&&(a=String(a));for(var e=a.length,b=0;b<e;b++){var g=a[b];if(c.call(d,g,b,a))return{i:b,v:g}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,d){a!=Array.prototype&&a!=Object.prototype&&(a[c]=d.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,d,e){if(c){d=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var b=a[e];b in d||(d[b]={});d=d[b]}a=a[a.length-1];e=d[a];c=c(e);c!=e&&null!=c&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,d){return $jscomp.findInternal(this,a,d).v}},"es6-impl","es3"); (function(a){var c={init:function(){this.galleryShortcode()},galleryShortcode:function(){var d=wp.media.gallery.shortcode,c=wp.media.gallery,b;a(".themify-gallery-shortcode-btn").on("click",function(e){var f=a(this).closest(".themify_field").find(".themify-gallery-shortcode-input");f.html()&&(f.val(f.html()),f.html(""),f.text(""));b?b.open():b=0<a.trim(f.val()).length?c.edit(a.trim(f.val())):wp.media.frames.file_frame=wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle, editing:!0,multiple:!0,selection:!1});wp.media.gallery.shortcode=function(a){var c=a.props.toJSON(),b=_.pick(c,"orderby","order");a.gallery&&_.extend(b,a.gallery.toJSON());b.ids=a.pluck("id");c.uploadedTo&&(b.id=c.uploadedTo);b._orderbyRandom&&(b.orderby="rand");delete b._orderbyRandom;b.ids&&"post__in"===b.orderby&&delete b.orderby;_.each(wp.media.gallery.defaults,function(a,c){a===b[c]&&delete b[c]});a=new wp.shortcode({tag:"gallery",attrs:b,type:"single"});f.val(a.string());wp.media.gallery.shortcode= d;return a};b.on("update",function(a){a=wp.media.gallery.shortcode(a).string().slice(1,-1);f.val("["+a+"]")});0===a.trim(f.val()).length&&a(".media-menu").find(".media-menu-item").last().trigger("click");e.preventDefault()})}};a(document).ready(function(){c.init()})})(jQuery);
Back to File Manager