Docs: JSDoc improvements for namespaces.

Improve JS parsing of our inline JSDocs by introducing `@namespace`, `@lends` and `@memberOf`. Helps set the way for showing our JavaScript documentation on developer.wordpress.org, see https://meta.trac.wordpress.org/ticket/3063.

* Define all used namespaces using @namespace.
* Correctly specify in which namespace each class is using @memberOf.
* Define each usage of the extend function as a prototype assignment using @lends.
* Some comment blocks were moved to correct the parsing of certain definitions. 

Props herregroen, atimmer, netweb, SergeyBiryukov.  
Fixes #41682.


git-svn-id: https://develop.svn.wordpress.org/trunk@41351 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein 2017-09-08 18:41:20 +00:00
parent 357532ab64
commit 6e7053a6df
126 changed files with 1511 additions and 892 deletions

View File

@ -435,6 +435,14 @@ module.exports = function(grunt) {
} }
} }
}, },
jsdoc : {
dist : {
dest: 'jsdoc',
options: {
configure : 'jsdoc.conf.json'
}
}
},
qunit: { qunit: {
files: [ files: [
'tests/qunit/**/*.html', 'tests/qunit/**/*.html',

View File

@ -27,6 +27,7 @@
"grunt-contrib-uglify": "~2.0.0", "grunt-contrib-uglify": "~2.0.0",
"grunt-contrib-watch": "~1.0.0", "grunt-contrib-watch": "~1.0.0",
"grunt-includes": "~0.5.1", "grunt-includes": "~0.5.1",
"grunt-jsdoc": "^2.1.0",
"grunt-jsvalidate": "~0.2.2", "grunt-jsvalidate": "~0.2.2",
"grunt-legacy-util": "^0.2.0", "grunt-legacy-util": "^0.2.0",
"grunt-patch-wordpress": "~0.4.2", "grunt-patch-wordpress": "~0.4.2",
@ -34,6 +35,7 @@
"grunt-replace": "~1.0.1", "grunt-replace": "~1.0.1",
"grunt-rtlcss": "~2.0.1", "grunt-rtlcss": "~2.0.1",
"grunt-sass": "~1.2.1", "grunt-sass": "~1.2.1",
"ink-docstrap": "^1.3.0",
"matchdep": "~1.0.0" "matchdep": "~1.0.0"
} }
} }

View File

@ -8,7 +8,6 @@
* - Sends the REST API nonce as a request header. * - Sends the REST API nonce as a request header.
* - Allows specifying only an endpoint namespace/path instead of a full URL. * - Allows specifying only an endpoint namespace/path instead of a full URL.
* *
* @namespace wp.apiRequest
* @since 4.9.0 * @since 4.9.0
*/ */
@ -82,6 +81,7 @@
apiRequest.transport = $.ajax; apiRequest.transport = $.ajax;
/** @namespace wp */
window.wp = window.wp || {}; window.wp = window.wp || {};
window.wp.apiRequest = apiRequest; window.wp.apiRequest = apiRequest;
} )( jQuery ); } )( jQuery );

View File

@ -850,6 +850,7 @@ window.autosave = function() {
}; };
} }
/** @namespace wp */
window.wp = window.wp || {}; window.wp = window.wp || {};
window.wp.autosave = autosave(); window.wp.autosave = autosave();

View File

