mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 14:23:00 +02:00
Let us pray to the gods of backwards compatibility:
* The way that the JS modules for media are currently set up turns the existing global `wp.media` namespace into a read-only API, this is bad. * For the existing module implementation to work with plugins, those looking to override or extend a class would have to modify their own plugin to use `browserify` - we can't expect this to happen * Because the general way that plugins override media classes is via machete (resetting them to something else), we cannot use `require( 'module' )` in the internal code for media modules We CAN continue to use `require( 'fun/js' )` in the manifests for media. Future code/projects should carefully consider what is made to be public API. In 3.5, EVERYTHING was made public, so everything shall remain public. See #31684, #28510. Built from https://develop.svn.wordpress.org/trunk@31935 git-svn-id: http://core.svn.wordpress.org/trunk@31914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
57918dfc8f
commit
a5478d7adb
@ -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]);
|
||||
|
2
wp-includes/js/media/audio-video.min.js
vendored
2
wp-includes/js/media/audio-video.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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({
|
||||
|
@ -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: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
|
||||
priority: -40
|
||||
}) );
|
||||
|
@ -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 ) {
|
||||
|
@ -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.
|
||||
|
@ -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: {
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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({
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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]);
|
||||
|
2
wp-includes/js/media/grid.min.js
vendored
2
wp-includes/js/media/grid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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]);
|
||||
|
@ -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' );
|
||||
|
2
wp-includes/js/media/models.min.js
vendored
2
wp-includes/js/media/models.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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 } );
|
||||
})
|
||||
});
|
||||
|
@ -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 ) );
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -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 ) {
|
||||
|
@ -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({
|
||||
|
@ -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({
|
||||
|
File diff suppressed because it is too large
Load Diff
8
wp-includes/js/media/views.min.js
vendored
8
wp-includes/js/media/views.min.js
vendored
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
var View = wp.media.View,
|
||||
AttachmentCompat;
|
||||
|
||||
AttachmentCompat = View.extend({
|
||||
|
@ -8,11 +8,10 @@
|
||||
* @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',
|
||||
|
@ -9,11 +9,10 @@
|
||||
* @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 = {};
|
||||
|
||||
|
@ -9,11 +9,10 @@
|
||||
* @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() {
|
||||
|
@ -9,11 +9,10 @@
|
||||
* @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,
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
var View = wp.media.View,
|
||||
$ = jQuery,
|
||||
Attachment;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Attachment = require( '../attachment.js' ),
|
||||
var Attachment = wp.media.view.Attachment,
|
||||
l10n = wp.media.view.l10n,
|
||||
Details;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.Attachment.EditLibrary
|
||||
*
|
||||
@ -7,10 +9,7 @@
|
||||
* @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
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.Attachments.EditSelection
|
||||
*
|
||||
@ -8,10 +10,7 @@
|
||||
* @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
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.Attachment.Library
|
||||
*
|
||||
@ -7,10 +9,7 @@
|
||||
* @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
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.Attachment.Selection
|
||||
*
|
||||
@ -7,10 +9,7 @@
|
||||
* @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
|
||||
|
@ -8,8 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Attachment = require( './attachment.js' ),
|
||||
var View = wp.media.View,
|
||||
$ = jQuery,
|
||||
Attachments;
|
||||
|
||||
@ -27,7 +26,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
|
||||
|
@ -20,22 +20,7 @@
|
||||
* @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,
|
||||
@ -52,7 +37,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 ) );
|
||||
@ -103,18 +88,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 <select>, need to render
|
||||
// screen reader text before
|
||||
this.toolbar.set( 'filtersLabel', new Label({
|
||||
this.toolbar.set( 'filtersLabel', new wp.media.view.Label({
|
||||
value: l10n.filterByType,
|
||||
attributes: {
|
||||
'for': 'media-attachment-filters'
|
||||
@ -123,13 +108,13 @@ AttachmentsBrowser = View.extend({
|
||||
}).render() );
|
||||
|
||||
if ( 'uploaded' === this.options.filters ) {
|
||||
this.toolbar.set( 'filters', new Uploaded({
|
||||
this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({
|
||||
controller: this.controller,
|
||||
model: this.collection.props,
|
||||
priority: -80
|
||||
}).render() );
|
||||
} else {
|
||||
Filters = new All({
|
||||
Filters = new wp.media.view.AttachmentFilters.All({
|
||||
controller: this.controller,
|
||||
model: this.collection.props,
|
||||
priority: -80
|
||||
@ -154,14 +139,14 @@ AttachmentsBrowser = View.extend({
|
||||
}).render() );
|
||||
|
||||
// DateFilter is a <select>, screen reader text needs to be rendered before
|
||||
this.toolbar.set( 'dateFilterLabel', new Label({
|
||||
this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
|
||||
value: l10n.filterByDate,
|
||||
attributes: {
|
||||
'for': 'media-attachment-date-filters'
|
||||
},
|
||||
priority: -75
|
||||
}).render() );
|
||||
this.toolbar.set( 'dateFilter', new DateFilter({
|
||||
this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
|
||||
controller: this.controller,
|
||||
model: this.collection.props,
|
||||
priority: -75
|
||||
@ -265,14 +250,14 @@ AttachmentsBrowser = View.extend({
|
||||
|
||||
} else if ( this.options.date ) {
|
||||
// DateFilter is a <select>, screen reader text needs to be rendered before
|
||||
this.toolbar.set( 'dateFilterLabel', new Label({
|
||||
this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
|
||||
value: l10n.filterByDate,
|
||||
attributes: {
|
||||
'for': 'media-attachment-date-filters'
|
||||
},
|
||||
priority: -75
|
||||
}).render() );
|
||||
this.toolbar.set( 'dateFilter', new DateFilter({
|
||||
this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
|
||||
controller: this.controller,
|
||||
model: this.collection.props,
|
||||
priority: -75
|
||||
@ -281,14 +266,14 @@ AttachmentsBrowser = View.extend({
|
||||
|
||||
if ( this.options.search ) {
|
||||
// Search is an input, screen reader text needs to be rendered before
|
||||
this.toolbar.set( 'searchLabel', new Label({
|
||||
this.toolbar.set( 'searchLabel', new wp.media.view.Label({
|
||||
value: l10n.searchMediaLabel,
|
||||
attributes: {
|
||||
'for': 'media-search-input'
|
||||
},
|
||||
priority: 60
|
||||
}).render() );
|
||||
this.toolbar.set( 'search', new Search({
|
||||
this.toolbar.set( 'search', new wp.media.view.Search({
|
||||
controller: this.controller,
|
||||
model: this.collection.props,
|
||||
priority: 60
|
||||
@ -337,7 +322,7 @@ AttachmentsBrowser = View.extend({
|
||||
},
|
||||
|
||||
createUploader: function() {
|
||||
this.uploader = new UploaderInline({
|
||||
this.uploader = new wp.media.view.UploaderInline({
|
||||
controller: this.controller,
|
||||
status: false,
|
||||
message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound,
|
||||
@ -357,7 +342,7 @@ AttachmentsBrowser = View.extend({
|
||||
},
|
||||
|
||||
createAttachments: function() {
|
||||
this.attachments = new Attachments({
|
||||
this.attachments = new wp.media.view.Attachments({
|
||||
controller: this.controller,
|
||||
collection: this.collection,
|
||||
selection: this.options.selection,
|
||||
@ -393,14 +378,14 @@ AttachmentsBrowser = View.extend({
|
||||
createSidebar: function() {
|
||||
var options = this.options,
|
||||
selection = options.selection,
|
||||
sidebar = this.sidebar = new Sidebar({
|
||||
sidebar = this.sidebar = new wp.media.view.Sidebar({
|
||||
controller: this.controller
|
||||
});
|
||||
|
||||
this.views.add( sidebar );
|
||||
|
||||
if ( this.controller.uploader ) {
|
||||
sidebar.set( 'uploads', new UploaderStatus({
|
||||
sidebar.set( 'uploads', new wp.media.view.UploaderStatus({
|
||||
controller: this.controller,
|
||||
priority: 40
|
||||
}) );
|
||||
@ -418,20 +403,20 @@ AttachmentsBrowser = View.extend({
|
||||
var sidebar = this.sidebar,
|
||||
single = this.options.selection.single();
|
||||
|
||||
sidebar.set( 'details', new Details({
|
||||
sidebar.set( 'details', new wp.media.view.Attachment.Details({
|
||||
controller: this.controller,
|
||||
model: single,
|
||||
priority: 80
|
||||
}) );
|
||||
|
||||
sidebar.set( 'compat', new AttachmentCompat({
|
||||
sidebar.set( 'compat', new wp.media.view.AttachmentCompat({
|
||||
controller: this.controller,
|
||||
model: single,
|
||||
priority: 120
|
||||
}) );
|
||||
|
||||
if ( this.options.display ) {
|
||||
sidebar.set( 'display', new AttachmentDisplay({
|
||||
sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({
|
||||
controller: this.controller,
|
||||
model: this.model.display( single ),
|
||||
attachment: single,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*globals _ */
|
||||
/*globals wp, _ */
|
||||
|
||||
/**
|
||||
* wp.media.view.Attachments.Selection
|
||||
@ -9,8 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Attachments = require( '../attachments.js' ),
|
||||
AttachmentSelection = require( '../attachment/selection.js' ),
|
||||
var Attachments = wp.media.view.Attachments,
|
||||
Selection;
|
||||
|
||||
Selection = Attachments.extend({
|
||||
@ -21,7 +20,7 @@ Selection = Attachments.extend({
|
||||
resize: false,
|
||||
|
||||
// The single `Attachment` view to be used in the `Attachments` view.
|
||||
AttachmentView: AttachmentSelection
|
||||
AttachmentView: wp.media.view.Attachment.Selection
|
||||
});
|
||||
// Call 'initialize' directly on the parent class.
|
||||
return Attachments.prototype.initialize.apply( this, arguments );
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var MediaDetails = require( './media-details' ),
|
||||
var MediaDetails = wp.media.view.MediaDetails,
|
||||
AudioDetails;
|
||||
|
||||
AudioDetails = MediaDetails.extend({
|
||||
|
@ -8,12 +8,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Button = require( './button.js' ),
|
||||
$ = Backbone.$,
|
||||
var $ = Backbone.$,
|
||||
ButtonGroup;
|
||||
|
||||
ButtonGroup = View.extend({
|
||||
ButtonGroup = wp.media.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'button-group button-large media-button-group',
|
||||
|
||||
@ -25,7 +23,7 @@ ButtonGroup = View.extend({
|
||||
if ( button instanceof Backbone.View ) {
|
||||
return button;
|
||||
} else {
|
||||
return new Button( button ).render();
|
||||
return new wp.media.view.Button( button ).render();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -8,10 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Button;
|
||||
|
||||
Button = View.extend({
|
||||
var Button = wp.media.View.extend({
|
||||
tagName: 'a',
|
||||
className: 'media-button',
|
||||
attributes: { href: '#' },
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.DeleteSelectedPermanentlyButton
|
||||
*
|
||||
@ -11,7 +13,7 @@
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Button = wp.media.view.Button,
|
||||
DeleteSelected = require( './delete-selected.js' ),
|
||||
DeleteSelected = wp.media.view.DeleteSelectedButton,
|
||||
DeleteSelectedPermanently;
|
||||
|
||||
DeleteSelectedPermanently = DeleteSelected.extend({
|
||||
|
@ -14,9 +14,8 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
UploaderStatusError = require( './uploader/status-error.js' ),
|
||||
UploaderStatus = require( './uploader/status.js' ),
|
||||
var View = wp.media.View,
|
||||
UploaderStatus = wp.media.view.UploaderStatus,
|
||||
l10n = wp.media.view.l10n,
|
||||
$ = jQuery,
|
||||
Cropper;
|
||||
@ -58,7 +57,7 @@ Cropper = View.extend({
|
||||
onError: function() {
|
||||
var filename = this.options.attachment.get('filename');
|
||||
|
||||
this.views.add( '.upload-errors', new UploaderStatusError({
|
||||
this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
|
||||
filename: UploaderStatus.prototype.filename(filename),
|
||||
message: window._wpMediaViewsL10n.cropError
|
||||
}), { at: 0 });
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
var View = wp.media.View,
|
||||
EditImage;
|
||||
|
||||
EditImage = View.extend({
|
||||
|
@ -6,20 +6,14 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
EmbedImage = require( './embed/image.js' ),
|
||||
EmbedLink = require( './embed/link.js' ),
|
||||
EmbedUrl = require( './embed/url.js' ),
|
||||
Embed;
|
||||
|
||||
Embed = View.extend({
|
||||
var Embed = wp.media.View.extend({
|
||||
className: 'media-embed',
|
||||
|
||||
initialize: function() {
|
||||
/**
|
||||
* @member {wp.media.view.EmbedUrl}
|
||||
*/
|
||||
this.url = new EmbedUrl({
|
||||
this.url = new wp.media.view.EmbedUrl({
|
||||
controller: this.controller,
|
||||
model: this.model.props
|
||||
}).render();
|
||||
@ -46,9 +40,9 @@ Embed = View.extend({
|
||||
constructor;
|
||||
|
||||
if ( 'image' === type ) {
|
||||
constructor = EmbedImage;
|
||||
constructor = wp.media.view.EmbedImage;
|
||||
} else if ( 'link' === type ) {
|
||||
constructor = EmbedLink;
|
||||
constructor = wp.media.view.EmbedLink;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var AttachmentDisplay = require( '../settings/attachment-display.js' ),
|
||||
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
|
||||
EmbedImage;
|
||||
|
||||
EmbedImage = AttachmentDisplay.extend({
|
||||
|
@ -9,11 +9,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Settings = require( '../settings.js' ),
|
||||
$ = jQuery,
|
||||
var $ = jQuery,
|
||||
EmbedLink;
|
||||
|
||||
EmbedLink = Settings.extend({
|
||||
EmbedLink = wp.media.view.Settings.extend({
|
||||
className: 'embed-link-settings',
|
||||
template: wp.template('embed-link-settings'),
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
var View = wp.media.View,
|
||||
$ = jQuery,
|
||||
EmbedUrl;
|
||||
|
||||
|
@ -6,10 +6,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
FocusManager;
|
||||
|
||||
FocusManager = View.extend({
|
||||
var FocusManager = wp.media.View.extend({
|
||||
|
||||
events: {
|
||||
'keydown': 'constrainTabbing'
|
||||
|
@ -15,13 +15,7 @@
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var StateMachine = require( '../controllers/state-machine.js' ),
|
||||
State = require( '../controllers/state.js' ),
|
||||
Region = require( '../controllers/region.js' ),
|
||||
View = require( './view.js' ),
|
||||
Frame;
|
||||
|
||||
Frame = View.extend({
|
||||
var Frame = wp.media.View.extend({
|
||||
initialize: function() {
|
||||
_.defaults( this.options, {
|
||||
mode: [ 'select' ]
|
||||
@ -37,7 +31,7 @@ Frame = View.extend({
|
||||
|
||||
// Initialize regions.
|
||||
_.each( this.regions, function( region ) {
|
||||
this[ region ] = new Region({
|
||||
this[ region ] = new wp.media.controller.Region({
|
||||
view: this,
|
||||
id: region,
|
||||
selector: '.media-frame-' + region
|
||||
@ -55,7 +49,7 @@ Frame = View.extend({
|
||||
_createStates: function() {
|
||||
// Create the default `states` collection.
|
||||
this.states = new Backbone.Collection( null, {
|
||||
model: State
|
||||
model: wp.media.controller.State
|
||||
});
|
||||
|
||||
// Ensure states have a reference to the frame.
|
||||
@ -167,6 +161,6 @@ Frame = View.extend({
|
||||
});
|
||||
|
||||
// Make the `Frame` a `StateMachine`.
|
||||
_.extend( Frame.prototype, StateMachine.prototype );
|
||||
_.extend( Frame.prototype, wp.media.controller.StateMachine.prototype );
|
||||
|
||||
module.exports = Frame;
|
||||
|
@ -15,9 +15,7 @@
|
||||
*/
|
||||
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;
|
||||
|
||||
@ -34,7 +32,7 @@ AudioDetails = MediaDetails.extend({
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
options.DetailsView = AudioDetailsView;
|
||||
options.DetailsView = wp.media.view.AudioDetails;
|
||||
options.cancelText = l10n.audioDetailsCancel;
|
||||
options.addText = l10n.audioAddSourceTitle;
|
||||
|
||||
@ -50,7 +48,7 @@ AudioDetails = MediaDetails.extend({
|
||||
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new AudioDetailsController( {
|
||||
new wp.media.controller.AudioDetails( {
|
||||
media: this.media
|
||||
} ),
|
||||
|
||||
|
@ -18,13 +18,6 @@
|
||||
*/
|
||||
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;
|
||||
@ -80,7 +73,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
|
||||
});
|
||||
@ -109,7 +102,7 @@ EditAttachments = MediaFrame.extend({
|
||||
*/
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new EditAttachmentMetadata( { model: this.model } )
|
||||
new wp.media.controller.EditAttachmentMetadata( { model: this.model } )
|
||||
]);
|
||||
},
|
||||
|
||||
@ -120,7 +113,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
|
||||
});
|
||||
@ -129,7 +122,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
|
||||
}) );
|
||||
@ -147,7 +140,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
|
||||
} );
|
||||
@ -156,7 +149,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
|
||||
|
@ -15,13 +15,7 @@
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var Select = require( './select.js' ),
|
||||
Toolbar = require( '../toolbar.js' ),
|
||||
ImageDetailsController = require( '../../controllers/image-details.js' ),
|
||||
ReplaceImageController = require( '../../controllers/replace-image.js' ),
|
||||
EditImageController = require( '../../controllers/edit-image.js' ),
|
||||
ImageDetailsView = require( '../image-details.js' ),
|
||||
EditImageView = require( '../edit-image.js' ),
|
||||
var Select = wp.media.view.MediaFrame.Select,
|
||||
l10n = wp.media.view.l10n,
|
||||
ImageDetails;
|
||||
|
||||
@ -55,11 +49,11 @@ ImageDetails = Select.extend({
|
||||
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new ImageDetailsController({
|
||||
new wp.media.controller.ImageDetails({
|
||||
image: this.image,
|
||||
editable: false
|
||||
}),
|
||||
new ReplaceImageController({
|
||||
new wp.media.controller.ReplaceImage({
|
||||
id: 'replace-image',
|
||||
library: wp.media.query( { type: 'image' } ),
|
||||
image: this.image,
|
||||
@ -69,7 +63,7 @@ ImageDetails = Select.extend({
|
||||
priority: 80,
|
||||
displaySettings: true
|
||||
}),
|
||||
new EditImageController( {
|
||||
new wp.media.controller.EditImage( {
|
||||
image: this.image,
|
||||
selection: this.options.selection
|
||||
} )
|
||||
@ -77,7 +71,7 @@ ImageDetails = Select.extend({
|
||||
},
|
||||
|
||||
imageDetailsContent: function( options ) {
|
||||
options.view = new ImageDetailsView({
|
||||
options.view = new wp.media.view.ImageDetails({
|
||||
controller: this,
|
||||
model: this.state().image,
|
||||
attachment: this.state().image.attachment
|
||||
@ -93,7 +87,7 @@ ImageDetails = Select.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
view = new EditImageView( { model: model, controller: this } ).render();
|
||||
view = new wp.media.view.EditImage( { model: model, controller: this } ).render();
|
||||
|
||||
this.content.set( view );
|
||||
|
||||
@ -103,7 +97,7 @@ ImageDetails = Select.extend({
|
||||
},
|
||||
|
||||
renderImageDetailsToolbar: function() {
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
select: {
|
||||
@ -135,7 +129,7 @@ ImageDetails = Select.extend({
|
||||
lastState = frame.lastState(),
|
||||
previous = lastState && lastState.id;
|
||||
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
back: {
|
||||
|
@ -16,12 +16,8 @@
|
||||
* @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;
|
||||
|
||||
@ -58,7 +54,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,
|
||||
@ -71,7 +67,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 );
|
||||
@ -221,7 +217,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'),
|
||||
|
@ -12,9 +12,7 @@
|
||||
* @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;
|
||||
|
||||
@ -77,7 +75,7 @@ MediaDetails = Select.extend({
|
||||
}
|
||||
}
|
||||
},
|
||||
separateCancel: new View({
|
||||
separateCancel: new wp.media.View({
|
||||
className: 'separator',
|
||||
priority: 40
|
||||
})
|
||||
@ -86,7 +84,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: {
|
||||
|
@ -14,24 +14,8 @@
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
Select = require( './select.js' ),
|
||||
Library = require( '../../controllers/library.js' ),
|
||||
Embed = require( '../embed.js' ),
|
||||
EditImage = require( '../edit-image.js' ),
|
||||
EditSelection = require( '../attachment/edit-selection.js' ),
|
||||
Toolbar = require( '../toolbar.js' ),
|
||||
ToolbarEmbed = require( '../toolbar/embed.js' ),
|
||||
PlaylistSettings = require( '../settings/playlist.js' ),
|
||||
AttachmentsBrowser = require( '../attachments/browser.js' ),
|
||||
SelectionView = require( '../selection.js' ),
|
||||
EmbedController = require( '../../controllers/embed.js' ),
|
||||
EditImageController = require( '../../controllers/edit-image.js' ),
|
||||
GalleryEditController = require( '../../controllers/gallery-edit.js' ),
|
||||
GalleryAddController = require( '../../controllers/gallery-add.js' ),
|
||||
CollectionEditController = require( '../../controllers/collection-edit.js' ),
|
||||
CollectionAddController = require( '../../controllers/collection-add.js' ),
|
||||
FeaturedImageController = require( '../../controllers/featured-image.js' ),
|
||||
var Select = wp.media.view.MediaFrame.Select,
|
||||
Library = wp.media.controller.Library,
|
||||
l10n = wp.media.view.l10n,
|
||||
Post;
|
||||
|
||||
@ -105,18 +89,18 @@ Post = Select.extend({
|
||||
}),
|
||||
|
||||
// Embed states.
|
||||
new EmbedController( { metadata: options.metadata } ),
|
||||
new wp.media.controller.Embed( { metadata: options.metadata } ),
|
||||
|
||||
new EditImageController( { model: options.editImage } ),
|
||||
new wp.media.controller.EditImage( { model: options.editImage } ),
|
||||
|
||||
// Gallery states.
|
||||
new GalleryEditController({
|
||||
new wp.media.controller.GalleryEdit({
|
||||
library: options.selection,
|
||||
editing: options.editing,
|
||||
menu: 'gallery'
|
||||
}),
|
||||
|
||||
new GalleryAddController(),
|
||||
new wp.media.controller.GalleryAdd(),
|
||||
|
||||
new Library({
|
||||
id: 'playlist',
|
||||
@ -133,11 +117,11 @@ Post = Select.extend({
|
||||
}),
|
||||
|
||||
// Playlist states.
|
||||
new CollectionEditController({
|
||||
new wp.media.controller.CollectionEdit({
|
||||
type: 'audio',
|
||||
collectionType: 'playlist',
|
||||
title: l10n.editPlaylistTitle,
|
||||
SettingsView: PlaylistSettings,
|
||||
SettingsView: wp.media.view.Settings.Playlist,
|
||||
library: options.selection,
|
||||
editing: options.editing,
|
||||
menu: 'playlist',
|
||||
@ -145,7 +129,7 @@ Post = Select.extend({
|
||||
dragInfo: false
|
||||
}),
|
||||
|
||||
new CollectionAddController({
|
||||
new wp.media.controller.CollectionAdd({
|
||||
type: 'audio',
|
||||
collectionType: 'playlist',
|
||||
title: l10n.addToPlaylistTitle
|
||||
@ -165,11 +149,11 @@ Post = Select.extend({
|
||||
}, options.library ) )
|
||||
}),
|
||||
|
||||
new CollectionEditController({
|
||||
new wp.media.controller.CollectionEdit({
|
||||
type: 'video',
|
||||
collectionType: 'playlist',
|
||||
title: l10n.editVideoPlaylistTitle,
|
||||
SettingsView: PlaylistSettings,
|
||||
SettingsView: wp.media.view.Settings.Playlist,
|
||||
library: options.selection,
|
||||
editing: options.editing,
|
||||
menu: 'video-playlist',
|
||||
@ -177,7 +161,7 @@ Post = Select.extend({
|
||||
dragInfo: false
|
||||
}),
|
||||
|
||||
new CollectionAddController({
|
||||
new wp.media.controller.CollectionAdd({
|
||||
type: 'video',
|
||||
collectionType: 'playlist',
|
||||
title: l10n.addToVideoPlaylistTitle
|
||||
@ -185,7 +169,7 @@ Post = Select.extend({
|
||||
]);
|
||||
|
||||
if ( wp.media.view.settings.post.featuredImageId ) {
|
||||
this.states.add( new FeaturedImageController() );
|
||||
this.states.add( new wp.media.controller.FeaturedImage() );
|
||||
}
|
||||
},
|
||||
|
||||
@ -272,7 +256,7 @@ Post = Select.extend({
|
||||
*/
|
||||
mainMenu: function( view ) {
|
||||
view.set({
|
||||
'library-separator': new View({
|
||||
'library-separator': new wp.media.View({
|
||||
className: 'separator',
|
||||
priority: 100
|
||||
})
|
||||
@ -311,7 +295,7 @@ Post = Select.extend({
|
||||
this.controller.modal.focusManager.focus();
|
||||
}
|
||||
},
|
||||
separateCancel: new View({
|
||||
separateCancel: new wp.media.View({
|
||||
className: 'separator',
|
||||
priority: 40
|
||||
})
|
||||
@ -335,7 +319,7 @@ Post = Select.extend({
|
||||
}
|
||||
}
|
||||
},
|
||||
separateCancel: new View({
|
||||
separateCancel: new wp.media.View({
|
||||
className: 'separator',
|
||||
priority: 40
|
||||
})
|
||||
@ -359,7 +343,7 @@ Post = Select.extend({
|
||||
}
|
||||
}
|
||||
},
|
||||
separateCancel: new View({
|
||||
separateCancel: new wp.media.View({
|
||||
className: 'separator',
|
||||
priority: 40
|
||||
})
|
||||
@ -368,7 +352,7 @@ Post = Select.extend({
|
||||
|
||||
// Content
|
||||
embedContent: function() {
|
||||
var view = new Embed({
|
||||
var view = new wp.media.view.Embed({
|
||||
controller: this,
|
||||
model: this.state()
|
||||
}).render();
|
||||
@ -385,7 +369,7 @@ Post = Select.extend({
|
||||
selection = state.get('selection'),
|
||||
view;
|
||||
|
||||
view = new AttachmentsBrowser({
|
||||
view = new wp.media.view.AttachmentsBrowser({
|
||||
controller: this,
|
||||
collection: selection,
|
||||
selection: selection,
|
||||
@ -395,7 +379,7 @@ Post = Select.extend({
|
||||
date: false,
|
||||
dragInfo: true,
|
||||
|
||||
AttachmentView: EditSelection
|
||||
AttachmentView: wp.media.view.Attachments.EditSelection
|
||||
}).render();
|
||||
|
||||
view.toolbar.set( 'backToLibrary', {
|
||||
@ -416,7 +400,7 @@ Post = Select.extend({
|
||||
|
||||
editImageContent: function() {
|
||||
var image = this.state().get('image'),
|
||||
view = new EditImage( { model: image, controller: this } ).render();
|
||||
view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
|
||||
|
||||
this.content.set( view );
|
||||
|
||||
@ -433,7 +417,7 @@ Post = Select.extend({
|
||||
selectionStatusToolbar: function( view ) {
|
||||
var editable = this.state().get('editable');
|
||||
|
||||
view.set( 'selection', new SelectionView({
|
||||
view.set( 'selection', new wp.media.view.Selection({
|
||||
controller: this,
|
||||
collection: this.state().get('selection'),
|
||||
priority: -40,
|
||||
@ -574,14 +558,14 @@ Post = Select.extend({
|
||||
},
|
||||
|
||||
mainEmbedToolbar: function( toolbar ) {
|
||||
toolbar.view = new ToolbarEmbed({
|
||||
toolbar.view = new wp.media.view.Toolbar.Embed({
|
||||
controller: this
|
||||
});
|
||||
},
|
||||
|
||||
galleryEditToolbar: function() {
|
||||
var editing = this.state().get('editing');
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
@ -610,7 +594,7 @@ Post = Select.extend({
|
||||
},
|
||||
|
||||
galleryAddToolbar: function() {
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
@ -638,7 +622,7 @@ Post = Select.extend({
|
||||
|
||||
playlistEditToolbar: function() {
|
||||
var editing = this.state().get('editing');
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
@ -667,7 +651,7 @@ Post = Select.extend({
|
||||
},
|
||||
|
||||
playlistAddToolbar: function() {
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
@ -695,7 +679,7 @@ Post = Select.extend({
|
||||
|
||||
videoPlaylistEditToolbar: function() {
|
||||
var editing = this.state().get('editing');
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
@ -724,7 +708,7 @@ Post = Select.extend({
|
||||
},
|
||||
|
||||
videoPlaylistAddToolbar: function() {
|
||||
this.toolbar.set( new Toolbar({
|
||||
this.toolbar.set( new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
|
@ -14,11 +14,7 @@
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
|
||||
var MediaFrame = require( '../media-frame.js' ),
|
||||
Library = require( '../../controllers/library.js' ),
|
||||
AttachmentsBrowser = require( '../attachments/browser.js' ),
|
||||
UploaderInline = require( '../uploader/inline.js' ),
|
||||
ToolbarSelect = require( '../toolbar/select.js' ),
|
||||
var MediaFrame = wp.media.view.MediaFrame,
|
||||
l10n = wp.media.view.l10n,
|
||||
Select;
|
||||
|
||||
@ -76,7 +72,7 @@ Select = MediaFrame.extend({
|
||||
// Add the default states.
|
||||
this.states.add([
|
||||
// Main states.
|
||||
new Library({
|
||||
new wp.media.controller.Library({
|
||||
library: wp.media.query( options.library ),
|
||||
multiple: options.multiple,
|
||||
title: options.title,
|
||||
@ -127,7 +123,7 @@ Select = MediaFrame.extend({
|
||||
this.$el.removeClass('hide-toolbar');
|
||||
|
||||
// Browse our library of attachments.
|
||||
contentRegion.view = new AttachmentsBrowser({
|
||||
contentRegion.view = new wp.media.view.AttachmentsBrowser({
|
||||
controller: this,
|
||||
collection: state.get('library'),
|
||||
selection: state.get('selection'),
|
||||
@ -151,7 +147,7 @@ Select = MediaFrame.extend({
|
||||
*/
|
||||
uploadContent: function() {
|
||||
this.$el.removeClass( 'hide-toolbar' );
|
||||
this.content.set( new UploaderInline({
|
||||
this.content.set( new wp.media.view.UploaderInline({
|
||||
controller: this
|
||||
}) );
|
||||
},
|
||||
@ -167,7 +163,7 @@ Select = MediaFrame.extend({
|
||||
options = options || this.options.button || {};
|
||||
options.controller = this;
|
||||
|
||||
toolbar.view = new ToolbarSelect( options );
|
||||
toolbar.view = new wp.media.view.Toolbar.Select( options );
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -15,8 +15,6 @@
|
||||
*/
|
||||
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;
|
||||
|
||||
@ -33,7 +31,7 @@ VideoDetails = MediaDetails.extend({
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
options.DetailsView = VideoDetailsView;
|
||||
options.DetailsView = wp.media.view.VideoDetails;
|
||||
options.cancelText = l10n.videoDetailsCancel;
|
||||
options.addText = l10n.videoAddSourceTitle;
|
||||
|
||||
@ -51,7 +49,7 @@ VideoDetails = MediaDetails.extend({
|
||||
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new VideoDetailsController({
|
||||
new wp.media.controller.VideoDetails({
|
||||
media: this.media
|
||||
}),
|
||||
|
||||
|
@ -6,10 +6,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Iframe;
|
||||
|
||||
Iframe = View.extend({
|
||||
var Iframe = wp.media.View.extend({
|
||||
className: 'media-iframe',
|
||||
/**
|
||||
* @returns {wp.media.view.Iframe} Returns itself to allow chaining
|
||||
|
@ -10,7 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var AttachmentDisplay = require( './settings/attachment-display.js' ),
|
||||
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
|
||||
$ = jQuery,
|
||||
ImageDetails;
|
||||
|
||||
|
@ -6,10 +6,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Label;
|
||||
|
||||
Label = View.extend({
|
||||
var Label = wp.media.View.extend({
|
||||
tagName: 'label',
|
||||
className: 'screen-reader-text',
|
||||
|
||||
|
@ -12,14 +12,7 @@
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Frame = require( './frame.js' ),
|
||||
Modal = require( './modal.js' ),
|
||||
UploaderWindow = require( './uploader/window.js' ),
|
||||
Menu = require( './menu.js' ),
|
||||
Toolbar = require( './toolbar.js' ),
|
||||
Router = require( './router.js' ),
|
||||
Iframe = require( './iframe.js' ),
|
||||
var Frame = wp.media.view.Frame,
|
||||
$ = jQuery,
|
||||
MediaFrame;
|
||||
|
||||
@ -49,7 +42,7 @@ MediaFrame = Frame.extend({
|
||||
|
||||
// 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
|
||||
});
|
||||
@ -65,7 +58,7 @@ MediaFrame = Frame.extend({
|
||||
|
||||
// Initialize window-wide uploader.
|
||||
if ( this.options.uploader ) {
|
||||
this.uploader = new UploaderWindow({
|
||||
this.uploader = new wp.media.view.UploaderWindow({
|
||||
controller: this,
|
||||
uploader: {
|
||||
dropzone: this.modal ? this.modal.$el : this.$el,
|
||||
@ -106,7 +99,7 @@ MediaFrame = Frame.extend({
|
||||
* @this wp.media.controller.Region
|
||||
*/
|
||||
createTitle: function( title ) {
|
||||
title.view = new View({
|
||||
title.view = new wp.media.View({
|
||||
controller: this,
|
||||
tagName: 'h1'
|
||||
});
|
||||
@ -116,7 +109,7 @@ MediaFrame = Frame.extend({
|
||||
* @this wp.media.controller.Region
|
||||
*/
|
||||
createMenu: function( menu ) {
|
||||
menu.view = new Menu({
|
||||
menu.view = new wp.media.view.Menu({
|
||||
controller: this
|
||||
});
|
||||
},
|
||||
@ -130,7 +123,7 @@ MediaFrame = Frame.extend({
|
||||
* @this wp.media.controller.Region
|
||||
*/
|
||||
createToolbar: function( toolbar ) {
|
||||
toolbar.view = new Toolbar({
|
||||
toolbar.view = new wp.media.view.Toolbar({
|
||||
controller: this
|
||||
});
|
||||
},
|
||||
@ -139,7 +132,7 @@ MediaFrame = Frame.extend({
|
||||
* @this wp.media.controller.Region
|
||||
*/
|
||||
createRouter: function( router ) {
|
||||
router.view = new Router({
|
||||
router.view = new wp.media.view.Router({
|
||||
controller: this
|
||||
});
|
||||
},
|
||||
@ -186,7 +179,7 @@ MediaFrame = Frame.extend({
|
||||
*/
|
||||
iframeContent: function( content ) {
|
||||
this.$el.addClass('hide-toolbar');
|
||||
content.view = new Iframe({
|
||||
content.view = new wp.media.view.Iframe({
|
||||
controller: this
|
||||
});
|
||||
},
|
||||
|
@ -8,11 +8,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
$ = jQuery,
|
||||
var $ = jQuery,
|
||||
MenuItem;
|
||||
|
||||
MenuItem = View.extend({
|
||||
MenuItem = wp.media.View.extend({
|
||||
tagName: 'a',
|
||||
className: 'media-menu-item',
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var MenuItem = require( './menu-item.js' ),
|
||||
PriorityList = require( './priority-list.js' ),
|
||||
var MenuItem = wp.media.view.MenuItem,
|
||||
PriorityList = wp.media.view.PriorityList,
|
||||
Menu;
|
||||
|
||||
Menu = PriorityList.extend({
|
||||
|
@ -10,12 +10,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
FocusManager = require( './focus-manager.js' ),
|
||||
$ = jQuery,
|
||||
var $ = jQuery,
|
||||
Modal;
|
||||
|
||||
Modal = View.extend({
|
||||
Modal = wp.media.View.extend({
|
||||
tagName: 'div',
|
||||
template: wp.template('media-modal'),
|
||||
|
||||
@ -36,7 +34,7 @@ Modal = View.extend({
|
||||
freeze: true
|
||||
});
|
||||
|
||||
this.focusManager = new FocusManager({
|
||||
this.focusManager = new wp.media.view.FocusManager({
|
||||
el: this.el
|
||||
});
|
||||
},
|
||||
|
@ -8,10 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
PriorityList;
|
||||
|
||||
PriorityList = View.extend({
|
||||
var PriorityList = wp.media.View.extend({
|
||||
tagName: 'div',
|
||||
|
||||
initialize: function() {
|
||||
@ -93,7 +90,7 @@ PriorityList = View.extend({
|
||||
* @returns {wp.media.View}
|
||||
*/
|
||||
toView: function( options ) {
|
||||
return new View( options );
|
||||
return new wp.media.View( options );
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -7,10 +7,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var MenuItem = require( './menu-item.js' ),
|
||||
RouterItem;
|
||||
|
||||
RouterItem = MenuItem.extend({
|
||||
var RouterItem = wp.media.view.MenuItem.extend({
|
||||
/**
|
||||
* On click handler to activate the content region's corresponding mode.
|
||||
*/
|
||||
|
@ -1,3 +1,5 @@
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.Router
|
||||
*
|
||||
@ -8,15 +10,14 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Menu = require( './menu.js' ),
|
||||
RouterItem = require( './router-item.js' ),
|
||||
var Menu = wp.media.view.Menu,
|
||||
Router;
|
||||
|
||||
Router = Menu.extend({
|
||||
tagName: 'div',
|
||||
className: 'media-router',
|
||||
property: 'contentMode',
|
||||
ItemView: RouterItem,
|
||||
ItemView: wp.media.view.RouterItem,
|
||||
region: 'router',
|
||||
|
||||
initialize: function() {
|
||||
|
@ -8,11 +8,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
l10n = wp.media.view.l10n,
|
||||
var l10n = wp.media.view.l10n,
|
||||
Search;
|
||||
|
||||
Search = View.extend({
|
||||
Search = wp.media.View.extend({
|
||||
tagName: 'input',
|
||||
className: 'search',
|
||||
id: 'media-search-input',
|
||||
|
@ -8,12 +8,10 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
AttachmentsSelection = require( './attachments/selection.js' ),
|
||||
l10n = wp.media.view.l10n,
|
||||
var l10n = wp.media.view.l10n,
|
||||
Selection;
|
||||
|
||||
Selection = View.extend({
|
||||
Selection = wp.media.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'media-selection',
|
||||
template: wp.template('media-selection'),
|
||||
@ -32,7 +30,7 @@ Selection = View.extend({
|
||||
/**
|
||||
* @member {wp.media.view.Attachments.Selection}
|
||||
*/
|
||||
this.attachments = new AttachmentsSelection({
|
||||
this.attachments = new wp.media.view.Attachments.Selection({
|
||||
controller: this.controller,
|
||||
collection: this.collection,
|
||||
selection: this.collection,
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
var View = wp.media.View,
|
||||
$ = Backbone.$,
|
||||
Settings;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Settings = require( '../settings.js' ),
|
||||
var Settings = wp.media.view.Settings,
|
||||
AttachmentDisplay;
|
||||
|
||||
AttachmentDisplay = Settings.extend({
|
||||
|
@ -9,10 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Settings = require( '../settings.js' ),
|
||||
Gallery;
|
||||
|
||||
Gallery = Settings.extend({
|
||||
var Gallery = wp.media.view.Settings.extend({
|
||||
className: 'collection-settings gallery-settings',
|
||||
template: wp.template('gallery-settings')
|
||||
});
|
||||
|
@ -9,10 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Settings = require( '../settings.js' ),
|
||||
Playlist;
|
||||
|
||||
Playlist = Settings.extend({
|
||||
var Playlist = wp.media.view.Settings.extend({
|
||||
className: 'collection-settings playlist-settings',
|
||||
template: wp.template('playlist-settings')
|
||||
});
|
||||
|
@ -7,10 +7,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var PriorityList = require( './priority-list.js' ),
|
||||
Sidebar;
|
||||
|
||||
Sidebar = PriorityList.extend({
|
||||
var Sidebar = wp.media.view.PriorityList.extend({
|
||||
className: 'media-sidebar'
|
||||
});
|
||||
|
||||
|
@ -8,10 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Spinner;
|
||||
|
||||
Spinner = View.extend({
|
||||
var Spinner = wp.media.View.extend({
|
||||
tagName: 'span',
|
||||
className: 'spinner',
|
||||
spinnerTimeout: false,
|
||||
|
@ -11,9 +11,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( './view.js' ),
|
||||
Button = require( './button.js' ),
|
||||
PriorityList = require( './priority-list.js' ),
|
||||
var View = wp.media.View,
|
||||
Toolbar;
|
||||
|
||||
Toolbar = View.extend({
|
||||
@ -28,8 +26,8 @@ Toolbar = View.extend({
|
||||
this._views = {};
|
||||
|
||||
// The toolbar is composed of two `PriorityList` views.
|
||||
this.primary = new PriorityList();
|
||||
this.secondary = new PriorityList();
|
||||
this.primary = new wp.media.view.PriorityList();
|
||||
this.secondary = new wp.media.view.PriorityList();
|
||||
this.primary.$el.addClass('media-toolbar-primary search-form');
|
||||
this.secondary.$el.addClass('media-toolbar-secondary');
|
||||
|
||||
@ -91,7 +89,7 @@ Toolbar = View.extend({
|
||||
} else {
|
||||
if ( ! ( view instanceof Backbone.View ) ) {
|
||||
view.classes = [ 'media-button-' + id ].concat( view.classes || [] );
|
||||
view = new Button( view ).render();
|
||||
view = new wp.media.view.Button( view ).render();
|
||||
}
|
||||
|
||||
view.controller = view.controller || this.controller;
|
||||
|
@ -10,7 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Select = require( './select.js' ),
|
||||
var Select = wp.media.view.Toolbar.Select,
|
||||
l10n = wp.media.view.l10n,
|
||||
Embed;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var Toolbar = require( '../toolbar.js' ),
|
||||
var Toolbar = wp.media.view.Toolbar,
|
||||
l10n = wp.media.view.l10n,
|
||||
Select;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
var View = wp.media.View,
|
||||
l10n = wp.media.view.l10n,
|
||||
$ = jQuery,
|
||||
EditorUploader;
|
||||
|
@ -10,8 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
UploaderStatus = require( './status.js' ),
|
||||
var View = wp.media.View,
|
||||
UploaderInline;
|
||||
|
||||
UploaderInline = View.extend({
|
||||
@ -39,7 +38,7 @@ UploaderInline = View.extend({
|
||||
}
|
||||
|
||||
if ( this.options.status ) {
|
||||
this.views.set( '.upload-inline-status', new UploaderStatus({
|
||||
this.views.set( '.upload-inline-status', new wp.media.view.UploaderStatus({
|
||||
controller: this.controller
|
||||
}) );
|
||||
}
|
||||
|
@ -8,10 +8,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
UploaderStatusError;
|
||||
|
||||
UploaderStatusError = View.extend({
|
||||
var UploaderStatusError = wp.media.View.extend({
|
||||
className: 'upload-error',
|
||||
template: wp.template('uploader-status-error')
|
||||
});
|
||||
|
@ -10,8 +10,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
UploaderStatusError = require( './status-error.js' ),
|
||||
var View = wp.media.View,
|
||||
UploaderStatus;
|
||||
|
||||
UploaderStatus = View.extend({
|
||||
@ -113,7 +112,7 @@ UploaderStatus = View.extend({
|
||||
* @param {Backbone.Model} error
|
||||
*/
|
||||
error: function( error ) {
|
||||
this.views.add( '.upload-errors', new UploaderStatusError({
|
||||
this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
|
||||
filename: this.filename( error.get('file').name ),
|
||||
message: error.get('message')
|
||||
}), { at: 0 });
|
||||
|
@ -16,11 +16,10 @@
|
||||
* @param {jQuery} [options.uploader.dropzone] jQuery collection of the dropzone.
|
||||
* @param {object} [options.uploader.params]
|
||||
*/
|
||||
var View = require( '../view.js' ),
|
||||
$ = jQuery,
|
||||
var $ = jQuery,
|
||||
UploaderWindow;
|
||||
|
||||
UploaderWindow = View.extend({
|
||||
UploaderWindow = wp.media.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'uploader-window',
|
||||
template: wp.template('uploader-window'),
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var MediaDetails = require( './media-details' ),
|
||||
var MediaDetails = wp.media.view.MediaDetails,
|
||||
VideoDetails;
|
||||
|
||||
VideoDetails = MediaDetails.extend({
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-beta3-31934';
|
||||
$wp_version = '4.2-beta3-31935';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user