mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 22:32:52 +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 wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MediaDetails = require( './media-details' ),
|
var MediaDetails = wp.media.view.MediaDetails,
|
||||||
AudioDetails;
|
AudioDetails;
|
||||||
|
|
||||||
AudioDetails = MediaDetails.extend({
|
AudioDetails = MediaDetails.extend({
|
||||||
@ -371,7 +371,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
module.exports = AudioDetails;
|
module.exports = AudioDetails;
|
||||||
|
|
||||||
},{"./media-details":9}],6:[function(require,module,exports){
|
},{}],6:[function(require,module,exports){
|
||||||
/*globals wp */
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -390,8 +390,6 @@ module.exports = AudioDetails;
|
|||||||
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||||
|
|
||||||
AudioDetailsView = require( '../audio-details.js' ),
|
|
||||||
AudioDetailsController = require( '../../controllers/audio-details.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
AudioDetails;
|
AudioDetails;
|
||||||
|
|
||||||
@ -408,7 +406,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
initialize: function( options ) {
|
initialize: function( options ) {
|
||||||
options.DetailsView = AudioDetailsView;
|
options.DetailsView = wp.media.view.AudioDetails;
|
||||||
options.cancelText = l10n.audioDetailsCancel;
|
options.cancelText = l10n.audioDetailsCancel;
|
||||||
options.addText = l10n.audioAddSourceTitle;
|
options.addText = l10n.audioAddSourceTitle;
|
||||||
|
|
||||||
@ -424,7 +422,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new AudioDetailsController( {
|
new wp.media.controller.AudioDetails( {
|
||||||
media: this.media
|
media: this.media
|
||||||
} ),
|
} ),
|
||||||
|
|
||||||
@ -451,7 +449,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
module.exports = AudioDetails;
|
module.exports = AudioDetails;
|
||||||
|
|
||||||
},{"../../controllers/audio-details.js":2,"../audio-details.js":5}],7:[function(require,module,exports){
|
},{}],7:[function(require,module,exports){
|
||||||
/*globals wp */
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -466,9 +464,7 @@ module.exports = AudioDetails;
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var View = wp.media.View,
|
var Select = wp.media.view.MediaFrame.Select,
|
||||||
Toolbar = wp.media.view.Toolbar,
|
|
||||||
Select = wp.media.view.MediaFrame.Select,
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
MediaDetails;
|
MediaDetails;
|
||||||
|
|
||||||
@ -531,7 +527,7 @@ MediaDetails = Select.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separateCancel: new View({
|
separateCancel: new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 40
|
priority: 40
|
||||||
})
|
})
|
||||||
@ -540,7 +536,7 @@ MediaDetails = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setPrimaryButton: function(text, handler) {
|
setPrimaryButton: function(text, handler) {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
button: {
|
button: {
|
||||||
@ -603,8 +599,6 @@ module.exports = MediaDetails;
|
|||||||
*/
|
*/
|
||||||
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||||
VideoDetailsView = require( '../video-details.js' ),
|
|
||||||
VideoDetailsController = require( '../../controllers/video-details.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
VideoDetails;
|
VideoDetails;
|
||||||
|
|
||||||
@ -621,7 +615,7 @@ VideoDetails = MediaDetails.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
initialize: function( options ) {
|
initialize: function( options ) {
|
||||||
options.DetailsView = VideoDetailsView;
|
options.DetailsView = wp.media.view.VideoDetails;
|
||||||
options.cancelText = l10n.videoDetailsCancel;
|
options.cancelText = l10n.videoDetailsCancel;
|
||||||
options.addText = l10n.videoAddSourceTitle;
|
options.addText = l10n.videoAddSourceTitle;
|
||||||
|
|
||||||
@ -639,7 +633,7 @@ VideoDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new VideoDetailsController({
|
new wp.media.controller.VideoDetails({
|
||||||
media: this.media
|
media: this.media
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -724,7 +718,7 @@ VideoDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
module.exports = VideoDetails;
|
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 */
|
/*global wp, jQuery, _, MediaElementPlayer */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -906,7 +900,7 @@ module.exports = MediaDetails;
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MediaDetails = require( './media-details' ),
|
var MediaDetails = wp.media.view.MediaDetails,
|
||||||
VideoDetails;
|
VideoDetails;
|
||||||
|
|
||||||
VideoDetails = MediaDetails.extend({
|
VideoDetails = MediaDetails.extend({
|
||||||
@ -937,4 +931,4 @@ VideoDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
module.exports = VideoDetails;
|
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').
|
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
|
||||||
*/
|
*/
|
||||||
var Selection = wp.media.model.Selection,
|
var Selection = wp.media.model.Selection,
|
||||||
Library = require( './library.js' ),
|
Library = wp.media.controller.Library,
|
||||||
CollectionAdd;
|
CollectionAdd;
|
||||||
|
|
||||||
CollectionAdd = Library.extend({
|
CollectionAdd = Library.extend({
|
||||||
|
@ -34,9 +34,7 @@
|
|||||||
* @param {string} attributes.type The collection's media type. (e.g. 'video').
|
* @param {string} attributes.type The collection's media type. (e.g. 'video').
|
||||||
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
|
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
|
||||||
*/
|
*/
|
||||||
var Library = require( './library.js' ),
|
var Library = wp.media.controller.Library,
|
||||||
View = require( '../views/view.js' ),
|
|
||||||
EditLibraryView = require( '../views/attachment/edit-library.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
CollectionEdit;
|
CollectionEdit;
|
||||||
@ -75,7 +73,7 @@ CollectionEdit = Library.extend({
|
|||||||
}
|
}
|
||||||
// The single `Attachment` view to be used in the `Attachments` view.
|
// The single `Attachment` view to be used in the `Attachments` view.
|
||||||
if ( ! this.get('AttachmentView') ) {
|
if ( ! this.get('AttachmentView') ) {
|
||||||
this.set( 'AttachmentView', EditLibraryView );
|
this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
|
||||||
}
|
}
|
||||||
Library.prototype.initialize.apply( this, arguments );
|
Library.prototype.initialize.apply( this, arguments );
|
||||||
},
|
},
|
||||||
@ -141,7 +139,7 @@ CollectionEdit = Library.extend({
|
|||||||
attachmentsBrowserView.sidebar.set( obj );
|
attachmentsBrowserView.sidebar.set( obj );
|
||||||
|
|
||||||
if ( dragInfoText ) {
|
if ( dragInfoText ) {
|
||||||
attachmentsBrowserView.toolbar.set( 'dragInfo', new View({
|
attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
|
||||||
el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
|
el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
|
||||||
priority: -40
|
priority: -40
|
||||||
}) );
|
}) );
|
||||||
|
@ -9,13 +9,10 @@
|
|||||||
* @augments wp.media.controller.State
|
* @augments wp.media.controller.State
|
||||||
* @augments Backbone.Model
|
* @augments Backbone.Model
|
||||||
*/
|
*/
|
||||||
var State = require( './state.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
ToolbarView = require( '../views/toolbar.js' ),
|
|
||||||
CropperView = require( '../views/cropper.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
Cropper;
|
Cropper;
|
||||||
|
|
||||||
Cropper = State.extend({
|
Cropper = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'cropper',
|
id: 'cropper',
|
||||||
title: l10n.cropImage,
|
title: l10n.cropImage,
|
||||||
@ -38,7 +35,7 @@ Cropper = State.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
createCropContent: function() {
|
createCropContent: function() {
|
||||||
this.cropperView = new CropperView({
|
this.cropperView = new wp.media.view.Cropper({
|
||||||
controller: this,
|
controller: this,
|
||||||
attachment: this.get('selection').first()
|
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 ) {
|
doCrop: function( attachment ) {
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
* @augments wp.media.controller.State
|
* @augments wp.media.controller.State
|
||||||
* @augments Backbone.Model
|
* @augments Backbone.Model
|
||||||
*/
|
*/
|
||||||
var State = wp.media.controller.State,
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
EditAttachmentMetadata;
|
EditAttachmentMetadata;
|
||||||
|
|
||||||
EditAttachmentMetadata = State.extend({
|
EditAttachmentMetadata = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'edit-attachment',
|
id: 'edit-attachment',
|
||||||
// Title string passed to the frame's title region view.
|
// 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.menu=false] Initial mode for the menu region.
|
||||||
* @param {string} [attributes.url] Unused. @todo Consider removal.
|
* @param {string} [attributes.url] Unused. @todo Consider removal.
|
||||||
*/
|
*/
|
||||||
var State = require( './state.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
ToolbarView = require( '../views/toolbar.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
EditImage;
|
EditImage;
|
||||||
|
|
||||||
EditImage = State.extend({
|
EditImage = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'edit-image',
|
id: 'edit-image',
|
||||||
title: l10n.editImage,
|
title: l10n.editImage,
|
||||||
@ -55,7 +53,7 @@ EditImage = State.extend({
|
|||||||
lastState = frame.lastState(),
|
lastState = frame.lastState(),
|
||||||
previous = lastState && lastState.id;
|
previous = lastState && lastState.id;
|
||||||
|
|
||||||
frame.toolbar.set( new ToolbarView({
|
frame.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: frame,
|
controller: frame,
|
||||||
items: {
|
items: {
|
||||||
back: {
|
back: {
|
||||||
|
@ -21,12 +21,11 @@
|
|||||||
* @param {string} [attributes.url] The embed URL.
|
* @param {string} [attributes.url] The embed URL.
|
||||||
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
|
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
|
||||||
*/
|
*/
|
||||||
var State = require( './state.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
$ = Backbone.$,
|
$ = Backbone.$,
|
||||||
Embed;
|
Embed;
|
||||||
|
|
||||||
Embed = State.extend({
|
Embed = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'embed',
|
id: 'embed',
|
||||||
title: l10n.insertFromUrlTitle,
|
title: l10n.insertFromUrlTitle,
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
|
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
|
||||||
*/
|
*/
|
||||||
var Attachment = wp.media.model.Attachment,
|
var Attachment = wp.media.model.Attachment,
|
||||||
Library = require( './library.js' ),
|
Library = wp.media.controller.Library,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
FeaturedImage;
|
FeaturedImage;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
|
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
|
||||||
*/
|
*/
|
||||||
var Selection = wp.media.model.Selection,
|
var Selection = wp.media.model.Selection,
|
||||||
Library = require( './library.js' ),
|
Library = wp.media.controller.Library,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
GalleryAdd;
|
GalleryAdd;
|
||||||
|
|
||||||
|
@ -31,9 +31,7 @@
|
|||||||
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
|
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
|
||||||
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
|
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
|
||||||
*/
|
*/
|
||||||
var Library = require( './library.js' ),
|
var Library = wp.media.controller.Library,
|
||||||
EditLibraryView = require( '../views/attachment/edit-library.js' ),
|
|
||||||
GallerySettingsView = require( '../views/settings/gallery.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
GalleryEdit;
|
GalleryEdit;
|
||||||
|
|
||||||
@ -67,7 +65,7 @@ GalleryEdit = Library.extend({
|
|||||||
|
|
||||||
// The single `Attachment` view to be used in the `Attachments` view.
|
// The single `Attachment` view to be used in the `Attachments` view.
|
||||||
if ( ! this.get('AttachmentView') ) {
|
if ( ! this.get('AttachmentView') ) {
|
||||||
this.set( 'AttachmentView', EditLibraryView );
|
this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
|
||||||
}
|
}
|
||||||
|
|
||||||
Library.prototype.initialize.apply( this, arguments );
|
Library.prototype.initialize.apply( this, arguments );
|
||||||
@ -121,7 +119,7 @@ GalleryEdit = Library.extend({
|
|||||||
library.gallery = library.gallery || new Backbone.Model();
|
library.gallery = library.gallery || new Backbone.Model();
|
||||||
|
|
||||||
browser.sidebar.set({
|
browser.sidebar.set({
|
||||||
gallery: new GallerySettingsView({
|
gallery: new wp.media.view.Settings.Gallery({
|
||||||
controller: this,
|
controller: this,
|
||||||
model: library.gallery,
|
model: library.gallery,
|
||||||
priority: 40
|
priority: 40
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
|
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
|
||||||
* however this may not do anything.
|
* however this may not do anything.
|
||||||
*/
|
*/
|
||||||
var State = require( './state.js' ),
|
var State = wp.media.controller.State,
|
||||||
Library = require( './library.js' ),
|
Library = wp.media.controller.Library,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
ImageDetails;
|
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.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.
|
* @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
|
||||||
*/
|
*/
|
||||||
var selectionSync = require( '../utils/selection-sync.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
State = require( './state.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
getUserSetting = window.getUserSetting,
|
getUserSetting = window.getUserSetting,
|
||||||
setUserSetting = window.setUserSetting,
|
setUserSetting = window.setUserSetting,
|
||||||
Library;
|
Library;
|
||||||
|
|
||||||
Library = State.extend({
|
Library = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'library',
|
id: 'library',
|
||||||
title: l10n.mediaLibraryTitle,
|
title: l10n.mediaLibraryTitle,
|
||||||
@ -269,6 +267,6 @@ Library = State.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Make selectionSync available on any Media Library state.
|
// Make selectionSync available on any Media Library state.
|
||||||
_.extend( Library.prototype, selectionSync );
|
_.extend( Library.prototype, wp.media.selectionSync );
|
||||||
|
|
||||||
module.exports = Library;
|
module.exports = Library;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @augments wp.media.controller.State
|
* @augments wp.media.controller.State
|
||||||
* @augments Backbone.Model
|
* @augments Backbone.Model
|
||||||
*/
|
*/
|
||||||
var Library = require( './library.js' ),
|
var Library = wp.media.controller.Library,
|
||||||
MediaLibrary;
|
MediaLibrary;
|
||||||
|
|
||||||
MediaLibrary = Library.extend({
|
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.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.
|
* @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,
|
l10n = wp.media.view.l10n,
|
||||||
ReplaceImage;
|
ReplaceImage;
|
||||||
|
|
||||||
|
@ -10,11 +10,10 @@
|
|||||||
* @augments wp.media.controller.State
|
* @augments wp.media.controller.State
|
||||||
* @augments Backbone.Model
|
* @augments Backbone.Model
|
||||||
*/
|
*/
|
||||||
var State = wp.media.controller.State,
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
EditAttachmentMetadata;
|
EditAttachmentMetadata;
|
||||||
|
|
||||||
EditAttachmentMetadata = State.extend({
|
EditAttachmentMetadata = wp.media.controller.State.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
id: 'edit-attachment',
|
id: 'edit-attachment',
|
||||||
// Title string passed to the frame's title region view.
|
// Title string passed to the frame's title region view.
|
||||||
@ -140,6 +139,8 @@ TwoColumn = Details.extend({
|
|||||||
module.exports = TwoColumn;
|
module.exports = TwoColumn;
|
||||||
|
|
||||||
},{}],5:[function(require,module,exports){
|
},{}],5:[function(require,module,exports){
|
||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.DeleteSelectedPermanentlyButton
|
* wp.media.view.DeleteSelectedPermanentlyButton
|
||||||
*
|
*
|
||||||
@ -153,7 +154,7 @@ module.exports = TwoColumn;
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Button = wp.media.view.Button,
|
var Button = wp.media.view.Button,
|
||||||
DeleteSelected = require( './delete-selected.js' ),
|
DeleteSelected = wp.media.view.DeleteSelectedButton,
|
||||||
DeleteSelectedPermanently;
|
DeleteSelectedPermanently;
|
||||||
|
|
||||||
DeleteSelectedPermanently = DeleteSelected.extend({
|
DeleteSelectedPermanently = DeleteSelected.extend({
|
||||||
@ -186,7 +187,7 @@ DeleteSelectedPermanently = DeleteSelected.extend({
|
|||||||
|
|
||||||
module.exports = DeleteSelectedPermanently;
|
module.exports = DeleteSelectedPermanently;
|
||||||
|
|
||||||
},{"./delete-selected.js":6}],6:[function(require,module,exports){
|
},{}],6:[function(require,module,exports){
|
||||||
/*globals wp */
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -365,13 +366,6 @@ module.exports = Details;
|
|||||||
*/
|
*/
|
||||||
var Frame = wp.media.view.Frame,
|
var Frame = wp.media.view.Frame,
|
||||||
MediaFrame = wp.media.view.MediaFrame,
|
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,
|
$ = jQuery,
|
||||||
EditAttachments;
|
EditAttachments;
|
||||||
@ -427,7 +421,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
createModal: function() {
|
createModal: function() {
|
||||||
// Initialize modal container view.
|
// Initialize modal container view.
|
||||||
if ( this.options.modal ) {
|
if ( this.options.modal ) {
|
||||||
this.modal = new Modal({
|
this.modal = new wp.media.view.Modal({
|
||||||
controller: this,
|
controller: this,
|
||||||
title: this.options.title
|
title: this.options.title
|
||||||
});
|
});
|
||||||
@ -456,7 +450,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
*/
|
*/
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
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.
|
* should be set with the proper region view.
|
||||||
*/
|
*/
|
||||||
editMetadataMode: function( contentRegion ) {
|
editMetadataMode: function( contentRegion ) {
|
||||||
contentRegion.view = new TwoColumn({
|
contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({
|
||||||
controller: this,
|
controller: this,
|
||||||
model: this.model
|
model: this.model
|
||||||
});
|
});
|
||||||
@ -476,7 +470,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
* Attach a subview to display fields added via the
|
* Attach a subview to display fields added via the
|
||||||
* `attachment_fields_to_edit` filter.
|
* `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,
|
controller: this,
|
||||||
model: this.model
|
model: this.model
|
||||||
}) );
|
}) );
|
||||||
@ -494,7 +488,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
* should be set with the proper region view.
|
* should be set with the proper region view.
|
||||||
*/
|
*/
|
||||||
editImageMode: function( contentRegion ) {
|
editImageMode: function( contentRegion ) {
|
||||||
var editImageController = new EditImageController( {
|
var editImageController = new wp.media.controller.EditImage( {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
frame: this
|
frame: this
|
||||||
} );
|
} );
|
||||||
@ -503,7 +497,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
editImageController._router = function() {};
|
editImageController._router = function() {};
|
||||||
editImageController._menu = function() {};
|
editImageController._menu = function() {};
|
||||||
|
|
||||||
contentRegion.view = new DetailsView( {
|
contentRegion.view = new wp.media.view.EditImage.Details( {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
frame: this,
|
frame: this,
|
||||||
controller: editImageController
|
controller: editImageController
|
||||||
@ -596,7 +590,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
|
|
||||||
module.exports = EditAttachments;
|
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 */
|
/*globals wp, _, Backbone */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -615,12 +609,8 @@ module.exports = EditAttachments;
|
|||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var MediaFrame = wp.media.view.MediaFrame,
|
var MediaFrame = wp.media.view.MediaFrame,
|
||||||
UploaderWindow = wp.media.view.UploaderWindow,
|
|
||||||
AttachmentsBrowser = wp.media.view.AttachmentsBrowser,
|
|
||||||
Library = wp.media.controller.Library,
|
Library = wp.media.controller.Library,
|
||||||
|
|
||||||
Router = require( '../../routers/manage.js' ),
|
|
||||||
|
|
||||||
$ = Backbone.$,
|
$ = Backbone.$,
|
||||||
Manage;
|
Manage;
|
||||||
|
|
||||||
@ -657,7 +647,7 @@ Manage = MediaFrame.extend({
|
|||||||
|
|
||||||
// Initialize a window-wide uploader.
|
// Initialize a window-wide uploader.
|
||||||
if ( this.options.uploader ) {
|
if ( this.options.uploader ) {
|
||||||
this.uploader = new UploaderWindow({
|
this.uploader = new wp.media.view.UploaderWindow({
|
||||||
controller: this,
|
controller: this,
|
||||||
uploader: {
|
uploader: {
|
||||||
dropzone: document.body,
|
dropzone: document.body,
|
||||||
@ -670,7 +660,7 @@ Manage = MediaFrame.extend({
|
|||||||
this.options.uploader = false;
|
this.options.uploader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gridRouter = new Router();
|
this.gridRouter = new wp.media.view.MediaFrame.Manage.Router();
|
||||||
|
|
||||||
// Call 'initialize' directly on the parent class.
|
// Call 'initialize' directly on the parent class.
|
||||||
MediaFrame.prototype.initialize.apply( this, arguments );
|
MediaFrame.prototype.initialize.apply( this, arguments );
|
||||||
@ -820,7 +810,7 @@ Manage = MediaFrame.extend({
|
|||||||
var state = this.state();
|
var state = this.state();
|
||||||
|
|
||||||
// Browse our library of attachments.
|
// Browse our library of attachments.
|
||||||
this.browserView = contentRegion.view = new AttachmentsBrowser({
|
this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({
|
||||||
controller: this,
|
controller: this,
|
||||||
collection: state.get('library'),
|
collection: state.get('library'),
|
||||||
selection: state.get('selection'),
|
selection: state.get('selection'),
|
||||||
@ -870,4 +860,4 @@ Manage = MediaFrame.extend({
|
|||||||
|
|
||||||
module.exports = Manage;
|
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 || {};
|
media.model.settings = l10n.settings || {};
|
||||||
delete l10n.settings;
|
delete l10n.settings;
|
||||||
|
|
||||||
Attachments = media.model.Attachments = require( './models/attachments.js' );
|
|
||||||
Attachment = media.model.Attachment = require( './models/attachment.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.Query = require( './models/query.js' );
|
||||||
media.model.PostImage = require( './models/post-image.js' );
|
media.model.PostImage = require( './models/post-image.js' );
|
||||||
@ -379,7 +379,7 @@ Attachment = Backbone.Model.extend({
|
|||||||
* @returns {wp.media.model.Attachment}
|
* @returns {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
create: function( attrs ) {
|
create: function( attrs ) {
|
||||||
var Attachments = require( './attachments.js' );
|
var Attachments = wp.media.model.Attachments;
|
||||||
return Attachments.all.push( attrs );
|
return Attachments.all.push( attrs );
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -394,14 +394,14 @@ Attachment = Backbone.Model.extend({
|
|||||||
* @returns {wp.media.model.Attachment}
|
* @returns {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
get: _.memoize( function( id, attachment ) {
|
get: _.memoize( function( id, attachment ) {
|
||||||
var Attachments = require( './attachments.js' );
|
var Attachments = wp.media.model.Attachments;
|
||||||
return Attachments.all.push( attachment || { id: id } );
|
return Attachments.all.push( attachment || { id: id } );
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = Attachment;
|
module.exports = Attachment;
|
||||||
|
|
||||||
},{"./attachments.js":3}],3:[function(require,module,exports){
|
},{}],3:[function(require,module,exports){
|
||||||
/*globals wp, _, Backbone */
|
/*globals wp, _, Backbone */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -426,14 +426,11 @@ module.exports = Attachment;
|
|||||||
* @param {string} [options.filters]
|
* @param {string} [options.filters]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
var Attachment = require( './attachment.js' ),
|
var Attachments = Backbone.Collection.extend({
|
||||||
Attachments;
|
|
||||||
|
|
||||||
Attachments = Backbone.Collection.extend({
|
|
||||||
/**
|
/**
|
||||||
* @type {wp.media.model.Attachment}
|
* @type {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
model: Attachment,
|
model: wp.media.model.Attachment,
|
||||||
/**
|
/**
|
||||||
* @param {Array} [models=[]] Array of models used to populate the collection.
|
* @param {Array} [models=[]] Array of models used to populate the collection.
|
||||||
* @param {Object} [options={}]
|
* @param {Object} [options={}]
|
||||||
@ -771,7 +768,7 @@ Attachments = Backbone.Collection.extend({
|
|||||||
id = attrs.id;
|
id = attrs.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
attachment = Attachment.get( id );
|
attachment = wp.media.model.Attachment.get( id );
|
||||||
newAttributes = attachment.parse( attrs, xhr );
|
newAttributes = attachment.parse( attrs, xhr );
|
||||||
|
|
||||||
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
|
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
|
||||||
@ -787,12 +784,11 @@ Attachments = Backbone.Collection.extend({
|
|||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
_requery: function( refresh ) {
|
_requery: function( refresh ) {
|
||||||
var props, Query;
|
var props;
|
||||||
if ( this.props.get('query') ) {
|
if ( this.props.get('query') ) {
|
||||||
Query = require( './query.js' );
|
|
||||||
props = this.props.toJSON();
|
props = this.props.toJSON();
|
||||||
props.cache = ( true !== refresh );
|
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;
|
module.exports = Attachments;
|
||||||
|
|
||||||
},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
|
},{}],4:[function(require,module,exports){
|
||||||
/*globals Backbone */
|
/*globals Backbone */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -955,12 +951,10 @@ module.exports = Attachments;
|
|||||||
* @param {int} [attributes] Initial model attributes.
|
* @param {int} [attributes] Initial model attributes.
|
||||||
* @param {int} [attributes.attachment_id] ID of the attachment.
|
* @param {int} [attributes.attachment_id] ID of the attachment.
|
||||||
**/
|
**/
|
||||||
var Attachment = require( './attachment' ),
|
var PostImage = Backbone.Model.extend({
|
||||||
PostImage;
|
|
||||||
|
|
||||||
PostImage = Backbone.Model.extend({
|
|
||||||
|
|
||||||
initialize: function( attributes ) {
|
initialize: function( attributes ) {
|
||||||
|
var Attachment = wp.media.model.Attachment;
|
||||||
this.attachment = false;
|
this.attachment = false;
|
||||||
|
|
||||||
if ( attributes.attachment_id ) {
|
if ( attributes.attachment_id ) {
|
||||||
@ -1097,7 +1091,7 @@ PostImage = Backbone.Model.extend({
|
|||||||
|
|
||||||
module.exports = PostImage;
|
module.exports = PostImage;
|
||||||
|
|
||||||
},{"./attachment":2}],5:[function(require,module,exports){
|
},{}],5:[function(require,module,exports){
|
||||||
/*globals wp, _ */
|
/*globals wp, _ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1117,7 +1111,7 @@ module.exports = PostImage;
|
|||||||
* @param {object} [options.args] Attachments query arguments.
|
* @param {object} [options.args] Attachments query arguments.
|
||||||
* @param {object} [options.args.posts_per_page]
|
* @param {object} [options.args.posts_per_page]
|
||||||
*/
|
*/
|
||||||
var Attachments = require( './attachments.js' ),
|
var Attachments = wp.media.model.Attachments,
|
||||||
Query;
|
Query;
|
||||||
|
|
||||||
Query = Attachments.extend({
|
Query = Attachments.extend({
|
||||||
@ -1407,8 +1401,8 @@ Query = Attachments.extend({
|
|||||||
|
|
||||||
module.exports = Query;
|
module.exports = Query;
|
||||||
|
|
||||||
},{"./attachments.js":3}],6:[function(require,module,exports){
|
},{}],6:[function(require,module,exports){
|
||||||
/*globals _ */
|
/*globals wp, _ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.model.Selection
|
* wp.media.model.Selection
|
||||||
@ -1419,7 +1413,7 @@ module.exports = Query;
|
|||||||
* @augments wp.media.model.Attachments
|
* @augments wp.media.model.Attachments
|
||||||
* @augments Backbone.Collection
|
* @augments Backbone.Collection
|
||||||
*/
|
*/
|
||||||
var Attachments = require( './attachments.js' ),
|
var Attachments = wp.media.model.Attachments,
|
||||||
Selection;
|
Selection;
|
||||||
|
|
||||||
Selection = Attachments.extend({
|
Selection = Attachments.extend({
|
||||||
@ -1506,4 +1500,4 @@ Selection = Attachments.extend({
|
|||||||
|
|
||||||
module.exports = Selection;
|
module.exports = Selection;
|
||||||
|
|
||||||
},{"./attachments.js":3}]},{},[1]);
|
},{}]},{},[1]);
|
||||||
|
@ -57,8 +57,8 @@ l10n = media.model.l10n = window._wpMediaModelsL10n || {};
|
|||||||
media.model.settings = l10n.settings || {};
|
media.model.settings = l10n.settings || {};
|
||||||
delete l10n.settings;
|
delete l10n.settings;
|
||||||
|
|
||||||
Attachments = media.model.Attachments = require( './models/attachments.js' );
|
|
||||||
Attachment = media.model.Attachment = require( './models/attachment.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.Query = require( './models/query.js' );
|
||||||
media.model.PostImage = require( './models/post-image.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}
|
* @returns {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
create: function( attrs ) {
|
create: function( attrs ) {
|
||||||
var Attachments = require( './attachments.js' );
|
var Attachments = wp.media.model.Attachments;
|
||||||
return Attachments.all.push( attrs );
|
return Attachments.all.push( attrs );
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -160,7 +160,7 @@ Attachment = Backbone.Model.extend({
|
|||||||
* @returns {wp.media.model.Attachment}
|
* @returns {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
get: _.memoize( function( id, attachment ) {
|
get: _.memoize( function( id, attachment ) {
|
||||||
var Attachments = require( './attachments.js' );
|
var Attachments = wp.media.model.Attachments;
|
||||||
return Attachments.all.push( attachment || { id: id } );
|
return Attachments.all.push( attachment || { id: id } );
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -22,14 +22,11 @@
|
|||||||
* @param {string} [options.filters]
|
* @param {string} [options.filters]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
var Attachment = require( './attachment.js' ),
|
var Attachments = Backbone.Collection.extend({
|
||||||
Attachments;
|
|
||||||
|
|
||||||
Attachments = Backbone.Collection.extend({
|
|
||||||
/**
|
/**
|
||||||
* @type {wp.media.model.Attachment}
|
* @type {wp.media.model.Attachment}
|
||||||
*/
|
*/
|
||||||
model: Attachment,
|
model: wp.media.model.Attachment,
|
||||||
/**
|
/**
|
||||||
* @param {Array} [models=[]] Array of models used to populate the collection.
|
* @param {Array} [models=[]] Array of models used to populate the collection.
|
||||||
* @param {Object} [options={}]
|
* @param {Object} [options={}]
|
||||||
@ -367,7 +364,7 @@ Attachments = Backbone.Collection.extend({
|
|||||||
id = attrs.id;
|
id = attrs.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
attachment = Attachment.get( id );
|
attachment = wp.media.model.Attachment.get( id );
|
||||||
newAttributes = attachment.parse( attrs, xhr );
|
newAttributes = attachment.parse( attrs, xhr );
|
||||||
|
|
||||||
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
|
if ( ! _.isEqual( attachment.attributes, newAttributes ) ) {
|
||||||
@ -383,12 +380,11 @@ Attachments = Backbone.Collection.extend({
|
|||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
_requery: function( refresh ) {
|
_requery: function( refresh ) {
|
||||||
var props, Query;
|
var props;
|
||||||
if ( this.props.get('query') ) {
|
if ( this.props.get('query') ) {
|
||||||
Query = require( './query.js' );
|
|
||||||
props = this.props.toJSON();
|
props = this.props.toJSON();
|
||||||
props.cache = ( true !== refresh );
|
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] Initial model attributes.
|
||||||
* @param {int} [attributes.attachment_id] ID of the attachment.
|
* @param {int} [attributes.attachment_id] ID of the attachment.
|
||||||
**/
|
**/
|
||||||
var Attachment = require( './attachment' ),
|
var PostImage = Backbone.Model.extend({
|
||||||
PostImage;
|
|
||||||
|
|
||||||
PostImage = Backbone.Model.extend({
|
|
||||||
|
|
||||||
initialize: function( attributes ) {
|
initialize: function( attributes ) {
|
||||||
|
var Attachment = wp.media.model.Attachment;
|
||||||
this.attachment = false;
|
this.attachment = false;
|
||||||
|
|
||||||
if ( attributes.attachment_id ) {
|
if ( attributes.attachment_id ) {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* @param {object} [options.args] Attachments query arguments.
|
* @param {object} [options.args] Attachments query arguments.
|
||||||
* @param {object} [options.args.posts_per_page]
|
* @param {object} [options.args.posts_per_page]
|
||||||
*/
|
*/
|
||||||
var Attachments = require( './attachments.js' ),
|
var Attachments = wp.media.model.Attachments,
|
||||||
Query;
|
Query;
|
||||||
|
|
||||||
Query = Attachments.extend({
|
Query = Attachments.extend({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*globals _ */
|
/*globals wp, _ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.model.Selection
|
* wp.media.model.Selection
|
||||||
@ -9,7 +9,7 @@
|
|||||||
* @augments wp.media.model.Attachments
|
* @augments wp.media.model.Attachments
|
||||||
* @augments Backbone.Collection
|
* @augments Backbone.Collection
|
||||||
*/
|
*/
|
||||||
var Attachments = require( './attachments.js' ),
|
var Attachments = wp.media.model.Attachments,
|
||||||
Selection;
|
Selection;
|
||||||
|
|
||||||
Selection = Attachments.extend({
|
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 wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
AttachmentCompat;
|
AttachmentCompat;
|
||||||
|
|
||||||
AttachmentCompat = View.extend({
|
AttachmentCompat = View.extend({
|
||||||
|
@ -8,11 +8,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var $ = jQuery,
|
||||||
$ = jQuery,
|
|
||||||
AttachmentFilters;
|
AttachmentFilters;
|
||||||
|
|
||||||
AttachmentFilters = View.extend({
|
AttachmentFilters = wp.media.View.extend({
|
||||||
tagName: 'select',
|
tagName: 'select',
|
||||||
className: 'attachment-filters',
|
className: 'attachment-filters',
|
||||||
id: 'media-attachment-filters',
|
id: 'media-attachment-filters',
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var AttachmentFilters = require( '../attachment-filters.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
All;
|
All;
|
||||||
|
|
||||||
All = AttachmentFilters.extend({
|
All = wp.media.view.AttachmentFilters.extend({
|
||||||
createFilters: function() {
|
createFilters: function() {
|
||||||
var filters = {};
|
var filters = {};
|
||||||
|
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var AttachmentFilters = require( '../attachment-filters.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
DateFilter;
|
DateFilter;
|
||||||
|
|
||||||
DateFilter = AttachmentFilters.extend({
|
DateFilter = wp.media.view.AttachmentFilters.extend({
|
||||||
id: 'media-attachment-date-filters',
|
id: 'media-attachment-date-filters',
|
||||||
|
|
||||||
createFilters: function() {
|
createFilters: function() {
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var AttachmentFilters = require( '../attachment-filters.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
Uploaded;
|
Uploaded;
|
||||||
|
|
||||||
Uploaded = AttachmentFilters.extend({
|
Uploaded = wp.media.view.AttachmentFilters.extend({
|
||||||
createFilters: function() {
|
createFilters: function() {
|
||||||
var type = this.model.get('type'),
|
var type = this.model.get('type'),
|
||||||
types = wp.media.view.settings.mimeTypes,
|
types = wp.media.view.settings.mimeTypes,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
Attachment;
|
Attachment;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Attachment = require( '../attachment.js' ),
|
var Attachment = wp.media.view.Attachment,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
Details;
|
Details;
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Attachment.EditLibrary
|
* wp.media.view.Attachment.EditLibrary
|
||||||
*
|
*
|
||||||
@ -7,10 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Attachment = require( '../attachment.js' ),
|
var EditLibrary = wp.media.view.Attachment.extend({
|
||||||
EditLibrary;
|
|
||||||
|
|
||||||
EditLibrary = Attachment.extend({
|
|
||||||
buttons: {
|
buttons: {
|
||||||
close: true
|
close: true
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Attachments.EditSelection
|
* wp.media.view.Attachments.EditSelection
|
||||||
*
|
*
|
||||||
@ -8,10 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Selection = require( './selection.js' ),
|
var EditSelection = wp.media.view.Attachment.Selection.extend({
|
||||||
EditSelection;
|
|
||||||
|
|
||||||
EditSelection = Selection.extend({
|
|
||||||
buttons: {
|
buttons: {
|
||||||
close: true
|
close: true
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Attachment.Library
|
* wp.media.view.Attachment.Library
|
||||||
*
|
*
|
||||||
@ -7,10 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Attachment = require( '../attachment.js' ),
|
var Library = wp.media.view.Attachment.extend({
|
||||||
Library;
|
|
||||||
|
|
||||||
Library = Attachment.extend({
|
|
||||||
buttons: {
|
buttons: {
|
||||||
check: true
|
check: true
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Attachment.Selection
|
* wp.media.view.Attachment.Selection
|
||||||
*
|
*
|
||||||
@ -7,10 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Attachment = require( '../attachment.js' ),
|
var Selection = wp.media.view.Attachment.extend({
|
||||||
Selection;
|
|
||||||
|
|
||||||
Selection = Attachment.extend({
|
|
||||||
className: 'attachment selection',
|
className: 'attachment selection',
|
||||||
|
|
||||||
// On click, just select the model, instead of removing the model from
|
// On click, just select the model, instead of removing the model from
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
Attachment = require( './attachment.js' ),
|
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
Attachments;
|
Attachments;
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ Attachments = View.extend({
|
|||||||
_.defaults( this.options, {
|
_.defaults( this.options, {
|
||||||
refreshSensitivity: wp.media.isTouchDevice ? 300 : 200,
|
refreshSensitivity: wp.media.isTouchDevice ? 300 : 200,
|
||||||
refreshThreshold: 3,
|
refreshThreshold: 3,
|
||||||
AttachmentView: Attachment,
|
AttachmentView: wp.media.view.Attachment,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
resize: true,
|
resize: true,
|
||||||
idealColumnWidth: $( window ).width() < 640 ? 135 : 150
|
idealColumnWidth: $( window ).width() < 640 ? 135 : 150
|
||||||
|
@ -20,22 +20,7 @@
|
|||||||
* @param {bool|string} [options.sidebar=true] Whether to create a sidebar for the browser.
|
* @param {bool|string} [options.sidebar=true] Whether to create a sidebar for the browser.
|
||||||
* Accepts true, false, and 'errors'.
|
* Accepts true, false, and 'errors'.
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var View = wp.media.View,
|
||||||
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' ),
|
|
||||||
mediaTrash = wp.media.view.settings.mediaTrash,
|
mediaTrash = wp.media.view.settings.mediaTrash,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
@ -52,7 +37,7 @@ AttachmentsBrowser = View.extend({
|
|||||||
date: true,
|
date: true,
|
||||||
display: false,
|
display: false,
|
||||||
sidebar: true,
|
sidebar: true,
|
||||||
AttachmentView: Library
|
AttachmentView: wp.media.view.Attachment.Library
|
||||||
});
|
});
|
||||||
|
|
||||||
this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
|
this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
|
||||||
@ -103,18 +88,18 @@ AttachmentsBrowser = View.extend({
|
|||||||
/**
|
/**
|
||||||
* @member {wp.media.view.Toolbar}
|
* @member {wp.media.view.Toolbar}
|
||||||
*/
|
*/
|
||||||
this.toolbar = new Toolbar( toolbarOptions );
|
this.toolbar = new wp.media.view.Toolbar( toolbarOptions );
|
||||||
|
|
||||||
this.views.add( this.toolbar );
|
this.views.add( this.toolbar );
|
||||||
|
|
||||||
this.toolbar.set( 'spinner', new Spinner({
|
this.toolbar.set( 'spinner', new wp.media.view.Spinner({
|
||||||
priority: -60
|
priority: -60
|
||||||
}) );
|
}) );
|
||||||
|
|
||||||
if ( -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ) ) {
|
if ( -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ) ) {
|
||||||
// "Filters" will return a <select>, need to render
|
// "Filters" will return a <select>, need to render
|
||||||
// screen reader text before
|
// screen reader text before
|
||||||
this.toolbar.set( 'filtersLabel', new Label({
|
this.toolbar.set( 'filtersLabel', new wp.media.view.Label({
|
||||||
value: l10n.filterByType,
|
value: l10n.filterByType,
|
||||||
attributes: {
|
attributes: {
|
||||||
'for': 'media-attachment-filters'
|
'for': 'media-attachment-filters'
|
||||||
@ -123,13 +108,13 @@ AttachmentsBrowser = View.extend({
|
|||||||
}).render() );
|
}).render() );
|
||||||
|
|
||||||
if ( 'uploaded' === this.options.filters ) {
|
if ( 'uploaded' === this.options.filters ) {
|
||||||
this.toolbar.set( 'filters', new Uploaded({
|
this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: -80
|
priority: -80
|
||||||
}).render() );
|
}).render() );
|
||||||
} else {
|
} else {
|
||||||
Filters = new All({
|
Filters = new wp.media.view.AttachmentFilters.All({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: -80
|
priority: -80
|
||||||
@ -154,14 +139,14 @@ AttachmentsBrowser = View.extend({
|
|||||||
}).render() );
|
}).render() );
|
||||||
|
|
||||||
// DateFilter is a <select>, screen reader text needs to be rendered before
|
// 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,
|
value: l10n.filterByDate,
|
||||||
attributes: {
|
attributes: {
|
||||||
'for': 'media-attachment-date-filters'
|
'for': 'media-attachment-date-filters'
|
||||||
},
|
},
|
||||||
priority: -75
|
priority: -75
|
||||||
}).render() );
|
}).render() );
|
||||||
this.toolbar.set( 'dateFilter', new DateFilter({
|
this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: -75
|
priority: -75
|
||||||
@ -265,14 +250,14 @@ AttachmentsBrowser = View.extend({
|
|||||||
|
|
||||||
} else if ( this.options.date ) {
|
} else if ( this.options.date ) {
|
||||||
// DateFilter is a <select>, screen reader text needs to be rendered before
|
// 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,
|
value: l10n.filterByDate,
|
||||||
attributes: {
|
attributes: {
|
||||||
'for': 'media-attachment-date-filters'
|
'for': 'media-attachment-date-filters'
|
||||||
},
|
},
|
||||||
priority: -75
|
priority: -75
|
||||||
}).render() );
|
}).render() );
|
||||||
this.toolbar.set( 'dateFilter', new DateFilter({
|
this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: -75
|
priority: -75
|
||||||
@ -281,14 +266,14 @@ AttachmentsBrowser = View.extend({
|
|||||||
|
|
||||||
if ( this.options.search ) {
|
if ( this.options.search ) {
|
||||||
// Search is an input, screen reader text needs to be rendered before
|
// 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,
|
value: l10n.searchMediaLabel,
|
||||||
attributes: {
|
attributes: {
|
||||||
'for': 'media-search-input'
|
'for': 'media-search-input'
|
||||||
},
|
},
|
||||||
priority: 60
|
priority: 60
|
||||||
}).render() );
|
}).render() );
|
||||||
this.toolbar.set( 'search', new Search({
|
this.toolbar.set( 'search', new wp.media.view.Search({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: 60
|
priority: 60
|
||||||
@ -337,7 +322,7 @@ AttachmentsBrowser = View.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
createUploader: function() {
|
createUploader: function() {
|
||||||
this.uploader = new UploaderInline({
|
this.uploader = new wp.media.view.UploaderInline({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
status: false,
|
status: false,
|
||||||
message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound,
|
message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound,
|
||||||
@ -357,7 +342,7 @@ AttachmentsBrowser = View.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
createAttachments: function() {
|
createAttachments: function() {
|
||||||
this.attachments = new Attachments({
|
this.attachments = new wp.media.view.Attachments({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
selection: this.options.selection,
|
selection: this.options.selection,
|
||||||
@ -393,14 +378,14 @@ AttachmentsBrowser = View.extend({
|
|||||||
createSidebar: function() {
|
createSidebar: function() {
|
||||||
var options = this.options,
|
var options = this.options,
|
||||||
selection = options.selection,
|
selection = options.selection,
|
||||||
sidebar = this.sidebar = new Sidebar({
|
sidebar = this.sidebar = new wp.media.view.Sidebar({
|
||||||
controller: this.controller
|
controller: this.controller
|
||||||
});
|
});
|
||||||
|
|
||||||
this.views.add( sidebar );
|
this.views.add( sidebar );
|
||||||
|
|
||||||
if ( this.controller.uploader ) {
|
if ( this.controller.uploader ) {
|
||||||
sidebar.set( 'uploads', new UploaderStatus({
|
sidebar.set( 'uploads', new wp.media.view.UploaderStatus({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
priority: 40
|
priority: 40
|
||||||
}) );
|
}) );
|
||||||
@ -418,20 +403,20 @@ AttachmentsBrowser = View.extend({
|
|||||||
var sidebar = this.sidebar,
|
var sidebar = this.sidebar,
|
||||||
single = this.options.selection.single();
|
single = this.options.selection.single();
|
||||||
|
|
||||||
sidebar.set( 'details', new Details({
|
sidebar.set( 'details', new wp.media.view.Attachment.Details({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: single,
|
model: single,
|
||||||
priority: 80
|
priority: 80
|
||||||
}) );
|
}) );
|
||||||
|
|
||||||
sidebar.set( 'compat', new AttachmentCompat({
|
sidebar.set( 'compat', new wp.media.view.AttachmentCompat({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: single,
|
model: single,
|
||||||
priority: 120
|
priority: 120
|
||||||
}) );
|
}) );
|
||||||
|
|
||||||
if ( this.options.display ) {
|
if ( this.options.display ) {
|
||||||
sidebar.set( 'display', new AttachmentDisplay({
|
sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.model.display( single ),
|
model: this.model.display( single ),
|
||||||
attachment: single,
|
attachment: single,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*globals _ */
|
/*globals wp, _ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Attachments.Selection
|
* wp.media.view.Attachments.Selection
|
||||||
@ -9,8 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Attachments = require( '../attachments.js' ),
|
var Attachments = wp.media.view.Attachments,
|
||||||
AttachmentSelection = require( '../attachment/selection.js' ),
|
|
||||||
Selection;
|
Selection;
|
||||||
|
|
||||||
Selection = Attachments.extend({
|
Selection = Attachments.extend({
|
||||||
@ -21,7 +20,7 @@ Selection = Attachments.extend({
|
|||||||
resize: false,
|
resize: false,
|
||||||
|
|
||||||
// The single `Attachment` view to be used in the `Attachments` view.
|
// 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.
|
// Call 'initialize' directly on the parent class.
|
||||||
return Attachments.prototype.initialize.apply( this, arguments );
|
return Attachments.prototype.initialize.apply( this, arguments );
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MediaDetails = require( './media-details' ),
|
var MediaDetails = wp.media.view.MediaDetails,
|
||||||
AudioDetails;
|
AudioDetails;
|
||||||
|
|
||||||
AudioDetails = MediaDetails.extend({
|
AudioDetails = MediaDetails.extend({
|
||||||
|
@ -8,12 +8,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var $ = Backbone.$,
|
||||||
Button = require( './button.js' ),
|
|
||||||
$ = Backbone.$,
|
|
||||||
ButtonGroup;
|
ButtonGroup;
|
||||||
|
|
||||||
ButtonGroup = View.extend({
|
ButtonGroup = wp.media.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
className: 'button-group button-large media-button-group',
|
className: 'button-group button-large media-button-group',
|
||||||
|
|
||||||
@ -25,7 +23,7 @@ ButtonGroup = View.extend({
|
|||||||
if ( button instanceof Backbone.View ) {
|
if ( button instanceof Backbone.View ) {
|
||||||
return button;
|
return button;
|
||||||
} else {
|
} else {
|
||||||
return new Button( button ).render();
|
return new wp.media.view.Button( button ).render();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,10 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Button = wp.media.View.extend({
|
||||||
Button;
|
|
||||||
|
|
||||||
Button = View.extend({
|
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
className: 'media-button',
|
className: 'media-button',
|
||||||
attributes: { href: '#' },
|
attributes: { href: '#' },
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.DeleteSelectedPermanentlyButton
|
* wp.media.view.DeleteSelectedPermanentlyButton
|
||||||
*
|
*
|
||||||
@ -11,7 +13,7 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Button = wp.media.view.Button,
|
var Button = wp.media.view.Button,
|
||||||
DeleteSelected = require( './delete-selected.js' ),
|
DeleteSelected = wp.media.view.DeleteSelectedButton,
|
||||||
DeleteSelectedPermanently;
|
DeleteSelectedPermanently;
|
||||||
|
|
||||||
DeleteSelectedPermanently = DeleteSelected.extend({
|
DeleteSelectedPermanently = DeleteSelected.extend({
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
UploaderStatusError = require( './uploader/status-error.js' ),
|
UploaderStatus = wp.media.view.UploaderStatus,
|
||||||
UploaderStatus = require( './uploader/status.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
Cropper;
|
Cropper;
|
||||||
@ -58,7 +57,7 @@ Cropper = View.extend({
|
|||||||
onError: function() {
|
onError: function() {
|
||||||
var filename = this.options.attachment.get('filename');
|
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),
|
filename: UploaderStatus.prototype.filename(filename),
|
||||||
message: window._wpMediaViewsL10n.cropError
|
message: window._wpMediaViewsL10n.cropError
|
||||||
}), { at: 0 });
|
}), { at: 0 });
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
EditImage;
|
EditImage;
|
||||||
|
|
||||||
EditImage = View.extend({
|
EditImage = View.extend({
|
||||||
|
@ -6,20 +6,14 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Embed = wp.media.View.extend({
|
||||||
EmbedImage = require( './embed/image.js' ),
|
|
||||||
EmbedLink = require( './embed/link.js' ),
|
|
||||||
EmbedUrl = require( './embed/url.js' ),
|
|
||||||
Embed;
|
|
||||||
|
|
||||||
Embed = View.extend({
|
|
||||||
className: 'media-embed',
|
className: 'media-embed',
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
/**
|
/**
|
||||||
* @member {wp.media.view.EmbedUrl}
|
* @member {wp.media.view.EmbedUrl}
|
||||||
*/
|
*/
|
||||||
this.url = new EmbedUrl({
|
this.url = new wp.media.view.EmbedUrl({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.model.props
|
model: this.model.props
|
||||||
}).render();
|
}).render();
|
||||||
@ -46,9 +40,9 @@ Embed = View.extend({
|
|||||||
constructor;
|
constructor;
|
||||||
|
|
||||||
if ( 'image' === type ) {
|
if ( 'image' === type ) {
|
||||||
constructor = EmbedImage;
|
constructor = wp.media.view.EmbedImage;
|
||||||
} else if ( 'link' === type ) {
|
} else if ( 'link' === type ) {
|
||||||
constructor = EmbedLink;
|
constructor = wp.media.view.EmbedLink;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var AttachmentDisplay = require( '../settings/attachment-display.js' ),
|
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
|
||||||
EmbedImage;
|
EmbedImage;
|
||||||
|
|
||||||
EmbedImage = AttachmentDisplay.extend({
|
EmbedImage = AttachmentDisplay.extend({
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Settings = require( '../settings.js' ),
|
var $ = jQuery,
|
||||||
$ = jQuery,
|
|
||||||
EmbedLink;
|
EmbedLink;
|
||||||
|
|
||||||
EmbedLink = Settings.extend({
|
EmbedLink = wp.media.view.Settings.extend({
|
||||||
className: 'embed-link-settings',
|
className: 'embed-link-settings',
|
||||||
template: wp.template('embed-link-settings'),
|
template: wp.template('embed-link-settings'),
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var View = wp.media.View,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
EmbedUrl;
|
EmbedUrl;
|
||||||
|
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var FocusManager = wp.media.View.extend({
|
||||||
FocusManager;
|
|
||||||
|
|
||||||
FocusManager = View.extend({
|
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'keydown': 'constrainTabbing'
|
'keydown': 'constrainTabbing'
|
||||||
|
@ -15,13 +15,7 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var StateMachine = require( '../controllers/state-machine.js' ),
|
var Frame = wp.media.View.extend({
|
||||||
State = require( '../controllers/state.js' ),
|
|
||||||
Region = require( '../controllers/region.js' ),
|
|
||||||
View = require( './view.js' ),
|
|
||||||
Frame;
|
|
||||||
|
|
||||||
Frame = View.extend({
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
_.defaults( this.options, {
|
_.defaults( this.options, {
|
||||||
mode: [ 'select' ]
|
mode: [ 'select' ]
|
||||||
@ -37,7 +31,7 @@ Frame = View.extend({
|
|||||||
|
|
||||||
// Initialize regions.
|
// Initialize regions.
|
||||||
_.each( this.regions, function( region ) {
|
_.each( this.regions, function( region ) {
|
||||||
this[ region ] = new Region({
|
this[ region ] = new wp.media.controller.Region({
|
||||||
view: this,
|
view: this,
|
||||||
id: region,
|
id: region,
|
||||||
selector: '.media-frame-' + region
|
selector: '.media-frame-' + region
|
||||||
@ -55,7 +49,7 @@ Frame = View.extend({
|
|||||||
_createStates: function() {
|
_createStates: function() {
|
||||||
// Create the default `states` collection.
|
// Create the default `states` collection.
|
||||||
this.states = new Backbone.Collection( null, {
|
this.states = new Backbone.Collection( null, {
|
||||||
model: State
|
model: wp.media.controller.State
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure states have a reference to the frame.
|
// Ensure states have a reference to the frame.
|
||||||
@ -167,6 +161,6 @@ Frame = View.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Make the `Frame` a `StateMachine`.
|
// Make the `Frame` a `StateMachine`.
|
||||||
_.extend( Frame.prototype, StateMachine.prototype );
|
_.extend( Frame.prototype, wp.media.controller.StateMachine.prototype );
|
||||||
|
|
||||||
module.exports = Frame;
|
module.exports = Frame;
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||||
|
|
||||||
AudioDetailsView = require( '../audio-details.js' ),
|
|
||||||
AudioDetailsController = require( '../../controllers/audio-details.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
AudioDetails;
|
AudioDetails;
|
||||||
|
|
||||||
@ -34,7 +32,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
initialize: function( options ) {
|
initialize: function( options ) {
|
||||||
options.DetailsView = AudioDetailsView;
|
options.DetailsView = wp.media.view.AudioDetails;
|
||||||
options.cancelText = l10n.audioDetailsCancel;
|
options.cancelText = l10n.audioDetailsCancel;
|
||||||
options.addText = l10n.audioAddSourceTitle;
|
options.addText = l10n.audioAddSourceTitle;
|
||||||
|
|
||||||
@ -50,7 +48,7 @@ AudioDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new AudioDetailsController( {
|
new wp.media.controller.AudioDetails( {
|
||||||
media: this.media
|
media: this.media
|
||||||
} ),
|
} ),
|
||||||
|
|
||||||
|
@ -18,13 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
var Frame = wp.media.view.Frame,
|
var Frame = wp.media.view.Frame,
|
||||||
MediaFrame = wp.media.view.MediaFrame,
|
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,
|
$ = jQuery,
|
||||||
EditAttachments;
|
EditAttachments;
|
||||||
@ -80,7 +73,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
createModal: function() {
|
createModal: function() {
|
||||||
// Initialize modal container view.
|
// Initialize modal container view.
|
||||||
if ( this.options.modal ) {
|
if ( this.options.modal ) {
|
||||||
this.modal = new Modal({
|
this.modal = new wp.media.view.Modal({
|
||||||
controller: this,
|
controller: this,
|
||||||
title: this.options.title
|
title: this.options.title
|
||||||
});
|
});
|
||||||
@ -109,7 +102,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
*/
|
*/
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
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.
|
* should be set with the proper region view.
|
||||||
*/
|
*/
|
||||||
editMetadataMode: function( contentRegion ) {
|
editMetadataMode: function( contentRegion ) {
|
||||||
contentRegion.view = new TwoColumn({
|
contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({
|
||||||
controller: this,
|
controller: this,
|
||||||
model: this.model
|
model: this.model
|
||||||
});
|
});
|
||||||
@ -129,7 +122,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
* Attach a subview to display fields added via the
|
* Attach a subview to display fields added via the
|
||||||
* `attachment_fields_to_edit` filter.
|
* `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,
|
controller: this,
|
||||||
model: this.model
|
model: this.model
|
||||||
}) );
|
}) );
|
||||||
@ -147,7 +140,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
* should be set with the proper region view.
|
* should be set with the proper region view.
|
||||||
*/
|
*/
|
||||||
editImageMode: function( contentRegion ) {
|
editImageMode: function( contentRegion ) {
|
||||||
var editImageController = new EditImageController( {
|
var editImageController = new wp.media.controller.EditImage( {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
frame: this
|
frame: this
|
||||||
} );
|
} );
|
||||||
@ -156,7 +149,7 @@ EditAttachments = MediaFrame.extend({
|
|||||||
editImageController._router = function() {};
|
editImageController._router = function() {};
|
||||||
editImageController._menu = function() {};
|
editImageController._menu = function() {};
|
||||||
|
|
||||||
contentRegion.view = new DetailsView( {
|
contentRegion.view = new wp.media.view.EditImage.Details( {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
frame: this,
|
frame: this,
|
||||||
controller: editImageController
|
controller: editImageController
|
||||||
|
@ -15,13 +15,7 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var Select = require( './select.js' ),
|
var Select = wp.media.view.MediaFrame.Select,
|
||||||
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' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
ImageDetails;
|
ImageDetails;
|
||||||
|
|
||||||
@ -55,11 +49,11 @@ ImageDetails = Select.extend({
|
|||||||
|
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new ImageDetailsController({
|
new wp.media.controller.ImageDetails({
|
||||||
image: this.image,
|
image: this.image,
|
||||||
editable: false
|
editable: false
|
||||||
}),
|
}),
|
||||||
new ReplaceImageController({
|
new wp.media.controller.ReplaceImage({
|
||||||
id: 'replace-image',
|
id: 'replace-image',
|
||||||
library: wp.media.query( { type: 'image' } ),
|
library: wp.media.query( { type: 'image' } ),
|
||||||
image: this.image,
|
image: this.image,
|
||||||
@ -69,7 +63,7 @@ ImageDetails = Select.extend({
|
|||||||
priority: 80,
|
priority: 80,
|
||||||
displaySettings: true
|
displaySettings: true
|
||||||
}),
|
}),
|
||||||
new EditImageController( {
|
new wp.media.controller.EditImage( {
|
||||||
image: this.image,
|
image: this.image,
|
||||||
selection: this.options.selection
|
selection: this.options.selection
|
||||||
} )
|
} )
|
||||||
@ -77,7 +71,7 @@ ImageDetails = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
imageDetailsContent: function( options ) {
|
imageDetailsContent: function( options ) {
|
||||||
options.view = new ImageDetailsView({
|
options.view = new wp.media.view.ImageDetails({
|
||||||
controller: this,
|
controller: this,
|
||||||
model: this.state().image,
|
model: this.state().image,
|
||||||
attachment: this.state().image.attachment
|
attachment: this.state().image.attachment
|
||||||
@ -93,7 +87,7 @@ ImageDetails = Select.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
view = new EditImageView( { model: model, controller: this } ).render();
|
view = new wp.media.view.EditImage( { model: model, controller: this } ).render();
|
||||||
|
|
||||||
this.content.set( view );
|
this.content.set( view );
|
||||||
|
|
||||||
@ -103,7 +97,7 @@ ImageDetails = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
renderImageDetailsToolbar: function() {
|
renderImageDetailsToolbar: function() {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
select: {
|
select: {
|
||||||
@ -135,7 +129,7 @@ ImageDetails = Select.extend({
|
|||||||
lastState = frame.lastState(),
|
lastState = frame.lastState(),
|
||||||
previous = lastState && lastState.id;
|
previous = lastState && lastState.id;
|
||||||
|
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
back: {
|
back: {
|
||||||
|
@ -16,12 +16,8 @@
|
|||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var MediaFrame = wp.media.view.MediaFrame,
|
var MediaFrame = wp.media.view.MediaFrame,
|
||||||
UploaderWindow = wp.media.view.UploaderWindow,
|
|
||||||
AttachmentsBrowser = wp.media.view.AttachmentsBrowser,
|
|
||||||
Library = wp.media.controller.Library,
|
Library = wp.media.controller.Library,
|
||||||
|
|
||||||
Router = require( '../../routers/manage.js' ),
|
|
||||||
|
|
||||||
$ = Backbone.$,
|
$ = Backbone.$,
|
||||||
Manage;
|
Manage;
|
||||||
|
|
||||||
@ -58,7 +54,7 @@ Manage = MediaFrame.extend({
|
|||||||
|
|
||||||
// Initialize a window-wide uploader.
|
// Initialize a window-wide uploader.
|
||||||
if ( this.options.uploader ) {
|
if ( this.options.uploader ) {
|
||||||
this.uploader = new UploaderWindow({
|
this.uploader = new wp.media.view.UploaderWindow({
|
||||||
controller: this,
|
controller: this,
|
||||||
uploader: {
|
uploader: {
|
||||||
dropzone: document.body,
|
dropzone: document.body,
|
||||||
@ -71,7 +67,7 @@ Manage = MediaFrame.extend({
|
|||||||
this.options.uploader = false;
|
this.options.uploader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gridRouter = new Router();
|
this.gridRouter = new wp.media.view.MediaFrame.Manage.Router();
|
||||||
|
|
||||||
// Call 'initialize' directly on the parent class.
|
// Call 'initialize' directly on the parent class.
|
||||||
MediaFrame.prototype.initialize.apply( this, arguments );
|
MediaFrame.prototype.initialize.apply( this, arguments );
|
||||||
@ -221,7 +217,7 @@ Manage = MediaFrame.extend({
|
|||||||
var state = this.state();
|
var state = this.state();
|
||||||
|
|
||||||
// Browse our library of attachments.
|
// Browse our library of attachments.
|
||||||
this.browserView = contentRegion.view = new AttachmentsBrowser({
|
this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({
|
||||||
controller: this,
|
controller: this,
|
||||||
collection: state.get('library'),
|
collection: state.get('library'),
|
||||||
selection: state.get('selection'),
|
selection: state.get('selection'),
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var View = wp.media.View,
|
var Select = wp.media.view.MediaFrame.Select,
|
||||||
Toolbar = wp.media.view.Toolbar,
|
|
||||||
Select = wp.media.view.MediaFrame.Select,
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
MediaDetails;
|
MediaDetails;
|
||||||
|
|
||||||
@ -77,7 +75,7 @@ MediaDetails = Select.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separateCancel: new View({
|
separateCancel: new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 40
|
priority: 40
|
||||||
})
|
})
|
||||||
@ -86,7 +84,7 @@ MediaDetails = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setPrimaryButton: function(text, handler) {
|
setPrimaryButton: function(text, handler) {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
button: {
|
button: {
|
||||||
|
@ -14,24 +14,8 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var Select = wp.media.view.MediaFrame.Select,
|
||||||
Select = require( './select.js' ),
|
Library = wp.media.controller.Library,
|
||||||
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' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
Post;
|
Post;
|
||||||
|
|
||||||
@ -105,18 +89,18 @@ Post = Select.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// Embed states.
|
// 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.
|
// Gallery states.
|
||||||
new GalleryEditController({
|
new wp.media.controller.GalleryEdit({
|
||||||
library: options.selection,
|
library: options.selection,
|
||||||
editing: options.editing,
|
editing: options.editing,
|
||||||
menu: 'gallery'
|
menu: 'gallery'
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new GalleryAddController(),
|
new wp.media.controller.GalleryAdd(),
|
||||||
|
|
||||||
new Library({
|
new Library({
|
||||||
id: 'playlist',
|
id: 'playlist',
|
||||||
@ -133,11 +117,11 @@ Post = Select.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// Playlist states.
|
// Playlist states.
|
||||||
new CollectionEditController({
|
new wp.media.controller.CollectionEdit({
|
||||||
type: 'audio',
|
type: 'audio',
|
||||||
collectionType: 'playlist',
|
collectionType: 'playlist',
|
||||||
title: l10n.editPlaylistTitle,
|
title: l10n.editPlaylistTitle,
|
||||||
SettingsView: PlaylistSettings,
|
SettingsView: wp.media.view.Settings.Playlist,
|
||||||
library: options.selection,
|
library: options.selection,
|
||||||
editing: options.editing,
|
editing: options.editing,
|
||||||
menu: 'playlist',
|
menu: 'playlist',
|
||||||
@ -145,7 +129,7 @@ Post = Select.extend({
|
|||||||
dragInfo: false
|
dragInfo: false
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new CollectionAddController({
|
new wp.media.controller.CollectionAdd({
|
||||||
type: 'audio',
|
type: 'audio',
|
||||||
collectionType: 'playlist',
|
collectionType: 'playlist',
|
||||||
title: l10n.addToPlaylistTitle
|
title: l10n.addToPlaylistTitle
|
||||||
@ -165,11 +149,11 @@ Post = Select.extend({
|
|||||||
}, options.library ) )
|
}, options.library ) )
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new CollectionEditController({
|
new wp.media.controller.CollectionEdit({
|
||||||
type: 'video',
|
type: 'video',
|
||||||
collectionType: 'playlist',
|
collectionType: 'playlist',
|
||||||
title: l10n.editVideoPlaylistTitle,
|
title: l10n.editVideoPlaylistTitle,
|
||||||
SettingsView: PlaylistSettings,
|
SettingsView: wp.media.view.Settings.Playlist,
|
||||||
library: options.selection,
|
library: options.selection,
|
||||||
editing: options.editing,
|
editing: options.editing,
|
||||||
menu: 'video-playlist',
|
menu: 'video-playlist',
|
||||||
@ -177,7 +161,7 @@ Post = Select.extend({
|
|||||||
dragInfo: false
|
dragInfo: false
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new CollectionAddController({
|
new wp.media.controller.CollectionAdd({
|
||||||
type: 'video',
|
type: 'video',
|
||||||
collectionType: 'playlist',
|
collectionType: 'playlist',
|
||||||
title: l10n.addToVideoPlaylistTitle
|
title: l10n.addToVideoPlaylistTitle
|
||||||
@ -185,7 +169,7 @@ Post = Select.extend({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if ( wp.media.view.settings.post.featuredImageId ) {
|
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 ) {
|
mainMenu: function( view ) {
|
||||||
view.set({
|
view.set({
|
||||||
'library-separator': new View({
|
'library-separator': new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 100
|
priority: 100
|
||||||
})
|
})
|
||||||
@ -311,7 +295,7 @@ Post = Select.extend({
|
|||||||
this.controller.modal.focusManager.focus();
|
this.controller.modal.focusManager.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separateCancel: new View({
|
separateCancel: new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 40
|
priority: 40
|
||||||
})
|
})
|
||||||
@ -335,7 +319,7 @@ Post = Select.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separateCancel: new View({
|
separateCancel: new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 40
|
priority: 40
|
||||||
})
|
})
|
||||||
@ -359,7 +343,7 @@ Post = Select.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separateCancel: new View({
|
separateCancel: new wp.media.View({
|
||||||
className: 'separator',
|
className: 'separator',
|
||||||
priority: 40
|
priority: 40
|
||||||
})
|
})
|
||||||
@ -368,7 +352,7 @@ Post = Select.extend({
|
|||||||
|
|
||||||
// Content
|
// Content
|
||||||
embedContent: function() {
|
embedContent: function() {
|
||||||
var view = new Embed({
|
var view = new wp.media.view.Embed({
|
||||||
controller: this,
|
controller: this,
|
||||||
model: this.state()
|
model: this.state()
|
||||||
}).render();
|
}).render();
|
||||||
@ -385,7 +369,7 @@ Post = Select.extend({
|
|||||||
selection = state.get('selection'),
|
selection = state.get('selection'),
|
||||||
view;
|
view;
|
||||||
|
|
||||||
view = new AttachmentsBrowser({
|
view = new wp.media.view.AttachmentsBrowser({
|
||||||
controller: this,
|
controller: this,
|
||||||
collection: selection,
|
collection: selection,
|
||||||
selection: selection,
|
selection: selection,
|
||||||
@ -395,7 +379,7 @@ Post = Select.extend({
|
|||||||
date: false,
|
date: false,
|
||||||
dragInfo: true,
|
dragInfo: true,
|
||||||
|
|
||||||
AttachmentView: EditSelection
|
AttachmentView: wp.media.view.Attachments.EditSelection
|
||||||
}).render();
|
}).render();
|
||||||
|
|
||||||
view.toolbar.set( 'backToLibrary', {
|
view.toolbar.set( 'backToLibrary', {
|
||||||
@ -416,7 +400,7 @@ Post = Select.extend({
|
|||||||
|
|
||||||
editImageContent: function() {
|
editImageContent: function() {
|
||||||
var image = this.state().get('image'),
|
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 );
|
this.content.set( view );
|
||||||
|
|
||||||
@ -433,7 +417,7 @@ Post = Select.extend({
|
|||||||
selectionStatusToolbar: function( view ) {
|
selectionStatusToolbar: function( view ) {
|
||||||
var editable = this.state().get('editable');
|
var editable = this.state().get('editable');
|
||||||
|
|
||||||
view.set( 'selection', new SelectionView({
|
view.set( 'selection', new wp.media.view.Selection({
|
||||||
controller: this,
|
controller: this,
|
||||||
collection: this.state().get('selection'),
|
collection: this.state().get('selection'),
|
||||||
priority: -40,
|
priority: -40,
|
||||||
@ -574,14 +558,14 @@ Post = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mainEmbedToolbar: function( toolbar ) {
|
mainEmbedToolbar: function( toolbar ) {
|
||||||
toolbar.view = new ToolbarEmbed({
|
toolbar.view = new wp.media.view.Toolbar.Embed({
|
||||||
controller: this
|
controller: this
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
galleryEditToolbar: function() {
|
galleryEditToolbar: function() {
|
||||||
var editing = this.state().get('editing');
|
var editing = this.state().get('editing');
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
@ -610,7 +594,7 @@ Post = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
galleryAddToolbar: function() {
|
galleryAddToolbar: function() {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
@ -638,7 +622,7 @@ Post = Select.extend({
|
|||||||
|
|
||||||
playlistEditToolbar: function() {
|
playlistEditToolbar: function() {
|
||||||
var editing = this.state().get('editing');
|
var editing = this.state().get('editing');
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
@ -667,7 +651,7 @@ Post = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
playlistAddToolbar: function() {
|
playlistAddToolbar: function() {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
@ -695,7 +679,7 @@ Post = Select.extend({
|
|||||||
|
|
||||||
videoPlaylistEditToolbar: function() {
|
videoPlaylistEditToolbar: function() {
|
||||||
var editing = this.state().get('editing');
|
var editing = this.state().get('editing');
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
@ -724,7 +708,7 @@ Post = Select.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
videoPlaylistAddToolbar: function() {
|
videoPlaylistAddToolbar: function() {
|
||||||
this.toolbar.set( new Toolbar({
|
this.toolbar.set( new wp.media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
items: {
|
items: {
|
||||||
insert: {
|
insert: {
|
||||||
|
@ -14,11 +14,7 @@
|
|||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var MediaFrame = require( '../media-frame.js' ),
|
var MediaFrame = wp.media.view.MediaFrame,
|
||||||
Library = require( '../../controllers/library.js' ),
|
|
||||||
AttachmentsBrowser = require( '../attachments/browser.js' ),
|
|
||||||
UploaderInline = require( '../uploader/inline.js' ),
|
|
||||||
ToolbarSelect = require( '../toolbar/select.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
Select;
|
Select;
|
||||||
|
|
||||||
@ -76,7 +72,7 @@ Select = MediaFrame.extend({
|
|||||||
// Add the default states.
|
// Add the default states.
|
||||||
this.states.add([
|
this.states.add([
|
||||||
// Main states.
|
// Main states.
|
||||||
new Library({
|
new wp.media.controller.Library({
|
||||||
library: wp.media.query( options.library ),
|
library: wp.media.query( options.library ),
|
||||||
multiple: options.multiple,
|
multiple: options.multiple,
|
||||||
title: options.title,
|
title: options.title,
|
||||||
@ -127,7 +123,7 @@ Select = MediaFrame.extend({
|
|||||||
this.$el.removeClass('hide-toolbar');
|
this.$el.removeClass('hide-toolbar');
|
||||||
|
|
||||||
// Browse our library of attachments.
|
// Browse our library of attachments.
|
||||||
contentRegion.view = new AttachmentsBrowser({
|
contentRegion.view = new wp.media.view.AttachmentsBrowser({
|
||||||
controller: this,
|
controller: this,
|
||||||
collection: state.get('library'),
|
collection: state.get('library'),
|
||||||
selection: state.get('selection'),
|
selection: state.get('selection'),
|
||||||
@ -151,7 +147,7 @@ Select = MediaFrame.extend({
|
|||||||
*/
|
*/
|
||||||
uploadContent: function() {
|
uploadContent: function() {
|
||||||
this.$el.removeClass( 'hide-toolbar' );
|
this.$el.removeClass( 'hide-toolbar' );
|
||||||
this.content.set( new UploaderInline({
|
this.content.set( new wp.media.view.UploaderInline({
|
||||||
controller: this
|
controller: this
|
||||||
}) );
|
}) );
|
||||||
},
|
},
|
||||||
@ -167,7 +163,7 @@ Select = MediaFrame.extend({
|
|||||||
options = options || this.options.button || {};
|
options = options || this.options.button || {};
|
||||||
options.controller = this;
|
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,
|
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||||
VideoDetailsView = require( '../video-details.js' ),
|
|
||||||
VideoDetailsController = require( '../../controllers/video-details.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
VideoDetails;
|
VideoDetails;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ VideoDetails = MediaDetails.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
initialize: function( options ) {
|
initialize: function( options ) {
|
||||||
options.DetailsView = VideoDetailsView;
|
options.DetailsView = wp.media.view.VideoDetails;
|
||||||
options.cancelText = l10n.videoDetailsCancel;
|
options.cancelText = l10n.videoDetailsCancel;
|
||||||
options.addText = l10n.videoAddSourceTitle;
|
options.addText = l10n.videoAddSourceTitle;
|
||||||
|
|
||||||
@ -51,7 +49,7 @@ VideoDetails = MediaDetails.extend({
|
|||||||
|
|
||||||
createStates: function() {
|
createStates: function() {
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new VideoDetailsController({
|
new wp.media.controller.VideoDetails({
|
||||||
media: this.media
|
media: this.media
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Iframe = wp.media.View.extend({
|
||||||
Iframe;
|
|
||||||
|
|
||||||
Iframe = View.extend({
|
|
||||||
className: 'media-iframe',
|
className: 'media-iframe',
|
||||||
/**
|
/**
|
||||||
* @returns {wp.media.view.Iframe} Returns itself to allow chaining
|
* @returns {wp.media.view.Iframe} Returns itself to allow chaining
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var AttachmentDisplay = require( './settings/attachment-display.js' ),
|
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
ImageDetails;
|
ImageDetails;
|
||||||
|
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Label = wp.media.View.extend({
|
||||||
Label;
|
|
||||||
|
|
||||||
Label = View.extend({
|
|
||||||
tagName: 'label',
|
tagName: 'label',
|
||||||
className: 'screen-reader-text',
|
className: 'screen-reader-text',
|
||||||
|
|
||||||
|
@ -12,14 +12,7 @@
|
|||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
* @mixes wp.media.controller.StateMachine
|
* @mixes wp.media.controller.StateMachine
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Frame = wp.media.view.Frame,
|
||||||
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' ),
|
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
MediaFrame;
|
MediaFrame;
|
||||||
|
|
||||||
@ -49,7 +42,7 @@ MediaFrame = Frame.extend({
|
|||||||
|
|
||||||
// Initialize modal container view.
|
// Initialize modal container view.
|
||||||
if ( this.options.modal ) {
|
if ( this.options.modal ) {
|
||||||
this.modal = new Modal({
|
this.modal = new wp.media.view.Modal({
|
||||||
controller: this,
|
controller: this,
|
||||||
title: this.options.title
|
title: this.options.title
|
||||||
});
|
});
|
||||||
@ -65,7 +58,7 @@ MediaFrame = Frame.extend({
|
|||||||
|
|
||||||
// Initialize window-wide uploader.
|
// Initialize window-wide uploader.
|
||||||
if ( this.options.uploader ) {
|
if ( this.options.uploader ) {
|
||||||
this.uploader = new UploaderWindow({
|
this.uploader = new wp.media.view.UploaderWindow({
|
||||||
controller: this,
|
controller: this,
|
||||||
uploader: {
|
uploader: {
|
||||||
dropzone: this.modal ? this.modal.$el : this.$el,
|
dropzone: this.modal ? this.modal.$el : this.$el,
|
||||||
@ -106,7 +99,7 @@ MediaFrame = Frame.extend({
|
|||||||
* @this wp.media.controller.Region
|
* @this wp.media.controller.Region
|
||||||
*/
|
*/
|
||||||
createTitle: function( title ) {
|
createTitle: function( title ) {
|
||||||
title.view = new View({
|
title.view = new wp.media.View({
|
||||||
controller: this,
|
controller: this,
|
||||||
tagName: 'h1'
|
tagName: 'h1'
|
||||||
});
|
});
|
||||||
@ -116,7 +109,7 @@ MediaFrame = Frame.extend({
|
|||||||
* @this wp.media.controller.Region
|
* @this wp.media.controller.Region
|
||||||
*/
|
*/
|
||||||
createMenu: function( menu ) {
|
createMenu: function( menu ) {
|
||||||
menu.view = new Menu({
|
menu.view = new wp.media.view.Menu({
|
||||||
controller: this
|
controller: this
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -130,7 +123,7 @@ MediaFrame = Frame.extend({
|
|||||||
* @this wp.media.controller.Region
|
* @this wp.media.controller.Region
|
||||||
*/
|
*/
|
||||||
createToolbar: function( toolbar ) {
|
createToolbar: function( toolbar ) {
|
||||||
toolbar.view = new Toolbar({
|
toolbar.view = new wp.media.view.Toolbar({
|
||||||
controller: this
|
controller: this
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -139,7 +132,7 @@ MediaFrame = Frame.extend({
|
|||||||
* @this wp.media.controller.Region
|
* @this wp.media.controller.Region
|
||||||
*/
|
*/
|
||||||
createRouter: function( router ) {
|
createRouter: function( router ) {
|
||||||
router.view = new Router({
|
router.view = new wp.media.view.Router({
|
||||||
controller: this
|
controller: this
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -186,7 +179,7 @@ MediaFrame = Frame.extend({
|
|||||||
*/
|
*/
|
||||||
iframeContent: function( content ) {
|
iframeContent: function( content ) {
|
||||||
this.$el.addClass('hide-toolbar');
|
this.$el.addClass('hide-toolbar');
|
||||||
content.view = new Iframe({
|
content.view = new wp.media.view.Iframe({
|
||||||
controller: this
|
controller: this
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -8,11 +8,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var $ = jQuery,
|
||||||
$ = jQuery,
|
|
||||||
MenuItem;
|
MenuItem;
|
||||||
|
|
||||||
MenuItem = View.extend({
|
MenuItem = wp.media.View.extend({
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
className: 'media-menu-item',
|
className: 'media-menu-item',
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MenuItem = require( './menu-item.js' ),
|
var MenuItem = wp.media.view.MenuItem,
|
||||||
PriorityList = require( './priority-list.js' ),
|
PriorityList = wp.media.view.PriorityList,
|
||||||
Menu;
|
Menu;
|
||||||
|
|
||||||
Menu = PriorityList.extend({
|
Menu = PriorityList.extend({
|
||||||
|
@ -10,12 +10,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var $ = jQuery,
|
||||||
FocusManager = require( './focus-manager.js' ),
|
|
||||||
$ = jQuery,
|
|
||||||
Modal;
|
Modal;
|
||||||
|
|
||||||
Modal = View.extend({
|
Modal = wp.media.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
template: wp.template('media-modal'),
|
template: wp.template('media-modal'),
|
||||||
|
|
||||||
@ -36,7 +34,7 @@ Modal = View.extend({
|
|||||||
freeze: true
|
freeze: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.focusManager = new FocusManager({
|
this.focusManager = new wp.media.view.FocusManager({
|
||||||
el: this.el
|
el: this.el
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -8,10 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var PriorityList = wp.media.View.extend({
|
||||||
PriorityList;
|
|
||||||
|
|
||||||
PriorityList = View.extend({
|
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
@ -93,7 +90,7 @@ PriorityList = View.extend({
|
|||||||
* @returns {wp.media.View}
|
* @returns {wp.media.View}
|
||||||
*/
|
*/
|
||||||
toView: function( options ) {
|
toView: function( options ) {
|
||||||
return new View( options );
|
return new wp.media.View( options );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7,10 +7,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MenuItem = require( './menu-item.js' ),
|
var RouterItem = wp.media.view.MenuItem.extend({
|
||||||
RouterItem;
|
|
||||||
|
|
||||||
RouterItem = MenuItem.extend({
|
|
||||||
/**
|
/**
|
||||||
* On click handler to activate the content region's corresponding mode.
|
* On click handler to activate the content region's corresponding mode.
|
||||||
*/
|
*/
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/*globals wp */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wp.media.view.Router
|
* wp.media.view.Router
|
||||||
*
|
*
|
||||||
@ -8,15 +10,14 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Menu = require( './menu.js' ),
|
var Menu = wp.media.view.Menu,
|
||||||
RouterItem = require( './router-item.js' ),
|
|
||||||
Router;
|
Router;
|
||||||
|
|
||||||
Router = Menu.extend({
|
Router = Menu.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
className: 'media-router',
|
className: 'media-router',
|
||||||
property: 'contentMode',
|
property: 'contentMode',
|
||||||
ItemView: RouterItem,
|
ItemView: wp.media.view.RouterItem,
|
||||||
region: 'router',
|
region: 'router',
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
@ -8,11 +8,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
Search;
|
Search;
|
||||||
|
|
||||||
Search = View.extend({
|
Search = wp.media.View.extend({
|
||||||
tagName: 'input',
|
tagName: 'input',
|
||||||
className: 'search',
|
className: 'search',
|
||||||
id: 'media-search-input',
|
id: 'media-search-input',
|
||||||
|
@ -8,12 +8,10 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var l10n = wp.media.view.l10n,
|
||||||
AttachmentsSelection = require( './attachments/selection.js' ),
|
|
||||||
l10n = wp.media.view.l10n,
|
|
||||||
Selection;
|
Selection;
|
||||||
|
|
||||||
Selection = View.extend({
|
Selection = wp.media.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
className: 'media-selection',
|
className: 'media-selection',
|
||||||
template: wp.template('media-selection'),
|
template: wp.template('media-selection'),
|
||||||
@ -32,7 +30,7 @@ Selection = View.extend({
|
|||||||
/**
|
/**
|
||||||
* @member {wp.media.view.Attachments.Selection}
|
* @member {wp.media.view.Attachments.Selection}
|
||||||
*/
|
*/
|
||||||
this.attachments = new AttachmentsSelection({
|
this.attachments = new wp.media.view.Attachments.Selection({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
selection: this.collection,
|
selection: this.collection,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
$ = Backbone.$,
|
$ = Backbone.$,
|
||||||
Settings;
|
Settings;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Settings = require( '../settings.js' ),
|
var Settings = wp.media.view.Settings,
|
||||||
AttachmentDisplay;
|
AttachmentDisplay;
|
||||||
|
|
||||||
AttachmentDisplay = Settings.extend({
|
AttachmentDisplay = Settings.extend({
|
||||||
|
@ -9,10 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Settings = require( '../settings.js' ),
|
var Gallery = wp.media.view.Settings.extend({
|
||||||
Gallery;
|
|
||||||
|
|
||||||
Gallery = Settings.extend({
|
|
||||||
className: 'collection-settings gallery-settings',
|
className: 'collection-settings gallery-settings',
|
||||||
template: wp.template('gallery-settings')
|
template: wp.template('gallery-settings')
|
||||||
});
|
});
|
||||||
|
@ -9,10 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Settings = require( '../settings.js' ),
|
var Playlist = wp.media.view.Settings.extend({
|
||||||
Playlist;
|
|
||||||
|
|
||||||
Playlist = Settings.extend({
|
|
||||||
className: 'collection-settings playlist-settings',
|
className: 'collection-settings playlist-settings',
|
||||||
template: wp.template('playlist-settings')
|
template: wp.template('playlist-settings')
|
||||||
});
|
});
|
||||||
|
@ -7,10 +7,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var PriorityList = require( './priority-list.js' ),
|
var Sidebar = wp.media.view.PriorityList.extend({
|
||||||
Sidebar;
|
|
||||||
|
|
||||||
Sidebar = PriorityList.extend({
|
|
||||||
className: 'media-sidebar'
|
className: 'media-sidebar'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,10 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var Spinner = wp.media.View.extend({
|
||||||
Spinner;
|
|
||||||
|
|
||||||
Spinner = View.extend({
|
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
className: 'spinner',
|
className: 'spinner',
|
||||||
spinnerTimeout: false,
|
spinnerTimeout: false,
|
||||||
|
@ -11,9 +11,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( './view.js' ),
|
var View = wp.media.View,
|
||||||
Button = require( './button.js' ),
|
|
||||||
PriorityList = require( './priority-list.js' ),
|
|
||||||
Toolbar;
|
Toolbar;
|
||||||
|
|
||||||
Toolbar = View.extend({
|
Toolbar = View.extend({
|
||||||
@ -28,8 +26,8 @@ Toolbar = View.extend({
|
|||||||
this._views = {};
|
this._views = {};
|
||||||
|
|
||||||
// The toolbar is composed of two `PriorityList` views.
|
// The toolbar is composed of two `PriorityList` views.
|
||||||
this.primary = new PriorityList();
|
this.primary = new wp.media.view.PriorityList();
|
||||||
this.secondary = new PriorityList();
|
this.secondary = new wp.media.view.PriorityList();
|
||||||
this.primary.$el.addClass('media-toolbar-primary search-form');
|
this.primary.$el.addClass('media-toolbar-primary search-form');
|
||||||
this.secondary.$el.addClass('media-toolbar-secondary');
|
this.secondary.$el.addClass('media-toolbar-secondary');
|
||||||
|
|
||||||
@ -91,7 +89,7 @@ Toolbar = View.extend({
|
|||||||
} else {
|
} else {
|
||||||
if ( ! ( view instanceof Backbone.View ) ) {
|
if ( ! ( view instanceof Backbone.View ) ) {
|
||||||
view.classes = [ 'media-button-' + id ].concat( view.classes || [] );
|
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;
|
view.controller = view.controller || this.controller;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Select = require( './select.js' ),
|
var Select = wp.media.view.Toolbar.Select,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
Embed;
|
Embed;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var Toolbar = require( '../toolbar.js' ),
|
var Toolbar = wp.media.view.Toolbar,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
Select;
|
Select;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var View = wp.media.View,
|
||||||
l10n = wp.media.view.l10n,
|
l10n = wp.media.view.l10n,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
EditorUploader;
|
EditorUploader;
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var View = wp.media.View,
|
||||||
UploaderStatus = require( './status.js' ),
|
|
||||||
UploaderInline;
|
UploaderInline;
|
||||||
|
|
||||||
UploaderInline = View.extend({
|
UploaderInline = View.extend({
|
||||||
@ -39,7 +38,7 @@ UploaderInline = View.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( this.options.status ) {
|
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
|
controller: this.controller
|
||||||
}) );
|
}) );
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var UploaderStatusError = wp.media.View.extend({
|
||||||
UploaderStatusError;
|
|
||||||
|
|
||||||
UploaderStatusError = View.extend({
|
|
||||||
className: 'upload-error',
|
className: 'upload-error',
|
||||||
template: wp.template('uploader-status-error')
|
template: wp.template('uploader-status-error')
|
||||||
});
|
});
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var View = wp.media.View,
|
||||||
UploaderStatusError = require( './status-error.js' ),
|
|
||||||
UploaderStatus;
|
UploaderStatus;
|
||||||
|
|
||||||
UploaderStatus = View.extend({
|
UploaderStatus = View.extend({
|
||||||
@ -113,7 +112,7 @@ UploaderStatus = View.extend({
|
|||||||
* @param {Backbone.Model} error
|
* @param {Backbone.Model} error
|
||||||
*/
|
*/
|
||||||
error: function( 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 ),
|
filename: this.filename( error.get('file').name ),
|
||||||
message: error.get('message')
|
message: error.get('message')
|
||||||
}), { at: 0 });
|
}), { at: 0 });
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
* @param {jQuery} [options.uploader.dropzone] jQuery collection of the dropzone.
|
* @param {jQuery} [options.uploader.dropzone] jQuery collection of the dropzone.
|
||||||
* @param {object} [options.uploader.params]
|
* @param {object} [options.uploader.params]
|
||||||
*/
|
*/
|
||||||
var View = require( '../view.js' ),
|
var $ = jQuery,
|
||||||
$ = jQuery,
|
|
||||||
UploaderWindow;
|
UploaderWindow;
|
||||||
|
|
||||||
UploaderWindow = View.extend({
|
UploaderWindow = wp.media.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
className: 'uploader-window',
|
className: 'uploader-window',
|
||||||
template: wp.template('uploader-window'),
|
template: wp.template('uploader-window'),
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
* @augments Backbone.View
|
* @augments Backbone.View
|
||||||
*/
|
*/
|
||||||
var MediaDetails = require( './media-details' ),
|
var MediaDetails = wp.media.view.MediaDetails,
|
||||||
VideoDetails;
|
VideoDetails;
|
||||||
|
|
||||||
VideoDetails = MediaDetails.extend({
|
VideoDetails = MediaDetails.extend({
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user