2020-10-18 19:39:07 +02:00
|
|
|
!function(i){var o={};function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}n.m=i,n.c=o,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([,,,,,,,,,,,function(t,e,i){t.exports=i(12)},function(t,e,i){var o=wp.media;o.controller.EditAttachmentMetadata=i(13),o.view.MediaFrame.Manage=i(14),o.view.Attachment.Details.TwoColumn=i(15),o.view.MediaFrame.Manage.Router=i(16),o.view.EditImage.Details=i(17),o.view.MediaFrame.EditAttachments=i(18),o.view.SelectModeToggleButton=i(19),o.view.DeleteSelectedButton=i(20),o.view.DeleteSelectedPermanentlyButton=i(21)},function(t,e){var i,o=wp.media.view.l10n;i=wp.media.controller.State.extend({defaults:{id:"edit-attachment",title:o.attachmentDetails,content:"edit-metadata",menu:!1,toolbar:!1,router:!1}}),t.exports=i},function(t,e){var i,o=wp.media.view.MediaFrame,n=wp.media.controller.Library,s=Backbone.$;i=o.extend({initialize:function(){_.defaults(this.options,{title:"",modal:!1,selection:[],library:{},multiple:"add",state:"library",uploader:!0,mode:["grid","edit"]}),this.$body=s(document.body),this.$window=s(window),this.$adminBar=s("#wpadminbar"),this.$uploaderToggler=s(".page-title-action").attr("aria-expanded","false").on("click",_.bind(this.addNewClickHandler,this)),this.$window.on("scroll resize",_.debounce(_.bind(this.fixPosition,this),15)),this.$el.addClass("wp-core-ui"),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.view.UploaderWindow({controller:this,uploader:{dropzone:document.body,container:document.body}}).render(),this.uploader.ready(),s("body").append(this.uploader.el),this.options.uploader=!1),this.gridRouter=new wp.media.view.MediaFrame.Manage.Router,o.prototype.initialize.apply(this,arguments),this.$el.appendTo(this.options.container),this.createStates(),this.bindRegionModeHandlers(),this.render(),this.bindSearchHandler(),wp.media.frames.browse=this},bindSearchHandler:function(){var t=this.$("#media-search-input"),e=this.browserView.toolbar.get("search").$el,i=this.$(".view-list"),o=_.throttle(function(t){var e=s(t.currentTarget).val(),i="";e&&(i+="?search="+e,this.gridRouter.navigate(this.gridRouter.baseUrl(i),{replace:!0}))},1e3);t.on("input",_.bind(o,this)),this.gridRouter.on("route:search",function(){var t=window.location.href;-1<t.indexOf("mode=")?t=t.replace(/mode=[^&]+/g,"mode=list"):t+=-1<t.indexOf("?")?"&mode=list":"?mode=list",t=t.replace("search=","s="),i.prop("href",t)}).on("route:reset",function(){e.val("").trigger("input")})},createStates:function(){var t=this.options;this.options.states||this.states.add([new n({library:wp.media.query(t.library),multiple:t.multiple,title:t.title,content:"browse",toolbar:"select",contentUserSetting:!1,filterable:"all",autoSelect:!1})])},bindRegionModeHandlers:function(){this.on("content:create:browse",this.browseContent,this),this.on("edit:attachment",this.openEditAttachmentModal,this),this.on("select:activate",this.bindKeydown,this),this.on("select:deactivate",this.unbindKeydown,this)},handleKeydown:function(t){27===t.which&&(t.preventDefault(),this.deactivateMode("select").activateMode("edit"))},bindKeydown:function(){this.$body.on("keydown.select",_.bind(this.handleKeydown,this))},unbindKeydown:function(){this.$body.off("keydown.select")},fixPosition:function(){var t,e;this
|