File Editor
Directories:
.. (Back)
Files:
admin.min.asset.php
admin.min.js
gallery.min.asset.php
gallery.min.js
Create New File
Create
Edit File: admin.min.js
!function(e){var t,i;e((function(){e(document.body).on("click",".gallery-widget-choose-images",(function(l){l.preventDefault();var r=e(this).closest("form, .form");t=r.find(".gallery-widget-ids"),i=r.find(".gallery-widget-thumbs");var n=function(e){if(!e)return null;var t=wp.shortcode.next("gallery",'[gallery ids="'+e+'"]');t=t.shortcode;var i=wp.media.gallery.attachments(t);return i}(t.val()),a=null,o=!1;n&&(a=function(e){var t=new wp.media.model.Selection(e.models,{props:e.props.toJSON(),multiple:!0});return t.gallery=e.gallery,t.more().done((function(){t.props.set({query:!1}),t.unmirror(),t.props.unset("orderby")})),t}(n),o=!0);var d=function(e){var l=new wp.media.view.MediaFrame.GalleryWidget(e);return l.on("update",(function(e){var r=l.state();if(e=e||r.get("selection")){var n=e.map((function(e){return e.get("id")})).join(",");t.val(n).trigger("change"),function(e,t){t.empty();var i=_wpGalleryWidgetAdminSettings.thumbSize;e.each((function(e){var l=e.get("url")+"?w="+i+"&h="+i+"&crop=true",r=jQuery("<img>",{src:l,alt:e.get("title"),title:e.get("title"),width:i,height:i,class:"thumb"});t.append(r)}))}(e,i)}}),this),l.setState(l.options.state),l}({state:"gallery-edit",title:wp.media.view.l10n.addMedia,multiple:!0,editing:o,selection:a});d.open()})),e(".widget-inside").on("change",".gallery-widget-style",n),n()}));var l,r=wp.media;function n(){e(".widget-inside .gallery-widget-style").each((function(){var t=e(this).val(),i=e(this).parents("form");"slideshow"===t?(i.find(".gallery-widget-link-wrapper").hide(),i.find(".gallery-widget-columns-wrapper").hide()):(i.find(".gallery-widget-link-wrapper").show(),i.find(".gallery-widget-columns-wrapper").show())}))}l=r.view.l10n="undefined"==typeof _wpMediaViewsL10n?{}:_wpMediaViewsL10n,r.view.MediaFrame.GalleryWidget=r.view.MediaFrame.Post.extend({createStates:function(){var e=this.options;"CollectionEdit"in r.controller?this.states.add([new r.controller.CollectionEdit({type:"image",collectionType:"gallery",title:l.editGalleryTitle,SettingsView:r.view.Settings.Gallery,library:e.selection,editing:e.editing,menu:"gallery"}),new r.controller.CollectionAdd({type:"image",collectionType:"gallery",title:l.addToGalleryTitle})]):("WidgetGalleryEdit"in r.controller||(r.controller.WidgetGalleryEdit=r.controller.GalleryEdit.extend({gallerySettings:function(){}})),this.states.add([new r.controller.WidgetGalleryEdit({library:e.selection,editing:e.editing,menu:"gallery"}),new r.controller.GalleryAdd({})]))}})}(jQuery);
Save Changes
Rename File
Rename