Media JS files:

* In media manifests, ditch IIFEs and global injection, these get dynamically scoped via Browserify
* Remove the `debug` option from `browserify:media`
* Add `jshint:media` to `jshint:corejs`
* Add a trailing newline to all new module files

Props iseulde.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31385


git-svn-id: http://core.svn.wordpress.org/trunk@31366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-02-09 16:01:29 +00:00
parent 941075c8ca
commit b191013198
106 changed files with 1462 additions and 1749 deletions

View File

@ -1,19 +1,12 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */ var media = wp.media,
baseSettings = window._wpmejsSettings || {},
l10n = window._wpMediaViewsL10n || {};
(function(_) { /**
var media = wp.media,
baseSettings = {},
l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
if ( ! _.isUndefined( window._wpmejsSettings ) ) {
baseSettings = _wpmejsSettings;
}
/**
* @mixin * @mixin
*/ */
wp.media.mixin = { wp.media.mixin = {
mejsSettings: baseSettings, mejsSettings: baseSettings,
removeAllPlayers: function() { removeAllPlayers: function() {
@ -79,12 +72,12 @@
this.players = []; this.players = [];
} }
} }
}; };
/** /**
* Autowire "collection"-type shortcodes * Autowire "collection"-type shortcodes
*/ */
wp.media.playlist = new wp.media.collection({ wp.media.playlist = new wp.media.collection({
tag: 'playlist', tag: 'playlist',
editTitle : l10n.editPlaylistTitle, editTitle : l10n.editPlaylistTitle,
defaults : { defaults : {
@ -96,16 +89,16 @@
artists: true, artists: true,
type: 'audio' type: 'audio'
} }
}); });
/** /**
* Shortcode modeling for audio * Shortcode modeling for audio
* `edit()` prepares the shortcode for the media modal * `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update * `shortcode()` builds the new shortcode after update
* *
* @namespace * @namespace
*/ */
wp.media.audio = { wp.media.audio = {
coerce : wp.media.coerce, coerce : wp.media.coerce,
defaults : { defaults : {
@ -133,7 +126,7 @@
var content; var content;
_.each( this.defaults, function( value, key ) { _.each( this.defaults, function( value, key ) {
model[ key ] = self.coerce( model, key ); model[ key ] = this.coerce( model, key );
if ( value === model[ key ] ) { if ( value === model[ key ] ) {
delete model[ key ]; delete model[ key ];
@ -149,16 +142,16 @@
content: content content: content
}); });
} }
}; };
/** /**
* Shortcode modeling for video * Shortcode modeling for video
* `edit()` prepares the shortcode for the media modal * `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update * `shortcode()` builds the new shortcode after update
* *
* @namespace * @namespace
*/ */
wp.media.video = { wp.media.video = {
coerce : wp.media.coerce, coerce : wp.media.coerce,
defaults : { defaults : {
@ -210,22 +203,19 @@
content: content content: content
}); });
} }
}; };
media.model.PostMedia = require( './models/post-media.js' ); media.model.PostMedia = require( './models/post-media.js' );
media.controller.AudioDetails = require( './controllers/audio-details.js' ); media.controller.AudioDetails = require( './controllers/audio-details.js' );
media.controller.VideoDetails = require( './controllers/video-details.js' ); media.controller.VideoDetails = require( './controllers/video-details.js' );
media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' ); media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' ); media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' ); media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
media.view.MediaDetails = require( './views/media-details.js' ); media.view.MediaDetails = require( './views/media-details.js' );
media.view.AudioDetails = require( './views/audio-details.js' ); media.view.AudioDetails = require( './views/audio-details.js' );
media.view.VideoDetails = require( './views/video-details.js' ); media.view.VideoDetails = require( './views/video-details.js' );
}(_));
},{"./controllers/audio-details.js":2,"./controllers/video-details.js":8,"./models/post-media.js":9,"./views/audio-details.js":21,"./views/frame/audio-details.js":25,"./views/frame/media-details.js":26,"./views/frame/video-details.js":28,"./views/media-details.js":31,"./views/video-details.js":50}],2:[function(require,module,exports){ },{"./controllers/audio-details.js":2,"./controllers/video-details.js":8,"./models/post-media.js":9,"./views/audio-details.js":21,"./views/frame/audio-details.js":25,"./views/frame/media-details.js":26,"./views/frame/video-details.js":28,"./views/media-details.js":31,"./views/video-details.js":50}],2:[function(require,module,exports){
/*globals wp */
/** /**
* The controller for the Audio Details state * The controller for the Audio Details state
* *
@ -255,9 +245,8 @@ AudioDetails = State.extend({
}); });
module.exports = AudioDetails; module.exports = AudioDetails;
},{"./state.js":7}],3:[function(require,module,exports){
/*globals _, wp, Backbone, getUserSetting, setUserSetting */
},{"./state.js":7}],3:[function(require,module,exports){
/** /**
* wp.media.controller.Library * wp.media.controller.Library
* *
@ -295,6 +284,8 @@ module.exports = AudioDetails;
var selectionSync = require( '../utils/selection-sync.js' ), var selectionSync = require( '../utils/selection-sync.js' ),
State = require( './state.js' ), State = require( './state.js' ),
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library; Library;
Library = State.extend({ Library = State.extend({
@ -329,7 +320,7 @@ Library = State.extend({
this.set( 'library', wp.media.query() ); this.set( 'library', wp.media.query() );
} }
if ( ! (selection instanceof Selection) ) { if ( ! ( selection instanceof wp.media.model.Selection ) ) {
props = selection; props = selection;
if ( ! props ) { if ( ! props ) {
@ -528,9 +519,8 @@ Library = State.extend({
_.extend( Library.prototype, selectionSync ); _.extend( Library.prototype, selectionSync );
module.exports = Library; module.exports = Library;
},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
/*globals _, wp */
},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
/** /**
* wp.media.controller.MediaLibrary * wp.media.controller.MediaLibrary
* *
@ -579,9 +569,8 @@ MediaLibrary = Library.extend({
}); });
module.exports = MediaLibrary; module.exports = MediaLibrary;
},{"./library.js":3}],5:[function(require,module,exports){
/*globals _, Backbone */
},{"./library.js":3}],5:[function(require,module,exports){
/** /**
* wp.media.controller.Region * wp.media.controller.Region
* *
@ -759,9 +748,8 @@ _.extend( Region.prototype, {
}); });
module.exports = Region; module.exports = Region;
},{}],6:[function(require,module,exports){
/*globals _, Backbone */
},{}],6:[function(require,module,exports){
/** /**
* wp.media.controller.StateMachine * wp.media.controller.StateMachine
* *
@ -884,9 +872,8 @@ _.each([ 'on', 'off', 'trigger' ], function( method ) {
}); });
module.exports = StateMachine; module.exports = StateMachine;
},{}],7:[function(require,module,exports){
/*globals _, Backbone */
},{}],7:[function(require,module,exports){
/** /**
* wp.media.controller.State * wp.media.controller.State
* *
@ -1126,9 +1113,8 @@ _.each(['toolbar','content'], function( region ) {
}); });
module.exports = State; module.exports = State;
},{}],8:[function(require,module,exports){
/*globals wp */
},{}],8:[function(require,module,exports){
/** /**
* The controller for the Video Details state * The controller for the Video Details state
* *
@ -1158,9 +1144,8 @@ VideoDetails = State.extend({
}); });
module.exports = VideoDetails; module.exports = VideoDetails;
},{"./state.js":7}],9:[function(require,module,exports){
/*globals Backbone, _, wp */
},{"./state.js":7}],9:[function(require,module,exports){
/** /**
* Shared model class for audio and video. Updates the model after * Shared model class for audio and video. Updates the model after
* "Add Audio|Video Source" and "Replace Audio|Video" states return * "Add Audio|Video Source" and "Replace Audio|Video" states return
@ -1199,9 +1184,8 @@ var PostMedia = Backbone.Model.extend({
}); });
module.exports = PostMedia; module.exports = PostMedia;
},{}],10:[function(require,module,exports){
/*globals _ */
},{}],10:[function(require,module,exports){
/** /**
* wp.media.selectionSync * wp.media.selectionSync
* *
@ -1266,9 +1250,8 @@ var selectionSync = {
}; };
module.exports = selectionSync; module.exports = selectionSync;
},{}],11:[function(require,module,exports){
/*globals _ */
},{}],11:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentCompat * wp.media.view.AttachmentCompat
* *
@ -1352,9 +1335,8 @@ AttachmentCompat = View.extend({
}); });
module.exports = AttachmentCompat; module.exports = AttachmentCompat;
},{"./view.js":51}],12:[function(require,module,exports){
/*globals _, jQuery */
},{"./view.js":51}],12:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters * wp.media.view.AttachmentFilters
* *
@ -1431,9 +1413,8 @@ AttachmentFilters = View.extend({
}); });
module.exports = AttachmentFilters; module.exports = AttachmentFilters;
},{"./view.js":51}],13:[function(require,module,exports){
/*globals _, wp */
},{"./view.js":51}],13:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters.All * wp.media.view.AttachmentFilters.All
* *
@ -1523,9 +1504,8 @@ All = AttachmentFilters.extend({
}); });
module.exports = All; module.exports = All;
},{"../attachment-filters.js":12}],14:[function(require,module,exports){
/*globals _, wp */
},{"../attachment-filters.js":12}],14:[function(require,module,exports){
/** /**
* A filter dropdown for month/dates. * A filter dropdown for month/dates.
* *
@ -1566,9 +1546,8 @@ DateFilter = AttachmentFilters.extend({
}); });
module.exports = DateFilter; module.exports = DateFilter;
},{"../attachment-filters.js":12}],15:[function(require,module,exports){
/*globals wp */
},{"../attachment-filters.js":12}],15:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters.Uploaded * wp.media.view.AttachmentFilters.Uploaded
* *
@ -1627,9 +1606,8 @@ Uploaded = AttachmentFilters.extend({
}); });
module.exports = Uploaded; module.exports = Uploaded;
},{"../attachment-filters.js":12}],16:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../attachment-filters.js":12}],16:[function(require,module,exports){
/** /**
* wp.media.view.Attachment * wp.media.view.Attachment
* *
@ -2182,9 +2160,8 @@ _.each({
}); });
module.exports = Attachment; module.exports = Attachment;
},{"./view.js":51}],17:[function(require,module,exports){
/*globals _, wp */
},{"./view.js":51}],17:[function(require,module,exports){
/** /**
* wp.media.view.Attachment.Details * wp.media.view.Attachment.Details
* *
@ -2244,7 +2221,7 @@ Details = Attachment.extend({
deleteAttachment: function( event ) { deleteAttachment: function( event ) {
event.preventDefault(); event.preventDefault();
if ( confirm( l10n.warnDelete ) ) { if ( window.confirm( l10n.warnDelete ) ) {
this.model.destroy(); this.model.destroy();
// Keep focus inside media modal // Keep focus inside media modal
// after image is deleted // after image is deleted
@ -2323,6 +2300,7 @@ Details = Attachment.extend({
}); });
module.exports = Details; module.exports = Details;
},{"../attachment.js":16}],18:[function(require,module,exports){ },{"../attachment.js":16}],18:[function(require,module,exports){
/** /**
* wp.media.view.Attachment.Library * wp.media.view.Attachment.Library
@ -2343,9 +2321,8 @@ Library = Attachment.extend({
}); });
module.exports = Library; module.exports = Library;
},{"../attachment.js":16}],19:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../attachment.js":16}],19:[function(require,module,exports){
/** /**
* wp.media.view.Attachments * wp.media.view.Attachments
* *
@ -2618,7 +2595,7 @@ Attachments = View.extend({
// The scroll event occurs on the document, but the element // The scroll event occurs on the document, but the element
// that should be checked is the document body. // that should be checked is the document body.
if ( el == document ) { if ( el === document ) {
el = document.body; el = document.body;
scrollTop = $(document).scrollTop(); scrollTop = $(document).scrollTop();
} }
@ -2644,9 +2621,8 @@ Attachments = View.extend({
}); });
module.exports = Attachments; module.exports = Attachments;
},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentsBrowser * wp.media.view.AttachmentsBrowser
* *
@ -2837,13 +2813,13 @@ AttachmentsBrowser = View.extend({
return; return;
} }
if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) { if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }
if ( mediaTrash && if ( mediaTrash &&
'trash' !== selection.at( 0 ).get( 'status' ) && 'trash' !== selection.at( 0 ).get( 'status' ) &&
! confirm( l10n.warnBulkTrash ) ) { ! window.confirm( l10n.warnBulkTrash ) ) {
return; return;
} }
@ -2891,7 +2867,7 @@ AttachmentsBrowser = View.extend({
click: function() { click: function() {
var removed = [], selection = this.controller.state().get( 'selection' ); var removed = [], selection = this.controller.state().get( 'selection' );
if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) { if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }
@ -3104,9 +3080,8 @@ AttachmentsBrowser = View.extend({
}); });
module.exports = AttachmentsBrowser; module.exports = AttachmentsBrowser;
},{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
/*globals wp */
},{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
/** /**
* wp.media.view.AudioDetails * wp.media.view.AudioDetails
* *
@ -3143,9 +3118,8 @@ AudioDetails = MediaDetails.extend({
}); });
module.exports = AudioDetails; module.exports = AudioDetails;
},{"./media-details":31}],22:[function(require,module,exports){
/*globals _, Backbone */
},{"./media-details":31}],22:[function(require,module,exports){
/** /**
* wp.media.view.Button * wp.media.view.Button
* *
@ -3233,6 +3207,7 @@ Button = View.extend({
}); });
module.exports = Button; module.exports = Button;
},{"./view.js":51}],23:[function(require,module,exports){ },{"./view.js":51}],23:[function(require,module,exports){
/** /**
* wp.media.view.FocusManager * wp.media.view.FocusManager
@ -3281,9 +3256,8 @@ FocusManager = View.extend({
}); });
module.exports = FocusManager; module.exports = FocusManager;
},{"./view.js":51}],24:[function(require,module,exports){
/*globals _, Backbone */
},{"./view.js":51}],24:[function(require,module,exports){
/** /**
* wp.media.view.Frame * wp.media.view.Frame
* *
@ -3454,9 +3428,8 @@ Frame = View.extend({
_.extend( Frame.prototype, StateMachine.prototype ); _.extend( Frame.prototype, StateMachine.prototype );
module.exports = Frame; module.exports = Frame;
},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
/*globals wp */
},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame.AudioDetails * wp.media.view.MediaFrame.AudioDetails
* *
@ -3532,9 +3505,8 @@ AudioDetails = MediaDetails.extend({
}); });
module.exports = AudioDetails; module.exports = AudioDetails;
},{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
/*globals wp */
},{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame.MediaDetails * wp.media.view.MediaFrame.MediaDetails
* *
@ -3665,9 +3637,8 @@ MediaDetails = Select.extend({
}); });
module.exports = MediaDetails; module.exports = MediaDetails;
},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
/*globals _, wp */
},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame.Select * wp.media.view.MediaFrame.Select
* *
@ -3840,9 +3811,8 @@ Select = MediaFrame.extend({
}); });
module.exports = Select; module.exports = Select;
},{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
/*globals _, wp */
},{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame.VideoDetails * wp.media.view.MediaFrame.VideoDetails
* *
@ -3978,6 +3948,7 @@ VideoDetails = MediaDetails.extend({
}); });
module.exports = VideoDetails; module.exports = VideoDetails;
},{"../../controllers/media-library.js":4,"../../controllers/video-details.js":8,"../video-details.js":50,"./media-details":26}],29:[function(require,module,exports){ },{"../../controllers/media-library.js":4,"../../controllers/video-details.js":8,"../video-details.js":50,"./media-details":26}],29:[function(require,module,exports){
/** /**
* wp.media.view.Iframe * wp.media.view.Iframe
@ -4004,6 +3975,7 @@ Iframe = View.extend({
}); });
module.exports = Iframe; module.exports = Iframe;
},{"./view.js":51}],30:[function(require,module,exports){ },{"./view.js":51}],30:[function(require,module,exports){
/** /**
* @class * @class
@ -4030,9 +4002,8 @@ Label = View.extend({
}); });
module.exports = Label; module.exports = Label;
},{"./view.js":51}],31:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./view.js":51}],31:[function(require,module,exports){
/** /**
* wp.media.view.MediaDetails * wp.media.view.MediaDetails
* *
@ -4116,7 +4087,7 @@ MediaDetails = AttachmentDisplay.extend({
*/ */
setPlayer : function() { setPlayer : function() {
if ( ! this.players.length && this.media ) { if ( ! this.players.length && this.media ) {
this.players.push( new MediaElementPlayer( this.media, this.settings ) ); this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
} }
}, },
@ -4183,9 +4154,8 @@ MediaDetails = AttachmentDisplay.extend({
}); });
module.exports = MediaDetails; module.exports = MediaDetails;
},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame * wp.media.view.MediaFrame
* *
@ -4438,9 +4408,8 @@ _.each(['open','close','attach','detach','escape'], function( method ) {
}); });
module.exports = MediaFrame; module.exports = MediaFrame;
},{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
/*globals wp, jQuery */
},{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
/** /**
* wp.media.view.MenuItem * wp.media.view.MenuItem
* *
@ -4512,6 +4481,7 @@ MenuItem = View.extend({
}); });
module.exports = MenuItem; module.exports = MenuItem;
},{"./view.js":51}],34:[function(require,module,exports){ },{"./view.js":51}],34:[function(require,module,exports){
/** /**
* wp.media.view.Menu * wp.media.view.Menu
@ -4628,9 +4598,8 @@ Menu = PriorityList.extend({
}); });
module.exports = Menu; module.exports = Menu;
},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
/** /**
* wp.media.view.Modal * wp.media.view.Modal
* *
@ -4844,9 +4813,8 @@ Modal = View.extend({
}); });
module.exports = Modal; module.exports = Modal;
},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
/*globals _, Backbone */
},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
/** /**
* wp.media.view.PriorityList * wp.media.view.PriorityList
* *
@ -4945,6 +4913,7 @@ PriorityList = View.extend({
}); });
module.exports = PriorityList; module.exports = PriorityList;
},{"./view.js":51}],37:[function(require,module,exports){ },{"./view.js":51}],37:[function(require,module,exports){
/** /**
* wp.media.view.RouterItem * wp.media.view.RouterItem
@ -4971,6 +4940,7 @@ RouterItem = MenuItem.extend({
}); });
module.exports = RouterItem; module.exports = RouterItem;
},{"./menu-item.js":33}],38:[function(require,module,exports){ },{"./menu-item.js":33}],38:[function(require,module,exports){
/** /**
* wp.media.view.Router * wp.media.view.Router
@ -5008,9 +4978,8 @@ Router = Menu.extend({
}); });
module.exports = Router; module.exports = Router;
},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
/*globals wp */
},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
/** /**
* wp.media.view.Search * wp.media.view.Search
* *
@ -5058,9 +5027,8 @@ Search = View.extend({
}); });
module.exports = Search; module.exports = Search;
},{"./view.js":51}],40:[function(require,module,exports){
/*globals _, Backbone, jQuery */
},{"./view.js":51}],40:[function(require,module,exports){
/** /**
* wp.media.view.Settings * wp.media.view.Settings
* *
@ -5168,7 +5136,7 @@ Settings = View.extend({
// If the setting has a corresponding user setting, // If the setting has a corresponding user setting,
// update that as well. // update that as well.
if ( userSetting = $setting.data('userSetting') ) { if ( userSetting = $setting.data('userSetting') ) {
setUserSetting( userSetting, value ); window.setUserSetting( userSetting, value );
} }
}, },
@ -5180,9 +5148,8 @@ Settings = View.extend({
}); });
module.exports = Settings; module.exports = Settings;
},{"./view.js":51}],41:[function(require,module,exports){
/*globals _, wp */
},{"./view.js":51}],41:[function(require,module,exports){
/** /**
* wp.media.view.Settings.AttachmentDisplay * wp.media.view.Settings.AttachmentDisplay
* *
@ -5275,6 +5242,7 @@ AttachmentDisplay = Settings.extend({
}); });
module.exports = AttachmentDisplay; module.exports = AttachmentDisplay;
},{"../settings.js":40}],42:[function(require,module,exports){ },{"../settings.js":40}],42:[function(require,module,exports){
/** /**
* wp.media.view.Sidebar * wp.media.view.Sidebar
@ -5293,9 +5261,8 @@ Sidebar = PriorityList.extend({
}); });
module.exports = Sidebar; module.exports = Sidebar;
},{"./priority-list.js":36}],43:[function(require,module,exports){
/*globals _, wp */
},{"./priority-list.js":36}],43:[function(require,module,exports){
/** /**
* wp.media.view.Spinner * wp.media.view.Spinner
* *
@ -5332,9 +5299,8 @@ Spinner = View.extend({
}); });
module.exports = Spinner; module.exports = Spinner;
},{"./view.js":51}],44:[function(require,module,exports){
/*globals Backbone, _ */
},{"./view.js":51}],44:[function(require,module,exports){
/** /**
* wp.media.view.Toolbar * wp.media.view.Toolbar
* *
@ -5495,9 +5461,8 @@ Toolbar = View.extend({
}); });
module.exports = Toolbar; module.exports = Toolbar;
},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
/*globals _, wp */
},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
/** /**
* wp.media.view.Toolbar.Select * wp.media.view.Toolbar.Select
* *
@ -5566,9 +5531,8 @@ Select = Toolbar.extend({
}); });
module.exports = Select; module.exports = Select;
},{"../toolbar.js":44}],46:[function(require,module,exports){
/*globals _, wp */
},{"../toolbar.js":44}],46:[function(require,module,exports){
/** /**
* wp.media.view.UploaderInline * wp.media.view.UploaderInline
* *
@ -5699,9 +5663,8 @@ UploaderInline = View.extend({
}); });
module.exports = UploaderInline; module.exports = UploaderInline;
},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
/*globals wp */
},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
/** /**
* wp.media.view.UploaderStatusError * wp.media.view.UploaderStatusError
* *
@ -5719,9 +5682,8 @@ UploaderStatusError = View.extend({
}); });
module.exports = UploaderStatusError; module.exports = UploaderStatusError;
},{"../view.js":51}],48:[function(require,module,exports){
/*globals _, wp */
},{"../view.js":51}],48:[function(require,module,exports){
/** /**
* wp.media.view.UploaderStatus * wp.media.view.UploaderStatus
* *
@ -5859,9 +5821,8 @@ UploaderStatus = View.extend({
}); });
module.exports = UploaderStatus; module.exports = UploaderStatus;
},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
/** /**
* wp.media.view.UploaderWindow * wp.media.view.UploaderWindow
* *
@ -5972,9 +5933,8 @@ UploaderWindow = View.extend({
}); });
module.exports = UploaderWindow; module.exports = UploaderWindow;
},{"../view.js":51}],50:[function(require,module,exports){
/*globals wp */
},{"../view.js":51}],50:[function(require,module,exports){
/** /**
* wp.media.view.VideoDetails * wp.media.view.VideoDetails
* *
@ -6016,9 +5976,8 @@ VideoDetails = MediaDetails.extend({
}); });
module.exports = VideoDetails; module.exports = VideoDetails;
},{"./media-details":31}],51:[function(require,module,exports){
/*globals wp */
},{"./media-details":31}],51:[function(require,module,exports){
/** /**
* wp.media.View * wp.media.View
* *
@ -6083,4 +6042,5 @@ var View = wp.Backbone.View.extend({
}); });
module.exports = View; module.exports = View;
},{}]},{},[1]); },{}]},{},[1]);

View File

@ -1,18 +1,11 @@
/* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */ var media = wp.media,
baseSettings = window._wpmejsSettings || {},
l10n = window._wpMediaViewsL10n || {};
(function(_) { /**
var media = wp.media,
baseSettings = {},
l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
if ( ! _.isUndefined( window._wpmejsSettings ) ) {
baseSettings = _wpmejsSettings;
}
/**
* @mixin * @mixin
*/ */
wp.media.mixin = { wp.media.mixin = {
mejsSettings: baseSettings, mejsSettings: baseSettings,
removeAllPlayers: function() { removeAllPlayers: function() {
@ -78,12 +71,12 @@
this.players = []; this.players = [];
} }
} }
}; };
/** /**
* Autowire "collection"-type shortcodes * Autowire "collection"-type shortcodes
*/ */
wp.media.playlist = new wp.media.collection({ wp.media.playlist = new wp.media.collection({
tag: 'playlist', tag: 'playlist',
editTitle : l10n.editPlaylistTitle, editTitle : l10n.editPlaylistTitle,
defaults : { defaults : {
@ -95,16 +88,16 @@
artists: true, artists: true,
type: 'audio' type: 'audio'
} }
}); });
/** /**
* Shortcode modeling for audio * Shortcode modeling for audio
* `edit()` prepares the shortcode for the media modal * `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update * `shortcode()` builds the new shortcode after update
* *
* @namespace * @namespace
*/ */
wp.media.audio = { wp.media.audio = {
coerce : wp.media.coerce, coerce : wp.media.coerce,
defaults : { defaults : {
@ -132,7 +125,7 @@
var content; var content;
_.each( this.defaults, function( value, key ) { _.each( this.defaults, function( value, key ) {
model[ key ] = self.coerce( model, key ); model[ key ] = this.coerce( model, key );
if ( value === model[ key ] ) { if ( value === model[ key ] ) {
delete model[ key ]; delete model[ key ];
@ -148,16 +141,16 @@
content: content content: content
}); });
} }
}; };
/** /**
* Shortcode modeling for video * Shortcode modeling for video
* `edit()` prepares the shortcode for the media modal * `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update * `shortcode()` builds the new shortcode after update
* *
* @namespace * @namespace
*/ */
wp.media.video = { wp.media.video = {
coerce : wp.media.coerce, coerce : wp.media.coerce,
defaults : { defaults : {
@ -209,16 +202,14 @@
content: content content: content
}); });
} }
}; };
media.model.PostMedia = require( './models/post-media.js' ); media.model.PostMedia = require( './models/post-media.js' );
media.controller.AudioDetails = require( './controllers/audio-details.js' ); media.controller.AudioDetails = require( './controllers/audio-details.js' );
media.controller.VideoDetails = require( './controllers/video-details.js' ); media.controller.VideoDetails = require( './controllers/video-details.js' );
media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' ); media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' ); media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' ); media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
media.view.MediaDetails = require( './views/media-details.js' ); media.view.MediaDetails = require( './views/media-details.js' );
media.view.AudioDetails = require( './views/audio-details.js' ); media.view.AudioDetails = require( './views/audio-details.js' );
media.view.VideoDetails = require( './views/video-details.js' ); media.view.VideoDetails = require( './views/video-details.js' );
}(_));

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* The controller for the Audio Details state * The controller for the Audio Details state
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.CollectionAdd * wp.media.controller.CollectionAdd
* *

