WordPress/wp-includes/js/media-audiovideo.min.js

1 line
13 KiB
JavaScript
Raw Normal View History

Update Backbone and Underscore to the latest versions. Backbone, from 1.1.2 to 1.2.3. Underscore, from 1.6.0 to 1.8.3. The new versions of Backbone and Underscore offer numerous small bug fixes and some optimizations and other improvements. Check the [http://backbonejs.org/#changelog Backbone changelog] and [http://underscorejs.org/#changelog Underscore changelog] for the full details. The new versions include some significant changes that may break existing code. Plugins or themes that rely on the bundled Backbone and/or Underscore libraries should carefully check functionality with the latest versions and run any available unit tests to ensure compatibility. Some changes of note that were addressed in core as part of this upgrade: * `_.flatten` no longer works with objects since Underscore.js 1.7. `_.flatten()` working with objects was an unintended side-affect of the implementation, see [https://github.com/jashkenas/underscore/issues/1904#issuecomment-60241576 underscore#1904]. Check any `_flatten` usage and only flatten arrays. * As of Backbone 1.2.0, you can no longer modify the `events` hash or your view's `el` property in `initialize`, so don't try to modify them there. * Since Underscore 1.7, Underscore templates no longer accept an initial data object. `_.template` always returns a function now so make sure you use it that way. Props adamsilverstein. Fixes #34350. Built from https://develop.svn.wordpress.org/trunk@36546 git-svn-id: http://core.svn.wordpress.org/trunk@36513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-17 10:22:26 -05:00
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=wp.media,e=window._wpmejsSettings||{},f=window._wpMediaViewsL10n||{};wp.media.mixin={mejsSettings:e,removeAllPlayers:function(){var a;if(window.mejs&&window.mejs.players)for(a in window.mejs.players)window.mejs.players[a].pause(),this.removePlayer(window.mejs.players[a])},removePlayer:function(a){var b,c;if(a.options){for(b in a.options.features)if(c=a.options.features[b],a["clean"+c])try{a["clean"+c](a)}catch(d){}a.isDynamic||a.$node.remove(),"native"!==a.media.pluginType&&a.$media.remove(),delete window.mejs.players[a.id],a.container.remove(),a.globalUnbind(),delete a.node.player}},unsetPlayers:function(){this.players&&this.players.length&&(_.each(this.players,function(a){a.pause(),wp.media.mixin.removePlayer(a)}),this.players=[])}},wp.media.playlist=new wp.media.collection({tag:"playlist",editTitle:f.editPlaylistTitle,defaults:{id:wp.media.view.settings.post.id,style:"light",tracklist:!0,tracknumbers:!0,images:!0,artists:!0,type:"audio"}}),wp.media.audio={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",loop:!1,autoplay:!1,preload:"none",width:400},edit:function(a){var b,c=wp.shortcode.next("audio",a).shortcode;return b=wp.media({frame:"audio",state:"audio-details",metadata:_.defaults(c.attrs.named,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"audio",attrs:a,content:b})}},wp.media.video={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",poster:"",loop:!1,autoplay:!1,preload:"metadata",content:"",width:640,height:360},edit:function(a){var b,c,d=wp.shortcode.next("video",a).shortcode;return c=d.attrs.named,c.content=d.content,b=wp.media({frame:"video",state:"video-details",metadata:_.defaults(c,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"video",attrs:a,content:b})}},d.model.PostMedia=a("./models/post-media.js"),d.controller.AudioDetails=a("./controllers/audio-details.js"),d.controller.VideoDetails=a("./controllers/video-details.js"),d.view.MediaFrame.MediaDetails=a("./views/frame/media-details.js"),d.view.MediaFrame.AudioDetails=a("./views/frame/audio-details.js"),d.view.MediaFrame.VideoDetails=a("./views/frame/video-details.js"),d.view.MediaDetails=a("./views/media-details.js"),d.view.AudioDetails=a("./views/audio-details.js"),d.view.VideoDetails=a("./views/video-details.js")},{"./controllers/audio-details.js":2,"./controllers/video-details.js":3,"./models/post-media.js":4,"./views/audio-details.js":5,"./views/frame/audio-details.js":6,"./views/frame/media-details.js":7,"./views/frame/video-details.js":8,"./views/media-details.js":9,"./views/video-details.js":10}],2:[function(a,b,c){var d,e=wp.media.controller.State,f=wp.media.view.l10n;d=e.extend({defaults:{id:"audio-details",toolbar:"audio-details",title:f.audioDetailsTitle,content:"audio-details",menu:"audio-details",router:!1,priority:60},initialize:function(a){this.media=a.media,e.prototype.initialize.apply(this,arguments)}}),b.exports=d},{}],3:[function(a,b,c){var d,e=wp.media.controller.State,f=wp.media.view.l10n;d=e.extend({defaults:{id:"video-details",toolbar:"video-details",title:f.videoDetailsTitle,content:"video-details",menu:"video-details",router:!1,priority:60},initialize:function(a){this.media=a.media,e.prototype.initialize.apply(this,arguments)}}),b.exports=d},{}],4:[function(a,b,c){var d=Backbone.Model.extend({initialize:function(){this.attachment=!1},setSource