2019-09-30 21:37:58 +02:00
|
|
|
!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=29)}(Array(29).concat([function(a,b,c){a.exports=c(30)},function(a,b,c){var d,e=wp.media,f=jQuery;e.isTouchDevice="ontouchend"in document,d=e.view.l10n=window._wpMediaViewsL10n||{},e.view.settings=d.settings||{},delete d.settings,e.model.settings.post=e.view.settings.post,f.support.transition=function(){var a,b=document.documentElement.style,c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};return a=_.find(_.keys(c),function(a){return!_.isUndefined(b[a])}),a&&{end:c[a]}}(),e.events=_.extend({},Backbone.Events),e.transition=function(a,b){var c=f.Deferred();return b=b||2e3,f.support.transition?(a instanceof f||(a=f(a)),a.first().one(f.support.transition.end,c.resolve),_.delay(c.resolve,b)):c.resolve(),c.promise()},e.controller.Region=c(31),e.controller.StateMachine=c(32),e.controller.State=c(33),e.selectionSync=c(34),e.controller.Library=c(35),e.controller.ImageDetails=c(36),e.controller.GalleryEdit=c(37),e.controller.GalleryAdd=c(38),e.controller.CollectionEdit=c(39),e.controller.CollectionAdd=c(40),e.controller.FeaturedImage=c(41),e.controller.ReplaceImage=c(42),e.controller.EditImage=c(43),e.controller.MediaLibrary=c(44),e.controller.Embed=c(45),e.controller.Cropper=c(46),e.controller.CustomizeImageCropper=c(47),e.controller.SiteIconCropper=c(48),e.View=c(49),e.view.Frame=c(50),e.view.MediaFrame=c(51),e.view.MediaFrame.Select=c(52),e.view.MediaFrame.Post=c(53),e.view.MediaFrame.ImageDetails=c(54),e.view.Modal=c(55),e.view.FocusManager=c(56),e.view.UploaderWindow=c(57),e.view.EditorUploader=c(58),e.view.UploaderInline=c(59),e.view.UploaderStatus=c(60),e.view.UploaderStatusError=c(61),e.view.Toolbar=c(62),e.view.Toolbar.Select=c(63),e.view.Toolbar.Embed=c(64),e.view.Button=c(65),e.view.ButtonGroup=c(66),e.view.PriorityList=c(67),e.view.MenuItem=c(68),e.view.Menu=c(69),e.view.RouterItem=c(70),e.view.Router=c(71),e.view.Sidebar=c(72),e.view.Attachment=c(73),e.view.Attachment.Library=c(74),e.view.Attachment.EditLibrary=c(75),e.view.Attachments=c(76),e.view.Search=c(77),e.view.AttachmentFilters=c(78),e.view.DateFilter=c(79),e.view.AttachmentFilters.Uploaded=c(80),e.view.AttachmentFilters.All=c(81),e.view.AttachmentsBrowser=c(82),e.view.Selection=c(83),e.view.Attachment.Selection=c(84),e.view.Attachments.Selection=c(85),e.view.Attachment.EditSelection=c(86),e.view.Settings=c(87),e.view.Settings.AttachmentDisplay=c(88),e.view.Settings.Gallery=c(89),e.view.Settings.Playlist=c(90),e.view.Attachment.Details=c(91),e.view.AttachmentCompat=c(92),e.view.Iframe=c(93),e.view.Embed=c(94),e.view.Label=c(95),e.view.EmbedUrl=c(96),e.view.EmbedLink=c(97),e.view.EmbedImage=c(98),e.view.ImageDetails=c(99),e.view.Cropper=c(100),e.view.SiteIconCropper=c(101),e.view.SiteIconPreview=c(102),e.view.EditImage=c(103),e.view.Spinner=c(104),e.view.Heading=c(105)},function(a,b){var c=function(a){_.extend(this,_.pick(a||{},"id","view","selector"))};c.extend=Backbone.Model.extend,_.extend(c.prototype,{mode:function(a){return a?a===this._mode?this:(this.trigger("deactivate"),this._mode=a,this.render(a),this.trigger("activate"),this):this._mode},render:function(a){i
|
|
|
|
this.createIframeStates()},createStates:function(){var a=this.options;this.states.add([new e({id:"insert",title:f.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:wp.media.query(a.library),multiple:!!a.multiple&&"reset",editable:!0,allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0}),new e({id:"gallery",title:f.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"image"},a.library))}),new wp.media.controller.Embed({metadata:a.metadata}),new wp.media.controller.EditImage({model:a.editImage}),new wp.media.controller.GalleryEdit({library:a.selection,editing:a.editing,menu:"gallery"}),new wp.media.controller.GalleryAdd,new e({id:"playlist",title:f.createPlaylistTitle,priority:60,toolbar:"main-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"audio"},a.library))}),new wp.media.controller.CollectionEdit({type:"audio",collectionType:"playlist",title:f.editPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:a.selection,editing:a.editing,menu:"playlist",dragInfoText:f.playlistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"audio",collectionType:"playlist",title:f.addToPlaylistTitle}),new e({id:"video-playlist",title:f.createVideoPlaylistTitle,priority:60,toolbar:"main-video-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"video"},a.library))}),new wp.media.controller.CollectionEdit({type:"video",collectionType:"playlist",title:f.editVideoPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:a.selection,editing:a.editing,menu:"video-playlist",dragInfoText:f.videoPlaylistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"video",collectionType:"playlist",title:f.addToVideoPlaylistTitle})]),wp.media.view.settings.post.featuredImageId&&this.states.add(new wp.media.controller.FeaturedImage)},bindHandlers:function(){var a,b;d.prototype.bindHandlers.apply(this,arguments),this.on("activate",this.activate,this),b=_.find(this.counts,function(a){return 0===a.count}),"undefined"!=typeof b&&this.listenTo(wp.media.model.Attachments.all,"change:type",this.mediaTypeCounts),this.on("menu:create:gallery",this.createMenu,this),this.on("menu:create:playlist",this.createMenu,this),this.on("menu:create:video-playlist",this.createMenu,this),this.on("toolbar:create:main-insert",this.createToolbar,this),this.on("toolbar:create:main-gallery",this.createToolbar,this),this.on("toolbar:create:main-playlist",this.createToolbar,this),this.on("toolbar:create:main-video-playlist",this.createToolbar,this),this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this),a={menu:{"default":"mainMenu",gallery:"galleryMenu",playlist:"playlistMenu","video-playlist":"videoPlaylistMenu"},content:{embed:"embedContent","edit-image":"editImageContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar","main-playlist":"mainPlaylistToolbar","playlist-edit":"playlistEditToolbar","playlist-add":"playlistAddToolbar","main-video-playlist":"mainVideoPlaylistToolbar","video-playlist-edit":"videoPlaylistEditToolbar","video-playlist-add":"videoPlaylistAddToolbar"}},_.each(a,function(a,b){_.each(a,function(a,c){this.on(b+":render:"+c,this[a],this)},this)},this)},activate:function(){_.each(this.counts,function(a){a.count<1&&this.menuItemVisibility(a.state,"hide")},this)},mediaTypeCounts:function(a,b){"undefined"!=typeof this.counts[b]&&this.counts[b].count<1&&(this.counts[b].count++,this.menuItemVisibility(this.counts[b].state,"show"))},mainMenu:function(a){a.set({"library-separator":new wp.media.View({className:"separator",priority:100,attributes:{role:"presentation"}})})},menuItemVisibility:function(a,b){var c=this.menu.get();"hide"===b?c.hide(a):"show"===b&&c.show(a)},galleryMenu:functio
|
2019-10-03 14:10:57 +02:00
|
|
|
this.visibility()},unset:function(){e.prototype.unset.apply(this,arguments),this.visibility()},visibility:function(){var a=this.region,b=this.controller[a].get(),c=this.views.get(),d=!c||c.length<2;this===b&&(this.isVisible=!d,this.controller.$el.toggleClass("hide-"+a,d))},select:function(a){var b=this.get(a);b&&(this.deselect(),b.$el.addClass("active"),this.focusManager.setupAriaTabs())},deselect:function(){this.$el.children().removeClass("active")},hide:function(a){var b=this.get(a);b&&b.$el.addClass("hidden")},show:function(a){var b=this.get(a);b&&b.$el.removeClass("hidden")}}),a.exports=c},function(a,b){var c=wp.media.view.MenuItem.extend({click:function(){var a=this.options.contentMode;a&&this.controller.content.mode(a)}});a.exports=c},function(a,b){var c,d=wp.media.view.Menu;c=d.extend({tagName:"div",className:"media-router",property:"contentMode",ItemView:wp.media.view.RouterItem,region:"router",attributes:{role:"tablist","aria-orientation":"horizontal"},initialize:function(){this.controller.on("content:render",this.update,this),d.prototype.initialize.apply(this,arguments)},update:function(){var a=this.controller.content.mode();a&&this.select(a)}}),a.exports=c},function(a,b){var c=wp.media.view.PriorityList.extend({className:"media-sidebar"});a.exports=c},function(a,b){var c,d=wp.media.View,e=jQuery;c=d.extend({tagName:"li",className:"attachment",template:wp.template("attachment"),attributes:function(){return{tabIndex:0,role:"checkbox","aria-label":this.model.get("title"),"aria-checked":!1,"data-id":this.model.get("id")}},events:{click:"toggleSelectionHandler","change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .attachment-close":"removeFromLibrary","click .check":"checkClickHandler",keydown:"toggleSelectionHandler"},buttons:{},initialize:function(){var a=this.options.selection,b=_.defaults(this.options,{rerenderOnModelChange:!0});b.rerenderOnModelChange?this.listenTo(this.model,"change",this.render):this.listenTo(this.model,"change:percent",this.progress),this.listenTo(this.model,"change:title",this._syncTitle),this.listenTo(this.model,"change:caption",this._syncCaption),this.listenTo(this.model,"change:artist",this._syncArtist),this.listenTo(this.model,"change:album",this._syncAlbum),this.listenTo(this.model,"add",this.select),this.listenTo(this.model,"remove",this.deselect),a&&(a.on("reset",this.updateSelect,this),this.listenTo(this.model,"selection:single selection:unsingle",this.details),this.details(this.model,this.controller.state().get("selection"))),this.listenTo(this.controller.states,"attachment:compat:waiting attachment:compat:ready",this.updateSave)},dispose:function(){var a=this.options.selection;return this.updateAll(),a&&a.off(null,null,this),d.prototype.dispose.apply(this,arguments),this},render:function(){var a=_.defaults(this.model.toJSON(),{orientation:"landscape",uploading:!1,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:!1,alt:"",description:""},this.options);return a.buttons=this.buttons,a.describe=this.controller.state().get("describe"),"image"===a.type&&(a.size=this.imageSize()),a.can={},a.nonces&&(a.can.remove=!!a.nonces["delete"],a.can.save=!!a.nonces.update),this.controller.state().get("allowLocalEdits")&&(a.allowLocalEdits=!0),a.uploading&&!a.percent&&(a.percent=0),this.views.detach(),this.$el.html(this.template(a)),this.$el.toggleClass("uploading",a.uploading),a.uploading?this.$bar=this.$(".media-progress-bar div"):delete this.$bar,this.updateSelect(),this.updateSave(),this.views.render(),this},progress:function(){this.$bar&&this.$bar.length&&this.$bar.width(this.model.get("percent")+"%")},toggleSelectionHandler:function(a){var b;if("INPUT"!==a.target.nodeName&&"BUTTON"!==a.target.nodeName){if(37===a.keyCode||38===a.keyCode||39===a.keyCode||40===a.keyCode)return void this.controller.trigger("attachment:keydown:arrow",a);if("keydown"!==a.type||13===a.keyCode||32===a.keyCode){if(a.preventDefault(
|
|
|
|
this.views.render(),this}});a.exports=c},function(a,b){var c=wp.media.View.extend({className:"media-embed",initialize:function(){this.url=new wp.media.view.EmbedUrl({controller:this.controller,model:this.model.props}).render(),this.views.set([this.url]),this.refresh(),this.listenTo(this.model,"change:type",this.refresh),this.listenTo(this.model,"change:loading",this.loading)},settings:function(a){this._settings&&this._settings.remove(),this._settings=a,this.views.add(a)},refresh:function(){var a,b=this.model.get("type");if("image"===b)a=wp.media.view.EmbedImage;else{if("link"!==b)return;a=wp.media.view.EmbedLink}this.settings(new a({controller:this.controller,model:this.model.props,priority:40}))},loading:function(){this.$el.toggleClass("embed-loading",this.model.get("loading"))}});a.exports=c},function(a,b){var c=wp.media.View.extend({tagName:"label",className:"screen-reader-text",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}});a.exports=c},function(a,b){var c,d=wp.media.View,e=jQuery,f=wp.media.view.l10n;c=d.extend({tagName:"span",className:"embed-url",events:{input:"url"},initialize:function(){this.$input=e('<input id="embed-url-field" type="url" />').attr("aria-label",f.insertFromUrlTitle).val(this.model.get("url")),this.input=this.$input[0],this.spinner=e('<span class="spinner" />')[0],this.$el.append([this.input,this.spinner]),this.listenTo(this.model,"change:url",this.render),this.model.get("url")&&_.delay(_.bind(function(){this.model.trigger("change:url")},this),500)},render:function(){var a=this.$input;if(!a.is(":focus"))return this.input.value=this.model.get("url")||"http://",d.prototype.render.apply(this,arguments),this},url:function(a){this.model.set("url",e.trim(a.target.value))}}),a.exports=c},function(a,b){var c,d=jQuery;c=wp.media.view.Settings.extend({className:"embed-link-settings",template:wp.template("embed-link-settings"),initialize:function(){this.listenTo(this.model,"change:url",this.updateoEmbed)},updateoEmbed:_.debounce(function(){var a=this.model.get("url");this.$(".embed-container").hide().find(".embed-preview").empty(),this.$(".setting").hide(),a&&(a.length<11||!a.match(/^http(s)?:\/\//))||this.fetch()},wp.media.controller.Embed.sensitivity),fetch:function(){var a,b,c=this.model.get("url");d("#embed-url-field").val()===c&&(this.dfd&&"pending"===this.dfd.state()&&this.dfd.abort(),a=/https?:\/\/www\.youtube\.com\/embed\/([^\/]+)/,b=a.exec(c),b&&(c="https://www.youtube.com/watch?v="+b[1]),this.dfd=wp.apiRequest({url:wp.media.view.settings.oEmbedProxyUrl,data:{url:c,maxwidth:this.model.get("width"),maxheight:this.model.get("height")},type:"GET",dataType:"json",context:this}).done(function(a){this.renderoEmbed({data:{body:a.html||""}})}).fail(this.renderFail))},renderFail:function(a,b){"abort"!==b&&this.$(".link-text").show()},renderoEmbed:function(a){var b=a&&a.data&&a.data.body||"";b?this.$(".embed-container").show().find(".embed-preview").html(b):this.renderFail()}}),a.exports=c},function(a,b){var c,d=wp.media.view.Settings.AttachmentDisplay;c=d.extend({className:"embed-media-settings",template:wp.template("embed-image-settings"),initialize:function(){d.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:url",this.updateImage)},updateImage:function(){this.$("img").attr("src",this.model.get("url"))}}),a.exports=c},function(a,b){var c,d=wp.media.view.Settings.AttachmentDisplay,e=jQuery;c=d.extend({className:"image-details",template:wp.template("image-details"),events:_.defaults(d.prototype.events,{"click .edit-attachment":"editAttachment","click .replace-attachment":"replaceAttachment","click .advanced-toggle":"onToggleAdvanced",'change [data-setting="customWidth"]':"onCustomSize",'change [data-setting="customHeight"]':"onCustomSize",'keyup [data-setting="customWidth"]':"onCustomSize",'keyup [data-setting="customHeight"]':"onCustomSize"}),initialize:function(){this.options.attachment=this.model.attachment,this.listenTo(this.model,"change:url",this.updateUrl),this.listenTo(this.model,"change:link",this.toggleLi
|