View File

@ -1,5 +1,3 @@
/*globals wp, jQuery, Backbone */
/** /**
* wp.media.controller.CollectionEdit * wp.media.controller.CollectionEdit
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, Backbone */
/** /**
* wp.media.controller.Cropper * wp.media.controller.Cropper
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.controller.EditAttachmentMetadata * wp.media.controller.EditAttachmentMetadata
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.EditImage * wp.media.controller.EditImage
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery, Backbone */
/** /**
* wp.media.controller.Embed * wp.media.controller.Embed
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.FeaturedImage * wp.media.controller.FeaturedImage
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* A state for selecting more images to add to a gallery. * A state for selecting more images to add to a gallery.
* *
@ -51,8 +49,9 @@ GalleryAdd = Library.extend({
*/ */
initialize: function() { initialize: function() {
// If a library wasn't supplied, create a library of images. // If a library wasn't supplied, create a library of images.
if ( ! this.get('library') ) if ( ! this.get('library') ) {
this.set( 'library', wp.media.query({ type: 'image' }) ); this.set( 'library', wp.media.query({ type: 'image' }) );
}
Library.prototype.initialize.apply( this, arguments ); Library.prototype.initialize.apply( this, arguments );
}, },
@ -64,8 +63,9 @@ GalleryAdd = Library.extend({
var library = this.get('library'), var library = this.get('library'),
edit = this.frame.state('gallery-edit').get('library'); edit = this.frame.state('gallery-edit').get('library');
if ( this.editLibrary && this.editLibrary !== edit ) if ( this.editLibrary && this.editLibrary !== edit ) {
library.unobserve( this.editLibrary ); library.unobserve( this.editLibrary );
}
// Accepts attachments that exist in the original library and // Accepts attachments that exist in the original library and
// that do not exist in gallery's library. // that do not exist in gallery's library.

View File

@ -1,5 +1,3 @@
/*globals wp, Backbone */
/** /**
* wp.media.controller.GalleryEdit * wp.media.controller.GalleryEdit
* *
@ -61,12 +59,15 @@ GalleryEdit = Library.extend({
*/ */
initialize: function() { initialize: function() {
// If we haven't been provided a `library`, create a `Selection`. // If we haven't been provided a `library`, create a `Selection`.
if ( ! this.get('library') ) if ( ! this.get('library') ) {
this.set( 'library', new wp.media.model.Selection() ); this.set( 'library', new wp.media.model.Selection() );
}
// The single `Attachment` view to be used in the `Attachments` view. // The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) if ( ! this.get('AttachmentView') ) {
this.set( 'AttachmentView', EditLibraryView ); this.set( 'AttachmentView', EditLibraryView );
}
Library.prototype.initialize.apply( this, arguments ); Library.prototype.initialize.apply( this, arguments );
}, },

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.ImageDetails * wp.media.controller.ImageDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, Backbone, getUserSetting, setUserSetting */
/** /**
* wp.media.controller.Library * wp.media.controller.Library
* *
@ -37,6 +35,8 @@
var selectionSync = require( '../utils/selection-sync.js' ), var selectionSync = require( '../utils/selection-sync.js' ),
State = require( './state.js' ), State = require( './state.js' ),
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library; Library;
Library = State.extend({ Library = State.extend({
@ -71,7 +71,7 @@ Library = State.extend({
this.set( 'library', wp.media.query() ); this.set( 'library', wp.media.query() );
} }
if ( ! (selection instanceof Selection) ) { if ( ! ( selection instanceof wp.media.model.Selection ) ) {
props = selection; props = selection;
if ( ! props ) { if ( ! props ) {

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.MediaLibrary * wp.media.controller.MediaLibrary
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.controller.Region * wp.media.controller.Region
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.controller.ReplaceImage * wp.media.controller.ReplaceImage
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.controller.StateMachine * wp.media.controller.StateMachine
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.controller.State * wp.media.controller.State
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* The controller for the Video Details state * The controller for the Video Details state
* *

View File

@ -1,6 +1,4 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*globals wp */
/** /**
* wp.media.controller.EditAttachmentMetadata * wp.media.controller.EditAttachmentMetadata
* *
@ -28,9 +26,8 @@ EditAttachmentMetadata = State.extend({
}); });
module.exports = EditAttachmentMetadata; module.exports = EditAttachmentMetadata;
},{"./state.js":6}],2:[function(require,module,exports){
/*globals _, wp */
},{"./state.js":6}],2:[function(require,module,exports){
/** /**
* wp.media.controller.EditImage * wp.media.controller.EditImage
* *
@ -107,9 +104,8 @@ EditImage = State.extend({
}); });
module.exports = EditImage; module.exports = EditImage;
},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
/*globals _, wp, Backbone, getUserSetting, setUserSetting */
},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
/** /**
* wp.media.controller.Library * wp.media.controller.Library
* *
@ -147,6 +143,8 @@ module.exports = EditImage;
var selectionSync = require( '../utils/selection-sync.js' ), var selectionSync = require( '../utils/selection-sync.js' ),
State = require( './state.js' ), State = require( './state.js' ),
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library; Library;
Library = State.extend({ Library = State.extend({
@ -181,7 +179,7 @@ Library = State.extend({
this.set( 'library', wp.media.query() ); this.set( 'library', wp.media.query() );
} }
if ( ! (selection instanceof Selection) ) { if ( ! ( selection instanceof wp.media.model.Selection ) ) {
props = selection; props = selection;
if ( ! props ) { if ( ! props ) {
@ -380,9 +378,8 @@ Library = State.extend({
_.extend( Library.prototype, selectionSync ); _.extend( Library.prototype, selectionSync );
module.exports = Library; module.exports = Library;
},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
/*globals _, Backbone */
},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
/** /**
* wp.media.controller.Region * wp.media.controller.Region
* *
@ -560,9 +557,8 @@ _.extend( Region.prototype, {
}); });
module.exports = Region; module.exports = Region;
},{}],5:[function(require,module,exports){
/*globals _, Backbone */
},{}],5:[function(require,module,exports){
/** /**
* wp.media.controller.StateMachine * wp.media.controller.StateMachine
* *
@ -685,9 +681,8 @@ _.each([ 'on', 'off', 'trigger' ], function( method ) {
}); });
module.exports = StateMachine; module.exports = StateMachine;
},{}],6:[function(require,module,exports){
/*globals _, Backbone */
},{}],6:[function(require,module,exports){
/** /**
* wp.media.controller.State * wp.media.controller.State
* *
@ -927,25 +922,21 @@ _.each(['toolbar','content'], function( region ) {
}); });
module.exports = State; module.exports = State;
},{}],7:[function(require,module,exports){ },{}],7:[function(require,module,exports){
/* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ var media = wp.media;
(function (wp) {
var media = wp.media;
media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
media.view.EditImage.Details = require( './views/edit-image-details.js' ); media.view.EditImage.Details = require( './views/edit-image-details.js' );
media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
}(wp));
},{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){ },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){
/*globals jQuery, Backbone */
/** /**
* A router for handling the browser history and application state. * A router for handling the browser history and application state.
* *
@ -990,9 +981,8 @@ var Router = Backbone.Router.extend({
}); });
module.exports = Router; module.exports = Router;
},{}],9:[function(require,module,exports){
/*globals _ */
},{}],9:[function(require,module,exports){
/** /**
* wp.media.selectionSync * wp.media.selectionSync
* *
@ -1057,9 +1047,8 @@ var selectionSync = {
}; };
module.exports = selectionSync; module.exports = selectionSync;
},{}],10:[function(require,module,exports){
/*globals _ */
},{}],10:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentCompat * wp.media.view.AttachmentCompat
* *
@ -1143,9 +1132,8 @@ AttachmentCompat = View.extend({
}); });
module.exports = AttachmentCompat; module.exports = AttachmentCompat;
},{"./view.js":51}],11:[function(require,module,exports){
/*globals _, jQuery */
},{"./view.js":51}],11:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters * wp.media.view.AttachmentFilters
* *
@ -1222,9 +1210,8 @@ AttachmentFilters = View.extend({
}); });
module.exports = AttachmentFilters; module.exports = AttachmentFilters;
},{"./view.js":51}],12:[function(require,module,exports){
/*globals _, wp */
},{"./view.js":51}],12:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters.All * wp.media.view.AttachmentFilters.All
* *
@ -1314,9 +1301,8 @@ All = AttachmentFilters.extend({
}); });
module.exports = All; module.exports = All;
},{"../attachment-filters.js":11}],13:[function(require,module,exports){
/*globals _, wp */
},{"../attachment-filters.js":11}],13:[function(require,module,exports){
/** /**
* A filter dropdown for month/dates. * A filter dropdown for month/dates.
* *
@ -1357,9 +1343,8 @@ DateFilter = AttachmentFilters.extend({
}); });
module.exports = DateFilter; module.exports = DateFilter;
},{"../attachment-filters.js":11}],14:[function(require,module,exports){
/*globals wp */
},{"../attachment-filters.js":11}],14:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentFilters.Uploaded * wp.media.view.AttachmentFilters.Uploaded
* *
@ -1418,9 +1403,8 @@ Uploaded = AttachmentFilters.extend({
}); });
module.exports = Uploaded; module.exports = Uploaded;
},{"../attachment-filters.js":11}],15:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../attachment-filters.js":11}],15:[function(require,module,exports){
/** /**
* wp.media.view.Attachment * wp.media.view.Attachment
* *
@ -1973,9 +1957,8 @@ _.each({
}); });
module.exports = Attachment; module.exports = Attachment;
},{"./view.js":51}],16:[function(require,module,exports){
/*globals wp */
},{"./view.js":51}],16:[function(require,module,exports){
/** /**
* A similar view to media.view.Attachment.Details * A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal. * for use in the Edit Attachment modal.
@ -2010,15 +1993,14 @@ TwoColumn = Details.extend({
wp.media.mixin.removeAllPlayers(); wp.media.mixin.removeAllPlayers();
this.$( 'audio, video' ).each( function (i, elem) { this.$( 'audio, video' ).each( function (i, elem) {
var el = MediaDetails.prepareSrc( elem ); var el = MediaDetails.prepareSrc( elem );
new MediaElementPlayer( el, wp.media.mixin.mejsSettings ); new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
} ); } );
} }
}); });
module.exports = TwoColumn; module.exports = TwoColumn;
},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
/*globals _, wp */
},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
/** /**
* wp.media.view.Attachment.Details * wp.media.view.Attachment.Details
* *
@ -2078,7 +2060,7 @@ Details = Attachment.extend({
deleteAttachment: function( event ) { deleteAttachment: function( event ) {
event.preventDefault(); event.preventDefault();
if ( confirm( l10n.warnDelete ) ) { if ( window.confirm( l10n.warnDelete ) ) {
this.model.destroy(); this.model.destroy();
// Keep focus inside media modal // Keep focus inside media modal
// after image is deleted // after image is deleted
@ -2157,6 +2139,7 @@ Details = Attachment.extend({
}); });
module.exports = Details; module.exports = Details;
},{"../attachment.js":15}],18:[function(require,module,exports){ },{"../attachment.js":15}],18:[function(require,module,exports){
/** /**
* wp.media.view.Attachment.Library * wp.media.view.Attachment.Library
@ -2177,9 +2160,8 @@ Library = Attachment.extend({
}); });
module.exports = Library; module.exports = Library;
},{"../attachment.js":15}],19:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../attachment.js":15}],19:[function(require,module,exports){
/** /**
* wp.media.view.Attachments * wp.media.view.Attachments
* *
@ -2452,7 +2434,7 @@ Attachments = View.extend({
// The scroll event occurs on the document, but the element // The scroll event occurs on the document, but the element
// that should be checked is the document body. // that should be checked is the document body.
if ( el == document ) { if ( el === document ) {
el = document.body; el = document.body;
scrollTop = $(document).scrollTop(); scrollTop = $(document).scrollTop();
} }
@ -2478,9 +2460,8 @@ Attachments = View.extend({
}); });
module.exports = Attachments; module.exports = Attachments;
},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
/** /**
* wp.media.view.AttachmentsBrowser * wp.media.view.AttachmentsBrowser
* *
@ -2671,13 +2652,13 @@ AttachmentsBrowser = View.extend({
return; return;
} }
if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) { if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }
if ( mediaTrash && if ( mediaTrash &&
'trash' !== selection.at( 0 ).get( 'status' ) && 'trash' !== selection.at( 0 ).get( 'status' ) &&
! confirm( l10n.warnBulkTrash ) ) { ! window.confirm( l10n.warnBulkTrash ) ) {
return; return;
} }
@ -2725,7 +2706,7 @@ AttachmentsBrowser = View.extend({
click: function() { click: function() {
var removed = [], selection = this.controller.state().get( 'selection' ); var removed = [], selection = this.controller.state().get( 'selection' );
if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) { if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }
@ -2938,9 +2919,8 @@ AttachmentsBrowser = View.extend({
}); });
module.exports = AttachmentsBrowser; module.exports = AttachmentsBrowser;
},{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
/*globals _, Backbone */
},{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
/** /**
* wp.media.view.Button * wp.media.view.Button
* *
@ -3028,6 +3008,7 @@ Button = View.extend({
}); });
module.exports = Button; module.exports = Button;
},{"./view.js":51}],22:[function(require,module,exports){ },{"./view.js":51}],22:[function(require,module,exports){
/** /**
* When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
@ -3072,9 +3053,8 @@ DeleteSelectedPermanently = DeleteSelected.extend({
}); });
module.exports = DeleteSelectedPermanently; module.exports = DeleteSelectedPermanently;
},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
/*globals wp */
},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
/** /**
* A button that handles bulk Delete/Trash logic * A button that handles bulk Delete/Trash logic
* *
@ -3124,9 +3104,8 @@ DeleteSelected = Button.extend({
}); });
module.exports = DeleteSelected; module.exports = DeleteSelected;
},{"../button.js":21}],24:[function(require,module,exports){
/*globals wp */
},{"../button.js":21}],24:[function(require,module,exports){
var Button = require( '../button.js' ), var Button = require( '../button.js' ),
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
SelectModeToggle; SelectModeToggle;
@ -3180,6 +3159,7 @@ SelectModeToggle = Button.extend({
}); });
module.exports = SelectModeToggle; module.exports = SelectModeToggle;
},{"../button.js":21}],25:[function(require,module,exports){ },{"../button.js":21}],25:[function(require,module,exports){
var View = require( './view.js' ), var View = require( './view.js' ),
EditImage = require( './edit-image.js' ), EditImage = require( './edit-image.js' ),
@ -3205,9 +3185,8 @@ Details = EditImage.extend({
}); });
module.exports = Details; module.exports = Details;
},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
/*globals _, wp */
},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
var View = require( './view.js' ), var View = require( './view.js' ),
EditImage; EditImage;
@ -3259,6 +3238,7 @@ EditImage = View.extend({
}); });
module.exports = EditImage; module.exports = EditImage;
},{"./view.js":51}],27:[function(require,module,exports){ },{"./view.js":51}],27:[function(require,module,exports){
/** /**
* wp.media.view.FocusManager * wp.media.view.FocusManager
@ -3307,9 +3287,8 @@ FocusManager = View.extend({
}); });
module.exports = FocusManager; module.exports = FocusManager;
},{"./view.js":51}],28:[function(require,module,exports){
/*globals _, Backbone */
},{"./view.js":51}],28:[function(require,module,exports){
/** /**
* wp.media.view.Frame * wp.media.view.Frame
* *
@ -3480,9 +3459,8 @@ Frame = View.extend({
_.extend( Frame.prototype, StateMachine.prototype ); _.extend( Frame.prototype, StateMachine.prototype );
module.exports = Frame; module.exports = Frame;
},{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
/** /**
* A frame for editing the details of a specific media item. * A frame for editing the details of a specific media item.
* *
@ -3727,9 +3705,8 @@ EditAttachments = MediaFrame.extend({
}); });
module.exports = EditAttachments; module.exports = EditAttachments;
},{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
/*globals _, Backbone, wp, jQuery */
},{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame.Manage * wp.media.view.MediaFrame.Manage
* *
@ -3967,7 +3944,7 @@ Manage = MediaFrame.extend({
// Verify pushState support and activate // Verify pushState support and activate
if ( window.history && window.history.pushState ) { if ( window.history && window.history.pushState ) {
Backbone.history.start( { Backbone.history.start( {
root: _wpMediaGridSettings.adminUrl, root: window._wpMediaGridSettings.adminUrl,
pushState: true pushState: true
} ); } );
} }
@ -3975,6 +3952,7 @@ Manage = MediaFrame.extend({
}); });
module.exports = Manage; module.exports = Manage;
},{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){ },{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){
/** /**
* wp.media.view.Iframe * wp.media.view.Iframe
@ -4001,6 +3979,7 @@ Iframe = View.extend({
}); });
module.exports = Iframe; module.exports = Iframe;
},{"./view.js":51}],32:[function(require,module,exports){ },{"./view.js":51}],32:[function(require,module,exports){
/** /**
* @class * @class
@ -4027,9 +4006,8 @@ Label = View.extend({
}); });
module.exports = Label; module.exports = Label;
},{"./view.js":51}],33:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./view.js":51}],33:[function(require,module,exports){
/** /**
* wp.media.view.MediaDetails * wp.media.view.MediaDetails
* *
@ -4113,7 +4091,7 @@ MediaDetails = AttachmentDisplay.extend({
*/ */
setPlayer : function() { setPlayer : function() {
if ( ! this.players.length && this.media ) { if ( ! this.players.length && this.media ) {
this.players.push( new MediaElementPlayer( this.media, this.settings ) ); this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
} }
}, },
@ -4180,9 +4158,8 @@ MediaDetails = AttachmentDisplay.extend({
}); });
module.exports = MediaDetails; module.exports = MediaDetails;
},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
/** /**
* wp.media.view.MediaFrame * wp.media.view.MediaFrame
* *
@ -4435,9 +4412,8 @@ _.each(['open','close','attach','detach','escape'], function( method ) {
}); });
module.exports = MediaFrame; module.exports = MediaFrame;
},{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
/*globals wp, jQuery */
},{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
/** /**
* wp.media.view.MenuItem * wp.media.view.MenuItem
* *
@ -4509,6 +4485,7 @@ MenuItem = View.extend({
}); });
module.exports = MenuItem; module.exports = MenuItem;
},{"./view.js":51}],36:[function(require,module,exports){ },{"./view.js":51}],36:[function(require,module,exports){
/** /**
* wp.media.view.Menu * wp.media.view.Menu
@ -4625,9 +4602,8 @@ Menu = PriorityList.extend({
}); });
module.exports = Menu; module.exports = Menu;
},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
/** /**
* wp.media.view.Modal * wp.media.view.Modal
* *
@ -4841,9 +4817,8 @@ Modal = View.extend({
}); });
module.exports = Modal; module.exports = Modal;
},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
/*globals _, Backbone */
},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
/** /**
* wp.media.view.PriorityList * wp.media.view.PriorityList
* *
@ -4942,6 +4917,7 @@ PriorityList = View.extend({
}); });
module.exports = PriorityList; module.exports = PriorityList;
},{"./view.js":51}],39:[function(require,module,exports){ },{"./view.js":51}],39:[function(require,module,exports){
/** /**
* wp.media.view.RouterItem * wp.media.view.RouterItem
@ -4968,6 +4944,7 @@ RouterItem = MenuItem.extend({
}); });
module.exports = RouterItem; module.exports = RouterItem;
},{"./menu-item.js":35}],40:[function(require,module,exports){ },{"./menu-item.js":35}],40:[function(require,module,exports){
/** /**
* wp.media.view.Router * wp.media.view.Router
@ -5005,9 +4982,8 @@ Router = Menu.extend({
}); });
module.exports = Router; module.exports = Router;
},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
/*globals wp */
},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
/** /**
* wp.media.view.Search * wp.media.view.Search
* *
@ -5055,9 +5031,8 @@ Search = View.extend({
}); });
module.exports = Search; module.exports = Search;
},{"./view.js":51}],42:[function(require,module,exports){
/*globals _, Backbone, jQuery */
},{"./view.js":51}],42:[function(require,module,exports){
/** /**
* wp.media.view.Settings * wp.media.view.Settings
* *
@ -5165,7 +5140,7 @@ Settings = View.extend({
// If the setting has a corresponding user setting, // If the setting has a corresponding user setting,
// update that as well. // update that as well.
if ( userSetting = $setting.data('userSetting') ) { if ( userSetting = $setting.data('userSetting') ) {
setUserSetting( userSetting, value ); window.setUserSetting( userSetting, value );
} }
}, },
@ -5177,9 +5152,8 @@ Settings = View.extend({
}); });
module.exports = Settings; module.exports = Settings;
},{"./view.js":51}],43:[function(require,module,exports){
/*globals _, wp */
},{"./view.js":51}],43:[function(require,module,exports){
/** /**
* wp.media.view.Settings.AttachmentDisplay * wp.media.view.Settings.AttachmentDisplay
* *
@ -5272,6 +5246,7 @@ AttachmentDisplay = Settings.extend({
}); });
module.exports = AttachmentDisplay; module.exports = AttachmentDisplay;
},{"../settings.js":42}],44:[function(require,module,exports){ },{"../settings.js":42}],44:[function(require,module,exports){
/** /**
* wp.media.view.Sidebar * wp.media.view.Sidebar
@ -5290,9 +5265,8 @@ Sidebar = PriorityList.extend({
}); });
module.exports = Sidebar; module.exports = Sidebar;
},{"./priority-list.js":38}],45:[function(require,module,exports){
/*globals _, wp */
},{"./priority-list.js":38}],45:[function(require,module,exports){
/** /**
* wp.media.view.Spinner * wp.media.view.Spinner
* *
@ -5329,9 +5303,8 @@ Spinner = View.extend({
}); });
module.exports = Spinner; module.exports = Spinner;
},{"./view.js":51}],46:[function(require,module,exports){
/*globals Backbone, _ */
},{"./view.js":51}],46:[function(require,module,exports){
/** /**
* wp.media.view.Toolbar * wp.media.view.Toolbar
* *
@ -5492,9 +5465,8 @@ Toolbar = View.extend({
}); });
module.exports = Toolbar; module.exports = Toolbar;
},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
/*globals _, wp */
},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
/** /**
* wp.media.view.UploaderInline * wp.media.view.UploaderInline
* *
@ -5625,9 +5597,8 @@ UploaderInline = View.extend({
}); });
module.exports = UploaderInline; module.exports = UploaderInline;
},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
/*globals wp */
},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
/** /**
* wp.media.view.UploaderStatusError * wp.media.view.UploaderStatusError
* *
@ -5645,9 +5616,8 @@ UploaderStatusError = View.extend({
}); });
module.exports = UploaderStatusError; module.exports = UploaderStatusError;
},{"../view.js":51}],49:[function(require,module,exports){
/*globals _, wp */
},{"../view.js":51}],49:[function(require,module,exports){
/** /**
* wp.media.view.UploaderStatus * wp.media.view.UploaderStatus
* *
@ -5785,9 +5755,8 @@ UploaderStatus = View.extend({
}); });
module.exports = UploaderStatus; module.exports = UploaderStatus;
},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
/*globals _, wp, jQuery */
},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
/** /**
* wp.media.view.UploaderWindow * wp.media.view.UploaderWindow
* *
@ -5898,9 +5867,8 @@ UploaderWindow = View.extend({
}); });
module.exports = UploaderWindow; module.exports = UploaderWindow;
},{"../view.js":51}],51:[function(require,module,exports){
/*globals wp */
},{"../view.js":51}],51:[function(require,module,exports){
/** /**
* wp.media.View * wp.media.View
* *
@ -5965,4 +5933,5 @@ var View = wp.Backbone.View.extend({
}); });
module.exports = View; module.exports = View;
},{}]},{},[7]); },{}]},{},[7]);

View File

@ -1,15 +1,11 @@
/* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ var media = wp.media;
(function (wp) {
var media = wp.media;
media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
media.view.EditImage.Details = require( './views/edit-image-details.js' ); media.view.EditImage.Details = require( './views/edit-image-details.js' );
media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
}(wp));

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,10 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/* global _wpMediaModelsL10n:false */ var $ = jQuery,
Attachment, Attachments, l10n, media;
window.wp = window.wp || {}; window.wp = window.wp || {};
(function($){ /**
var Attachment, Attachments, l10n, media;
/**
* Create and return a media frame. * Create and return a media frame.
* *
* Handles the default media experience. * Handles the default media experience.
@ -13,7 +12,7 @@ window.wp = window.wp || {};
* @param {object} attributes The properties passed to the main media controller. * @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow. * @return {wp.media.view.MediaFrame} A media workflow.
*/ */
media = wp.media = function( attributes ) { media = wp.media = function( attributes ) {
var MediaFrame = media.view.MediaFrame, var MediaFrame = media.view.MediaFrame,
frame; frame;
@ -46,31 +45,31 @@ window.wp = window.wp || {};
media.frame = frame; media.frame = frame;
return frame; return frame;
}; };
_.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
// Link any localized strings. // Link any localized strings.
l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n; l10n = media.model.l10n = window._wpMediaModelsL10n || {};
// Link any settings. // Link any settings.
media.model.settings = l10n.settings || {}; media.model.settings = l10n.settings || {};
delete l10n.settings; delete l10n.settings;
Attachments = media.model.Attachments = require( './models/attachments.js' ); Attachments = media.model.Attachments = require( './models/attachments.js' );
Attachment = media.model.Attachment = require( './models/attachment.js' ); Attachment = media.model.Attachment = require( './models/attachment.js' );
media.model.Query = require( './models/query.js' ); media.model.Query = require( './models/query.js' );
media.model.PostImage = require( './models/post-image.js' ); media.model.PostImage = require( './models/post-image.js' );
media.model.Selection = require( './models/selection.js' ); media.model.Selection = require( './models/selection.js' );
/** /**
* ======================================================================== * ========================================================================
* UTILITIES * UTILITIES
* ======================================================================== * ========================================================================
*/ */
/** /**
* A basic equality comparator for Backbone models. * A basic equality comparator for Backbone models.
* *
* Used to order models within a collection - @see wp.media.model.Attachments.comparator(). * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
@ -83,15 +82,15 @@ window.wp = window.wp || {};
* 0: a and b are of the same rank. * 0: a and b are of the same rank.
* 1: b should come before a. * 1: b should come before a.
*/ */
media.compare = function( a, b, ac, bc ) { media.compare = function( a, b, ac, bc ) {
if ( _.isEqual( a, b ) ) { if ( _.isEqual( a, b ) ) {
return ac === bc ? 0 : (ac > bc ? -1 : 1); return ac === bc ? 0 : (ac > bc ? -1 : 1);
} else { } else {
return a > b ? -1 : 1; return a > b ? -1 : 1;
} }
}; };
_.extend( media, { _.extend( media, {
/** /**
* media.template( id ) * media.template( id )
* *
@ -185,33 +184,33 @@ window.wp = window.wp || {};
return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
} }
}); });
/** /**
* ======================================================================== * ========================================================================
* MODELS * MODELS
* ======================================================================== * ========================================================================
*/ */
/** /**
* wp.media.attachment * wp.media.attachment
* *
* @static * @static
* @param {String} id A string used to identify a model. * @param {String} id A string used to identify a model.
* @returns {wp.media.model.Attachment} * @returns {wp.media.model.Attachment}
*/ */
media.attachment = function( id ) { media.attachment = function( id ) {
return Attachment.get( id ); return Attachment.get( id );
}; };
/** /**
* A collection of all attachments that have been fetched from the server. * A collection of all attachments that have been fetched from the server.
* *
* @static * @static
* @member {wp.media.model.Attachments} * @member {wp.media.model.Attachments}
*/ */
Attachments.all = new Attachments(); Attachments.all = new Attachments();
/** /**
* wp.media.query * wp.media.query
* *
* Shorthand for creating a new Attachments Query. * Shorthand for creating a new Attachments Query.
@ -219,21 +218,18 @@ window.wp = window.wp || {};
* @param {object} [props] * @param {object} [props]
* @returns {wp.media.model.Attachments} * @returns {wp.media.model.Attachments}
*/ */
media.query = function( props ) { media.query = function( props ) {
return new Attachments( null, { return new Attachments( null, {
props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
}); });
}; };
// Clean up. Prevents mobile browsers caching // Clean up. Prevents mobile browsers caching
$(window).on('unload', function(){ $(window).on('unload', function(){
window.wp = null; window.wp = null;
}); });
}(jQuery));
},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){ },{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
/*globals jQuery, Backbone, _, wp */
/** /**
* wp.media.model.Attachment * wp.media.model.Attachment
* *
@ -362,7 +358,7 @@ Attachment = Backbone.Model.extend({
return $.Deferred().rejectWith( this ).promise(); return $.Deferred().rejectWith( this ).promise();
} }
return media.post( 'save-attachment-compat', _.defaults({ return wp.media.post( 'save-attachment-compat', _.defaults({
id: this.id, id: this.id,
nonce: this.get('nonces').update, nonce: this.get('nonces').update,
post_id: wp.media.model.settings.post.id post_id: wp.media.model.settings.post.id
@ -400,9 +396,8 @@ Attachment = Backbone.Model.extend({
}); });
module.exports = Attachment; module.exports = Attachment;
},{"./attachments.js":3}],3:[function(require,module,exports){
/*globals jQuery, Backbone, _, wp */
},{"./attachments.js":3}],3:[function(require,module,exports){
/** /**
* wp.media.model.Attachments * wp.media.model.Attachments
* *
@ -726,8 +721,9 @@ Attachments = Backbone.Collection.extend({
// checking if we're still mirroring that collection when // checking if we're still mirroring that collection when
// the request resolves. // the request resolves.
mirroring.more( options ).done( function() { mirroring.more( options ).done( function() {
if ( this === attachments.mirroring ) if ( this === attachments.mirroring ) {
deferred.resolveWith( this ); deferred.resolveWith( this );
}
}); });
return deferred.promise(); return deferred.promise();
@ -936,9 +932,8 @@ Attachments = Backbone.Collection.extend({
}); });
module.exports = Attachments; module.exports = Attachments;
},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
/*globals jQuery, Backbone */
},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
/** /**
* wp.media.model.PostImage * wp.media.model.PostImage
* *
@ -1093,9 +1088,8 @@ PostImage = Backbone.Model.extend({
}); });
module.exports = PostImage; module.exports = PostImage;
},{"./attachment":2}],5:[function(require,module,exports){
/*globals jQuery, _, wp */
},{"./attachment":2}],5:[function(require,module,exports){
/** /**
* wp.media.model.Query * wp.media.model.Query
* *
@ -1402,9 +1396,8 @@ Query = Attachments.extend({
}); });
module.exports = Query; module.exports = Query;
},{"./attachments.js":3}],6:[function(require,module,exports){
/*globals _ */
},{"./attachments.js":3}],6:[function(require,module,exports){
/** /**
* wp.media.model.Selection * wp.media.model.Selection
* *
@ -1500,4 +1493,5 @@ Selection = Attachments.extend({
}); });
module.exports = Selection; module.exports = Selection;
},{"./attachments.js":3}]},{},[1]); },{"./attachments.js":3}]},{},[1]);

View File

@ -1,10 +1,9 @@
/* global _wpMediaModelsL10n:false */ var $ = jQuery,
Attachment, Attachments, l10n, media;
window.wp = window.wp || {}; window.wp = window.wp || {};
(function($){ /**
var Attachment, Attachments, l10n, media;
/**
* Create and return a media frame. * Create and return a media frame.
* *
* Handles the default media experience. * Handles the default media experience.
@ -12,7 +11,7 @@ window.wp = window.wp || {};
* @param {object} attributes The properties passed to the main media controller. * @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow. * @return {wp.media.view.MediaFrame} A media workflow.
*/ */
media = wp.media = function( attributes ) { media = wp.media = function( attributes ) {
var MediaFrame = media.view.MediaFrame, var MediaFrame = media.view.MediaFrame,
frame; frame;
@ -45,31 +44,31 @@ window.wp = window.wp || {};
media.frame = frame; media.frame = frame;
return frame; return frame;
}; };
_.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
// Link any localized strings. // Link any localized strings.
l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n; l10n = media.model.l10n = window._wpMediaModelsL10n || {};
// Link any settings. // Link any settings.
media.model.settings = l10n.settings || {}; media.model.settings = l10n.settings || {};
delete l10n.settings; delete l10n.settings;
Attachments = media.model.Attachments = require( './models/attachments.js' ); Attachments = media.model.Attachments = require( './models/attachments.js' );
Attachment = media.model.Attachment = require( './models/attachment.js' ); Attachment = media.model.Attachment = require( './models/attachment.js' );
media.model.Query = require( './models/query.js' ); media.model.Query = require( './models/query.js' );
media.model.PostImage = require( './models/post-image.js' ); media.model.PostImage = require( './models/post-image.js' );
media.model.Selection = require( './models/selection.js' ); media.model.Selection = require( './models/selection.js' );
/** /**
* ======================================================================== * ========================================================================
* UTILITIES * UTILITIES
* ======================================================================== * ========================================================================
*/ */
/** /**
* A basic equality comparator for Backbone models. * A basic equality comparator for Backbone models.
* *
* Used to order models within a collection - @see wp.media.model.Attachments.comparator(). * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
@ -82,15 +81,15 @@ window.wp = window.wp || {};
* 0: a and b are of the same rank. * 0: a and b are of the same rank.
* 1: b should come before a. * 1: b should come before a.
*/ */
media.compare = function( a, b, ac, bc ) { media.compare = function( a, b, ac, bc ) {
if ( _.isEqual( a, b ) ) { if ( _.isEqual( a, b ) ) {
return ac === bc ? 0 : (ac > bc ? -1 : 1); return ac === bc ? 0 : (ac > bc ? -1 : 1);
} else { } else {
return a > b ? -1 : 1; return a > b ? -1 : 1;
} }
}; };
_.extend( media, { _.extend( media, {
/** /**
* media.template( id ) * media.template( id )
* *
@ -184,33 +183,33 @@ window.wp = window.wp || {};
return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
} }
}); });
/** /**
* ======================================================================== * ========================================================================
* MODELS * MODELS
* ======================================================================== * ========================================================================
*/ */
/** /**
* wp.media.attachment * wp.media.attachment
* *
* @static * @static
* @param {String} id A string used to identify a model. * @param {String} id A string used to identify a model.
* @returns {wp.media.model.Attachment} * @returns {wp.media.model.Attachment}
*/ */
media.attachment = function( id ) { media.attachment = function( id ) {
return Attachment.get( id ); return Attachment.get( id );
}; };
/** /**
* A collection of all attachments that have been fetched from the server. * A collection of all attachments that have been fetched from the server.
* *
* @static * @static
* @member {wp.media.model.Attachments} * @member {wp.media.model.Attachments}
*/ */
Attachments.all = new Attachments(); Attachments.all = new Attachments();
/** /**
* wp.media.query * wp.media.query
* *
* Shorthand for creating a new Attachments Query. * Shorthand for creating a new Attachments Query.
@ -218,15 +217,13 @@ window.wp = window.wp || {};
* @param {object} [props] * @param {object} [props]
* @returns {wp.media.model.Attachments} * @returns {wp.media.model.Attachments}
*/ */
media.query = function( props ) { media.query = function( props ) {
return new Attachments( null, { return new Attachments( null, {
props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
}); });
}; };
// Clean up. Prevents mobile browsers caching // Clean up. Prevents mobile browsers caching
$(window).on('unload', function(){ $(window).on('unload', function(){
window.wp = null; window.wp = null;
}); });
}(jQuery));

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,3 @@
/*globals jQuery, Backbone, _, wp */
/** /**
* wp.media.model.Attachment * wp.media.model.Attachment
* *
@ -128,7 +126,7 @@ Attachment = Backbone.Model.extend({
return $.Deferred().rejectWith( this ).promise(); return $.Deferred().rejectWith( this ).promise();
} }
return media.post( 'save-attachment-compat', _.defaults({ return wp.media.post( 'save-attachment-compat', _.defaults({
id: this.id, id: this.id,
nonce: this.get('nonces').update, nonce: this.get('nonces').update,
post_id: wp.media.model.settings.post.id post_id: wp.media.model.settings.post.id

View File

@ -1,5 +1,3 @@
/*globals jQuery, Backbone, _, wp */
/** /**
* wp.media.model.Attachments * wp.media.model.Attachments
* *
@ -323,8 +321,9 @@ Attachments = Backbone.Collection.extend({
// checking if we're still mirroring that collection when // checking if we're still mirroring that collection when
// the request resolves. // the request resolves.
mirroring.more( options ).done( function() { mirroring.more( options ).done( function() {
if ( this === attachments.mirroring ) if ( this === attachments.mirroring ) {
deferred.resolveWith( this ); deferred.resolveWith( this );
}
}); });
return deferred.promise(); return deferred.promise();

View File

@ -1,5 +1,3 @@
/*globals jQuery, Backbone */
/** /**
* wp.media.model.PostImage * wp.media.model.PostImage
* *

View File

@ -1,5 +1,3 @@
/*globals Backbone, _, wp */
/** /**
* Shared model class for audio and video. Updates the model after * Shared model class for audio and video. Updates the model after
* "Add Audio|Video Source" and "Replace Audio|Video" states return * "Add Audio|Video Source" and "Replace Audio|Video" states return

View File

@ -1,5 +1,3 @@
/*globals jQuery, _, wp */
/** /**
* wp.media.model.Query * wp.media.model.Query
* *

View File

@ -1,5 +1,3 @@
/*globals _ */
/** /**
* wp.media.model.Selection * wp.media.model.Selection
* *

View File

@ -1,5 +1,3 @@
/*globals jQuery, Backbone */
/** /**
* A router for handling the browser history and application state. * A router for handling the browser history and application state.
* *

View File

@ -1,5 +1,3 @@
/*globals _ */
/** /**
* wp.media.selectionSync * wp.media.selectionSync
* *

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,21 @@
/* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */ var media = wp.media,
( function( $, _ ) { $ = jQuery,
var l10n, l10n;
media = wp.media;
media.isTouchDevice = ( 'ontouchend' in document ); media.isTouchDevice = ( 'ontouchend' in document );
// Link any localized strings. // Link any localized strings.
l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n; l10n = media.view.l10n = window._wpMediaViewsL10n || {};
// Link any settings. // Link any settings.
media.view.settings = l10n.settings || {}; media.view.settings = l10n.settings || {};
delete l10n.settings; delete l10n.settings;
// Copy the `post` setting over to the model settings. // Copy the `post` setting over to the model settings.
media.model.settings.post = media.view.settings.post; media.model.settings.post = media.view.settings.post;
// Check if the browser supports CSS 3.0 transitions // Check if the browser supports CSS 3.0 transitions
$.support.transition = (function(){ $.support.transition = (function(){
var style = document.documentElement.style, var style = document.documentElement.style,
transitions = { transitions = {
WebkitTransition: 'webkitTransitionEnd', WebkitTransition: 'webkitTransitionEnd',
@ -32,23 +31,23 @@
return transition && { return transition && {
end: transitions[ transition ] end: transitions[ transition ]
}; };
}()); }());
/** /**
* A shared event bus used to provide events into * A shared event bus used to provide events into
* the media workflows that 3rd-party devs can use to hook * the media workflows that 3rd-party devs can use to hook
* in. * in.
*/ */
media.events = _.extend( {}, Backbone.Events ); media.events = _.extend( {}, Backbone.Events );
/** /**
* Makes it easier to bind events using transitions. * Makes it easier to bind events using transitions.
* *
* @param {string} selector * @param {string} selector
* @param {Number} sensitivity * @param {Number} sensitivity
* @returns {Promise} * @returns {Promise}
*/ */
media.transition = function( selector, sensitivity ) { media.transition = function( selector, sensitivity ) {
var deferred = $.Deferred(); var deferred = $.Deferred();
sensitivity = sensitivity || 2000; sensitivity = sensitivity || 2000;
@ -70,79 +69,77 @@
} }
return deferred.promise(); return deferred.promise();
}; };
media.controller.Region = require( './controllers/region.js' ); media.controller.Region = require( './controllers/region.js' );
media.controller.StateMachine = require( './controllers/state-machine.js' ); media.controller.StateMachine = require( './controllers/state-machine.js' );
media.controller.State = require( './controllers/state.js' ); media.controller.State = require( './controllers/state.js' );
media.selectionSync = require( './utils/selection-sync.js' ); media.selectionSync = require( './utils/selection-sync.js' );
media.controller.Library = require( './controllers/library.js' ); media.controller.Library = require( './controllers/library.js' );
media.controller.ImageDetails = require( './controllers/image-details.js' ); media.controller.ImageDetails = require( './controllers/image-details.js' );
media.controller.GalleryEdit = require( './controllers/gallery-edit.js' ); media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
media.controller.GalleryAdd = require( './controllers/gallery-add.js' ); media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
media.controller.CollectionEdit = require( './controllers/collection-edit.js' ); media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
media.controller.CollectionAdd = require( './controllers/collection-add.js' ); media.controller.CollectionAdd = require( './controllers/collection-add.js' );
media.controller.FeaturedImage = require( './controllers/featured-image.js' ); media.controller.FeaturedImage = require( './controllers/featured-image.js' );
media.controller.ReplaceImage = require( './controllers/replace-image.js' ); media.controller.ReplaceImage = require( './controllers/replace-image.js' );
media.controller.EditImage = require( './controllers/edit-image.js' ); media.controller.EditImage = require( './controllers/edit-image.js' );
media.controller.MediaLibrary = require( './controllers/media-library.js' ); media.controller.MediaLibrary = require( './controllers/media-library.js' );
media.controller.Embed = require( './controllers/embed.js' ); media.controller.Embed = require( './controllers/embed.js' );
media.controller.Cropper = require( './controllers/cropper.js' ); media.controller.Cropper = require( './controllers/cropper.js' );
media.View = require( './views/view.js' ); media.View = require( './views/view.js' );
media.view.Frame = require( './views/view.js' ); media.view.Frame = require( './views/view.js' );
media.view.MediaFrame = require( './views/media-frame.js' ); media.view.MediaFrame = require( './views/media-frame.js' );
media.view.MediaFrame.Select = require( './views/frame/select.js' ); media.view.MediaFrame.Select = require( './views/frame/select.js' );
media.view.MediaFrame.Post = require( './views/frame/post.js' ); media.view.MediaFrame.Post = require( './views/frame/post.js' );
media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' ); media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
media.view.Modal = require( './views/modal.js' ); media.view.Modal = require( './views/modal.js' );
media.view.FocusManager = require( './views/focus-manager.js' ); media.view.FocusManager = require( './views/focus-manager.js' );
media.view.UploaderWindow = require( './views/uploader/window.js' ); media.view.UploaderWindow = require( './views/uploader/window.js' );
media.view.EditorUploader = require( './views/uploader/editor.js' ); media.view.EditorUploader = require( './views/uploader/editor.js' );
media.view.UploaderInline = require( './views/uploader/inline.js' ); media.view.UploaderInline = require( './views/uploader/inline.js' );
media.view.UploaderStatus = require( './views/uploader/status.js' ); media.view.UploaderStatus = require( './views/uploader/status.js' );
media.view.UploaderStatusError = require( './views/uploader/status-error.js' ); media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
media.view.Toolbar = require( './views/toolbar.js' ); media.view.Toolbar = require( './views/toolbar.js' );
media.view.Toolbar.Select = require( './views/toolbar/select.js' ); media.view.Toolbar.Select = require( './views/toolbar/select.js' );
media.view.Toolbar.Embed = require( './views/toolbar/embed.js' ); media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
media.view.Button = require( './views/button.js' ); media.view.Button = require( './views/button.js' );
media.view.ButtonGroup = require( './views/button-group.js' ); media.view.ButtonGroup = require( './views/button-group.js' );
media.view.PriorityList = require( './views/priority-list.js' ); media.view.PriorityList = require( './views/priority-list.js' );
media.view.MenuItem = require( './views/menu-item.js' ); media.view.MenuItem = require( './views/menu-item.js' );
media.view.Menu = require( './views/menu.js' ); media.view.Menu = require( './views/menu.js' );
media.view.RouterItem = require( './views/router-item.js' ); media.view.RouterItem = require( './views/router-item.js' );
media.view.Router = require( './views/router.js' ); media.view.Router = require( './views/router.js' );
media.view.Sidebar = require( './views/sidebar.js' ); media.view.Sidebar = require( './views/sidebar.js' );
media.view.Attachment = require( './views/attachment.js' ); media.view.Attachment = require( './views/attachment.js' );
media.view.Attachment.Library = require( './views/attachment/library.js' ); media.view.Attachment.Library = require( './views/attachment/library.js' );
media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' ); media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
media.view.Attachments = require( './views/attachments.js' ); media.view.Attachments = require( './views/attachments.js' );
media.view.Search = require( './views/search.js' ); media.view.Search = require( './views/search.js' );
media.view.AttachmentFilters = require( './views/attachment-filters.js' ); media.view.AttachmentFilters = require( './views/attachment-filters.js' );
media.view.DateFilter = require( './views/attachment-filters/date.js' ); media.view.DateFilter = require( './views/attachment-filters/date.js' );
media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' ); media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' ); media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
media.view.AttachmentsBrowser = require( './views/attachments/browser.js' ); media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
media.view.Selection = require( './views/selection.js' ); media.view.Selection = require( './views/selection.js' );
media.view.Attachment.Selection = require( './views/attachment/selection.js' ); media.view.Attachment.Selection = require( './views/attachment/selection.js' );
media.view.Attachments.Selection = require( './views/attachments/selection.js' ); media.view.Attachments.Selection = require( './views/attachments/selection.js' );
media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' ); media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
media.view.Settings = require( './views/settings.js' ); media.view.Settings = require( './views/settings.js' );
media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' ); media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
media.view.Settings.Gallery = require( './views/settings/gallery.js' ); media.view.Settings.Gallery = require( './views/settings/gallery.js' );
media.view.Settings.Playlist = require( './views/settings/playlist.js' ); media.view.Settings.Playlist = require( './views/settings/playlist.js' );
media.view.Attachment.Details = require( './views/attachment/details.js' ); media.view.Attachment.Details = require( './views/attachment/details.js' );
media.view.AttachmentCompat = require( './views/attachment-compat.js' ); media.view.AttachmentCompat = require( './views/attachment-compat.js' );
media.view.Iframe = require( './views/iframe.js' ); media.view.Iframe = require( './views/iframe.js' );
media.view.Embed = require( './views/embed.js' ); media.view.Embed = require( './views/embed.js' );
media.view.Label = require( './views/label.js' ); media.view.Label = require( './views/label.js' );
media.view.EmbedUrl = require( './views/embed/url.js' ); media.view.EmbedUrl = require( './views/embed/url.js' );
media.view.EmbedLink = require( './views/embed/link.js' ); media.view.EmbedLink = require( './views/embed/link.js' );
media.view.EmbedImage = require( './views/embed/image.js' ); media.view.EmbedImage = require( './views/embed/image.js' );
media.view.ImageDetails = require( './views/image-details.js' ); media.view.ImageDetails = require( './views/image-details.js' );
media.view.Cropper = require( './views/cropper.js' ); media.view.Cropper = require( './views/cropper.js' );
media.view.EditImage = require( './views/edit-image.js' ); media.view.EditImage = require( './views/edit-image.js' );
media.view.Spinner = require( './views/spinner.js' ); media.view.Spinner = require( './views/spinner.js' );
}(jQuery, _));

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,3 @@
/*globals _ */
/** /**
* wp.media.view.AttachmentCompat * wp.media.view.AttachmentCompat
* *

View File

@ -1,5 +1,3 @@
/*globals _, jQuery */
/** /**
* wp.media.view.AttachmentFilters * wp.media.view.AttachmentFilters
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.AttachmentFilters.All * wp.media.view.AttachmentFilters.All
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* A filter dropdown for month/dates. * A filter dropdown for month/dates.
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.AttachmentFilters.Uploaded * wp.media.view.AttachmentFilters.Uploaded
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.Attachment * wp.media.view.Attachment
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* A similar view to media.view.Attachment.Details * A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal. * for use in the Edit Attachment modal.
@ -34,7 +32,7 @@ TwoColumn = Details.extend({
wp.media.mixin.removeAllPlayers(); wp.media.mixin.removeAllPlayers();
this.$( 'audio, video' ).each( function (i, elem) { this.$( 'audio, video' ).each( function (i, elem) {
var el = MediaDetails.prepareSrc( elem ); var el = MediaDetails.prepareSrc( elem );
new MediaElementPlayer( el, wp.media.mixin.mejsSettings ); new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
} ); } );
} }
}); });

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.Attachment.Details * wp.media.view.Attachment.Details
* *
@ -59,7 +57,7 @@ Details = Attachment.extend({
deleteAttachment: function( event ) { deleteAttachment: function( event ) {
event.preventDefault(); event.preventDefault();
if ( confirm( l10n.warnDelete ) ) { if ( window.confirm( l10n.warnDelete ) ) {
this.model.destroy(); this.model.destroy();
// Keep focus inside media modal // Keep focus inside media modal
// after image is deleted // after image is deleted

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.Attachments * wp.media.view.Attachments
* *
@ -272,7 +270,7 @@ Attachments = View.extend({
// The scroll event occurs on the document, but the element // The scroll event occurs on the document, but the element
// that should be checked is the document body. // that should be checked is the document body.
if ( el == document ) { if ( el === document ) {
el = document.body; el = document.body;
scrollTop = $(document).scrollTop(); scrollTop = $(document).scrollTop();
} }

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.AttachmentsBrowser * wp.media.view.AttachmentsBrowser
* *
@ -190,13 +188,13 @@ AttachmentsBrowser = View.extend({
return; return;
} }
if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) { if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }
if ( mediaTrash && if ( mediaTrash &&
'trash' !== selection.at( 0 ).get( 'status' ) && 'trash' !== selection.at( 0 ).get( 'status' ) &&
! confirm( l10n.warnBulkTrash ) ) { ! window.confirm( l10n.warnBulkTrash ) ) {
return; return;
} }
@ -244,7 +242,7 @@ AttachmentsBrowser = View.extend({
click: function() { click: function() {
var removed = [], selection = this.controller.state().get( 'selection' ); var removed = [], selection = this.controller.state().get( 'selection' );
if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) { if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
return; return;
} }

View File

@ -1,5 +1,3 @@
/*globals _ */
/** /**
* wp.media.view.Attachments.Selection * wp.media.view.Attachments.Selection
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.AudioDetails * wp.media.view.AudioDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone, jQuery */
/** /**
* wp.media.view.ButtonGroup * wp.media.view.ButtonGroup
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.view.Button * wp.media.view.Button
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* A button that handles bulk Delete/Trash logic * A button that handles bulk Delete/Trash logic
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
var Button = require( '../button.js' ), var Button = require( '../button.js' ),
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
SelectModeToggle; SelectModeToggle;

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.Cropper * wp.media.view.Cropper
* *
@ -60,7 +58,7 @@ Cropper = View.extend({
this.views.add( '.upload-errors', new UploaderStatusError({ this.views.add( '.upload-errors', new UploaderStatusError({
filename: UploaderStatus.prototype.filename(filename), filename: UploaderStatus.prototype.filename(filename),
message: _wpMediaViewsL10n.cropError message: window._wpMediaViewsL10n.cropError
}), { at: 0 }); }), { at: 0 });
} }
}); });

View File

@ -1,5 +1,3 @@
/*globals _, wp */
var View = require( './view.js' ), var View = require( './view.js' ),
EditImage; EditImage;

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.EmbedImage * wp.media.view.EmbedImage
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.EmbedLink * wp.media.view.EmbedLink
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.EmbedUrl * wp.media.view.EmbedUrl
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.view.Frame * wp.media.view.Frame
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.MediaFrame.AudioDetails * wp.media.view.MediaFrame.AudioDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* A frame for editing the details of a specific media item. * A frame for editing the details of a specific media item.
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.MediaFrame.ImageDetails * wp.media.view.MediaFrame.ImageDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone, wp, jQuery */
/** /**
* wp.media.view.MediaFrame.Manage * wp.media.view.MediaFrame.Manage
* *
@ -237,7 +235,7 @@ Manage = MediaFrame.extend({
// Verify pushState support and activate // Verify pushState support and activate
if ( window.history && window.history.pushState ) { if ( window.history && window.history.pushState ) {
Backbone.history.start( { Backbone.history.start( {
root: _wpMediaGridSettings.adminUrl, root: window._wpMediaGridSettings.adminUrl,
pushState: true pushState: true
} ); } );
} }

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.MediaFrame.MediaDetails * wp.media.view.MediaFrame.MediaDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.MediaFrame.Post * wp.media.view.MediaFrame.Post
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.MediaFrame.Select * wp.media.view.MediaFrame.Select
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.MediaFrame.VideoDetails * wp.media.view.MediaFrame.VideoDetails
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.ImageDetails * wp.media.view.ImageDetails
* *
@ -73,7 +71,7 @@ ImageDetails = AttachmentDisplay.extend({
postRender: function() { postRender: function() {
setTimeout( _.bind( this.resetFocus, this ), 10 ); setTimeout( _.bind( this.resetFocus, this ), 10 );
this.toggleLinkSettings(); this.toggleLinkSettings();
if ( getUserSetting( 'advImgDetails' ) === 'show' ) { if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) {
this.toggleAdvanced( true ); this.toggleAdvanced( true );
} }
this.trigger( 'post-render' ); this.trigger( 'post-render' );
@ -146,7 +144,7 @@ ImageDetails = AttachmentDisplay.extend({
mode = 'show'; mode = 'show';
} }
setUserSetting( 'advImgDetails', mode ); window.setUserSetting( 'advImgDetails', mode );
}, },
editAttachment: function( event ) { editAttachment: function( event ) {

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.MediaDetails * wp.media.view.MediaDetails
* *
@ -83,7 +81,7 @@ MediaDetails = AttachmentDisplay.extend({
*/ */
setPlayer : function() { setPlayer : function() {
if ( ! this.players.length && this.media ) { if ( ! this.players.length && this.media ) {
this.players.push( new MediaElementPlayer( this.media, this.settings ) ); this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
} }
}, },

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.MediaFrame * wp.media.view.MediaFrame
* *

View File

@ -1,5 +1,3 @@
/*globals wp, jQuery */
/** /**
* wp.media.view.MenuItem * wp.media.view.MenuItem
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.Modal * wp.media.view.Modal
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone */
/** /**
* wp.media.view.PriorityList * wp.media.view.PriorityList
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.Search * wp.media.view.Search
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone, wp */
/** /**
* wp.media.view.Selection * wp.media.view.Selection
* *

View File

@ -1,5 +1,3 @@
/*globals _, Backbone, jQuery */
/** /**
* wp.media.view.Settings * wp.media.view.Settings
* *
@ -107,7 +105,7 @@ Settings = View.extend({
// If the setting has a corresponding user setting, // If the setting has a corresponding user setting,
// update that as well. // update that as well.
if ( userSetting = $setting.data('userSetting') ) { if ( userSetting = $setting.data('userSetting') ) {
setUserSetting( userSetting, value ); window.setUserSetting( userSetting, value );
} }
}, },

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.Settings.AttachmentDisplay * wp.media.view.Settings.AttachmentDisplay
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.Settings.Gallery * wp.media.view.Settings.Gallery
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.Settings.Playlist * wp.media.view.Settings.Playlist
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.Spinner * wp.media.view.Spinner
* *

View File

@ -1,5 +1,3 @@
/*globals Backbone, _ */
/** /**
* wp.media.view.Toolbar * wp.media.view.Toolbar
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.Toolbar.Embed * wp.media.view.Toolbar.Embed
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.Toolbar.Select * wp.media.view.Toolbar.Select
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* Creates a dropzone on WP editor instances (elements with .wp-editor-wrap * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
* or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow. * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow.

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.UploaderInline * wp.media.view.UploaderInline
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.UploaderStatusError * wp.media.view.UploaderStatusError
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp */
/** /**
* wp.media.view.UploaderStatus * wp.media.view.UploaderStatus
* *

View File

@ -1,5 +1,3 @@
/*globals _, wp, jQuery */
/** /**
* wp.media.view.UploaderWindow * wp.media.view.UploaderWindow
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.view.VideoDetails * wp.media.view.VideoDetails
* *

View File

@ -1,5 +1,3 @@
/*globals wp */
/** /**
* wp.media.View * wp.media.View
* *

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31384'; $wp_version = '4.2-alpha-31385';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.