diff --git a/src/wp-includes/js/media/audio-video.js b/src/wp-includes/js/media/audio-video.js
index ace5919144..cf9d7550bf 100644
--- a/src/wp-includes/js/media/audio-video.js
+++ b/src/wp-includes/js/media/audio-video.js
@@ -345,7 +345,7 @@ module.exports = PostMedia;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var MediaDetails = require( './media-details' ),
+var MediaDetails = wp.media.view.MediaDetails,
AudioDetails;
AudioDetails = MediaDetails.extend({
@@ -371,7 +371,7 @@ AudioDetails = MediaDetails.extend({
module.exports = AudioDetails;
-},{"./media-details":9}],6:[function(require,module,exports){
+},{}],6:[function(require,module,exports){
/*globals wp */
/**
@@ -389,9 +389,7 @@ module.exports = AudioDetails;
*/
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
-
- AudioDetailsView = require( '../audio-details.js' ),
- AudioDetailsController = require( '../../controllers/audio-details.js' ),
+
l10n = wp.media.view.l10n,
AudioDetails;
@@ -408,7 +406,7 @@ AudioDetails = MediaDetails.extend({
},
initialize: function( options ) {
- options.DetailsView = AudioDetailsView;
+ options.DetailsView = wp.media.view.AudioDetails;
options.cancelText = l10n.audioDetailsCancel;
options.addText = l10n.audioAddSourceTitle;
@@ -424,7 +422,7 @@ AudioDetails = MediaDetails.extend({
createStates: function() {
this.states.add([
- new AudioDetailsController( {
+ new wp.media.controller.AudioDetails( {
media: this.media
} ),
@@ -451,7 +449,7 @@ AudioDetails = MediaDetails.extend({
module.exports = AudioDetails;
-},{"../../controllers/audio-details.js":2,"../audio-details.js":5}],7:[function(require,module,exports){
+},{}],7:[function(require,module,exports){
/*globals wp */
/**
@@ -466,9 +464,7 @@ module.exports = AudioDetails;
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
-var View = wp.media.View,
- Toolbar = wp.media.view.Toolbar,
- Select = wp.media.view.MediaFrame.Select,
+var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
MediaDetails;
@@ -531,7 +527,7 @@ MediaDetails = Select.extend({
}
}
},
- separateCancel: new View({
+ separateCancel: new wp.media.View({
className: 'separator',
priority: 40
})
@@ -540,7 +536,7 @@ MediaDetails = Select.extend({
},
setPrimaryButton: function(text, handler) {
- this.toolbar.set( new Toolbar({
+ this.toolbar.set( new wp.media.view.Toolbar({
controller: this,
items: {
button: {
@@ -603,8 +599,6 @@ module.exports = MediaDetails;
*/
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
- VideoDetailsView = require( '../video-details.js' ),
- VideoDetailsController = require( '../../controllers/video-details.js' ),
l10n = wp.media.view.l10n,
VideoDetails;
@@ -621,7 +615,7 @@ VideoDetails = MediaDetails.extend({
},
initialize: function( options ) {
- options.DetailsView = VideoDetailsView;
+ options.DetailsView = wp.media.view.VideoDetails;
options.cancelText = l10n.videoDetailsCancel;
options.addText = l10n.videoAddSourceTitle;
@@ -639,7 +633,7 @@ VideoDetails = MediaDetails.extend({
createStates: function() {
this.states.add([
- new VideoDetailsController({
+ new wp.media.controller.VideoDetails({
media: this.media
}),
@@ -724,7 +718,7 @@ VideoDetails = MediaDetails.extend({
module.exports = VideoDetails;
-},{"../../controllers/video-details.js":3,"../video-details.js":10}],9:[function(require,module,exports){
+},{}],9:[function(require,module,exports){
/*global wp, jQuery, _, MediaElementPlayer */
/**
@@ -906,7 +900,7 @@ module.exports = MediaDetails;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var MediaDetails = require( './media-details' ),
+var MediaDetails = wp.media.view.MediaDetails,
VideoDetails;
VideoDetails = MediaDetails.extend({
@@ -937,4 +931,4 @@ VideoDetails = MediaDetails.extend({
module.exports = VideoDetails;
-},{"./media-details":9}]},{},[1]);
+},{}]},{},[1]);
diff --git a/src/wp-includes/js/media/controllers/collection-add.js b/src/wp-includes/js/media/controllers/collection-add.js
index e166f0e015..07c96cfb02 100644
--- a/src/wp-includes/js/media/controllers/collection-add.js
+++ b/src/wp-includes/js/media/controllers/collection-add.js
@@ -34,7 +34,7 @@
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
var Selection = wp.media.model.Selection,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
CollectionAdd;
CollectionAdd = Library.extend({
diff --git a/src/wp-includes/js/media/controllers/collection-edit.js b/src/wp-includes/js/media/controllers/collection-edit.js
index 28ce858153..a715faf70f 100644
--- a/src/wp-includes/js/media/controllers/collection-edit.js
+++ b/src/wp-includes/js/media/controllers/collection-edit.js
@@ -34,9 +34,7 @@
* @param {string} attributes.type The collection's media type. (e.g. 'video').
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
-var Library = require( './library.js' ),
- View = require( '../views/view.js' ),
- EditLibraryView = require( '../views/attachment/edit-library.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
$ = jQuery,
CollectionEdit;
@@ -75,7 +73,7 @@ CollectionEdit = Library.extend({
}
// The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) {
- this.set( 'AttachmentView', EditLibraryView );
+ this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
}
Library.prototype.initialize.apply( this, arguments );
},
@@ -141,7 +139,7 @@ CollectionEdit = Library.extend({
attachmentsBrowserView.sidebar.set( obj );
if ( dragInfoText ) {
- attachmentsBrowserView.toolbar.set( 'dragInfo', new View({
+ attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
el: $( '
' + dragInfoText + '
' )[0],
priority: -40
}) );
diff --git a/src/wp-includes/js/media/controllers/cropper.js b/src/wp-includes/js/media/controllers/cropper.js
index 0de436252a..10f8020808 100644
--- a/src/wp-includes/js/media/controllers/cropper.js
+++ b/src/wp-includes/js/media/controllers/cropper.js
@@ -9,13 +9,10 @@
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var State = require( './state.js' ),
- ToolbarView = require( '../views/toolbar.js' ),
- CropperView = require( '../views/cropper.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
Cropper;
-Cropper = State.extend({
+Cropper = wp.media.controller.State.extend({
defaults: {
id: 'cropper',
title: l10n.cropImage,
@@ -38,7 +35,7 @@ Cropper = State.extend({
},
createCropContent: function() {
- this.cropperView = new CropperView({
+ this.cropperView = new wp.media.view.Cropper({
controller: this,
attachment: this.get('selection').first()
});
@@ -104,7 +101,7 @@ Cropper = State.extend({
});
}
- this.frame.toolbar.set( new ToolbarView(toolbarOptions) );
+ this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) );
},
doCrop: function( attachment ) {
diff --git a/src/wp-includes/js/media/controllers/edit-attachment-metadata.js b/src/wp-includes/js/media/controllers/edit-attachment-metadata.js
index f2d2aa1c32..31dc001adc 100644
--- a/src/wp-includes/js/media/controllers/edit-attachment-metadata.js
+++ b/src/wp-includes/js/media/controllers/edit-attachment-metadata.js
@@ -9,11 +9,10 @@
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var State = wp.media.controller.State,
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
-EditAttachmentMetadata = State.extend({
+EditAttachmentMetadata = wp.media.controller.State.extend({
defaults: {
id: 'edit-attachment',
// Title string passed to the frame's title region view.
diff --git a/src/wp-includes/js/media/controllers/edit-image.js b/src/wp-includes/js/media/controllers/edit-image.js
index d80195fce9..426114b53a 100644
--- a/src/wp-includes/js/media/controllers/edit-image.js
+++ b/src/wp-includes/js/media/controllers/edit-image.js
@@ -18,12 +18,10 @@
* @param {string} [attributes.menu=false] Initial mode for the menu region.
* @param {string} [attributes.url] Unused. @todo Consider removal.
*/
-var State = require( './state.js' ),
- ToolbarView = require( '../views/toolbar.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
EditImage;
-EditImage = State.extend({
+EditImage = wp.media.controller.State.extend({
defaults: {
id: 'edit-image',
title: l10n.editImage,
@@ -55,7 +53,7 @@ EditImage = State.extend({
lastState = frame.lastState(),
previous = lastState && lastState.id;
- frame.toolbar.set( new ToolbarView({
+ frame.toolbar.set( new wp.media.view.Toolbar({
controller: frame,
items: {
back: {
diff --git a/src/wp-includes/js/media/controllers/embed.js b/src/wp-includes/js/media/controllers/embed.js
index ca43d42f44..7426d2cde5 100644
--- a/src/wp-includes/js/media/controllers/embed.js
+++ b/src/wp-includes/js/media/controllers/embed.js
@@ -21,12 +21,11 @@
* @param {string} [attributes.url] The embed URL.
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
*/
-var State = require( './state.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
$ = Backbone.$,
Embed;
-Embed = State.extend({
+Embed = wp.media.controller.State.extend({
defaults: {
id: 'embed',
title: l10n.insertFromUrlTitle,
diff --git a/src/wp-includes/js/media/controllers/featured-image.js b/src/wp-includes/js/media/controllers/featured-image.js
index 9ed2b93e1c..f6cdce3472 100644
--- a/src/wp-includes/js/media/controllers/featured-image.js
+++ b/src/wp-includes/js/media/controllers/featured-image.js
@@ -32,7 +32,7 @@
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
var Attachment = wp.media.model.Attachment,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
FeaturedImage;
diff --git a/src/wp-includes/js/media/controllers/gallery-add.js b/src/wp-includes/js/media/controllers/gallery-add.js
index 4e06591099..a9b1f630d6 100644
--- a/src/wp-includes/js/media/controllers/gallery-add.js
+++ b/src/wp-includes/js/media/controllers/gallery-add.js
@@ -32,7 +32,7 @@
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
*/
var Selection = wp.media.model.Selection,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryAdd;
diff --git a/src/wp-includes/js/media/controllers/gallery-edit.js b/src/wp-includes/js/media/controllers/gallery-edit.js
index b8a5306433..da9b2e1708 100644
--- a/src/wp-includes/js/media/controllers/gallery-edit.js
+++ b/src/wp-includes/js/media/controllers/gallery-edit.js
@@ -31,9 +31,7 @@
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
*/
-var Library = require( './library.js' ),
- EditLibraryView = require( '../views/attachment/edit-library.js' ),
- GallerySettingsView = require( '../views/settings/gallery.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryEdit;
@@ -67,7 +65,7 @@ GalleryEdit = Library.extend({
// The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) {
- this.set( 'AttachmentView', EditLibraryView );
+ this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
}
Library.prototype.initialize.apply( this, arguments );
@@ -121,7 +119,7 @@ GalleryEdit = Library.extend({
library.gallery = library.gallery || new Backbone.Model();
browser.sidebar.set({
- gallery: new GallerySettingsView({
+ gallery: new wp.media.view.Settings.Gallery({
controller: this,
model: library.gallery,
priority: 40
diff --git a/src/wp-includes/js/media/controllers/image-details.js b/src/wp-includes/js/media/controllers/image-details.js
index 21eb7ce141..ab7d6c9191 100644
--- a/src/wp-includes/js/media/controllers/image-details.js
+++ b/src/wp-includes/js/media/controllers/image-details.js
@@ -24,8 +24,8 @@
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
* however this may not do anything.
*/
-var State = require( './state.js' ),
- Library = require( './library.js' ),
+var State = wp.media.controller.State,
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ImageDetails;
diff --git a/src/wp-includes/js/media/controllers/library.js b/src/wp-includes/js/media/controllers/library.js
index 265831d8f0..d089adfb64 100644
--- a/src/wp-includes/js/media/controllers/library.js
+++ b/src/wp-includes/js/media/controllers/library.js
@@ -34,14 +34,12 @@
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
-var selectionSync = require( '../utils/selection-sync.js' ),
- State = require( './state.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library;
-Library = State.extend({
+Library = wp.media.controller.State.extend({
defaults: {
id: 'library',
title: l10n.mediaLibraryTitle,
@@ -269,6 +267,6 @@ Library = State.extend({
});
// Make selectionSync available on any Media Library state.
-_.extend( Library.prototype, selectionSync );
+_.extend( Library.prototype, wp.media.selectionSync );
module.exports = Library;
diff --git a/src/wp-includes/js/media/controllers/media-library.js b/src/wp-includes/js/media/controllers/media-library.js
index 2e890b7dcd..ae04550530 100644
--- a/src/wp-includes/js/media/controllers/media-library.js
+++ b/src/wp-includes/js/media/controllers/media-library.js
@@ -8,7 +8,7 @@
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var Library = require( './library.js' ),
+var Library = wp.media.controller.Library,
MediaLibrary;
MediaLibrary = Library.extend({
diff --git a/src/wp-includes/js/media/controllers/replace-image.js b/src/wp-includes/js/media/controllers/replace-image.js
index 206aa904c3..cd33e75e28 100644
--- a/src/wp-includes/js/media/controllers/replace-image.js
+++ b/src/wp-includes/js/media/controllers/replace-image.js
@@ -31,7 +31,7 @@
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
-var Library = require( './library.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ReplaceImage;
diff --git a/src/wp-includes/js/media/grid.js b/src/wp-includes/js/media/grid.js
index dff1832d75..6c8faa5a82 100644
--- a/src/wp-includes/js/media/grid.js
+++ b/src/wp-includes/js/media/grid.js
@@ -10,11 +10,10 @@
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var State = wp.media.controller.State,
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
-EditAttachmentMetadata = State.extend({
+EditAttachmentMetadata = wp.media.controller.State.extend({
defaults: {
id: 'edit-attachment',
// Title string passed to the frame's title region view.
@@ -140,6 +139,8 @@ TwoColumn = Details.extend({
module.exports = TwoColumn;
},{}],5:[function(require,module,exports){
+/*globals wp */
+
/**
* wp.media.view.DeleteSelectedPermanentlyButton
*
@@ -153,7 +154,7 @@ module.exports = TwoColumn;
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
- DeleteSelected = require( './delete-selected.js' ),
+ DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
DeleteSelectedPermanently = DeleteSelected.extend({
@@ -186,7 +187,7 @@ DeleteSelectedPermanently = DeleteSelected.extend({
module.exports = DeleteSelectedPermanently;
-},{"./delete-selected.js":6}],6:[function(require,module,exports){
+},{}],6:[function(require,module,exports){
/*globals wp */
/**
@@ -365,13 +366,6 @@ module.exports = Details;
*/
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
- Modal = wp.media.view.Modal,
- AttachmentCompat = wp.media.view.AttachmentCompat,
- EditImageController = wp.media.controller.EditImage,
-
- EditAttachmentMetadata = require( '../../controllers/edit-attachment-metadata.js' ),
- TwoColumn = require( '../attachment/details-two-column.js' ),
- DetailsView = require( '../edit-image-details.js' ),
$ = jQuery,
EditAttachments;
@@ -427,7 +421,7 @@ EditAttachments = MediaFrame.extend({
createModal: function() {
// Initialize modal container view.
if ( this.options.modal ) {
- this.modal = new Modal({
+ this.modal = new wp.media.view.Modal({
controller: this,
title: this.options.title
});
@@ -456,7 +450,7 @@ EditAttachments = MediaFrame.extend({
*/
createStates: function() {
this.states.add([
- new EditAttachmentMetadata( { model: this.model } )
+ new wp.media.controller.EditAttachmentMetadata( { model: this.model } )
]);
},
@@ -467,7 +461,7 @@ EditAttachments = MediaFrame.extend({
* should be set with the proper region view.
*/
editMetadataMode: function( contentRegion ) {
- contentRegion.view = new TwoColumn({
+ contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({
controller: this,
model: this.model
});
@@ -476,7 +470,7 @@ EditAttachments = MediaFrame.extend({
* Attach a subview to display fields added via the
* `attachment_fields_to_edit` filter.
*/
- contentRegion.view.views.set( '.attachment-compat', new AttachmentCompat({
+ contentRegion.view.views.set( '.attachment-compat', new wp.media.view.AttachmentCompat({
controller: this,
model: this.model
}) );
@@ -494,7 +488,7 @@ EditAttachments = MediaFrame.extend({
* should be set with the proper region view.
*/
editImageMode: function( contentRegion ) {
- var editImageController = new EditImageController( {
+ var editImageController = new wp.media.controller.EditImage( {
model: this.model,
frame: this
} );
@@ -503,7 +497,7 @@ EditAttachments = MediaFrame.extend({
editImageController._router = function() {};
editImageController._menu = function() {};
- contentRegion.view = new DetailsView( {
+ contentRegion.view = new wp.media.view.EditImage.Details( {
model: this.model,
frame: this,
controller: editImageController
@@ -596,7 +590,7 @@ EditAttachments = MediaFrame.extend({
module.exports = EditAttachments;
-},{"../../controllers/edit-attachment-metadata.js":1,"../attachment/details-two-column.js":4,"../edit-image-details.js":8}],10:[function(require,module,exports){
+},{}],10:[function(require,module,exports){
/*globals wp, _, Backbone */
/**
@@ -615,12 +609,8 @@ module.exports = EditAttachments;
* @mixes wp.media.controller.StateMachine
*/
var MediaFrame = wp.media.view.MediaFrame,
- UploaderWindow = wp.media.view.UploaderWindow,
- AttachmentsBrowser = wp.media.view.AttachmentsBrowser,
Library = wp.media.controller.Library,
- Router = require( '../../routers/manage.js' ),
-
$ = Backbone.$,
Manage;
@@ -657,7 +647,7 @@ Manage = MediaFrame.extend({
// Initialize a window-wide uploader.
if ( this.options.uploader ) {
- this.uploader = new UploaderWindow({
+ this.uploader = new wp.media.view.UploaderWindow({
controller: this,
uploader: {
dropzone: document.body,
@@ -670,7 +660,7 @@ Manage = MediaFrame.extend({
this.options.uploader = false;
}
- this.gridRouter = new Router();
+ this.gridRouter = new wp.media.view.MediaFrame.Manage.Router();
// Call 'initialize' directly on the parent class.
MediaFrame.prototype.initialize.apply( this, arguments );
@@ -820,7 +810,7 @@ Manage = MediaFrame.extend({
var state = this.state();
// Browse our library of attachments.
- this.browserView = contentRegion.view = new AttachmentsBrowser({
+ this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({
controller: this,
collection: state.get('library'),
selection: state.get('selection'),
@@ -870,4 +860,4 @@ Manage = MediaFrame.extend({
module.exports = Manage;
-},{"../../routers/manage.js":3}]},{},[2]);
+},{}]},{},[2]);
diff --git a/src/wp-includes/js/media/models.js b/src/wp-includes/js/media/models.js
index fa81528a8a..4bc7f61c65 100644
--- a/src/wp-includes/js/media/models.js
+++ b/src/wp-includes/js/media/models.js
@@ -58,8 +58,8 @@ l10n = media.model.l10n = window._wpMediaModelsL10n || {};
media.model.settings = l10n.settings || {};
delete l10n.settings;
-Attachments = media.model.Attachments = require( './models/attachments.js' );
Attachment = media.model.Attachment = require( './models/attachment.js' );
+Attachments = media.model.Attachments = require( './models/attachments.js' );
media.model.Query = require( './models/query.js' );
media.model.PostImage = require( './models/post-image.js' );
@@ -379,7 +379,7 @@ Attachment = Backbone.Model.extend({
* @returns {wp.media.model.Attachment}
*/
create: function( attrs ) {
- var Attachments = require( './attachments.js' );
+ var Attachments = wp.media.model.Attachments;
return Attachments.all.push( attrs );
},
/**
@@ -394,14 +394,14 @@ Attachment = Backbone.Model.extend({
* @returns {wp.media.model.Attachment}
*/
get: _.memoize( function( id, attachment ) {
- var Attachments = require( './attachments.js' );
+ var Attachments = wp.media.model.Attachments;
return Attachments.all.push( attachment || { id: id } );
})
});
module.exports = Attachment;
-},{"./attachments.js":3}],3:[function(require,module,exports){
+},{}],3:[function(require,module,exports){
/*globals wp, _, Backbone */
/**
@@ -426,14 +426,11 @@ module.exports = Attachment;
* @param {string} [options.filters]
*
*/
-var Attachment = require( './attachment.js' ),
- Attachments;
-
-Attachments = Backbone.Collection.extend({
+var Attachments = Backbone.Collection.extend({
/**
* @type {wp.media.model.Attachment}
*/
- model: Attachment,
+ model: wp.media.model.Attachment,
/**
* @param {Array} [models=[]] Array of models used to populate the collection.
* @param {Object} [options={}]
@@ -771,7 +768,7 @@ Attachments = Backbone.Collection.extend({
id = attrs.id;
}
- attachment = Attachment.get( id );
+ attachment = wp.media.model.Attachment.get( id );
newAttributes = attachment.parse( attrs, xhr );
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
@@ -787,12 +784,11 @@ Attachments = Backbone.Collection.extend({
* @access private
*/
_requery: function( refresh ) {
- var props, Query;
+ var props;
if ( this.props.get('query') ) {
- Query = require( './query.js' );
props = this.props.toJSON();
props.cache = ( true !== refresh );
- this.mirror( Query.get( props ) );
+ this.mirror( wp.media.model.Query.get( props ) );
}
},
/**
@@ -939,7 +935,7 @@ Attachments = Backbone.Collection.extend({
module.exports = Attachments;
-},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
+},{}],4:[function(require,module,exports){
/*globals Backbone */
/**
@@ -955,12 +951,10 @@ module.exports = Attachments;
* @param {int} [attributes] Initial model attributes.
* @param {int} [attributes.attachment_id] ID of the attachment.
**/
-var Attachment = require( './attachment' ),
- PostImage;
-
-PostImage = Backbone.Model.extend({
+var PostImage = Backbone.Model.extend({
initialize: function( attributes ) {
+ var Attachment = wp.media.model.Attachment;
this.attachment = false;
if ( attributes.attachment_id ) {
@@ -1097,7 +1091,7 @@ PostImage = Backbone.Model.extend({
module.exports = PostImage;
-},{"./attachment":2}],5:[function(require,module,exports){
+},{}],5:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -1117,7 +1111,7 @@ module.exports = PostImage;
* @param {object} [options.args] Attachments query arguments.
* @param {object} [options.args.posts_per_page]
*/
-var Attachments = require( './attachments.js' ),
+var Attachments = wp.media.model.Attachments,
Query;
Query = Attachments.extend({
@@ -1407,8 +1401,8 @@ Query = Attachments.extend({
module.exports = Query;
-},{"./attachments.js":3}],6:[function(require,module,exports){
-/*globals _ */
+},{}],6:[function(require,module,exports){
+/*globals wp, _ */
/**
* wp.media.model.Selection
@@ -1419,7 +1413,7 @@ module.exports = Query;
* @augments wp.media.model.Attachments
* @augments Backbone.Collection
*/
-var Attachments = require( './attachments.js' ),
+var Attachments = wp.media.model.Attachments,
Selection;
Selection = Attachments.extend({
@@ -1506,4 +1500,4 @@ Selection = Attachments.extend({
module.exports = Selection;
-},{"./attachments.js":3}]},{},[1]);
+},{}]},{},[1]);
diff --git a/src/wp-includes/js/media/models.manifest.js b/src/wp-includes/js/media/models.manifest.js
index fe1b3512b5..1d86e863d3 100644
--- a/src/wp-includes/js/media/models.manifest.js
+++ b/src/wp-includes/js/media/models.manifest.js
@@ -57,8 +57,8 @@ l10n = media.model.l10n = window._wpMediaModelsL10n || {};
media.model.settings = l10n.settings || {};
delete l10n.settings;
-Attachments = media.model.Attachments = require( './models/attachments.js' );
Attachment = media.model.Attachment = require( './models/attachment.js' );
+Attachments = media.model.Attachments = require( './models/attachments.js' );
media.model.Query = require( './models/query.js' );
media.model.PostImage = require( './models/post-image.js' );
diff --git a/src/wp-includes/js/media/models/attachment.js b/src/wp-includes/js/media/models/attachment.js
index 60a65b3cb5..d230c348e4 100644
--- a/src/wp-includes/js/media/models/attachment.js
+++ b/src/wp-includes/js/media/models/attachment.js
@@ -145,7 +145,7 @@ Attachment = Backbone.Model.extend({
* @returns {wp.media.model.Attachment}
*/
create: function( attrs ) {
- var Attachments = require( './attachments.js' );
+ var Attachments = wp.media.model.Attachments;
return Attachments.all.push( attrs );
},
/**
@@ -160,7 +160,7 @@ Attachment = Backbone.Model.extend({
* @returns {wp.media.model.Attachment}
*/
get: _.memoize( function( id, attachment ) {
- var Attachments = require( './attachments.js' );
+ var Attachments = wp.media.model.Attachments;
return Attachments.all.push( attachment || { id: id } );
})
});
diff --git a/src/wp-includes/js/media/models/attachments.js b/src/wp-includes/js/media/models/attachments.js
index edd4eace0c..5f0f26d618 100644
--- a/src/wp-includes/js/media/models/attachments.js
+++ b/src/wp-includes/js/media/models/attachments.js
@@ -22,14 +22,11 @@
* @param {string} [options.filters]
*
*/
-var Attachment = require( './attachment.js' ),
- Attachments;
-
-Attachments = Backbone.Collection.extend({
+var Attachments = Backbone.Collection.extend({
/**
* @type {wp.media.model.Attachment}
*/
- model: Attachment,
+ model: wp.media.model.Attachment,
/**
* @param {Array} [models=[]] Array of models used to populate the collection.
* @param {Object} [options={}]
@@ -367,7 +364,7 @@ Attachments = Backbone.Collection.extend({
id = attrs.id;
}
- attachment = Attachment.get( id );
+ attachment = wp.media.model.Attachment.get( id );
newAttributes = attachment.parse( attrs, xhr );
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
@@ -383,12 +380,11 @@ Attachments = Backbone.Collection.extend({
* @access private
*/
_requery: function( refresh ) {
- var props, Query;
+ var props;
if ( this.props.get('query') ) {
- Query = require( './query.js' );
props = this.props.toJSON();
props.cache = ( true !== refresh );
- this.mirror( Query.get( props ) );
+ this.mirror( wp.media.model.Query.get( props ) );
}
},
/**
diff --git a/src/wp-includes/js/media/models/post-image.js b/src/wp-includes/js/media/models/post-image.js
index ba4327f27a..b53af4fb68 100644
--- a/src/wp-includes/js/media/models/post-image.js
+++ b/src/wp-includes/js/media/models/post-image.js
@@ -13,12 +13,10 @@
* @param {int} [attributes] Initial model attributes.
* @param {int} [attributes.attachment_id] ID of the attachment.
**/
-var Attachment = require( './attachment' ),
- PostImage;
-
-PostImage = Backbone.Model.extend({
+var PostImage = Backbone.Model.extend({
initialize: function( attributes ) {
+ var Attachment = wp.media.model.Attachment;
this.attachment = false;
if ( attributes.attachment_id ) {
diff --git a/src/wp-includes/js/media/models/query.js b/src/wp-includes/js/media/models/query.js
index 41a24d3e93..ce4e06e455 100644
--- a/src/wp-includes/js/media/models/query.js
+++ b/src/wp-includes/js/media/models/query.js
@@ -17,7 +17,7 @@
* @param {object} [options.args] Attachments query arguments.
* @param {object} [options.args.posts_per_page]
*/
-var Attachments = require( './attachments.js' ),
+var Attachments = wp.media.model.Attachments,
Query;
Query = Attachments.extend({
diff --git a/src/wp-includes/js/media/models/selection.js b/src/wp-includes/js/media/models/selection.js
index daa4730907..b65bf37b73 100644
--- a/src/wp-includes/js/media/models/selection.js
+++ b/src/wp-includes/js/media/models/selection.js
@@ -1,4 +1,4 @@
-/*globals _ */
+/*globals wp, _ */
/**
* wp.media.model.Selection
@@ -9,7 +9,7 @@
* @augments wp.media.model.Attachments
* @augments Backbone.Collection
*/
-var Attachments = require( './attachments.js' ),
+var Attachments = wp.media.model.Attachments,
Selection;
Selection = Attachments.extend({
diff --git a/src/wp-includes/js/media/views.js b/src/wp-includes/js/media/views.js
index a2f3f22614..3c37558736 100644
--- a/src/wp-includes/js/media/views.js
+++ b/src/wp-includes/js/media/views.js
@@ -35,7 +35,7 @@
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
var Selection = wp.media.model.Selection,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
CollectionAdd;
CollectionAdd = Library.extend({
@@ -101,7 +101,7 @@ CollectionAdd = Library.extend({
module.exports = CollectionAdd;
-},{"./library.js":10}],2:[function(require,module,exports){
+},{}],2:[function(require,module,exports){
/*globals wp, Backbone */
/**
@@ -138,9 +138,7 @@ module.exports = CollectionAdd;
* @param {string} attributes.type The collection's media type. (e.g. 'video').
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
-var Library = require( './library.js' ),
- View = require( '../views/view.js' ),
- EditLibraryView = require( '../views/attachment/edit-library.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
$ = jQuery,
CollectionEdit;
@@ -179,7 +177,7 @@ CollectionEdit = Library.extend({
}
// The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) {
- this.set( 'AttachmentView', EditLibraryView );
+ this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
}
Library.prototype.initialize.apply( this, arguments );
},
@@ -245,7 +243,7 @@ CollectionEdit = Library.extend({
attachmentsBrowserView.sidebar.set( obj );
if ( dragInfoText ) {
- attachmentsBrowserView.toolbar.set( 'dragInfo', new View({
+ attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
el: $( '' + dragInfoText + '
' )[0],
priority: -40
}) );
@@ -265,7 +263,7 @@ CollectionEdit = Library.extend({
module.exports = CollectionEdit;
-},{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
+},{}],3:[function(require,module,exports){
/*globals wp, _, Backbone */
/**
@@ -277,13 +275,10 @@ module.exports = CollectionEdit;
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var State = require( './state.js' ),
- ToolbarView = require( '../views/toolbar.js' ),
- CropperView = require( '../views/cropper.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
Cropper;
-Cropper = State.extend({
+Cropper = wp.media.controller.State.extend({
defaults: {
id: 'cropper',
title: l10n.cropImage,
@@ -306,7 +301,7 @@ Cropper = State.extend({
},
createCropContent: function() {
- this.cropperView = new CropperView({
+ this.cropperView = new wp.media.view.Cropper({
controller: this,
attachment: this.get('selection').first()
});
@@ -372,7 +367,7 @@ Cropper = State.extend({
});
}
- this.frame.toolbar.set( new ToolbarView(toolbarOptions) );
+ this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) );
},
doCrop: function( attachment ) {
@@ -386,7 +381,7 @@ Cropper = State.extend({
module.exports = Cropper;
-},{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
+},{}],4:[function(require,module,exports){
/*globals wp */
/**
@@ -407,12 +402,10 @@ module.exports = Cropper;
* @param {string} [attributes.menu=false] Initial mode for the menu region.
* @param {string} [attributes.url] Unused. @todo Consider removal.
*/
-var State = require( './state.js' ),
- ToolbarView = require( '../views/toolbar.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
EditImage;
-EditImage = State.extend({
+EditImage = wp.media.controller.State.extend({
defaults: {
id: 'edit-image',
title: l10n.editImage,
@@ -444,7 +437,7 @@ EditImage = State.extend({
lastState = frame.lastState(),
previous = lastState && lastState.id;
- frame.toolbar.set( new ToolbarView({
+ frame.toolbar.set( new wp.media.view.Toolbar({
controller: frame,
items: {
back: {
@@ -466,7 +459,7 @@ EditImage = State.extend({
module.exports = EditImage;
-},{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
+},{}],5:[function(require,module,exports){
/*globals wp, _, Backbone */
/**
@@ -490,12 +483,11 @@ module.exports = EditImage;
* @param {string} [attributes.url] The embed URL.
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
*/
-var State = require( './state.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
$ = Backbone.$,
Embed;
-Embed = State.extend({
+Embed = wp.media.controller.State.extend({
defaults: {
id: 'embed',
title: l10n.insertFromUrlTitle,
@@ -605,7 +597,7 @@ Embed = State.extend({
module.exports = Embed;
-},{"./state.js":15}],6:[function(require,module,exports){
+},{}],6:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -640,7 +632,7 @@ module.exports = Embed;
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
var Attachment = wp.media.model.Attachment,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
FeaturedImage;
@@ -729,7 +721,7 @@ FeaturedImage = Library.extend({
module.exports = FeaturedImage;
-},{"./library.js":10}],7:[function(require,module,exports){
+},{}],7:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -764,7 +756,7 @@ module.exports = FeaturedImage;
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
*/
var Selection = wp.media.model.Selection,
- Library = require( './library.js' ),
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryAdd;
@@ -822,7 +814,7 @@ GalleryAdd = Library.extend({
module.exports = GalleryAdd;
-},{"./library.js":10}],8:[function(require,module,exports){
+},{}],8:[function(require,module,exports){
/*globals wp */
/**
@@ -856,9 +848,7 @@ module.exports = GalleryAdd;
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
*/
-var Library = require( './library.js' ),
- EditLibraryView = require( '../views/attachment/edit-library.js' ),
- GallerySettingsView = require( '../views/settings/gallery.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryEdit;
@@ -892,7 +882,7 @@ GalleryEdit = Library.extend({
// The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) {
- this.set( 'AttachmentView', EditLibraryView );
+ this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
}
Library.prototype.initialize.apply( this, arguments );
@@ -946,7 +936,7 @@ GalleryEdit = Library.extend({
library.gallery = library.gallery || new Backbone.Model();
browser.sidebar.set({
- gallery: new GallerySettingsView({
+ gallery: new wp.media.view.Settings.Gallery({
controller: this,
model: library.gallery,
priority: 40
@@ -966,7 +956,7 @@ GalleryEdit = Library.extend({
module.exports = GalleryEdit;
-},{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
+},{}],9:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -993,8 +983,8 @@ module.exports = GalleryEdit;
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
* however this may not do anything.
*/
-var State = require( './state.js' ),
- Library = require( './library.js' ),
+var State = wp.media.controller.State,
+ Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ImageDetails;
@@ -1030,7 +1020,7 @@ ImageDetails = State.extend({
module.exports = ImageDetails;
-},{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
+},{}],10:[function(require,module,exports){
/*globals wp, _, Backbone */
/**
@@ -1067,14 +1057,12 @@ module.exports = ImageDetails;
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
-var selectionSync = require( '../utils/selection-sync.js' ),
- State = require( './state.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library;
-Library = State.extend({
+Library = wp.media.controller.State.extend({
defaults: {
id: 'library',
title: l10n.mediaLibraryTitle,
@@ -1302,11 +1290,11 @@ Library = State.extend({
});
// Make selectionSync available on any Media Library state.
-_.extend( Library.prototype, selectionSync );
+_.extend( Library.prototype, wp.media.selectionSync );
module.exports = Library;
-},{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
+},{}],11:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -1317,7 +1305,7 @@ module.exports = Library;
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
-var Library = require( './library.js' ),
+var Library = wp.media.controller.Library,
MediaLibrary;
MediaLibrary = Library.extend({
@@ -1358,7 +1346,7 @@ MediaLibrary = Library.extend({
module.exports = MediaLibrary;
-},{"./library.js":10}],12:[function(require,module,exports){
+},{}],12:[function(require,module,exports){
/*globals Backbone, _ */
/**
@@ -1573,7 +1561,7 @@ module.exports = Region;
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
-var Library = require( './library.js' ),
+var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ReplaceImage;
@@ -1649,7 +1637,7 @@ ReplaceImage = Library.extend({
module.exports = ReplaceImage;
-},{"./library.js":10}],14:[function(require,module,exports){
+},{}],14:[function(require,module,exports){
/*globals _, Backbone */
/**
@@ -2248,7 +2236,7 @@ media.view.Spinner = require( './views/spinner.js' );
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var View = require( './view.js' ),
+var View = wp.media.View,
AttachmentCompat;
AttachmentCompat = View.extend({
@@ -2322,7 +2310,7 @@ AttachmentCompat = View.extend({
module.exports = AttachmentCompat;
-},{"./view.js":71}],19:[function(require,module,exports){
+},{}],19:[function(require,module,exports){
/*globals _, jQuery */
/**
@@ -2333,11 +2321,10 @@ module.exports = AttachmentCompat;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var View = require( './view.js' ),
- $ = jQuery,
+var $ = jQuery,
AttachmentFilters;
-AttachmentFilters = View.extend({
+AttachmentFilters = wp.media.View.extend({
tagName: 'select',
className: 'attachment-filters',
id: 'media-attachment-filters',
@@ -2402,7 +2389,7 @@ AttachmentFilters = View.extend({
module.exports = AttachmentFilters;
-},{"./view.js":71}],20:[function(require,module,exports){
+},{}],20:[function(require,module,exports){
/*globals wp */
/**
@@ -2414,11 +2401,10 @@ module.exports = AttachmentFilters;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var AttachmentFilters = require( '../attachment-filters.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
All;
-All = AttachmentFilters.extend({
+All = wp.media.view.AttachmentFilters.extend({
createFilters: function() {
var filters = {};
@@ -2495,7 +2481,7 @@ All = AttachmentFilters.extend({
module.exports = All;
-},{"../attachment-filters.js":19}],21:[function(require,module,exports){
+},{}],21:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -2507,11 +2493,10 @@ module.exports = All;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var AttachmentFilters = require( '../attachment-filters.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
DateFilter;
-DateFilter = AttachmentFilters.extend({
+DateFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-date-filters',
createFilters: function() {
@@ -2539,7 +2524,7 @@ DateFilter = AttachmentFilters.extend({
module.exports = DateFilter;
-},{"../attachment-filters.js":19}],22:[function(require,module,exports){
+},{}],22:[function(require,module,exports){
/*globals wp */
/**
@@ -2551,11 +2536,10 @@ module.exports = DateFilter;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var AttachmentFilters = require( '../attachment-filters.js' ),
- l10n = wp.media.view.l10n,
+var l10n = wp.media.view.l10n,
Uploaded;
-Uploaded = AttachmentFilters.extend({
+Uploaded = wp.media.view.AttachmentFilters.extend({
createFilters: function() {
var type = this.model.get('type'),
types = wp.media.view.settings.mimeTypes,
@@ -2601,7 +2585,7 @@ Uploaded = AttachmentFilters.extend({
module.exports = Uploaded;
-},{"../attachment-filters.js":19}],23:[function(require,module,exports){
+},{}],23:[function(require,module,exports){
/*globals wp, _, jQuery */
/**
@@ -2612,7 +2596,7 @@ module.exports = Uploaded;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var View = require( './view.js' ),
+var View = wp.media.View,
$ = jQuery,
Attachment;
@@ -3158,7 +3142,7 @@ _.each({
module.exports = Attachment;
-},{"./view.js":71}],24:[function(require,module,exports){
+},{}],24:[function(require,module,exports){
/*globals wp, _ */
/**
@@ -3170,7 +3154,7 @@ module.exports = Attachment;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var Attachment = require( '../attachment.js' ),
+var Attachment = wp.media.view.Attachment,
l10n = wp.media.view.l10n,
Details;
@@ -3315,7 +3299,9 @@ Details = Attachment.extend({
module.exports = Details;
-},{"../attachment.js":23}],25:[function(require,module,exports){
+},{}],25:[function(require,module,exports){
+/*globals wp */
+
/**
* wp.media.view.Attachment.EditLibrary
*
@@ -3325,10 +3311,7 @@ module.exports = Details;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var Attachment = require( '../attachment.js' ),
- EditLibrary;
-
-EditLibrary = Attachment.extend({
+var EditLibrary = wp.media.view.Attachment.extend({
buttons: {
close: true
}
@@ -3336,7 +3319,9 @@ EditLibrary = Attachment.extend({
module.exports = EditLibrary;
-},{"../attachment.js":23}],26:[function(require,module,exports){
+},{}],26:[function(require,module,exports){
+/*globals wp */
+
/**
* wp.media.view.Attachments.EditSelection
*
@@ -3347,10 +3332,7 @@ module.exports = EditLibrary;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var Selection = require( './selection.js' ),
- EditSelection;
-
-EditSelection = Selection.extend({
+var EditSelection = wp.media.view.Attachment.Selection.extend({
buttons: {
close: true
}
@@ -3358,7 +3340,9 @@ EditSelection = Selection.extend({
module.exports = EditSelection;
-},{"./selection.js":28}],27:[function(require,module,exports){
+},{}],27:[function(require,module,exports){
+/*globals wp */
+
/**
* wp.media.view.Attachment.Library
*
@@ -3368,10 +3352,7 @@ module.exports = EditSelection;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var Attachment = require( '../attachment.js' ),
- Library;
-
-Library = Attachment.extend({
+var Library = wp.media.view.Attachment.extend({
buttons: {
check: true
}
@@ -3379,7 +3360,9 @@ Library = Attachment.extend({
module.exports = Library;
-},{"../attachment.js":23}],28:[function(require,module,exports){
+},{}],28:[function(require,module,exports){
+/*globals wp */
+
/**
* wp.media.view.Attachment.Selection
*
@@ -3389,10 +3372,7 @@ module.exports = Library;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var Attachment = require( '../attachment.js' ),
- Selection;
-
-Selection = Attachment.extend({
+var Selection = wp.media.view.Attachment.extend({
className: 'attachment selection',
// On click, just select the model, instead of removing the model from
@@ -3404,7 +3384,7 @@ Selection = Attachment.extend({
module.exports = Selection;
-},{"../attachment.js":23}],29:[function(require,module,exports){
+},{}],29:[function(require,module,exports){
/*globals wp, _, jQuery */
/**
@@ -3415,8 +3395,7 @@ module.exports = Selection;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
-var View = require( './view.js' ),
- Attachment = require( './attachment.js' ),
+var View = wp.media.View,
$ = jQuery,
Attachments;
@@ -3434,7 +3413,7 @@ Attachments = View.extend({
_.defaults( this.options, {
refreshSensitivity: wp.media.isTouchDevice ? 300 : 200,
refreshThreshold: 3,
- AttachmentView: Attachment,
+ AttachmentView: wp.media.view.Attachment,
sortable: false,
resize: true,
idealColumnWidth: $( window ).width() < 640 ? 135 : 150
@@ -3706,7 +3685,7 @@ Attachments = View.extend({
module.exports = Attachments;
-},{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
+},{}],30:[function(require,module,exports){
/*globals wp, _, jQuery */
/**
@@ -3729,22 +3708,7 @@ module.exports = Attachments;
* @param {bool|string} [options.sidebar=true] Whether to create a sidebar for the browser.
* Accepts true, false, and 'errors'.
*/
-var View = require( '../view.js' ),
- Library = require( '../attachment/library.js' ),
- Toolbar = require( '../toolbar.js' ),
- Spinner = require( '../spinner.js' ),
- Search = require( '../search.js' ),
- Label = require( '../label.js' ),
- Uploaded = require( '../attachment-filters/uploaded.js' ),
- All = require( '../attachment-filters/all.js' ),
- DateFilter = require( '../attachment-filters/date.js' ),
- UploaderInline = require( '../uploader/inline.js' ),
- Attachments = require( '../attachments.js' ),
- Sidebar = require( '../sidebar.js' ),
- UploaderStatus = require( '../uploader/status.js' ),
- Details = require( '../attachment/details.js' ),
- AttachmentCompat = require( '../attachment-compat.js' ),
- AttachmentDisplay = require( '../settings/attachment-display.js' ),
+var View = wp.media.View,
mediaTrash = wp.media.view.settings.mediaTrash,
l10n = wp.media.view.l10n,
$ = jQuery,
@@ -3761,7 +3725,7 @@ AttachmentsBrowser = View.extend({
date: true,
display: false,
sidebar: true,
- AttachmentView: Library
+ AttachmentView: wp.media.view.Attachment.Library
});
this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
@@ -3812,18 +3776,18 @@ AttachmentsBrowser = View.extend({
/**
* @member {wp.media.view.Toolbar}
*/
- this.toolbar = new Toolbar( toolbarOptions );
+ this.toolbar = new wp.media.view.Toolbar( toolbarOptions );
this.views.add( this.toolbar );
- this.toolbar.set( 'spinner', new Spinner({
+ this.toolbar.set( 'spinner', new wp.media.view.Spinner({
priority: -60
}) );
if ( -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ) ) {
// "Filters" will return a