@ -1,3 +1,4 @@
/** @namespace wp */
window.wp = window.wp || {}; window.wp = window.wp || {};
(function( exports, $ ){ (function( exports, $ ){
@ -165,9 +166,12 @@ window.wp = window.wp || {};
/** /**
* Observable values that support two-way binding. * Observable values that support two-way binding.
* *
* @memberOf wp.customize
* @alias wp.customize.Value
*
* @constructor * @constructor
*/ */
api.Value = api.Class.extend({ api.Value = api.Class.extend(/** @lends wp.customize.Value.prototype */{
/** /**
* @param {mixed} initial The initial value. * @param {mixed} initial The initial value.
* @param {object} options * @param {object} options
@ -304,11 +308,14 @@ window.wp = window.wp || {};
/** /**
* A collection of observable values. * A collection of observable values.
* *
* @memberOf wp.customize
* @alias wp.customize.Values
*
* @constructor * @constructor
* @augments wp.customize.Class * @augments wp.customize.Class
* @mixes wp.customize.Events * @mixes wp.customize.Events
*/ */
api.Values = api.Class.extend({ api.Values = api.Class.extend(/** @lends wp.customize.Values.prototype */{
/** /**
* The default constructor for items of the collection. * The default constructor for items of the collection.
@ -520,11 +527,14 @@ window.wp = window.wp || {};
* *
* Handles inputs, selects, and textareas by default. * Handles inputs, selects, and textareas by default.
* *
* @memberOf wp.customize
* @alias wp.customize.Element
*
* @constructor * @constructor
* @augments wp.customize.Value * @augments wp.customize.Value
* @augments wp.customize.Class * @augments wp.customize.Class
*/ */
api.Element = api.Value.extend({ api.Element = api.Value.extend(/** @lends wp.customize.Element */{
initialize: function( element, options ) { initialize: function( element, options ) {
var self = this, var self = this,
synchronizer = api.Element.synchronizer.html, synchronizer = api.Element.synchronizer.html,
@ -617,11 +627,14 @@ window.wp = window.wp || {};
/** /**
* A communicator for sending data from one window to another over postMessage. * A communicator for sending data from one window to another over postMessage.
* *
* @memberOf wp.customize
* @alias wp.customize.Messenger
*
* @constructor * @constructor
* @augments wp.customize.Class * @augments wp.customize.Class
* @mixes wp.customize.Events * @mixes wp.customize.Events
*/ */
api.Messenger = api.Class.extend({ api.Messenger = api.Class.extend(/** @lends wp.customize.Messenger.prototype */{
/** /**
* Create a new Value. * Create a new Value.
* *
@ -765,6 +778,9 @@ window.wp = window.wp || {};
* @augments wp.customize.Class * @augments wp.customize.Class
* @since 4.6.0 * @since 4.6.0
* *
* @memberOf wp.customize
* @alias wp.customize.Notification
*
* @param {string} code - The error code. * @param {string} code - The error code.
* @param {object} params - Params. * @param {object} params - Params.
* @param {string} params.message=null - The error message. * @param {string} params.message=null - The error message.
@ -773,7 +789,7 @@ window.wp = window.wp || {};
* @param {string} [params.setting=null] - The setting ID that the notification is related to. * @param {string} [params.setting=null] - The setting ID that the notification is related to.
* @param {*} [params.data=null] - Any additional data. * @param {*} [params.data=null] - Any additional data.
*/ */
api.Notification = api.Class.extend({ api.Notification = api.Class.extend(/** @lends wp.customize.Notification.prototype */{
initialize: function( code, params ) { initialize: function( code, params ) {
var _params; var _params;
this.code = code; this.code = code;
@ -798,6 +814,8 @@ window.wp = window.wp || {};
/** /**
* Get all customize settings. * Get all customize settings.
* *
* @memberOf wp.customize
*
* @return {object} * @return {object}
*/ */
api.get = function() { api.get = function() {
@ -812,6 +830,8 @@ window.wp = window.wp || {};
/** /**
* Utility function namespace * Utility function namespace
*
* @namespace wp.customize.utils
*/ */
api.utils = {}; api.utils = {};
@ -820,6 +840,7 @@ window.wp = window.wp || {};
* *
* @since 4.7.0 * @since 4.7.0
* @access public * @access public
* @memberOf wp.customize.utils
* *
* @param {string} queryString Query string. * @param {string} queryString Query string.
* @returns {object} Parsed query string. * @returns {object} Parsed query string.
@ -844,6 +865,10 @@ window.wp = window.wp || {};
return queryParams; return queryParams;
}; };
// Expose the API publicly on window.wp.customize /**
* Expose the API publicly on window.wp.customize
*
* @namespace wp.customize
*/
exports.customize = api; exports.customize = api;
})( wp, jQuery ); })( wp, jQuery );

View File

@ -1,7 +1,9 @@
/* global _wpCustomizeLoaderSettings, confirm */ /* global _wpCustomizeLoaderSettings, confirm */
/* /**
* Expose a public API that allows the customizer to be * Expose a public API that allows the customizer to be
* loaded on any page. * loaded on any page.
*
* @namespace wp
*/ */
window.wp = window.wp || {}; window.wp = window.wp || {};
@ -22,9 +24,12 @@ window.wp = window.wp || {};
* *
* e.g. <a class="load-customize" href="<?php echo wp_customize_url(); ?>">Open Customizer</a> * e.g. <a class="load-customize" href="<?php echo wp_customize_url(); ?>">Open Customizer</a>
* *
* @memberOf wp.customize
*
* @class
* @augments wp.customize.Events * @augments wp.customize.Events
*/ */
Loader = $.extend( {}, api.Events, { Loader = $.extend( {}, api.Events,/** @lends wp.customize.Loader.prototype */{
/** /**
* Setup the Loader; triggered on document#ready. * Setup the Loader; triggered on document#ready.
*/ */

View File

@ -1,6 +1,7 @@
/* global _wpCustomizeHeader */ /* global _wpCustomizeHeader */
(function( $, wp ) { (function( $, wp ) {
var api = wp.customize; var api = wp.customize;
/** @namespace wp.customize.HeaderTool */
api.HeaderTool = {}; api.HeaderTool = {};
@ -13,10 +14,13 @@
* These calls are made regardless of whether the user actually saves new * These calls are made regardless of whether the user actually saves new
* Customizer settings. * Customizer settings.
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ImageModel
*
* @constructor * @constructor
* @augments Backbone.Model * @augments Backbone.Model
*/ */
api.HeaderTool.ImageModel = Backbone.Model.extend({ api.HeaderTool.ImageModel = Backbone.Model.extend(/** @lends wp.customize.HeaderTool.ImageModel.prototype */{
defaults: function() { defaults: function() {
return { return {
header: { header: {
@ -125,6 +129,9 @@
/** /**
* wp.customize.HeaderTool.ChoiceList * wp.customize.HeaderTool.ChoiceList
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ChoiceList
*
* @constructor * @constructor
* @augments Backbone.Collection * @augments Backbone.Collection
*/ */
@ -232,6 +239,9 @@
/** /**
* wp.customize.HeaderTool.DefaultsList * wp.customize.HeaderTool.DefaultsList
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.DefaultsList
*
* @constructor * @constructor
* @augments wp.customize.HeaderTool.ChoiceList * @augments wp.customize.HeaderTool.ChoiceList
* @augments Backbone.Collection * @augments Backbone.Collection

View File

@ -1,4 +1,6 @@
/* global _wpCustomizePreviewNavMenusExports */ /* global _wpCustomizePreviewNavMenusExports */
/** @namespace wp.customize.navMenusPreview */
wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function( $, _, wp, api ) { wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function( $, _, wp, api ) {
'use strict'; 'use strict';
@ -72,11 +74,14 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
/** /**
* Partial representing an invocation of wp_nav_menu(). * Partial representing an invocation of wp_nav_menu().
* *
* @memberOf wp.customize.navMenusPreview
* @alias wp.customize.navMenusPreview.NavMenuInstancePartial
*
* @class * @class
* @augments wp.customize.selectiveRefresh.Partial * @augments wp.customize.selectiveRefresh.Partial
* @since 4.5.0 * @since 4.5.0
*/ */
self.NavMenuInstancePartial = api.selectiveRefresh.Partial.extend({ self.NavMenuInstancePartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.navMenusPreview.NavMenuInstancePartial.prototype */{
/** /**
* Constructor. * Constructor.

View File

@ -1,4 +1,6 @@
/* global _wpWidgetCustomizerPreviewSettings */ /* global _wpWidgetCustomizerPreviewSettings */
/** @namespace wp.customize.widgetsPreview */
wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function( $, _, wp, api ) { wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function( $, _, wp, api ) {
var self; var self;
@ -42,11 +44,14 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Partial representing a widget instance. * Partial representing a widget instance.
* *
* @memberOf wp.customize.widgetsPreview
* @alias wp.customize.widgetsPreview.WidgetPartial
*
* @class * @class
* @augments wp.customize.selectiveRefresh.Partial * @augments wp.customize.selectiveRefresh.Partial
* @since 4.5.0 * @since 4.5.0
*/ */
self.WidgetPartial = api.selectiveRefresh.Partial.extend({ self.WidgetPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.WidgetPartial.prototype */{
/** /**
* Constructor. * Constructor.
@ -112,11 +117,14 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Partial representing a widget area. * Partial representing a widget area.
* *
* @memberOf wp.customize.widgetsPreview
* @alias wp.customize.widgetsPreview.SidebarPartial
*
* @class * @class
* @augments wp.customize.selectiveRefresh.Partial * @augments wp.customize.selectiveRefresh.Partial
* @since 4.5.0 * @since 4.5.0
*/ */
self.SidebarPartial = api.selectiveRefresh.Partial.extend({ self.SidebarPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.SidebarPartial.prototype */{
/** /**
* Constructor. * Constructor.
@ -510,6 +518,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Calculate the selector for the sidebar's widgets based on the registered sidebar's info. * Calculate the selector for the sidebar's widgets based on the registered sidebar's info.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0 * @since 3.9.0
*/ */
self.buildWidgetSelectors = function() { self.buildWidgetSelectors = function() {
@ -548,6 +558,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Highlight the widget on widget updates or widget control mouse overs. * Highlight the widget on widget updates or widget control mouse overs.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0 * @since 3.9.0
* @param {string} widgetId ID of the widget. * @param {string} widgetId ID of the widget.
*/ */
@ -567,6 +579,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
* Show a title and highlight widgets on hover. On shift+clicking * Show a title and highlight widgets on hover. On shift+clicking
* focus the widget control. * focus the widget control.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0 * @since 3.9.0
*/ */
self.highlightControls = function() { self.highlightControls = function() {
@ -598,6 +612,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Parse a widget ID. * Parse a widget ID.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0 * @since 4.5.0
* *
* @param {string} widgetId Widget ID. * @param {string} widgetId Widget ID.
@ -623,6 +639,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Parse a widget setting ID. * Parse a widget setting ID.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0 * @since 4.5.0
* *
* @param {string} settingId Widget setting ID. * @param {string} settingId Widget setting ID.
@ -648,6 +666,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/** /**
* Convert a widget ID into a Customizer setting ID. * Convert a widget ID into a Customizer setting ID.
* *
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0 * @since 4.5.0
* *
* @param {string} widgetId Widget ID. * @param {string} widgetId Widget ID.

View File

@ -87,12 +87,15 @@
}; };
/** /**
* @memberOf wp.customize
* @alias wp.customize.Preview
*
* @constructor * @constructor
* @augments wp.customize.Messenger * @augments wp.customize.Messenger
* @augments wp.customize.Class * @augments wp.customize.Class
* @mixes wp.customize.Events * @mixes wp.customize.Events
*/ */
api.Preview = api.Messenger.extend({ api.Preview = api.Messenger.extend(/** @lends wp.customize.Preview.prototype */{
/** /**
* @param {object} params - Parameters to configure the messenger. * @param {object} params - Parameters to configure the messenger.
* @param {object} options - Extend any instance parameter or method with this object. * @param {object} options - Extend any instance parameter or method with this object.

View File

@ -1,5 +1,6 @@
/* global jQuery, JSON, _customizePartialRefreshExports, console */ /* global jQuery, JSON, _customizePartialRefreshExports, console */
/** @namespace wp.customize.selectiveRefresh */
wp.customize.selectiveRefresh = ( function( $, api ) { wp.customize.selectiveRefresh = ( function( $, api ) {
'use strict'; 'use strict';
var self, Partial, Placement; var self, Partial, Placement;
@ -24,6 +25,8 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* *
* A partial provides a rendering of one or more settings according to a template. * A partial provides a rendering of one or more settings according to a template.
* *
* @memberOf wp.customize.selectiveRefresh
*
* @see PHP class WP_Customize_Partial. * @see PHP class WP_Customize_Partial.
* *
* @class * @class
@ -39,7 +42,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* @param {string} options.params.primarySetting The ID for the primary setting the partial renders. * @param {string} options.params.primarySetting The ID for the primary setting the partial renders.
* @param {bool} options.params.fallbackRefresh Whether to refresh the entire preview in case of a partial refresh failure. * @param {bool} options.params.fallbackRefresh Whether to refresh the entire preview in case of a partial refresh failure.
*/ */
Partial = self.Partial = api.Class.extend({ Partial = self.Partial = api.Class.extend(/** @lends wp.customize.SelectiveRefresh.Partial.prototype */{
id: null, id: null,
@ -508,11 +511,13 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* It also may have information in relation to how a placement may have just changed. * It also may have information in relation to how a placement may have just changed.
* The placement is conceptually similar to a DOM Range or MutationRecord. * The placement is conceptually similar to a DOM Range or MutationRecord.
* *
* @class * @memberOf wp.customize.selectiveRefresh
*
* @class Placement
* @augments wp.customize.Class * @augments wp.customize.Class
* @since 4.5.0 * @since 4.5.0
*/ */
self.Placement = Placement = api.Class.extend({ self.Placement = Placement = api.Class.extend(/** @lends wp.customize.selectiveRefresh.prototype */{
/** /**
* The partial with which the container is associated. * The partial with which the container is associated.

View File

@ -11,10 +11,13 @@
* *
* Instantiate with model wp.customize.HeaderTool.currentHeader. * Instantiate with model wp.customize.HeaderTool.currentHeader.
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.CurrentView
*
* @constructor * @constructor
* @augments wp.Backbone.View * @augments wp.Backbone.View
*/ */
api.HeaderTool.CurrentView = wp.Backbone.View.extend({ api.HeaderTool.CurrentView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.CurrentView.prototype */{
template: wp.template('header-current'), template: wp.template('header-current'),
initialize: function() { initialize: function() {
@ -50,10 +53,13 @@
* Manually changes model wp.customize.HeaderTool.currentHeader via the * Manually changes model wp.customize.HeaderTool.currentHeader via the
* `select` method. * `select` method.
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ChoiceView
*
* @constructor * @constructor
* @augments wp.Backbone.View * @augments wp.Backbone.View
*/ */
api.HeaderTool.ChoiceView = wp.Backbone.View.extend({ api.HeaderTool.ChoiceView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.ChoiceView.prototype */{
template: wp.template('header-choice'), template: wp.template('header-choice'),
className: 'header-view', className: 'header-view',
@ -125,10 +131,13 @@
* *
* Takes a wp.customize.HeaderTool.ChoiceList. * Takes a wp.customize.HeaderTool.ChoiceList.
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ChoiceListView
*
* @constructor * @constructor
* @augments wp.Backbone.View * @augments wp.Backbone.View
*/ */
api.HeaderTool.ChoiceListView = wp.Backbone.View.extend({ api.HeaderTool.ChoiceListView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.ChoiceListView.prototype */{
initialize: function() { initialize: function() {
this.listenTo(this.collection, 'add', this.addOne); this.listenTo(this.collection, 'add', this.addOne);
this.listenTo(this.collection, 'remove', this.render); this.listenTo(this.collection, 'remove', this.render);
@ -168,10 +177,13 @@
* Aggregates wp.customize.HeaderTool.ChoiceList collections (or any * Aggregates wp.customize.HeaderTool.ChoiceList collections (or any
* Backbone object, really) and acts as a bus to feed them events. * Backbone object, really) and acts as a bus to feed them events.
* *
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.CombinedList
*
* @constructor * @constructor
* @augments wp.Backbone.View * @augments wp.Backbone.View
*/ */
api.HeaderTool.CombinedList = wp.Backbone.View.extend({ api.HeaderTool.CombinedList = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.CombinedList.prototype */{
initialize: function(collections) { initialize: function(collections) {
this.collections = collections; this.collections = collections;
this.on('all', this.propagate, this); this.on('all', this.propagate, this);

View File

@ -742,7 +742,11 @@
}; };
}; };
// Ensure the global `wp` object exists. /**
* Ensure the global `wp` object exists.
*
* @namespace wp
*/
window.wp = window.wp || {}; window.wp = window.wp || {};
window.wp.heartbeat = new Heartbeat(); window.wp.heartbeat = new Heartbeat();

View File

@ -280,7 +280,7 @@
wp.mce.View.extend = Backbone.View.extend; wp.mce.View.extend = Backbone.View.extend;
_.extend( wp.mce.View.prototype, { _.extend( wp.mce.View.prototype, /** @lends wp.mce.View.prototype */{
/** /**
* The content. * The content.

View File

@ -279,20 +279,22 @@ media.view.AudioDetails = require( './views/audio-details.js' );
media.view.VideoDetails = require( './views/video-details.js' ); media.view.VideoDetails = require( './views/video-details.js' );
},{"./controllers/audio-details.js":2,"./controllers/video-details.js":3,"./models/post-media.js":4,"./views/audio-details.js":5,"./views/frame/audio-details.js":6,"./views/frame/media-details.js":7,"./views/frame/video-details.js":8,"./views/media-details.js":9,"./views/video-details.js":10}],2:[function(require,module,exports){ },{"./controllers/audio-details.js":2,"./controllers/video-details.js":3,"./models/post-media.js":4,"./views/audio-details.js":5,"./views/frame/audio-details.js":6,"./views/frame/media-details.js":7,"./views/frame/video-details.js":8,"./views/media-details.js":9,"./views/video-details.js":10}],2:[function(require,module,exports){
var State = wp.media.controller.State,
l10n = wp.media.view.l10n,
AudioDetails;
/** /**
* wp.media.controller.AudioDetails * wp.media.controller.AudioDetails
* *
* The controller for the Audio Details state * The controller for the Audio Details state
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var State = wp.media.controller.State, AudioDetails = State.extend(/** @lends wp.media.controller.AudioDetails.prototype */{
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = State.extend({
defaults: { defaults: {
id: 'audio-details', id: 'audio-details',
toolbar: 'audio-details', toolbar: 'audio-details',
@ -317,6 +319,8 @@ module.exports = AudioDetails;
* *
* The controller for the Video Details state * The controller for the Video Details state
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -325,7 +329,7 @@ var State = wp.media.controller.State,
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
VideoDetails; VideoDetails;
VideoDetails = State.extend({ VideoDetails = State.extend(/** @lends wp.media.controller.VideoDetails.prototype */{
defaults: { defaults: {
id: 'video-details', id: 'video-details',
toolbar: 'video-details', toolbar: 'video-details',
@ -351,10 +355,12 @@ module.exports = VideoDetails;
* Shared model class for audio and video. Updates the model after * Shared model class for audio and video. Updates the model after
* "Add Audio|Video Source" and "Replace Audio|Video" states return * "Add Audio|Video Source" and "Replace Audio|Video" states return
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var PostMedia = Backbone.Model.extend({ var PostMedia = Backbone.Model.extend(/** @lends wp.media.model.PostMedia.prototype */{
initialize: function() { initialize: function() {
this.attachment = false; this.attachment = false;
}, },
@ -387,9 +393,14 @@ var PostMedia = Backbone.Model.extend({
module.exports = PostMedia; module.exports = PostMedia;
},{}],5:[function(require,module,exports){ },{}],5:[function(require,module,exports){
var MediaDetails = wp.media.view.MediaDetails,
AudioDetails;
/** /**
* wp.media.view.AudioDetails * wp.media.view.AudioDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.MediaDetails * @augments wp.media.view.MediaDetails
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
@ -398,10 +409,7 @@ module.exports = PostMedia;
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var MediaDetails = wp.media.view.MediaDetails, AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{
AudioDetails;
AudioDetails = MediaDetails.extend({
className: 'audio-details', className: 'audio-details',
template: wp.template('audio-details'), template: wp.template('audio-details'),
@ -425,9 +433,17 @@ AudioDetails = MediaDetails.extend({
module.exports = AudioDetails; module.exports = AudioDetails;
},{}],6:[function(require,module,exports){ },{}],6:[function(require,module,exports){
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
AudioDetails;
/** /**
* wp.media.view.MediaFrame.AudioDetails * wp.media.view.MediaFrame.AudioDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.MediaDetails * @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
@ -438,13 +454,7 @@ module.exports = AudioDetails;
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, AudioDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.AudioDetails.prototype */{
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = MediaDetails.extend({
defaults: { defaults: {
id: 'audio', id: 'audio',
url: '', url: '',
@ -501,9 +511,15 @@ AudioDetails = MediaDetails.extend({
module.exports = AudioDetails; module.exports = AudioDetails;
},{}],7:[function(require,module,exports){ },{}],7:[function(require,module,exports){
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
MediaDetails;
/** /**
* wp.media.view.MediaFrame.MediaDetails * wp.media.view.MediaFrame.MediaDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
@ -513,11 +529,7 @@ module.exports = AudioDetails;
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Select = wp.media.view.MediaFrame.Select, MediaDetails = Select.extend(/** @lends wp.media.view.MediaFrame.MediaDetails.prototype */{
l10n = wp.media.view.l10n,
MediaDetails;
MediaDetails = Select.extend({
defaults: { defaults: {
id: 'media', id: 'media',
url: '', url: '',
@ -631,9 +643,16 @@ MediaDetails = Select.extend({
module.exports = MediaDetails; module.exports = MediaDetails;
},{}],8:[function(require,module,exports){ },{}],8:[function(require,module,exports){
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
VideoDetails;
/** /**
* wp.media.view.MediaFrame.VideoDetails * wp.media.view.MediaFrame.VideoDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.MediaDetails * @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
@ -644,12 +663,7 @@ module.exports = MediaDetails;
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, VideoDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.VideoDetails.prototype */{
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
VideoDetails;
VideoDetails = MediaDetails.extend({
defaults: { defaults: {
id: 'video', id: 'video',
url: '', url: '',
@ -767,10 +781,15 @@ module.exports = VideoDetails;
},{}],9:[function(require,module,exports){ },{}],9:[function(require,module,exports){
/* global MediaElementPlayer */ /* global MediaElementPlayer */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
$ = jQuery,
MediaDetails;
/** /**
* wp.media.view.MediaDetails * wp.media.view.MediaDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings * @augments wp.media.view.Settings
@ -778,11 +797,7 @@ module.exports = VideoDetails;
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{
$ = jQuery,
MediaDetails;
MediaDetails = AttachmentDisplay.extend({
initialize: function() { initialize: function() {
_.bindAll(this, 'success'); _.bindAll(this, 'success');
this.players = []; this.players = [];
@ -854,9 +869,6 @@ MediaDetails = AttachmentDisplay.extend({
this.scriptXhr = false; this.scriptXhr = false;
}, },
/**
* @global MediaElementPlayer
*/
setPlayer : function() { setPlayer : function() {
var src; var src;
@ -912,7 +924,7 @@ MediaDetails = AttachmentDisplay.extend({
resetFocus: function() { resetFocus: function() {
this.$( '.embed-media-settings' ).scrollTop( 0 ); this.$( '.embed-media-settings' ).scrollTop( 0 );
} }
}, { },/** @lends wp.media.view.MediaDetails */{
instances : 0, instances : 0,
/** /**
* When multiple players in the DOM contain the same src, things get weird. * When multiple players in the DOM contain the same src, things get weird.
@ -938,9 +950,14 @@ MediaDetails = AttachmentDisplay.extend({
module.exports = MediaDetails; module.exports = MediaDetails;
},{}],10:[function(require,module,exports){ },{}],10:[function(require,module,exports){
var MediaDetails = wp.media.view.MediaDetails,
VideoDetails;
/** /**
* wp.media.view.VideoDetails * wp.media.view.VideoDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.MediaDetails * @augments wp.media.view.MediaDetails
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
@ -949,10 +966,7 @@ module.exports = MediaDetails;
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var MediaDetails = wp.media.view.MediaDetails, VideoDetails = MediaDetails.extend(/** @lends wp.media.view.VideoDetails.prototype */{
VideoDetails;
VideoDetails = MediaDetails.extend({
className: 'video-details', className: 'video-details',
template: wp.template('video-details'), template: wp.template('video-details'),

View File

@ -30,19 +30,13 @@
return attrs[ key ]; return attrs[ key ];
}; };
/** /** @namespace wp.media.string */
* wp.media.string
* @namespace
*/
wp.media.string = { wp.media.string = {
/** /**
* Joins the `props` and `attachment` objects, * Joins the `props` and `attachment` objects,
* outputting the proper object format based on the * outputting the proper object format based on the
* attachment's type. * attachment's type.
* *
* @global wp.media.view.settings
* @global getUserSetting()
*
* @param {Object} [props={}] Attachment details (align, link, size, etc). * @param {Object} [props={}] Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post. * @param {Object} attachment The attachment object, media version of Post.
* @returns {Object} Joined props * @returns {Object} Joined props
@ -109,8 +103,6 @@
/** /**
* Create link markup that is suitable for passing to the editor * Create link markup that is suitable for passing to the editor
* *
* @global wp.html.string
*
* @param {Object} props Attachment details (align, link, size, etc). * @param {Object} props Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post. * @param {Object} attachment The attachment object, media version of Post.
* @returns {string} The link markup * @returns {string} The link markup
@ -159,9 +151,6 @@
* *
* @access private * @access private
* *
* @global wp.shortcode
* @global wp.media.view.settings
*
* @param {string} type The shortcode tag name: 'audio' or 'video'. * @param {string} type The shortcode tag name: 'audio' or 'video'.
* @param {Object} props Attachment details (align, link, size, etc). * @param {Object} props Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post. * @param {Object} attachment The attachment object, media version of Post.
@ -210,9 +199,6 @@
* Create image markup, optionally with a link and/or wrapped in a caption shortcode, * Create image markup, optionally with a link and/or wrapped in a caption shortcode,
* that is suitable for passing to the editor * that is suitable for passing to the editor
* *
* @global wp.html
* @global wp.shortcode
*
* @param {Object} props Attachment details (align, link, size, etc). * @param {Object} props Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post. * @param {Object} attachment The attachment object, media version of Post.
* @returns {string} * @returns {string}
@ -341,16 +327,19 @@
} }
}; };
/**
* @class wp.media.collection
*
* @param {Object} attributes
*/
wp.media.collection = function(attributes) { wp.media.collection = function(attributes) {
var collections = {}; var collections = {};
return _.extend( { return _.extend(/** @lends wp.media.collection.prototype */{
coerce : wp.media.coerce, coerce : wp.media.coerce,
/** /**
* Retrieve attachments based on the properties of the passed shortcode * Retrieve attachments based on the properties of the passed shortcode
* *
* @global wp.media.query
*
* @param {wp.shortcode} shortcode An instance of wp.shortcode(). * @param {wp.shortcode} shortcode An instance of wp.shortcode().
* @returns {wp.media.model.Attachments} A Backbone.Collection containing * @returns {wp.media.model.Attachments} A Backbone.Collection containing
* the media items belonging to a collection. * the media items belonging to a collection.
@ -417,9 +406,6 @@
/** /**
* Triggered when clicking 'Insert {label}' or 'Update {label}' * Triggered when clicking 'Insert {label}' or 'Update {label}'
* *
* @global wp.shortcode
* @global wp.media.model.Attachments
*
* @param {wp.media.model.Attachments} attachments A Backbone.Collection containing * @param {wp.media.model.Attachments} attachments A Backbone.Collection containing
* the media items belonging to a collection. * the media items belonging to a collection.
* The query[ this.tag ] property is a Backbone.Model * The query[ this.tag ] property is a Backbone.Model
@ -488,10 +474,6 @@
* Triggered when double-clicking a collection shortcode placeholder * Triggered when double-clicking a collection shortcode placeholder
* in the editor * in the editor
* *
* @global wp.shortcode
* @global wp.media.model.Selection
* @global wp.media.view.l10n
*
* @param {string} content Content that is searched for possible * @param {string} content Content that is searched for possible
* shortcode markup matching the passed tag name, * shortcode markup matching the passed tag name,
* *
@ -610,15 +592,13 @@
}); });
/** /**
* wp.media.featuredImage * @namespace wp.media.featuredImage
* @namespace * @memberOf wp.media
*/ */
wp.media.featuredImage = { wp.media.featuredImage = {
/** /**
* Get the featured image post ID * Get the featured image post ID
* *
* @global wp.media.view.settings
*
* @returns {wp.media.view.settings.post.featuredImageId|number} * @returns {wp.media.view.settings.post.featuredImageId|number}
*/ */
get: function() { get: function() {
@ -628,9 +608,6 @@
* Set the featured image id, save the post thumbnail data and * Set the featured image id, save the post thumbnail data and
* set the HTML in the post meta box to the new featured image. * set the HTML in the post meta box to the new featured image.
* *
* @global wp.media.view.settings
* @global wp.media.post
*
* @param {number} id The post ID of the featured image, or -1 to unset it. * @param {number} id The post ID of the featured image, or -1 to unset it.
*/ */
set: function( id ) { set: function( id ) {
@ -660,9 +637,6 @@
/** /**
* The Featured Image workflow * The Featured Image workflow
* *
* @global wp.media.controller.FeaturedImage
* @global wp.media.view.l10n
*
* @this wp.media.featuredImage * @this wp.media.featuredImage
* *
* @returns {wp.media.view.MediaFrame.Select} A media workflow. * @returns {wp.media.view.MediaFrame.Select} A media workflow.
@ -705,8 +679,6 @@
* 'select' callback for Featured Image workflow, triggered when * 'select' callback for Featured Image workflow, triggered when
* the 'Set Featured Image' button is clicked in the media modal. * the 'Set Featured Image' button is clicked in the media modal.
* *
* @global wp.media.view.settings
*
* @this wp.media.controller.FeaturedImage * @this wp.media.controller.FeaturedImage
*/ */
select: function() { select: function() {
@ -723,8 +695,6 @@
* the post thumbnail is clicked. * the post thumbnail is clicked.
* *
* Update the featured image id when the 'remove' link is clicked. * Update the featured image id when the 'remove' link is clicked.
*
* @global wp.media.view.settings
*/ */
init: function() { init: function() {
$('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) { $('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) {
@ -742,19 +712,11 @@
$( wp.media.featuredImage.init ); $( wp.media.featuredImage.init );
/** /** @namespace wp.media.editor */
* wp.media.editor
* @namespace
*/
wp.media.editor = { wp.media.editor = {
/** /**
* Send content to the editor * Send content to the editor
* *
* @global tinymce
* @global QTags
* @global wpActiveEditor
* @global tb_remove() - Possibly overloaded by legacy plugins
*
* @param {string} html Content to send to the editor * @param {string} html Content to send to the editor
*/ */
insert: function( html ) { insert: function( html ) {
@ -805,8 +767,6 @@
* Setup 'workflow' and add to the 'workflows' cache. 'open' can * Setup 'workflow' and add to the 'workflows' cache. 'open' can
* subsequently be called upon it. * subsequently be called upon it.
* *
* @global wp.media.view.l10n
*
* @param {string} id A slug used to identify the workflow. * @param {string} id A slug used to identify the workflow.
* @param {Object} [options={}] * @param {Object} [options={}]
* *
@ -914,9 +874,6 @@
/** /**
* Determines the proper current workflow id * Determines the proper current workflow id
* *
* @global wpActiveEditor
* @global tinymce
*
* @param {string} [id=''] A slug used to identify the workflow. * @param {string} [id=''] A slug used to identify the workflow.
* *
* @returns {wpActiveEditor|string|tinymce.activeEditor.id} * @returns {wpActiveEditor|string|tinymce.activeEditor.id}
@ -962,17 +919,12 @@
id = this.id( id ); id = this.id( id );
delete workflows[ id ]; delete workflows[ id ];
}, },
/** /** @namespace wp.media.editor.send */
* @namespace
*/
send: { send: {
/** /**
* Called when sending an attachment to the editor * Called when sending an attachment to the editor
* from the medial modal. * from the medial modal.
* *
* @global wp.media.view.settings
* @global wp.media.post
*
* @param {Object} props Attachment details (align, link, size, etc). * @param {Object} props Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post. * @param {Object} attachment The attachment object, media version of Post.
* @returns {Promise} * @returns {Promise}
@ -1028,8 +980,6 @@
/** /**
* Called when 'Insert From URL' source is not an image. Example: YouTube url. * Called when 'Insert From URL' source is not an image. Example: YouTube url.
* *
* @global wp.media.view.settings
*
* @param {Object} embed * @param {Object} embed
* @returns {Promise} * @returns {Promise}
*/ */
@ -1075,8 +1025,6 @@
/** /**
* Bind click event for .insert-media using event delegation * Bind click event for .insert-media using event delegation
*
* @global wp.media.view.l10n
*/ */
init: function() { init: function() {
$(document.body) $(document.body)

View File

@ -1,17 +1,19 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
/** /**
* wp.media.controller.EditAttachmentMetadata * wp.media.controller.EditAttachmentMetadata
* *
* A state for editing an attachment's metadata. * A state for editing an attachment's metadata.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var l10n = wp.media.view.l10n, EditAttachmentMetadata = wp.media.controller.State.extend(/** @lends wp.media.controller.EditAttachmentMetadata.prototype */{
EditAttachmentMetadata;
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.
@ -45,10 +47,12 @@ media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-sel
* *
* A router for handling the browser history and application state. * A router for handling the browser history and application state.
* *
* @memberOf wp.media.view.MediaFrame.Manage
*
* @class * @class
* @augments Backbone.Router * @augments Backbone.Router
*/ */
var Router = Backbone.Router.extend({ var Router = Backbone.Router.extend(/** @lends wp.media.view.MediaFrame.Manage.Router.prototype */{
routes: { routes: {
'upload.php?item=:slug&mode=edit': 'editItem', 'upload.php?item=:slug&mode=edit': 'editItem',
'upload.php?item=:slug': 'showItem', 'upload.php?item=:slug': 'showItem',
@ -107,12 +111,17 @@ var Router = Backbone.Router.extend({
module.exports = Router; module.exports = Router;
},{}],4:[function(require,module,exports){ },{}],4:[function(require,module,exports){
var Details = wp.media.view.Attachment.Details,
TwoColumn;
/** /**
* wp.media.view.Attachment.Details.TwoColumn * wp.media.view.Attachment.Details.TwoColumn
* *
* A similar view to media.view.Attachment.Details * A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal. * for use in the Edit Attachment modal.
* *
* @memberOf wp.media.view.Attachment.Details
*
* @class * @class
* @augments wp.media.view.Attachment.Details * @augments wp.media.view.Attachment.Details
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
@ -120,10 +129,7 @@ module.exports = Router;
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Details = wp.media.view.Attachment.Details, TwoColumn = Details.extend(/** @lends wp.media.view.Attachment.Details.TowColumn.prototype */{
TwoColumn;
TwoColumn = Details.extend({
template: wp.template( 'attachment-details-two-column' ), template: wp.template( 'attachment-details-two-column' ),
initialize: function() { initialize: function() {
@ -158,11 +164,17 @@ TwoColumn = Details.extend({
module.exports = TwoColumn; module.exports = TwoColumn;
},{}],5:[function(require,module,exports){ },{}],5:[function(require,module,exports){
var Button = wp.media.view.Button,
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
/** /**
* wp.media.view.DeleteSelectedPermanentlyButton * wp.media.view.DeleteSelectedPermanentlyButton
* *
* When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.DeleteSelectedButton * @augments wp.media.view.DeleteSelectedButton
* @augments wp.media.view.Button * @augments wp.media.view.Button
@ -170,11 +182,7 @@ module.exports = TwoColumn;
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, DeleteSelectedPermanently = DeleteSelected.extend(/** @lends wp.media.view.DeleteSelectedPermanentlyButton.prototype */{
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
DeleteSelectedPermanently = DeleteSelected.extend({
initialize: function() { initialize: function() {
DeleteSelected.prototype.initialize.apply( this, arguments ); DeleteSelected.prototype.initialize.apply( this, arguments );
this.controller.on( 'select:activate', this.selectActivate, this ); this.controller.on( 'select:activate', this.selectActivate, this );
@ -205,22 +213,24 @@ DeleteSelectedPermanently = DeleteSelected.extend({
module.exports = DeleteSelectedPermanently; module.exports = DeleteSelectedPermanently;
},{}],6:[function(require,module,exports){ },{}],6:[function(require,module,exports){
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
DeleteSelected;
/** /**
* wp.media.view.DeleteSelectedButton * wp.media.view.DeleteSelectedButton
* *
* A button that handles bulk Delete/Trash logic * A button that handles bulk Delete/Trash logic
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Button * @augments wp.media.view.Button
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, DeleteSelected = Button.extend(/** @lends wp.media.view.DeleteSelectedButton.prototype */{
l10n = wp.media.view.l10n,
DeleteSelected;
DeleteSelected = Button.extend({
initialize: function() { initialize: function() {
Button.prototype.initialize.apply( this, arguments ); Button.prototype.initialize.apply( this, arguments );
if ( this.options.filters ) { if ( this.options.filters ) {
@ -258,20 +268,23 @@ DeleteSelected = Button.extend({
module.exports = DeleteSelected; module.exports = DeleteSelected;
},{}],7:[function(require,module,exports){ },{}],7:[function(require,module,exports){
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
SelectModeToggle;
/** /**
* wp.media.view.SelectModeToggleButton * wp.media.view.SelectModeToggleButton
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Button * @augments wp.media.view.Button
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, SelectModeToggle = Button.extend(/** @lends wp.media.view.SelectModeToggle.prototype */{
l10n = wp.media.view.l10n,
SelectModeToggle;
SelectModeToggle = Button.extend({
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {
size : '' size : ''
@ -332,20 +345,22 @@ SelectModeToggle = Button.extend({
module.exports = SelectModeToggle; module.exports = SelectModeToggle;
},{}],8:[function(require,module,exports){ },{}],8:[function(require,module,exports){
var View = wp.media.View,
EditImage = wp.media.view.EditImage,
Details;
/** /**
* wp.media.view.EditImage.Details * wp.media.view.EditImage.Details
* *
* @memberOf wp.media.view.EditImage
*
* @class * @class
* @augments wp.media.view.EditImage * @augments wp.media.view.EditImage
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Details = EditImage.extend(/** @lends wp.media.view.EditImage.Details.prototype */{
EditImage = wp.media.view.EditImage,
Details;
Details = EditImage.extend({
initialize: function( options ) { initialize: function( options ) {
this.editor = window.imageEdit; this.editor = window.imageEdit;
this.frame = options.frame; this.frame = options.frame;
@ -367,6 +382,12 @@ Details = EditImage.extend({
module.exports = Details; module.exports = Details;
},{}],9:[function(require,module,exports){ },{}],9:[function(require,module,exports){
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
/** /**
* wp.media.view.MediaFrame.EditAttachments * wp.media.view.MediaFrame.EditAttachments
* *
@ -376,6 +397,8 @@ module.exports = Details;
* *
* Requires an attachment model to be passed in the options hash under `model`. * Requires an attachment model to be passed in the options hash under `model`.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
* @augments wp.media.View * @augments wp.media.View
@ -383,13 +406,7 @@ module.exports = Details;
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Frame = wp.media.view.Frame, EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAttachments.prototype */{
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
EditAttachments = MediaFrame.extend({
className: 'edit-attachment-frame', className: 'edit-attachment-frame',
template: wp.template( 'edit-attachment-frame' ), template: wp.template( 'edit-attachment-frame' ),
@ -627,6 +644,12 @@ EditAttachments = MediaFrame.extend({
module.exports = EditAttachments; module.exports = EditAttachments;
},{}],10:[function(require,module,exports){ },{}],10:[function(require,module,exports){
var MediaFrame = wp.media.view.MediaFrame,
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
/** /**
* wp.media.view.MediaFrame.Manage * wp.media.view.MediaFrame.Manage
* *
@ -634,6 +657,8 @@ module.exports = EditAttachments;
* *
* Used in the media grid view. * Used in the media grid view.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
@ -642,15 +667,9 @@ module.exports = EditAttachments;
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaFrame = wp.media.view.MediaFrame, Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
Manage = MediaFrame.extend({
/** /**
* @global wp.Uploader * @constructs
*/ */
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {

View File

@ -2,6 +2,7 @@
var $ = jQuery, var $ = jQuery,
Attachment, Attachments, l10n, media; Attachment, Attachments, l10n, media;
/** @namespace wp */
window.wp = window.wp || {}; window.wp = window.wp || {};
/** /**
@ -9,6 +10,9 @@ window.wp = window.wp || {};
* *
* Handles the default media experience. * Handles the default media experience.
* *
* @alias wp.media
* @memberOf wp
*
* @param {object} attributes The properties passed to the main media controller. * @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow. * @return {wp.media.view.MediaFrame} A media workflow.
*/ */
@ -47,6 +51,11 @@ media = wp.media = function( attributes ) {
return frame; return frame;
}; };
/** @namespace wp.media */
/** @namespace wp.media.model */
/** @namespace wp.media.view */
/** @namespace wp.media.controller */
/** @namespace wp.media.frames */
_.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
// Link any localized strings. // Link any localized strings.
@ -90,7 +99,7 @@ media.compare = function( a, b, ac, bc ) {
} }
}; };
_.extend( media, { _.extend( media, /** @lends wp.media */{
/** /**
* media.template( id ) * media.template( id )
* *
@ -230,16 +239,18 @@ $(window).on('unload', function(){
}); });
},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){ },{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
var $ = Backbone.$,
Attachment;
/** /**
* wp.media.model.Attachment * wp.media.model.Attachment
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var $ = Backbone.$, Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{
Attachment;
Attachment = Backbone.Model.extend({
/** /**
* Triggered when attachment details change * Triggered when attachment details change
* Overrides Backbone.Model.sync * Overrides Backbone.Model.sync
@ -366,11 +377,12 @@ Attachment = Backbone.Model.extend({
model.set( model.parse( resp, xhr ), options ); model.set( model.parse( resp, xhr ), options );
}); });
} }
}, { },/** @lends wp.media.model.Attachment */{
/** /**
* Create a new model on the static 'all' attachments collection and return it. * Create a new model on the static 'all' attachments collection and return it.
* *
* @static * @static
*
* @param {Object} attrs * @param {Object} attrs
* @returns {wp.media.model.Attachment} * @returns {wp.media.model.Attachment}
*/ */
@ -407,6 +419,8 @@ module.exports = Attachment;
* 'options.props.query = true', which will mirror the collection * 'options.props.query = true', which will mirror the collection
* to an Attachments Query collection - @see wp.media.model.Attachments.mirror(). * to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Collection * @augments Backbone.Collection
* *
@ -420,7 +434,7 @@ module.exports = Attachment;
* @param {string} [options.filters] * @param {string} [options.filters]
* *
*/ */
var Attachments = Backbone.Collection.extend({ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachments.prototype */{
/** /**
* @type {wp.media.model.Attachment} * @type {wp.media.model.Attachment}
*/ */
@ -818,15 +832,13 @@ var Attachments = Backbone.Collection.extend({
attachments: attachments attachments: attachments
}); });
} }
}, { },/** @lends wp.media.model.Attachments */{
/** /**
* A function to compare two attachment models in an attachments collection. * A function to compare two attachment models in an attachments collection.
* *
* Used as the default comparator for instances of wp.media.model.Attachments * Used as the default comparator for instances of wp.media.model.Attachments
* and its subclasses. @see wp.media.model.Attachments._changeOrderby(). * and its subclasses. @see wp.media.model.Attachments._changeOrderby().
* *
* @static
*
* @param {Backbone.Model} a * @param {Backbone.Model} a
* @param {Backbone.Model} b * @param {Backbone.Model} b
* @param {Object} options * @param {Object} options
@ -855,9 +867,7 @@ var Attachments = Backbone.Collection.extend({
return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac ); return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac );
}, },
/** /** @namespace wp.media.model.Attachments.filters */
* @namespace
*/
filters: { filters: {
/** /**
* @static * @static
@ -952,13 +962,15 @@ module.exports = Attachments;
* *
* Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails. * Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
* *
* @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 PostImage = Backbone.Model.extend({ var PostImage = Backbone.Model.extend(/** @lends wp.media.model.PostImage.prototype */{
initialize: function( attributes ) { initialize: function( attributes ) {
var Attachment = wp.media.model.Attachment; var Attachment = wp.media.model.Attachment;
@ -1099,6 +1111,9 @@ var PostImage = Backbone.Model.extend({
module.exports = PostImage; module.exports = PostImage;
},{}],5:[function(require,module,exports){ },{}],5:[function(require,module,exports){
var Attachments = wp.media.model.Attachments,
Query;
/** /**
* wp.media.model.Query * wp.media.model.Query
* *
@ -1107,6 +1122,8 @@ module.exports = PostImage;
* Note: Do NOT change this.args after the query has been initialized. * Note: Do NOT change this.args after the query has been initialized.
* Things will break. * Things will break.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments wp.media.model.Attachments * @augments wp.media.model.Attachments
* @augments Backbone.Collection * @augments Backbone.Collection
@ -1116,13 +1133,8 @@ 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 = wp.media.model.Attachments, Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
Query;
Query = Attachments.extend({
/** /**
* @global wp.Uploader
*
* @param {array} [models=[]] Array of initial models to populate the collection. * @param {array} [models=[]] Array of initial models to populate the collection.
* @param {object} [options={}] * @param {object} [options={}]
*/ */
@ -1254,7 +1266,7 @@ Query = Attachments.extend({
return fallback.sync.apply( this, arguments ); return fallback.sync.apply( this, arguments );
} }
} }
}, { }, /** @lends wp.media.model.Query */{
/** /**
* @readonly * @readonly
*/ */
@ -1407,19 +1419,21 @@ Query = Attachments.extend({
module.exports = Query; module.exports = Query;
},{}],6:[function(require,module,exports){ },{}],6:[function(require,module,exports){
var Attachments = wp.media.model.Attachments,
Selection;
/** /**
* wp.media.model.Selection * wp.media.model.Selection
* *
* A selection of attachments. * A selection of attachments.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments wp.media.model.Attachments * @augments wp.media.model.Attachments
* @augments Backbone.Collection * @augments Backbone.Collection
*/ */
var Attachments = wp.media.model.Attachments, Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{
Selection;
Selection = Attachments.extend({
/** /**
* Refresh the `single` model whenever the selection changes. * Refresh the `single` model whenever the selection changes.
* Binds `single` instead of using the context argument to ensure * Binds `single` instead of using the context argument to ensure

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,19 @@
var State = wp.media.controller.State,
l10n = wp.media.view.l10n,
AudioDetails;
/** /**
* wp.media.controller.AudioDetails * wp.media.controller.AudioDetails
* *
* The controller for the Audio Details state * The controller for the Audio Details state
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var State = wp.media.controller.State, AudioDetails = State.extend(/** @lends wp.media.controller.AudioDetails.prototype */{
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = State.extend({
defaults: { defaults: {
id: 'audio-details', id: 'audio-details',
toolbar: 'audio-details', toolbar: 'audio-details',

View File

@ -1,8 +1,14 @@
var Selection = wp.media.model.Selection,
Library = wp.media.controller.Library,
CollectionAdd;
/** /**
* wp.media.controller.CollectionAdd * wp.media.controller.CollectionAdd
* *
* A state for adding attachments to a collection (e.g. video playlist). * A state for adding attachments to a collection (e.g. video playlist).
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -31,11 +37,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 Selection = wp.media.model.Selection, CollectionAdd = Library.extend(/** @lends wp.media.controller.CollectionAdd.prototype */{
Library = wp.media.controller.Library,
CollectionAdd;
CollectionAdd = Library.extend({
defaults: _.defaults( { defaults: _.defaults( {
// Selection defaults. @see media.model.Selection // Selection defaults. @see media.model.Selection
multiple: 'add', multiple: 'add',

View File

@ -1,9 +1,16 @@
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
$ = jQuery,
CollectionEdit;
/** /**
* wp.media.controller.CollectionEdit * wp.media.controller.CollectionEdit
* *
* A state for editing a collection, which is used by audio and video playlists, * A state for editing a collection, which is used by audio and video playlists,
* and can be used for other collections. * and can be used for other collections.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -33,12 +40,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 = wp.media.controller.Library, CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.prototype */{
l10n = wp.media.view.l10n,
$ = jQuery,
CollectionEdit;
CollectionEdit = Library.extend({
defaults: { defaults: {
multiple: false, multiple: false,
sortable: true, sortable: true,

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
Cropper;
/** /**
* wp.media.controller.Cropper * wp.media.controller.Cropper
* *
* A state for cropping an image. * A state for cropping an image.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var l10n = wp.media.view.l10n, Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Cropper.prototype */{
Cropper;
Cropper = wp.media.controller.State.extend({
defaults: { defaults: {
id: 'cropper', id: 'cropper',
title: l10n.cropImage, title: l10n.cropImage,

View File

@ -1,6 +1,11 @@
var Controller = wp.media.controller,
CustomizeImageCropper;
/** /**
* wp.media.controller.CustomizeImageCropper * wp.media.controller.CustomizeImageCropper
* *
* @memberOf wp.media.controller
*
* A state for cropping an image. * A state for cropping an image.
* *
* @class * @class
@ -8,10 +13,7 @@
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var Controller = wp.media.controller, CustomizeImageCropper = Controller.Cropper.extend(/** @lends wp.media.controller.CustomizeImageCropper.prototype */{
CustomizeImageCropper;
CustomizeImageCropper = Controller.Cropper.extend({
doCrop: function( attachment ) { doCrop: function( attachment ) {
var cropDetails = attachment.get( 'cropDetails' ), var cropDetails = attachment.get( 'cropDetails' ),
control = this.get( 'control' ), control = this.get( 'control' ),

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
/** /**
* wp.media.controller.EditAttachmentMetadata * wp.media.controller.EditAttachmentMetadata
* *
* A state for editing an attachment's metadata. * A state for editing an attachment's metadata.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var l10n = wp.media.view.l10n, EditAttachmentMetadata = wp.media.controller.State.extend(/** @lends wp.media.controller.EditAttachmentMetadata.prototype */{
EditAttachmentMetadata;
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.

View File

@ -1,8 +1,13 @@
var l10n = wp.media.view.l10n,
EditImage;
/** /**
* wp.media.controller.EditImage * wp.media.controller.EditImage
* *
* A state for editing (cropping, etc.) an image. * A state for editing (cropping, etc.) an image.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -16,10 +21,7 @@
* @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 l10n = wp.media.view.l10n, EditImage = wp.media.controller.State.extend(/** @lends wp.media.controller.EditImage.prototype */{
EditImage;
EditImage = wp.media.controller.State.extend({
defaults: { defaults: {
id: 'edit-image', id: 'edit-image',
title: l10n.editImage, title: l10n.editImage,

View File

@ -1,8 +1,14 @@
var l10n = wp.media.view.l10n,
$ = Backbone.$,
Embed;
/** /**
* wp.media.controller.Embed * wp.media.controller.Embed
* *
* A state for embedding media from a URL. * A state for embedding media from a URL.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -19,11 +25,7 @@
* @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 l10n = wp.media.view.l10n, Embed = wp.media.controller.State.extend(/** @lends wp.media.controller.Embed.prototype */{
$ = Backbone.$,
Embed;
Embed = wp.media.controller.State.extend({
defaults: { defaults: {
id: 'embed', id: 'embed',
title: l10n.insertFromUrlTitle, title: l10n.insertFromUrlTitle,

View File

@ -1,8 +1,15 @@
var Attachment = wp.media.model.Attachment,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
FeaturedImage;
/** /**
* wp.media.controller.FeaturedImage * wp.media.controller.FeaturedImage
* *
* A state for selecting a featured image for a post. * A state for selecting a featured image for a post.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -29,12 +36,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 Attachment = wp.media.model.Attachment, FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prototype */{
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
FeaturedImage;
FeaturedImage = Library.extend({
defaults: _.defaults({ defaults: _.defaults({
id: 'featured-image', id: 'featured-image',
title: l10n.setFeaturedImageTitle, title: l10n.setFeaturedImageTitle,

View File

@ -1,8 +1,15 @@
var Selection = wp.media.model.Selection,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryAdd;
/** /**
* wp.media.controller.GalleryAdd * wp.media.controller.GalleryAdd
* *
* A state for selecting more images to add to a gallery. * A state for selecting more images to add to a gallery.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -29,12 +36,7 @@
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
* 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, GalleryAdd = Library.extend(/** @lends wp.media.controller.GalleryAdd.prototype */{
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryAdd;
GalleryAdd = Library.extend({
defaults: _.defaults({ defaults: _.defaults({
id: 'gallery-library', id: 'gallery-library',
title: l10n.addToGalleryTitle, title: l10n.addToGalleryTitle,

View File

@ -1,8 +1,14 @@
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryEdit;
/** /**
* wp.media.controller.GalleryEdit * wp.media.controller.GalleryEdit
* *
* A state for editing a gallery's images and settings. * A state for editing a gallery's images and settings.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -30,11 +36,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 = wp.media.controller.Library, GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototype */{
l10n = wp.media.view.l10n,
GalleryEdit;
GalleryEdit = Library.extend({
defaults: { defaults: {
id: 'gallery-edit', id: 'gallery-edit',
title: l10n.editGalleryTitle, title: l10n.editGalleryTitle,

View File

@ -1,9 +1,16 @@
var State = wp.media.controller.State,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ImageDetails;
/** /**
* wp.media.controller.ImageDetails * wp.media.controller.ImageDetails
* *
* A state for editing the attachment display settings of an image that's been * A state for editing the attachment display settings of an image that's been
* inserted into the editor. * inserted into the editor.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -22,12 +29,7 @@
* @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 = wp.media.controller.State, ImageDetails = State.extend(/** @lends wp.media.controller.ImageDetails.prototype */{
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ImageDetails;
ImageDetails = State.extend({
defaults: _.defaults({ defaults: _.defaults({
id: 'image-details', id: 'image-details',
title: l10n.imageDetailsTitle, title: l10n.imageDetailsTitle,

View File

@ -1,8 +1,15 @@
var l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library;
/** /**
* wp.media.controller.Library * wp.media.controller.Library
* *
* A state for choosing an attachment or group of attachments from the media library. * A state for choosing an attachment or group of attachments from the media library.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -32,12 +39,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 l10n = wp.media.view.l10n, Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Library.prototype */{
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library;
Library = wp.media.controller.State.extend({
defaults: { defaults: {
id: 'library', id: 'library',
title: l10n.mediaLibraryTitle, title: l10n.mediaLibraryTitle,

View File

@ -1,6 +1,8 @@
/** /**
* wp.media.controller.MediaLibrary * wp.media.controller.MediaLibrary
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -9,7 +11,7 @@
var Library = wp.media.controller.Library, var Library = wp.media.controller.Library,
MediaLibrary; MediaLibrary;
MediaLibrary = Library.extend({ MediaLibrary = Library.extend(/** @lends wp.media.controller.MediaLibrary.prototype */{
defaults: _.defaults({ defaults: _.defaults({
// Attachments browser defaults. @see media.view.AttachmentsBrowser // Attachments browser defaults. @see media.view.AttachmentsBrowser
filterable: 'uploaded', filterable: 'uploaded',

View File

@ -11,6 +11,8 @@
* 'browse' mode t be activated on the 'content' view and then fills the region * 'browse' mode t be activated on the 'content' view and then fills the region
* with an AttachmentsBrowser view. * with an AttachmentsBrowser view.
* *
* @memberOf wp.media.controller
*
* @class * @class
* *
* @param {object} options Options hash for the region. * @param {object} options Options hash for the region.
@ -25,7 +27,7 @@ var Region = function( options ) {
// Use Backbone's self-propagating `extend` inheritance method. // Use Backbone's self-propagating `extend` inheritance method.
Region.extend = Backbone.Model.extend; Region.extend = Backbone.Model.extend;
_.extend( Region.prototype, { _.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{
/** /**
* Activate a mode. * Activate a mode.
* *
@ -33,10 +35,8 @@ _.extend( Region.prototype, {
* *
* @param {string} mode * @param {string} mode
* *
* @fires this.view#{this.id}:activate:{this._mode} * @fires Region#activate
* @fires this.view#{this.id}:activate * @fires Region#deactivate
* @fires this.view#{this.id}:deactivate:{this._mode}
* @fires this.view#{this.id}:deactivate
* *
* @returns {wp.media.controller.Region} Returns itself to allow chaining. * @returns {wp.media.controller.Region} Returns itself to allow chaining.
*/ */
@ -52,8 +52,7 @@ _.extend( Region.prototype, {
/** /**
* Region mode deactivation event. * Region mode deactivation event.
* *
* @event this.view#{this.id}:deactivate:{this._mode} * @event wp.media.controller.Region#deactivate
* @event this.view#{this.id}:deactivate
*/ */
this.trigger('deactivate'); this.trigger('deactivate');
@ -63,8 +62,7 @@ _.extend( Region.prototype, {
/** /**
* Region mode activation event. * Region mode activation event.
* *
* @event this.view#{this.id}:activate:{this._mode} * @event wp.media.controller.Region#activate
* @event this.view#{this.id}:activate
*/ */
this.trigger('activate'); this.trigger('activate');
return this; return this;
@ -76,10 +74,8 @@ _.extend( Region.prototype, {
* *
* @param {string} mode * @param {string} mode
* *
* @fires this.view#{this.id}:create:{this._mode} * @fires Region#create
* @fires this.view#{this.id}:create * @fires Region#render
* @fires this.view#{this.id}:render:{this._mode}
* @fires this.view#{this.id}:render
* *
* @returns {wp.media.controller.Region} Returns itself to allow chaining * @returns {wp.media.controller.Region} Returns itself to allow chaining
*/ */
@ -97,8 +93,9 @@ _.extend( Region.prototype, {
* *
* Region view creation takes place in an event callback on the frame. * Region view creation takes place in an event callback on the frame.
* *
* @event this.view#{this.id}:create:{this._mode} * @event wp.media.controller.Region#create
* @event this.view#{this.id}:create * @type {object}
* @property {object} view
*/ */
this.trigger( 'create', set ); this.trigger( 'create', set );
view = set.view; view = set.view;
@ -108,8 +105,8 @@ _.extend( Region.prototype, {
* *
* Region view creation takes place in an event callback on the frame. * Region view creation takes place in an event callback on the frame.
* *
* @event this.view#{this.id}:create:{this._mode} * @event wp.media.controller.Region#render
* @event this.view#{this.id}:create * @type {object}
*/ */
this.trigger( 'render', view ); this.trigger( 'render', view );
if ( view ) { if ( view ) {

View File

@ -1,8 +1,14 @@
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ReplaceImage;
/** /**
* wp.media.controller.ReplaceImage * wp.media.controller.ReplaceImage
* *
* A state for replacing an image. * A state for replacing an image.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Library * @augments wp.media.controller.Library
* @augments wp.media.controller.State * @augments wp.media.controller.State
@ -29,11 +35,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 = wp.media.controller.Library, ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.prototype */{
l10n = wp.media.view.l10n,
ReplaceImage;
ReplaceImage = Library.extend({
defaults: _.defaults({ defaults: _.defaults({
id: 'replace-image', id: 'replace-image',
title: l10n.replaceImageTitle, title: l10n.replaceImageTitle,

View File

@ -1,17 +1,19 @@
var Controller = wp.media.controller,
SiteIconCropper;
/** /**
* wp.media.controller.SiteIconCropper * wp.media.controller.SiteIconCropper
* *
* A state for cropping a Site Icon. * A state for cropping a Site Icon.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.Cropper * @augments wp.media.controller.Cropper
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var Controller = wp.media.controller, SiteIconCropper = Controller.Cropper.extend(/** @lends wp.media.controller.SiteIconCropper.prototype */{
SiteIconCropper;
SiteIconCropper = Controller.Cropper.extend({
activate: function() { activate: function() {
this.frame.on( 'content:create:crop', this.createCropContent, this ); this.frame.on( 'content:create:crop', this.createCropContent, this );
this.frame.on( 'close', this.removeCropper, this ); this.frame.on( 'close', this.removeCropper, this );

View File

@ -6,6 +6,8 @@
* *
* States are stored as models in a Backbone collection. * States are stored as models in a Backbone collection.
* *
* @memberOf wp.media.controller
*
* @since 3.5.0 * @since 3.5.0
* *
* @class * @class
@ -23,7 +25,7 @@ var StateMachine = function( states ) {
// Use Backbone's self-propagating `extend` inheritance method. // Use Backbone's self-propagating `extend` inheritance method.
StateMachine.extend = Backbone.Model.extend; StateMachine.extend = Backbone.Model.extend;
_.extend( StateMachine.prototype, Backbone.Events, { _.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller.StateMachine.prototype */{
/** /**
* Fetch a state. * Fetch a state.
* *
@ -107,6 +109,21 @@ _.extend( StateMachine.prototype, Backbone.Events, {
// Map all event binding and triggering on a StateMachine to its `states` collection. // Map all event binding and triggering on a StateMachine to its `states` collection.
_.each([ 'on', 'off', 'trigger' ], function( method ) { _.each([ 'on', 'off', 'trigger' ], function( method ) {
/** /**
* @function on
* @memberOf wp.media.controller.StateMachine
* @instance
* @returns {wp.media.controller.StateMachine} Returns itself to allow chaining.
*/
/**
* @function off
* @memberOf wp.media.controller.StateMachine
* @instance
* @returns {wp.media.controller.StateMachine} Returns itself to allow chaining.
*/
/**
* @function trigger
* @memberOf wp.media.controller.StateMachine
* @instance
* @returns {wp.media.controller.StateMachine} Returns itself to allow chaining. * @returns {wp.media.controller.StateMachine} Returns itself to allow chaining.
*/ */
StateMachine.prototype[ method ] = function() { StateMachine.prototype[ method ] = function() {

View File

@ -12,10 +12,12 @@
* 'reset' is not triggered automatically. It should be invoked by the * 'reset' is not triggered automatically. It should be invoked by the
* proper controller to reset the state to its default. * proper controller to reset the state to its default.
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var State = Backbone.Model.extend({ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype */{
/** /**
* Constructor. * Constructor.
* *

View File

@ -3,6 +3,8 @@
* *
* The controller for the Video Details state * The controller for the Video Details state
* *
* @memberOf wp.media.controller
*
* @class * @class
* @augments wp.media.controller.State * @augments wp.media.controller.State
* @augments Backbone.Model * @augments Backbone.Model
@ -11,7 +13,7 @@ var State = wp.media.controller.State,
l10n = wp.media.view.l10n, l10n = wp.media.view.l10n,
VideoDetails; VideoDetails;
VideoDetails = State.extend({ VideoDetails = State.extend(/** @lends wp.media.controller.VideoDetails.prototype */{
defaults: { defaults: {
id: 'video-details', id: 'video-details',
toolbar: 'video-details', toolbar: 'video-details',

View File

@ -1,6 +1,7 @@
var $ = jQuery, var $ = jQuery,
Attachment, Attachments, l10n, media; Attachment, Attachments, l10n, media;
/** @namespace wp */
window.wp = window.wp || {}; window.wp = window.wp || {};
/** /**
@ -8,6 +9,10 @@ window.wp = window.wp || {};
* *
* Handles the default media experience. * Handles the default media experience.
* *
* @alias wp.media
* @memberOf wp
* @namespace
*
* @param {object} attributes The properties passed to the main media controller. * @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow. * @return {wp.media.view.MediaFrame} A media workflow.
*/ */
@ -46,6 +51,10 @@ media = wp.media = function( attributes ) {
return frame; return frame;
}; };
/** @namespace wp.media.model */
/** @namespace wp.media.view */
/** @namespace wp.media.controller */
/** @namespace wp.media.frames */
_.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
// Link any localized strings. // Link any localized strings.
@ -89,7 +98,7 @@ media.compare = function( a, b, ac, bc ) {
} }
}; };
_.extend( media, { _.extend( media, /** @lends wp.media */{
/** /**
* media.template( id ) * media.template( id )
* *

View File

@ -1,13 +1,15 @@
var $ = Backbone.$,
Attachment;
/** /**
* wp.media.model.Attachment * wp.media.model.Attachment
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var $ = Backbone.$, Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{
Attachment;
Attachment = Backbone.Model.extend({
/** /**
* Triggered when attachment details change * Triggered when attachment details change
* Overrides Backbone.Model.sync * Overrides Backbone.Model.sync
@ -134,11 +136,12 @@ Attachment = Backbone.Model.extend({
model.set( model.parse( resp, xhr ), options ); model.set( model.parse( resp, xhr ), options );
}); });
} }
}, { },/** @lends wp.media.model.Attachment */{
/** /**
* Create a new model on the static 'all' attachments collection and return it. * Create a new model on the static 'all' attachments collection and return it.
* *
* @static * @static
*
* @param {Object} attrs * @param {Object} attrs
* @returns {wp.media.model.Attachment} * @returns {wp.media.model.Attachment}
*/ */

View File

@ -7,6 +7,8 @@
* 'options.props.query = true', which will mirror the collection * 'options.props.query = true', which will mirror the collection
* to an Attachments Query collection - @see wp.media.model.Attachments.mirror(). * to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Collection * @augments Backbone.Collection
* *
@ -20,7 +22,7 @@
* @param {string} [options.filters] * @param {string} [options.filters]
* *
*/ */
var Attachments = Backbone.Collection.extend({ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachments.prototype */{
/** /**
* @type {wp.media.model.Attachment} * @type {wp.media.model.Attachment}
*/ */
@ -418,15 +420,13 @@ var Attachments = Backbone.Collection.extend({
attachments: attachments attachments: attachments
}); });
} }
}, { },/** @lends wp.media.model.Attachments */{
/** /**
* A function to compare two attachment models in an attachments collection. * A function to compare two attachment models in an attachments collection.
* *
* Used as the default comparator for instances of wp.media.model.Attachments * Used as the default comparator for instances of wp.media.model.Attachments
* and its subclasses. @see wp.media.model.Attachments._changeOrderby(). * and its subclasses. @see wp.media.model.Attachments._changeOrderby().
* *
* @static
*
* @param {Backbone.Model} a * @param {Backbone.Model} a
* @param {Backbone.Model} b * @param {Backbone.Model} b
* @param {Object} options * @param {Object} options
@ -455,9 +455,7 @@ var Attachments = Backbone.Collection.extend({
return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac ); return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac );
}, },
/** /** @namespace wp.media.model.Attachments.filters */
* @namespace
*/
filters: { filters: {
/** /**
* @static * @static

View File

@ -5,13 +5,15 @@
* *
* Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails. * Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
* *
* @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 PostImage = Backbone.Model.extend({ var PostImage = Backbone.Model.extend(/** @lends wp.media.model.PostImage.prototype */{
initialize: function( attributes ) { initialize: function( attributes ) {
var Attachment = wp.media.model.Attachment; var Attachment = wp.media.model.Attachment;

View File

@ -4,10 +4,12 @@
* Shared model class for audio and video. Updates the model after * Shared model class for audio and video. Updates the model after
* "Add Audio|Video Source" and "Replace Audio|Video" states return * "Add Audio|Video Source" and "Replace Audio|Video" states return
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments Backbone.Model * @augments Backbone.Model
*/ */
var PostMedia = Backbone.Model.extend({ var PostMedia = Backbone.Model.extend(/** @lends wp.media.model.PostMedia.prototype */{
initialize: function() { initialize: function() {
this.attachment = false; this.attachment = false;
}, },

View File

@ -1,3 +1,6 @@
var Attachments = wp.media.model.Attachments,
Query;
/** /**
* wp.media.model.Query * wp.media.model.Query
* *
@ -6,6 +9,8 @@
* Note: Do NOT change this.args after the query has been initialized. * Note: Do NOT change this.args after the query has been initialized.
* Things will break. * Things will break.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments wp.media.model.Attachments * @augments wp.media.model.Attachments
* @augments Backbone.Collection * @augments Backbone.Collection
@ -15,13 +20,8 @@
* @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 = wp.media.model.Attachments, Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
Query;
Query = Attachments.extend({
/** /**
* @global wp.Uploader
*
* @param {array} [models=[]] Array of initial models to populate the collection. * @param {array} [models=[]] Array of initial models to populate the collection.
* @param {object} [options={}] * @param {object} [options={}]
*/ */
@ -153,7 +153,7 @@ Query = Attachments.extend({
return fallback.sync.apply( this, arguments ); return fallback.sync.apply( this, arguments );
} }
} }
}, { }, /** @lends wp.media.model.Query */{
/** /**
* @readonly * @readonly
*/ */

View File

@ -1,16 +1,18 @@
var Attachments = wp.media.model.Attachments,
Selection;
/** /**
* wp.media.model.Selection * wp.media.model.Selection
* *
* A selection of attachments. * A selection of attachments.
* *
* @memberOf wp.media.model
*
* @class * @class
* @augments wp.media.model.Attachments * @augments wp.media.model.Attachments
* @augments Backbone.Collection * @augments Backbone.Collection
*/ */
var Attachments = wp.media.model.Attachments, Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{
Selection;
Selection = Attachments.extend({
/** /**
* Refresh the `single` model whenever the selection changes. * Refresh the `single` model whenever the selection changes.
* Binds `single` instead of using the context argument to ensure * Binds `single` instead of using the context argument to ensure

View File

@ -3,10 +3,12 @@
* *
* A router for handling the browser history and application state. * A router for handling the browser history and application state.
* *
* @memberOf wp.media.view.MediaFrame.Manage
*
* @class * @class
* @augments Backbone.Router * @augments Backbone.Router
*/ */
var Router = Backbone.Router.extend({ var Router = Backbone.Router.extend(/** @lends wp.media.view.MediaFrame.Manage.Router.prototype */{
routes: { routes: {
'upload.php?item=:slug&mode=edit': 'editItem', 'upload.php?item=:slug&mode=edit': 'editItem',
'upload.php?item=:slug': 'showItem', 'upload.php?item=:slug': 'showItem',

View File

@ -6,6 +6,8 @@
* Allows for selecting multiple images in the Insert Media workflow, and then * Allows for selecting multiple images in the Insert Media workflow, and then
* switching to the Insert Gallery workflow while preserving the attachments selection. * switching to the Insert Gallery workflow while preserving the attachments selection.
* *
* @memberOf wp.media
*
* @mixin * @mixin
*/ */
var selectionSync = { var selectionSync = {

View File

@ -1,17 +1,19 @@
var View = wp.media.View,
AttachmentCompat;
/** /**
* wp.media.view.AttachmentCompat * wp.media.view.AttachmentCompat
* *
* A view to display fields added via the `attachment_fields_to_edit` filter. * A view to display fields added via the `attachment_fields_to_edit` filter.
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, AttachmentCompat = View.extend(/** @lends wp.media.view.AttachmentCompat.prototype */{
AttachmentCompat;
AttachmentCompat = View.extend({
tagName: 'form', tagName: 'form',
className: 'compat-item', className: 'compat-item',

View File

@ -1,15 +1,17 @@
var $ = jQuery,
AttachmentFilters;
/** /**
* wp.media.view.AttachmentFilters * wp.media.view.AttachmentFilters
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var $ = jQuery, AttachmentFilters = wp.media.View.extend(/** @lends wp.media.view.AttachmentFilters.prototype */{
AttachmentFilters;
AttachmentFilters = wp.media.View.extend({
tagName: 'select', tagName: 'select',
className: 'attachment-filters', className: 'attachment-filters',
id: 'media-attachment-filters', id: 'media-attachment-filters',

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
All;
/** /**
* wp.media.view.AttachmentFilters.All * wp.media.view.AttachmentFilters.All
* *
* @memberOf wp.media.view.AttachmentFilters
*
* @class * @class
* @augments wp.media.view.AttachmentFilters * @augments wp.media.view.AttachmentFilters
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var l10n = wp.media.view.l10n, All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.All.prototype */{
All;
All = wp.media.view.AttachmentFilters.extend({
createFilters: function() { createFilters: function() {
var filters = {}; var filters = {};

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
DateFilter;
/** /**
* A filter dropdown for month/dates. * A filter dropdown for month/dates.
* *
* @memberOf wp.media.view.AttachmentFilters
*
* @class * @class
* @augments wp.media.view.AttachmentFilters * @augments wp.media.view.AttachmentFilters
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var l10n = wp.media.view.l10n, DateFilter = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.Date.prototype */{
DateFilter;
DateFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-date-filters', id: 'media-attachment-date-filters',
createFilters: function() { createFilters: function() {

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
Uploaded;
/** /**
* wp.media.view.AttachmentFilters.Uploaded * wp.media.view.AttachmentFilters.Uploaded
* *
* @memberOf wp.media.view.AttachmentFilters
*
* @class * @class
* @augments wp.media.view.AttachmentFilters * @augments wp.media.view.AttachmentFilters
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var l10n = wp.media.view.l10n, Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.Uploaded.prototype */{
Uploaded;
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,

View File

@ -1,16 +1,18 @@
var View = wp.media.View,
$ = jQuery,
Attachment;
/** /**
* wp.media.view.Attachment * wp.media.view.Attachment
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
$ = jQuery,
Attachment;
Attachment = View.extend({
tagName: 'li', tagName: 'li',
className: 'attachment', className: 'attachment',
template: wp.template('attachment'), template: wp.template('attachment'),
@ -518,6 +520,37 @@ _.each({
album: '_syncAlbum' album: '_syncAlbum'
}, function( method, setting ) { }, function( method, setting ) {
/** /**
* @function _syncCaption
* @memberOf wp.media.view.Attachment
* @instance
*
* @param {Backbone.Model} model
* @param {string} value
* @returns {wp.media.view.Attachment} Returns itself to allow chaining
*/
/**
* @function _syncTitle
* @memberOf wp.media.view.Attachment
* @instance
*
* @param {Backbone.Model} model
* @param {string} value
* @returns {wp.media.view.Attachment} Returns itself to allow chaining
*/
/**
* @function _syncArtist
* @memberOf wp.media.view.Attachment
* @instance
*
* @param {Backbone.Model} model
* @param {string} value
* @returns {wp.media.view.Attachment} Returns itself to allow chaining
*/
/**
* @function _syncAlbum
* @memberOf wp.media.view.Attachment
* @instance
*
* @param {Backbone.Model} model * @param {Backbone.Model} model
* @param {string} value * @param {string} value
* @returns {wp.media.view.Attachment} Returns itself to allow chaining * @returns {wp.media.view.Attachment} Returns itself to allow chaining

View File

@ -1,9 +1,14 @@
var Details = wp.media.view.Attachment.Details,
TwoColumn;
/** /**
* wp.media.view.Attachment.Details.TwoColumn * wp.media.view.Attachment.Details.TwoColumn
* *
* A similar view to media.view.Attachment.Details * A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal. * for use in the Edit Attachment modal.
* *
* @memberOf wp.media.view.Attachment.Details
*
* @class * @class
* @augments wp.media.view.Attachment.Details * @augments wp.media.view.Attachment.Details
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
@ -11,10 +16,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Details = wp.media.view.Attachment.Details, TwoColumn = Details.extend(/** @lends wp.media.view.Attachment.Details.TowColumn.prototype */{
TwoColumn;
TwoColumn = Details.extend({
template: wp.template( 'attachment-details-two-column' ), template: wp.template( 'attachment-details-two-column' ),
initialize: function() { initialize: function() {

View File

@ -1,17 +1,19 @@
var Attachment = wp.media.view.Attachment,
l10n = wp.media.view.l10n,
Details;
/** /**
* wp.media.view.Attachment.Details * wp.media.view.Attachment.Details
* *
* @memberOf wp.media.view.Attachment
*
* @class * @class
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Attachment = wp.media.view.Attachment, Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototype */{
l10n = wp.media.view.l10n,
Details;
Details = Attachment.extend({
tagName: 'div', tagName: 'div',
className: 'attachment-details', className: 'attachment-details',
template: wp.template('attachment-details'), template: wp.template('attachment-details'),

View File

@ -1,13 +1,15 @@
/** /**
* wp.media.view.Attachment.EditLibrary * wp.media.view.Attachment.EditLibrary
* *
* @memberOf wp.media.view.Attachment
*
* @class * @class
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var EditLibrary = wp.media.view.Attachment.extend({ var EditLibrary = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.EditLibrary.prototype */{
buttons: { buttons: {
close: true close: true
} }

View File

@ -1,5 +1,7 @@
/** /**
* wp.media.view.Attachments.EditSelection * wp.media.view.Attachment.EditSelection
*
* @memberOf wp.media.view.Attachment
* *
* @class * @class
* @augments wp.media.view.Attachment.Selection * @augments wp.media.view.Attachment.Selection
@ -8,7 +10,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var EditSelection = wp.media.view.Attachment.Selection.extend({ var EditSelection = wp.media.view.Attachment.Selection.extend(/** @lends wp.media.view.Attachment.EditSelection.prototype */{
buttons: { buttons: {
close: true close: true
} }

View File

@ -1,13 +1,15 @@
/** /**
* wp.media.view.Attachment.Library * wp.media.view.Attachment.Library
* *
* @memberOf wp.media.view.Attachment
*
* @class * @class
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Library = wp.media.view.Attachment.extend({ var Library = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.Library.prototype */{
buttons: { buttons: {
check: true check: true
} }

View File

@ -1,13 +1,15 @@
/** /**
* wp.media.view.Attachment.Selection * wp.media.view.Attachment.Selection
* *
* @memberOf wp.media.view.Attachment
*
* @class * @class
* @augments wp.media.view.Attachment * @augments wp.media.view.Attachment
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Selection = wp.media.view.Attachment.extend({ var Selection = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.Selection.prototype */{
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

View File

@ -1,16 +1,18 @@
var View = wp.media.View,
$ = jQuery,
Attachments;
/** /**
* wp.media.view.Attachments * wp.media.view.Attachments
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{
$ = jQuery,
Attachments;
Attachments = View.extend({
tagName: 'ul', tagName: 'ul',
className: 'attachments', className: 'attachments',

View File

@ -1,6 +1,14 @@
var View = wp.media.View,
mediaTrash = wp.media.view.settings.mediaTrash,
l10n = wp.media.view.l10n,
$ = jQuery,
AttachmentsBrowser;
/** /**
* wp.media.view.AttachmentsBrowser * wp.media.view.AttachmentsBrowser
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
@ -18,13 +26,7 @@
* @param {boolean|string} [options.sidebar=true] Whether to create a sidebar for the browser. * @param {boolean|string} [options.sidebar=true] Whether to create a sidebar for the browser.
* Accepts true, false, and 'errors'. * Accepts true, false, and 'errors'.
*/ */
var View = wp.media.View, AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.prototype */{
mediaTrash = wp.media.view.settings.mediaTrash,
l10n = wp.media.view.l10n,
$ = jQuery,
AttachmentsBrowser;
AttachmentsBrowser = View.extend({
tagName: 'div', tagName: 'div',
className: 'attachments-browser', className: 'attachments-browser',

View File

@ -1,16 +1,18 @@
var Attachments = wp.media.view.Attachments,
Selection;
/** /**
* wp.media.view.Attachments.Selection * wp.media.view.Attachments.Selection
* *
* @memberOf wp.media.view.Attachments
*
* @class * @class
* @augments wp.media.view.Attachments * @augments wp.media.view.Attachments
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Attachments = wp.media.view.Attachments, Selection = Attachments.extend(/** @lends wp.media.view.Attachments.Selection.prototype */{
Selection;
Selection = Attachments.extend({
events: {}, events: {},
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {

View File

@ -1,6 +1,11 @@
var MediaDetails = wp.media.view.MediaDetails,
AudioDetails;
/** /**
* wp.media.view.AudioDetails * wp.media.view.AudioDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.MediaDetails * @augments wp.media.view.MediaDetails
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
@ -9,10 +14,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var MediaDetails = wp.media.view.MediaDetails, AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{
AudioDetails;
AudioDetails = MediaDetails.extend({
className: 'audio-details', className: 'audio-details',
template: wp.template('audio-details'), template: wp.template('audio-details'),

View File

@ -1,15 +1,17 @@
var $ = Backbone.$,
ButtonGroup;
/** /**
* wp.media.view.ButtonGroup * wp.media.view.ButtonGroup
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var $ = Backbone.$, ButtonGroup = wp.media.View.extend(/** @lends wp.media.view.ButtonGroup.prototype */{
ButtonGroup;
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',

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.Button * wp.media.view.Button
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.View.extend({ var Button = wp.media.View.extend(/** @lends wp.media.view.Button.prototype */{
tagName: 'button', tagName: 'button',
className: 'media-button', className: 'media-button',
attributes: { type: 'button' }, attributes: { type: 'button' },

View File

@ -1,8 +1,14 @@
var Button = wp.media.view.Button,
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
/** /**
* wp.media.view.DeleteSelectedPermanentlyButton * wp.media.view.DeleteSelectedPermanentlyButton
* *
* When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.DeleteSelectedButton * @augments wp.media.view.DeleteSelectedButton
* @augments wp.media.view.Button * @augments wp.media.view.Button
@ -10,11 +16,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, DeleteSelectedPermanently = DeleteSelected.extend(/** @lends wp.media.view.DeleteSelectedPermanentlyButton.prototype */{
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
DeleteSelectedPermanently = DeleteSelected.extend({
initialize: function() { initialize: function() {
DeleteSelected.prototype.initialize.apply( this, arguments ); DeleteSelected.prototype.initialize.apply( this, arguments );
this.controller.on( 'select:activate', this.selectActivate, this ); this.controller.on( 'select:activate', this.selectActivate, this );

View File

@ -1,19 +1,21 @@
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
DeleteSelected;
/** /**
* wp.media.view.DeleteSelectedButton * wp.media.view.DeleteSelectedButton
* *
* A button that handles bulk Delete/Trash logic * A button that handles bulk Delete/Trash logic
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Button * @augments wp.media.view.Button
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, DeleteSelected = Button.extend(/** @lends wp.media.view.DeleteSelectedButton.prototype */{
l10n = wp.media.view.l10n,
DeleteSelected;
DeleteSelected = Button.extend({
initialize: function() { initialize: function() {
Button.prototype.initialize.apply( this, arguments ); Button.prototype.initialize.apply( this, arguments );
if ( this.options.filters ) { if ( this.options.filters ) {

View File

@ -1,17 +1,20 @@
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
SelectModeToggle;
/** /**
* wp.media.view.SelectModeToggleButton * wp.media.view.SelectModeToggleButton
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Button * @augments wp.media.view.Button
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Button = wp.media.view.Button, SelectModeToggle = Button.extend(/** @lends wp.media.view.SelectModeToggle.prototype */{
l10n = wp.media.view.l10n,
SelectModeToggle;
SelectModeToggle = Button.extend({
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {
size : '' size : ''

View File

@ -1,3 +1,9 @@
var View = wp.media.View,
UploaderStatus = wp.media.view.UploaderStatus,
l10n = wp.media.view.l10n,
$ = jQuery,
Cropper;
/** /**
* wp.media.view.Cropper * wp.media.view.Cropper
* *
@ -7,18 +13,14 @@
* wp.customize.HeaderControl.calculateImageSelectOptions via * wp.customize.HeaderControl.calculateImageSelectOptions via
* wp.customize.HeaderControl.openMM. * wp.customize.HeaderControl.openMM.
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Cropper = View.extend(/** @lends wp.media.view.Cropper.prototype */{
UploaderStatus = wp.media.view.UploaderStatus,
l10n = wp.media.view.l10n,
$ = jQuery,
Cropper;
Cropper = View.extend({
className: 'crop-content', className: 'crop-content',
template: wp.template('crop-content'), template: wp.template('crop-content'),
initialize: function() { initialize: function() {

View File

@ -1,17 +1,19 @@
var View = wp.media.View,
EditImage = wp.media.view.EditImage,
Details;
/** /**
* wp.media.view.EditImage.Details * wp.media.view.EditImage.Details
* *
* @memberOf wp.media.view.EditImage
*
* @class * @class
* @augments wp.media.view.EditImage * @augments wp.media.view.EditImage
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Details = EditImage.extend(/** @lends wp.media.view.EditImage.Details.prototype */{
EditImage = wp.media.view.EditImage,
Details;
Details = EditImage.extend({
initialize: function( options ) { initialize: function( options ) {
this.editor = window.imageEdit; this.editor = window.imageEdit;
this.frame = options.frame; this.frame = options.frame;

View File

@ -1,15 +1,17 @@
var View = wp.media.View,
EditImage;
/** /**
* wp.media.view.EditImage * wp.media.view.EditImage
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, EditImage = View.extend(/** @lends wp.media.view.EditImage.prototype */{
EditImage;
EditImage = View.extend({
className: 'image-editor', className: 'image-editor',
template: wp.template('image-editor'), template: wp.template('image-editor'),

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.Embed * wp.media.view.Embed
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Embed = wp.media.View.extend({ var Embed = wp.media.View.extend(/** @lends wp.media.view.Ember.prototype */{
className: 'media-embed', className: 'media-embed',
initialize: function() { initialize: function() {

View File

@ -1,6 +1,11 @@
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
EmbedImage;
/** /**
* wp.media.view.EmbedImage * wp.media.view.EmbedImage
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings * @augments wp.media.view.Settings
@ -8,10 +13,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, EmbedImage = AttachmentDisplay.extend(/** @lends wp.media.view.EmbedImage.prototype */{
EmbedImage;
EmbedImage = AttachmentDisplay.extend({
className: 'embed-media-settings', className: 'embed-media-settings',
template: wp.template('embed-image-settings'), template: wp.template('embed-image-settings'),

View File

@ -1,16 +1,18 @@
var $ = jQuery,
EmbedLink;
/** /**
* wp.media.view.EmbedLink * wp.media.view.EmbedLink
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Settings * @augments wp.media.view.Settings
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var $ = jQuery, EmbedLink = wp.media.view.Settings.extend(/** @lends wp.media.view.EmbedLink.prototype */{
EmbedLink;
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'),

View File

@ -1,16 +1,18 @@
var View = wp.media.View,
$ = jQuery,
EmbedUrl;
/** /**
* wp.media.view.EmbedUrl * wp.media.view.EmbedUrl
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, EmbedUrl = View.extend(/** @lends wp.media.view.EmbedUrl.prototype */{
$ = jQuery,
EmbedUrl;
EmbedUrl = View.extend({
tagName: 'label', tagName: 'label',
className: 'embed-url', className: 'embed-url',

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.FocusManager * wp.media.view.FocusManager
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var FocusManager = wp.media.View.extend({ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.prototype */{
events: { events: {
'keydown': 'constrainTabbing' 'keydown': 'constrainTabbing'

View File

@ -4,6 +4,8 @@
* A frame is a composite view consisting of one or more regions and one or more * A frame is a composite view consisting of one or more regions and one or more
* states. * states.
* *
* @memberOf wp.media.view
*
* @see wp.media.controller.State * @see wp.media.controller.State
* @see wp.media.controller.Region * @see wp.media.controller.Region
* *
@ -13,7 +15,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Frame = wp.media.View.extend({ var Frame = wp.media.View.extend(/** @lends wp.media.view.Frame.prototype */{
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {
mode: [ 'select' ] mode: [ 'select' ]
@ -141,7 +143,7 @@ var Frame = wp.media.View.extend({
/** /**
* Frame mode deactivation event. * Frame mode deactivation event.
* *
* @event this#{mode}:deactivate * @event wp.media.view.Frame#{mode}:deactivate
*/ */
this.trigger( mode + ':deactivate' ); this.trigger( mode + ':deactivate' );

View File

@ -1,6 +1,14 @@
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
AudioDetails;
/** /**
* wp.media.view.MediaFrame.AudioDetails * wp.media.view.MediaFrame.AudioDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.MediaDetails * @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
@ -11,13 +19,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, AudioDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.AudioDetails.prototype */{
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = MediaDetails.extend({
defaults: { defaults: {
id: 'audio', id: 'audio',
url: '', url: '',

View File

@ -1,3 +1,9 @@
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
/** /**
* wp.media.view.MediaFrame.EditAttachments * wp.media.view.MediaFrame.EditAttachments
* *
@ -7,6 +13,8 @@
* *
* Requires an attachment model to be passed in the options hash under `model`. * Requires an attachment model to be passed in the options hash under `model`.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
* @augments wp.media.View * @augments wp.media.View
@ -14,13 +22,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Frame = wp.media.view.Frame, EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAttachments.prototype */{
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
EditAttachments = MediaFrame.extend({
className: 'edit-attachment-frame', className: 'edit-attachment-frame',
template: wp.template( 'edit-attachment-frame' ), template: wp.template( 'edit-attachment-frame' ),

View File

@ -1,9 +1,15 @@
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
ImageDetails;
/** /**
* wp.media.view.MediaFrame.ImageDetails * wp.media.view.MediaFrame.ImageDetails
* *
* A media frame for manipulating an image that's already been inserted * A media frame for manipulating an image that's already been inserted
* into a post. * into a post.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
@ -13,11 +19,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Select = wp.media.view.MediaFrame.Select, ImageDetails = Select.extend(/** @lends wp.media.view.MediaFrame.ImageDetails.prototype */{
l10n = wp.media.view.l10n,
ImageDetails;
ImageDetails = Select.extend({
defaults: { defaults: {
id: 'image', id: 'image',
url: '', url: '',

View File

@ -1,3 +1,9 @@
var MediaFrame = wp.media.view.MediaFrame,
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
/** /**
* wp.media.view.MediaFrame.Manage * wp.media.view.MediaFrame.Manage
* *
@ -5,6 +11,8 @@
* *
* Used in the media grid view. * Used in the media grid view.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
@ -13,15 +21,9 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaFrame = wp.media.view.MediaFrame, Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
Manage = MediaFrame.extend({
/** /**
* @global wp.Uploader * @constructs
*/ */
initialize: function() { initialize: function() {
_.defaults( this.options, { _.defaults( this.options, {

View File

@ -1,6 +1,12 @@
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
MediaDetails;
/** /**
* wp.media.view.MediaFrame.MediaDetails * wp.media.view.MediaFrame.MediaDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
@ -10,11 +16,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Select = wp.media.view.MediaFrame.Select, MediaDetails = Select.extend(/** @lends wp.media.view.MediaFrame.MediaDetails.prototype */{
l10n = wp.media.view.l10n,
MediaDetails;
MediaDetails = Select.extend({
defaults: { defaults: {
id: 'media', id: 'media',
url: '', url: '',

View File

@ -1,8 +1,15 @@
var Select = wp.media.view.MediaFrame.Select,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
Post;
/** /**
* wp.media.view.MediaFrame.Post * wp.media.view.MediaFrame.Post
* *
* The frame for manipulating media on the Edit Post page. * The frame for manipulating media on the Edit Post page.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
@ -12,12 +19,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Select = wp.media.view.MediaFrame.Select, Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
Post;
Post = Select.extend({
initialize: function() { initialize: function() {
this.counts = { this.counts = {
audio: { audio: {
@ -443,6 +445,7 @@ Post = Select.extend({
requires: { selection: true }, requires: { selection: true },
/** /**
* @callback
* @fires wp.media.controller.State#insert * @fires wp.media.controller.State#insert
*/ */
click: function() { click: function() {

View File

@ -1,8 +1,14 @@
var MediaFrame = wp.media.view.MediaFrame,
l10n = wp.media.view.l10n,
Select;
/** /**
* wp.media.view.MediaFrame.Select * wp.media.view.MediaFrame.Select
* *
* A frame for selecting an item or items from the media library. * A frame for selecting an item or items from the media library.
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame * @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
@ -11,12 +17,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype */{
var MediaFrame = wp.media.view.MediaFrame,
l10n = wp.media.view.l10n,
Select;
Select = MediaFrame.extend({
initialize: function() { initialize: function() {
// 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 );

View File

@ -1,6 +1,13 @@
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
VideoDetails;
/** /**
* wp.media.view.MediaFrame.VideoDetails * wp.media.view.MediaFrame.VideoDetails
* *
* @memberOf wp.media.view.MediaFrame
*
* @class * @class
* @augments wp.media.view.MediaFrame.MediaDetails * @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame.Select
@ -11,12 +18,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, VideoDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.VideoDetails.prototype */{
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
VideoDetails;
VideoDetails = MediaDetails.extend({
defaults: { defaults: {
id: 'video', id: 'video',
url: '', url: '',

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.Iframe * wp.media.view.Iframe
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Iframe = wp.media.View.extend({ var Iframe = wp.media.View.extend(/** @lends wp.media.view.Iframe.prototype */{
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

View File

@ -1,6 +1,12 @@
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
$ = jQuery,
ImageDetails;
/** /**
* wp.media.view.ImageDetails * wp.media.view.ImageDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings * @augments wp.media.view.Settings
@ -8,11 +14,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, ImageDetails = AttachmentDisplay.extend(/** @lends wp.media.view.ImageDetails.prototype */{
$ = jQuery,
ImageDetails;
ImageDetails = AttachmentDisplay.extend({
className: 'image-details', className: 'image-details',
template: wp.template('image-details'), template: wp.template('image-details'),
events: _.defaults( AttachmentDisplay.prototype.events, { events: _.defaults( AttachmentDisplay.prototype.events, {

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.Label * wp.media.view.Label
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Label = wp.media.View.extend({ var Label = wp.media.View.extend(/** @lends wp.media.view.Label.prototype */{
tagName: 'label', tagName: 'label',
className: 'screen-reader-text', className: 'screen-reader-text',

View File

@ -1,8 +1,13 @@
/* global MediaElementPlayer */ /* global MediaElementPlayer */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
$ = jQuery,
MediaDetails;
/** /**
* wp.media.view.MediaDetails * wp.media.view.MediaDetails
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings * @augments wp.media.view.Settings
@ -10,11 +15,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{
$ = jQuery,
MediaDetails;
MediaDetails = AttachmentDisplay.extend({
initialize: function() { initialize: function() {
_.bindAll(this, 'success'); _.bindAll(this, 'success');
this.players = []; this.players = [];
@ -86,9 +87,6 @@ MediaDetails = AttachmentDisplay.extend({
this.scriptXhr = false; this.scriptXhr = false;
}, },
/**
* @global MediaElementPlayer
*/
setPlayer : function() { setPlayer : function() {
var src; var src;
@ -144,7 +142,7 @@ MediaDetails = AttachmentDisplay.extend({
resetFocus: function() { resetFocus: function() {
this.$( '.embed-media-settings' ).scrollTop( 0 ); this.$( '.embed-media-settings' ).scrollTop( 0 );
} }
}, { },/** @lends wp.media.view.MediaDetails */{
instances : 0, instances : 0,
/** /**
* When multiple players in the DOM contain the same src, things get weird. * When multiple players in the DOM contain the same src, things get weird.

View File

@ -1,8 +1,14 @@
var Frame = wp.media.view.Frame,
$ = jQuery,
MediaFrame;
/** /**
* wp.media.view.MediaFrame * wp.media.view.MediaFrame
* *
* The frame used to create the media modal. * The frame used to create the media modal.
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Frame * @augments wp.media.view.Frame
* @augments wp.media.View * @augments wp.media.View
@ -10,11 +16,7 @@
* @augments Backbone.View * @augments Backbone.View
* @mixes wp.media.controller.StateMachine * @mixes wp.media.controller.StateMachine
*/ */
var Frame = wp.media.view.Frame, MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
$ = jQuery,
MediaFrame;
MediaFrame = Frame.extend({
className: 'media-frame', className: 'media-frame',
template: wp.template('media-frame'), template: wp.template('media-frame'),
regions: ['menu','title','content','toolbar','router'], regions: ['menu','title','content','toolbar','router'],
@ -24,7 +26,7 @@ MediaFrame = Frame.extend({
}, },
/** /**
* @global wp.Uploader * @constructs
*/ */
initialize: function() { initialize: function() {
Frame.prototype.initialize.apply( this, arguments ); Frame.prototype.initialize.apply( this, arguments );
@ -232,6 +234,38 @@ MediaFrame = Frame.extend({
// Map some of the modal's methods to the frame. // Map some of the modal's methods to the frame.
_.each(['open','close','attach','detach','escape'], function( method ) { _.each(['open','close','attach','detach','escape'], function( method ) {
/** /**
* @function open
* @memberOf wp.media.view.MediaFrame
* @instance
*
* @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
*/
/**
* @function close
* @memberOf wp.media.view.MediaFrame
* @instance
*
* @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
*/
/**
* @function attach
* @memberOf wp.media.view.MediaFrame
* @instance
*
* @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
*/
/**
* @function detach
* @memberOf wp.media.view.MediaFrame
* @instance
*
* @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
*/
/**
* @function escape
* @memberOf wp.media.view.MediaFrame
* @instance
*
* @returns {wp.media.view.MediaFrame} Returns itself to allow chaining * @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
*/ */
MediaFrame.prototype[ method ] = function() { MediaFrame.prototype[ method ] = function() {

View File

@ -1,15 +1,17 @@
var $ = jQuery,
MenuItem;
/** /**
* wp.media.view.MenuItem * wp.media.view.MenuItem
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var $ = jQuery, MenuItem = wp.media.View.extend(/** @lends wp.media.view.MenuItem.prototype */{
MenuItem;
MenuItem = wp.media.View.extend({
tagName: 'a', tagName: 'a',
className: 'media-menu-item', className: 'media-menu-item',

View File

@ -1,17 +1,19 @@
var MenuItem = wp.media.view.MenuItem,
PriorityList = wp.media.view.PriorityList,
Menu;
/** /**
* wp.media.view.Menu * wp.media.view.Menu
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.PriorityList * @augments wp.media.view.PriorityList
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var MenuItem = wp.media.view.MenuItem, Menu = PriorityList.extend(/** @lends wp.media.view.Menu.prototype */{
PriorityList = wp.media.view.PriorityList,
Menu;
Menu = PriorityList.extend({
tagName: 'div', tagName: 'div',
className: 'media-menu', className: 'media-menu',
property: 'state', property: 'state',

View File

@ -1,17 +1,19 @@
var $ = jQuery,
Modal;
/** /**
* wp.media.view.Modal * wp.media.view.Modal
* *
* A modal view, which the media modal uses as its default container. * A modal view, which the media modal uses as its default container.
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var $ = jQuery, Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
Modal;
Modal = wp.media.View.extend({
tagName: 'div', tagName: 'div',
template: wp.template('media-modal'), template: wp.template('media-modal'),

View File

@ -1,12 +1,14 @@
/** /**
* wp.media.view.PriorityList * wp.media.view.PriorityList
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var PriorityList = wp.media.View.extend({ var PriorityList = wp.media.View.extend(/** @lends wp.media.view.PriorityList.prototype */{
tagName: 'div', tagName: 'div',
initialize: function() { initialize: function() {

View File

@ -1,13 +1,15 @@
/** /**
* wp.media.view.RouterItem * wp.media.view.RouterItem
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.MenuItem * @augments wp.media.view.MenuItem
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var RouterItem = wp.media.view.MenuItem.extend({ var RouterItem = wp.media.view.MenuItem.extend(/** @lends wp.media.view.RouterItem.prototype */{
/** /**
* On click handler to activate the content region's corresponding mode. * On click handler to activate the content region's corresponding mode.
*/ */

View File

@ -1,6 +1,11 @@
var Menu = wp.media.view.Menu,
Router;
/** /**
* wp.media.view.Router * wp.media.view.Router
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.view.Menu * @augments wp.media.view.Menu
* @augments wp.media.view.PriorityList * @augments wp.media.view.PriorityList
@ -8,10 +13,7 @@
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var Menu = wp.media.view.Menu, Router = Menu.extend(/** @lends wp.media.view.Router.prototype */{
Router;
Router = Menu.extend({
tagName: 'div', tagName: 'div',
className: 'media-router', className: 'media-router',
property: 'contentMode', property: 'contentMode',

View File

@ -1,15 +1,17 @@
var l10n = wp.media.view.l10n,
Search;
/** /**
* wp.media.view.Search * wp.media.view.Search
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var l10n = wp.media.view.l10n, Search = wp.media.View.extend(/** @lends wp.media.view.Search.prototype */{
Search;
Search = wp.media.View.extend({
tagName: 'input', tagName: 'input',
className: 'search', className: 'search',
id: 'media-search-input', id: 'media-search-input',

View File

@ -1,15 +1,17 @@
var l10n = wp.media.view.l10n,
Selection;
/** /**
* wp.media.view.Selection * wp.media.view.Selection
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var l10n = wp.media.view.l10n, Selection = wp.media.View.extend(/** @lends wp.media.view.Selection.prototype */{
Selection;
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'),

View File

@ -1,16 +1,18 @@
var View = wp.media.View,
$ = Backbone.$,
Settings;
/** /**
* wp.media.view.Settings * wp.media.view.Settings
* *
* @memberOf wp.media.view
*
* @class * @class
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.View * @augments wp.Backbone.View
* @augments Backbone.View * @augments Backbone.View
*/ */
var View = wp.media.View, Settings = View.extend(/** @lends wp.media.view.Settings.prototype */{
$ = Backbone.$,
Settings;
Settings = View.extend({
events: { events: {
'click button': 'updateHandler', 'click button': 'updateHandler',
'change input': 'updateHandler', 'change input': 'updateHandler',

Some files were not shown because too many files have changed in this diff Show More