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: {
files: [
'tests/qunit/**/*.html',

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,9 @@
/* global _wpCustomizeLoaderSettings, confirm */
/*
/**
* Expose a public API that allows the customizer to be
* loaded on any page.
*
* @namespace 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>
*
* @memberOf wp.customize
*
* @class
* @augments wp.customize.Events
*/
Loader = $.extend( {}, api.Events, {
Loader = $.extend( {}, api.Events,/** @lends wp.customize.Loader.prototype */{
/**
* Setup the Loader; triggered on document#ready.
*/

View File

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

View File

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

View File

@ -1,4 +1,6 @@
/* global _wpWidgetCustomizerPreviewSettings */
/** @namespace wp.customize.widgetsPreview */
wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function( $, _, wp, api ) {
var self;
@ -42,11 +44,14 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/**
* Partial representing a widget instance.
*
* @memberOf wp.customize.widgetsPreview
* @alias wp.customize.widgetsPreview.WidgetPartial
*
* @class
* @augments wp.customize.selectiveRefresh.Partial
* @since 4.5.0
*/
self.WidgetPartial = api.selectiveRefresh.Partial.extend({
self.WidgetPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.WidgetPartial.prototype */{
/**
* Constructor.
@ -112,11 +117,14 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/**
* Partial representing a widget area.
*
* @memberOf wp.customize.widgetsPreview
* @alias wp.customize.widgetsPreview.SidebarPartial
*
* @class
* @augments wp.customize.selectiveRefresh.Partial
* @since 4.5.0
*/
self.SidebarPartial = api.selectiveRefresh.Partial.extend({
self.SidebarPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.SidebarPartial.prototype */{
/**
* 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.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0
*/
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.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0
* @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
* focus the widget control.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 3.9.0
*/
self.highlightControls = function() {
@ -598,6 +612,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/**
* Parse a widget ID.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0
*
* @param {string} widgetId Widget ID.
@ -623,6 +639,8 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
/**
* Parse a widget setting ID.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0
*
* @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.
*
* @memberOf wp.customize.widgetsPreview
*
* @since 4.5.0
*
* @param {string} widgetId Widget ID.

View File

@ -87,12 +87,15 @@
};
/**
* @memberOf wp.customize
* @alias wp.customize.Preview
*
* @constructor
* @augments wp.customize.Messenger
* @augments wp.customize.Class
* @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} options - Extend any instance parameter or method with this object.

View File

@ -1,5 +1,6 @@
/* global jQuery, JSON, _customizePartialRefreshExports, console */
/** @namespace wp.customize.selectiveRefresh */
wp.customize.selectiveRefresh = ( function( $, api ) {
'use strict';
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.
*
* @memberOf wp.customize.selectiveRefresh
*
* @see PHP class WP_Customize_Partial.
*
* @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 {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,
@ -508,11 +511,13 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* 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.
*
* @class
* @memberOf wp.customize.selectiveRefresh
*
* @class Placement
* @augments wp.customize.Class
* @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.

View File

@ -11,10 +11,13 @@
*
* Instantiate with model wp.customize.HeaderTool.currentHeader.
*
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.CurrentView
*
* @constructor
* @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'),
initialize: function() {
@ -50,10 +53,13 @@
* Manually changes model wp.customize.HeaderTool.currentHeader via the
* `select` method.
*
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ChoiceView
*
* @constructor
* @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'),
className: 'header-view',
@ -125,10 +131,13 @@
*
* Takes a wp.customize.HeaderTool.ChoiceList.
*
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.ChoiceListView
*
* @constructor
* @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() {
this.listenTo(this.collection, 'add', this.addOne);
this.listenTo(this.collection, 'remove', this.render);
@ -168,10 +177,13 @@
* Aggregates wp.customize.HeaderTool.ChoiceList collections (or any
* Backbone object, really) and acts as a bus to feed them events.
*
* @memberOf wp.customize.HeaderTool
* @alias wp.customize.HeaderTool.CombinedList
*
* @constructor
* @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) {
this.collections = collections;
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.heartbeat = new Heartbeat();

View File

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

View File

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

View File

@ -30,19 +30,13 @@
return attrs[ key ];
};
/**
* wp.media.string
* @namespace
*/
/** @namespace wp.media.string */
wp.media.string = {
/**
* Joins the `props` and `attachment` objects,
* outputting the proper object format based on the
* attachment's type.
*
* @global wp.media.view.settings
* @global getUserSetting()
*
* @param {Object} [props={}] Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post.
* @returns {Object} Joined props
@ -109,8 +103,6 @@
/**
* 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} attachment The attachment object, media version of Post.
* @returns {string} The link markup
@ -159,9 +151,6 @@
*
* @access private
*
* @global wp.shortcode
* @global wp.media.view.settings
*
* @param {string} type The shortcode tag name: 'audio' or 'video'.
* @param {Object} props Attachment details (align, link, size, etc).
* @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,
* 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} attachment The attachment object, media version of Post.
* @returns {string}
@ -341,16 +327,19 @@
}
};
/**
* @class wp.media.collection
*
* @param {Object} attributes
*/
wp.media.collection = function(attributes) {
var collections = {};
return _.extend( {
return _.extend(/** @lends wp.media.collection.prototype */{
coerce : wp.media.coerce,
/**
* Retrieve attachments based on the properties of the passed shortcode
*
* @global wp.media.query
*
* @param {wp.shortcode} shortcode An instance of wp.shortcode().
* @returns {wp.media.model.Attachments} A Backbone.Collection containing
* the media items belonging to a collection.
@ -417,9 +406,6 @@
/**
* 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
* the media items belonging to a collection.
* The query[ this.tag ] property is a Backbone.Model
@ -488,10 +474,6 @@
* Triggered when double-clicking a collection shortcode placeholder
* 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
* shortcode markup matching the passed tag name,
*
@ -610,15 +592,13 @@
});
/**
* wp.media.featuredImage
* @namespace
* @namespace wp.media.featuredImage
* @memberOf wp.media
*/
wp.media.featuredImage = {
/**
* Get the featured image post ID
*
* @global wp.media.view.settings
*
* @returns {wp.media.view.settings.post.featuredImageId|number}
*/
get: function() {
@ -628,9 +608,6 @@
* Set the featured image id, save the post thumbnail data and
* 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.
*/
set: function( id ) {
@ -660,9 +637,6 @@
/**
* The Featured Image workflow
*
* @global wp.media.controller.FeaturedImage
* @global wp.media.view.l10n
*
* @this wp.media.featuredImage
*
* @returns {wp.media.view.MediaFrame.Select} A media workflow.
@ -705,8 +679,6 @@
* 'select' callback for Featured Image workflow, triggered when
* the 'Set Featured Image' button is clicked in the media modal.
*
* @global wp.media.view.settings
*
* @this wp.media.controller.FeaturedImage
*/
select: function() {
@ -723,8 +695,6 @@
* the post thumbnail is clicked.
*
* Update the featured image id when the 'remove' link is clicked.
*
* @global wp.media.view.settings
*/
init: function() {
$('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) {
@ -742,19 +712,11 @@
$( wp.media.featuredImage.init );
/**
* wp.media.editor
* @namespace
*/
/** @namespace wp.media.editor */
wp.media.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
*/
insert: function( html ) {
@ -805,8 +767,6 @@
* Setup 'workflow' and add to the 'workflows' cache. 'open' can
* subsequently be called upon it.
*
* @global wp.media.view.l10n
*
* @param {string} id A slug used to identify the workflow.
* @param {Object} [options={}]
*
@ -914,9 +874,6 @@
/**
* Determines the proper current workflow id
*
* @global wpActiveEditor
* @global tinymce
*
* @param {string} [id=''] A slug used to identify the workflow.
*
* @returns {wpActiveEditor|string|tinymce.activeEditor.id}
@ -962,17 +919,12 @@
id = this.id( id );
delete workflows[ id ];
},
/**
* @namespace
*/
/** @namespace wp.media.editor.send */
send: {
/**
* Called when sending an attachment to the editor
* from the medial modal.
*
* @global wp.media.view.settings
* @global wp.media.post
*
* @param {Object} props Attachment details (align, link, size, etc).
* @param {Object} attachment The attachment object, media version of Post.
* @returns {Promise}
@ -1028,8 +980,6 @@
/**
* Called when 'Insert From URL' source is not an image. Example: YouTube url.
*
* @global wp.media.view.settings
*
* @param {Object} embed
* @returns {Promise}
*/
@ -1075,8 +1025,6 @@
/**
* Bind click event for .insert-media using event delegation
*
* @global wp.media.view.l10n
*/
init: function() {
$(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){
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
/**
* wp.media.controller.EditAttachmentMetadata
*
* A state for editing an attachment's metadata.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
EditAttachmentMetadata = wp.media.controller.State.extend({
EditAttachmentMetadata = wp.media.controller.State.extend(/** @lends wp.media.controller.EditAttachmentMetadata.prototype */{
defaults: {
id: 'edit-attachment',
// 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.
*
* @memberOf wp.media.view.MediaFrame.Manage
*
* @class
* @augments Backbone.Router
*/
var Router = Backbone.Router.extend({
var Router = Backbone.Router.extend(/** @lends wp.media.view.MediaFrame.Manage.Router.prototype */{
routes: {
'upload.php?item=:slug&mode=edit': 'editItem',
'upload.php?item=:slug': 'showItem',
@ -107,12 +111,17 @@ var Router = Backbone.Router.extend({
module.exports = Router;
},{}],4:[function(require,module,exports){
var Details = wp.media.view.Attachment.Details,
TwoColumn;
/**
* wp.media.view.Attachment.Details.TwoColumn
*
* A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal.
*
* @memberOf wp.media.view.Attachment.Details
*
* @class
* @augments wp.media.view.Attachment.Details
* @augments wp.media.view.Attachment
@ -120,10 +129,7 @@ module.exports = Router;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Details = wp.media.view.Attachment.Details,
TwoColumn;
TwoColumn = Details.extend({
TwoColumn = Details.extend(/** @lends wp.media.view.Attachment.Details.TowColumn.prototype */{
template: wp.template( 'attachment-details-two-column' ),
initialize: function() {
@ -158,11 +164,17 @@ TwoColumn = Details.extend({
module.exports = TwoColumn;
},{}],5:[function(require,module,exports){
var Button = wp.media.view.Button,
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
/**
* wp.media.view.DeleteSelectedPermanentlyButton
*
* When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.DeleteSelectedButton
* @augments wp.media.view.Button
@ -170,11 +182,7 @@ module.exports = TwoColumn;
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
DeleteSelectedPermanently = DeleteSelected.extend({
DeleteSelectedPermanently = DeleteSelected.extend(/** @lends wp.media.view.DeleteSelectedPermanentlyButton.prototype */{
initialize: function() {
DeleteSelected.prototype.initialize.apply( this, arguments );
this.controller.on( 'select:activate', this.selectActivate, this );
@ -205,22 +213,24 @@ DeleteSelectedPermanently = DeleteSelected.extend({
module.exports = DeleteSelectedPermanently;
},{}],6:[function(require,module,exports){
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
DeleteSelected;
/**
* wp.media.view.DeleteSelectedButton
*
* A button that handles bulk Delete/Trash logic
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Button
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
DeleteSelected;
DeleteSelected = Button.extend({
DeleteSelected = Button.extend(/** @lends wp.media.view.DeleteSelectedButton.prototype */{
initialize: function() {
Button.prototype.initialize.apply( this, arguments );
if ( this.options.filters ) {
@ -258,20 +268,23 @@ DeleteSelected = Button.extend({
module.exports = DeleteSelected;
},{}],7:[function(require,module,exports){
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
SelectModeToggle;
/**
* wp.media.view.SelectModeToggleButton
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Button
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
SelectModeToggle;
SelectModeToggle = Button.extend({
SelectModeToggle = Button.extend(/** @lends wp.media.view.SelectModeToggle.prototype */{
initialize: function() {
_.defaults( this.options, {
size : ''
@ -332,20 +345,22 @@ SelectModeToggle = Button.extend({
module.exports = SelectModeToggle;
},{}],8:[function(require,module,exports){
var View = wp.media.View,
EditImage = wp.media.view.EditImage,
Details;
/**
* wp.media.view.EditImage.Details
*
* @memberOf wp.media.view.EditImage
*
* @class
* @augments wp.media.view.EditImage
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var View = wp.media.View,
EditImage = wp.media.view.EditImage,
Details;
Details = EditImage.extend({
Details = EditImage.extend(/** @lends wp.media.view.EditImage.Details.prototype */{
initialize: function( options ) {
this.editor = window.imageEdit;
this.frame = options.frame;
@ -367,6 +382,12 @@ Details = EditImage.extend({
module.exports = Details;
},{}],9:[function(require,module,exports){
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
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`.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.Frame
* @augments wp.media.View
@ -383,13 +406,7 @@ module.exports = Details;
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
EditAttachments = MediaFrame.extend({
EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAttachments.prototype */{
className: 'edit-attachment-frame',
template: wp.template( 'edit-attachment-frame' ),
@ -627,6 +644,12 @@ EditAttachments = MediaFrame.extend({
module.exports = EditAttachments;
},{}],10:[function(require,module,exports){
var MediaFrame = wp.media.view.MediaFrame,
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
/**
* wp.media.view.MediaFrame.Manage
*
@ -634,6 +657,8 @@ module.exports = EditAttachments;
*
* Used in the media grid view.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
@ -642,15 +667,9 @@ module.exports = EditAttachments;
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var MediaFrame = wp.media.view.MediaFrame,
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
Manage = MediaFrame.extend({
Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{
/**
* @global wp.Uploader
* @constructs
*/
initialize: function() {
_.defaults( this.options, {

View File

@ -2,6 +2,7 @@
var $ = jQuery,
Attachment, Attachments, l10n, media;
/** @namespace wp */
window.wp = window.wp || {};
/**
@ -9,6 +10,9 @@ window.wp = window.wp || {};
*
* Handles the default media experience.
*
* @alias wp.media
* @memberOf wp
*
* @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow.
*/
@ -47,6 +51,11 @@ media = wp.media = function( attributes ) {
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: {} });
// 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 )
*
@ -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){
var $ = Backbone.$,
Attachment;
/**
* wp.media.model.Attachment
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Model
*/
var $ = Backbone.$,
Attachment;
Attachment = Backbone.Model.extend({
Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{
/**
* Triggered when attachment details change
* Overrides Backbone.Model.sync
@ -366,11 +377,12 @@ Attachment = Backbone.Model.extend({
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.
*
* @static
*
* @param {Object} attrs
* @returns {wp.media.model.Attachment}
*/
@ -407,6 +419,8 @@ module.exports = Attachment;
* 'options.props.query = true', which will mirror the collection
* to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Collection
*
@ -420,7 +434,7 @@ module.exports = Attachment;
* @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}
*/
@ -818,15 +832,13 @@ var Attachments = Backbone.Collection.extend({
attachments: attachments
});
}
}, {
},/** @lends wp.media.model.Attachments */{
/**
* A function to compare two attachment models in an attachments collection.
*
* Used as the default comparator for instances of wp.media.model.Attachments
* and its subclasses. @see wp.media.model.Attachments._changeOrderby().
*
* @static
*
* @param {Backbone.Model} a
* @param {Backbone.Model} b
* @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 );
},
/**
* @namespace
*/
/** @namespace wp.media.model.Attachments.filters */
filters: {
/**
* @static
@ -952,13 +962,15 @@ module.exports = Attachments;
*
* Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails.
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Model
*
* @param {int} [attributes] Initial model attributes.
* @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 ) {
var Attachment = wp.media.model.Attachment;
@ -1099,6 +1111,9 @@ var PostImage = Backbone.Model.extend({
module.exports = PostImage;
},{}],5:[function(require,module,exports){
var Attachments = wp.media.model.Attachments,
Query;
/**
* wp.media.model.Query
*
@ -1107,6 +1122,8 @@ module.exports = PostImage;
* Note: Do NOT change this.args after the query has been initialized.
* Things will break.
*
* @memberOf wp.media.model
*
* @class
* @augments wp.media.model.Attachments
* @augments Backbone.Collection
@ -1116,13 +1133,8 @@ module.exports = PostImage;
* @param {object} [options.args] Attachments query arguments.
* @param {object} [options.args.posts_per_page]
*/
var Attachments = wp.media.model.Attachments,
Query;
Query = Attachments.extend({
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
/**
* @global wp.Uploader
*
* @param {array} [models=[]] Array of initial models to populate the collection.
* @param {object} [options={}]
*/
@ -1254,7 +1266,7 @@ Query = Attachments.extend({
return fallback.sync.apply( this, arguments );
}
}
}, {
}, /** @lends wp.media.model.Query */{
/**
* @readonly
*/
@ -1407,19 +1419,21 @@ Query = Attachments.extend({
module.exports = Query;
},{}],6:[function(require,module,exports){
var Attachments = wp.media.model.Attachments,
Selection;
/**
* wp.media.model.Selection
*
* A selection of attachments.
*
* @memberOf wp.media.model
*
* @class
* @augments wp.media.model.Attachments
* @augments Backbone.Collection
*/
var Attachments = wp.media.model.Attachments,
Selection;
Selection = Attachments.extend({
Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{
/**
* Refresh the `single` model whenever the selection changes.
* 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
*
* The controller for the Audio Details state
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
var State = wp.media.controller.State,
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = State.extend({
AudioDetails = State.extend(/** @lends wp.media.controller.AudioDetails.prototype */{
defaults: {
id: '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
*
* A state for adding attachments to a collection (e.g. video playlist).
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @augments wp.media.controller.State
@ -31,11 +37,7 @@
* @param {string} attributes.type The collection's media type. (e.g. 'video').
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
var Selection = wp.media.model.Selection,
Library = wp.media.controller.Library,
CollectionAdd;
CollectionAdd = Library.extend({
CollectionAdd = Library.extend(/** @lends wp.media.controller.CollectionAdd.prototype */{
defaults: _.defaults( {
// Selection defaults. @see media.model.Selection
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
*
* A state for editing a collection, which is used by audio and video playlists,
* and can be used for other collections.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @augments wp.media.controller.State
@ -33,12 +40,7 @@
* @param {string} attributes.type The collection's media type. (e.g. 'video').
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
*/
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
$ = jQuery,
CollectionEdit;
CollectionEdit = Library.extend({
CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.prototype */{
defaults: {
multiple: false,
sortable: true,

View File

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

View File

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

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
/**
* wp.media.controller.EditAttachmentMetadata
*
* A state for editing an attachment's metadata.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
*/
var l10n = wp.media.view.l10n,
EditAttachmentMetadata;
EditAttachmentMetadata = wp.media.controller.State.extend({
EditAttachmentMetadata = wp.media.controller.State.extend(/** @lends wp.media.controller.EditAttachmentMetadata.prototype */{
defaults: {
id: 'edit-attachment',
// 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
*
* A state for editing (cropping, etc.) an image.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
@ -16,10 +21,7 @@
* @param {string} [attributes.menu=false] Initial mode for the menu region.
* @param {string} [attributes.url] Unused. @todo Consider removal.
*/
var l10n = wp.media.view.l10n,
EditImage;
EditImage = wp.media.controller.State.extend({
EditImage = wp.media.controller.State.extend(/** @lends wp.media.controller.EditImage.prototype */{
defaults: {
id: 'edit-image',
title: l10n.editImage,

View File

@ -1,8 +1,14 @@
var l10n = wp.media.view.l10n,
$ = Backbone.$,
Embed;
/**
* wp.media.controller.Embed
*
* A state for embedding media from a URL.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
@ -19,11 +25,7 @@
* @param {string} [attributes.url] The embed URL.
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
*/
var l10n = wp.media.view.l10n,
$ = Backbone.$,
Embed;
Embed = wp.media.controller.State.extend({
Embed = wp.media.controller.State.extend(/** @lends wp.media.controller.Embed.prototype */{
defaults: {
id: 'embed',
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
*
* A state for selecting a featured image for a post.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @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.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
var Attachment = wp.media.model.Attachment,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
FeaturedImage;
FeaturedImage = Library.extend({
FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prototype */{
defaults: _.defaults({
id: 'featured-image',
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
*
* A state for selecting more images to add to a gallery.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @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.
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
*/
var Selection = wp.media.model.Selection,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryAdd;
GalleryAdd = Library.extend({
GalleryAdd = Library.extend(/** @lends wp.media.controller.GalleryAdd.prototype */{
defaults: _.defaults({
id: 'gallery-library',
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
*
* A state for editing a gallery's images and settings.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @augments wp.media.controller.State
@ -30,11 +36,7 @@
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
*/
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryEdit;
GalleryEdit = Library.extend({
GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototype */{
defaults: {
id: 'gallery-edit',
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
*
* A state for editing the attachment display settings of an image that's been
* inserted into the editor.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
@ -22,12 +29,7 @@
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
* however this may not do anything.
*/
var State = wp.media.controller.State,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ImageDetails;
ImageDetails = State.extend({
ImageDetails = State.extend(/** @lends wp.media.controller.ImageDetails.prototype */{
defaults: _.defaults({
id: 'image-details',
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
*
* A state for choosing an attachment or group of attachments from the media library.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.State
* @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.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
var l10n = wp.media.view.l10n,
getUserSetting = window.getUserSetting,
setUserSetting = window.setUserSetting,
Library;
Library = wp.media.controller.State.extend({
Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Library.prototype */{
defaults: {
id: 'library',
title: l10n.mediaLibraryTitle,

View File

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

View File

@ -11,6 +11,8 @@
* 'browse' mode t be activated on the 'content' view and then fills the region
* with an AttachmentsBrowser view.
*
* @memberOf wp.media.controller
*
* @class
*
* @param {object} options Options hash for the region.
@ -25,7 +27,7 @@ var Region = function( options ) {
// Use Backbone's self-propagating `extend` inheritance method.
Region.extend = Backbone.Model.extend;
_.extend( Region.prototype, {
_.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{
/**
* Activate a mode.
*
@ -33,10 +35,8 @@ _.extend( Region.prototype, {
*
* @param {string} mode
*
* @fires this.view#{this.id}:activate:{this._mode}
* @fires this.view#{this.id}:activate
* @fires this.view#{this.id}:deactivate:{this._mode}
* @fires this.view#{this.id}:deactivate
* @fires Region#activate
* @fires Region#deactivate
*
* @returns {wp.media.controller.Region} Returns itself to allow chaining.
*/
@ -52,8 +52,7 @@ _.extend( Region.prototype, {
/**
* Region mode deactivation event.
*
* @event this.view#{this.id}:deactivate:{this._mode}
* @event this.view#{this.id}:deactivate
* @event wp.media.controller.Region#deactivate
*/
this.trigger('deactivate');
@ -63,8 +62,7 @@ _.extend( Region.prototype, {
/**
* Region mode activation event.
*
* @event this.view#{this.id}:activate:{this._mode}
* @event this.view#{this.id}:activate
* @event wp.media.controller.Region#activate
*/
this.trigger('activate');
return this;
@ -76,10 +74,8 @@ _.extend( Region.prototype, {
*
* @param {string} mode
*
* @fires this.view#{this.id}:create:{this._mode}
* @fires this.view#{this.id}:create
* @fires this.view#{this.id}:render:{this._mode}
* @fires this.view#{this.id}:render
* @fires Region#create
* @fires Region#render
*
* @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.
*
* @event this.view#{this.id}:create:{this._mode}
* @event this.view#{this.id}:create
* @event wp.media.controller.Region#create
* @type {object}
* @property {object} view
*/
this.trigger( 'create', set );
view = set.view;
@ -108,8 +105,8 @@ _.extend( Region.prototype, {
*
* Region view creation takes place in an event callback on the frame.
*
* @event this.view#{this.id}:create:{this._mode}
* @event this.view#{this.id}:create
* @event wp.media.controller.Region#render
* @type {object}
*/
this.trigger( 'render', 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
*
* A state for replacing an image.
*
* @memberOf wp.media.controller
*
* @class
* @augments wp.media.controller.Library
* @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.syncSelection=true] Whether the Attachments selection should be persisted from the last state.
*/
var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
ReplaceImage;
ReplaceImage = Library.extend({
ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.prototype */{
defaults: _.defaults({
id: 'replace-image',
title: l10n.replaceImageTitle,

View File

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

View File

@ -6,6 +6,8 @@
*
* States are stored as models in a Backbone collection.
*
* @memberOf wp.media.controller
*
* @since 3.5.0
*
* @class
@ -23,7 +25,7 @@ var StateMachine = function( states ) {
// Use Backbone's self-propagating `extend` inheritance method.
StateMachine.extend = Backbone.Model.extend;
_.extend( StateMachine.prototype, Backbone.Events, {
_.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller.StateMachine.prototype */{
/**
* 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.
_.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.
*/
StateMachine.prototype[ method ] = function() {

View File

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

View File

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

View File

@ -1,6 +1,7 @@
var $ = jQuery,
Attachment, Attachments, l10n, media;
/** @namespace wp */
window.wp = window.wp || {};
/**
@ -8,6 +9,10 @@ window.wp = window.wp || {};
*
* Handles the default media experience.
*
* @alias wp.media
* @memberOf wp
* @namespace
*
* @param {object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow.
*/
@ -46,6 +51,10 @@ media = wp.media = function( attributes ) {
return frame;
};
/** @namespace wp.media.model */
/** @namespace wp.media.view */
/** @namespace wp.media.controller */
/** @namespace wp.media.frames */
_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
// 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 )
*

View File

@ -1,13 +1,15 @@
var $ = Backbone.$,
Attachment;
/**
* wp.media.model.Attachment
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Model
*/
var $ = Backbone.$,
Attachment;
Attachment = Backbone.Model.extend({
Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{
/**
* Triggered when attachment details change
* Overrides Backbone.Model.sync
@ -134,11 +136,12 @@ Attachment = Backbone.Model.extend({
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.
*
* @static
*
* @param {Object} attrs
* @returns {wp.media.model.Attachment}
*/

View File

@ -7,6 +7,8 @@
* 'options.props.query = true', which will mirror the collection
* to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Collection
*
@ -20,7 +22,7 @@
* @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}
*/
@ -418,15 +420,13 @@ var Attachments = Backbone.Collection.extend({
attachments: attachments
});
}
}, {
},/** @lends wp.media.model.Attachments */{
/**
* A function to compare two attachment models in an attachments collection.
*
* Used as the default comparator for instances of wp.media.model.Attachments
* and its subclasses. @see wp.media.model.Attachments._changeOrderby().
*
* @static
*
* @param {Backbone.Model} a
* @param {Backbone.Model} b
* @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 );
},
/**
* @namespace
*/
/** @namespace wp.media.model.Attachments.filters */
filters: {
/**
* @static

View File

@ -5,13 +5,15 @@
*
* Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails.
*
* @memberOf wp.media.model
*
* @class
* @augments Backbone.Model
*
* @param {int} [attributes] Initial model attributes.
* @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 ) {
var Attachment = wp.media.model.Attachment;

View File

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

View File

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

View File

@ -1,16 +1,18 @@
var Attachments = wp.media.model.Attachments,
Selection;
/**
* wp.media.model.Selection
*
* A selection of attachments.
*
* @memberOf wp.media.model
*
* @class
* @augments wp.media.model.Attachments
* @augments Backbone.Collection
*/
var Attachments = wp.media.model.Attachments,
Selection;
Selection = Attachments.extend({
Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{
/**
* Refresh the `single` model whenever the selection changes.
* 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.
*
* @memberOf wp.media.view.MediaFrame.Manage
*
* @class
* @augments Backbone.Router
*/
var Router = Backbone.Router.extend({
var Router = Backbone.Router.extend(/** @lends wp.media.view.MediaFrame.Manage.Router.prototype */{
routes: {
'upload.php?item=:slug&mode=edit': 'editItem',
'upload.php?item=:slug': 'showItem',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,18 @@
var l10n = wp.media.view.l10n,
Uploaded;
/**
* wp.media.view.AttachmentFilters.Uploaded
*
* @memberOf wp.media.view.AttachmentFilters
*
* @class
* @augments wp.media.view.AttachmentFilters
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var l10n = wp.media.view.l10n,
Uploaded;
Uploaded = wp.media.view.AttachmentFilters.extend({
Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.Uploaded.prototype */{
createFilters: function() {
var type = this.model.get('type'),
types = wp.media.view.settings.mimeTypes,

View File

@ -1,16 +1,18 @@
var View = wp.media.View,
$ = jQuery,
Attachment;
/**
* wp.media.view.Attachment
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var View = wp.media.View,
$ = jQuery,
Attachment;
Attachment = View.extend({
Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
tagName: 'li',
className: 'attachment',
template: wp.template('attachment'),
@ -518,6 +520,37 @@ _.each({
album: '_syncAlbum'
}, 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 {string} value
* @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
*
* A similar view to media.view.Attachment.Details
* for use in the Edit Attachment modal.
*
* @memberOf wp.media.view.Attachment.Details
*
* @class
* @augments wp.media.view.Attachment.Details
* @augments wp.media.view.Attachment
@ -11,10 +16,7 @@
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Details = wp.media.view.Attachment.Details,
TwoColumn;
TwoColumn = Details.extend({
TwoColumn = Details.extend(/** @lends wp.media.view.Attachment.Details.TowColumn.prototype */{
template: wp.template( 'attachment-details-two-column' ),
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
*
* @memberOf wp.media.view.Attachment
*
* @class
* @augments wp.media.view.Attachment
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Attachment = wp.media.view.Attachment,
l10n = wp.media.view.l10n,
Details;
Details = Attachment.extend({
Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototype */{
tagName: 'div',
className: 'attachment-details',
template: wp.template('attachment-details'),

View File

@ -1,13 +1,15 @@
/**
* wp.media.view.Attachment.EditLibrary
*
* @memberOf wp.media.view.Attachment
*
* @class
* @augments wp.media.view.Attachment
* @augments wp.media.View
* @augments wp.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: {
close: true
}

View File

@ -1,5 +1,7 @@
/**
* wp.media.view.Attachments.EditSelection
* wp.media.view.Attachment.EditSelection
*
* @memberOf wp.media.view.Attachment
*
* @class
* @augments wp.media.view.Attachment.Selection
@ -8,7 +10,7 @@
* @augments wp.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: {
close: true
}

View File

@ -1,13 +1,15 @@
/**
* wp.media.view.Attachment.Library
*
* @memberOf wp.media.view.Attachment
*
* @class
* @augments wp.media.view.Attachment
* @augments wp.media.View
* @augments wp.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: {
check: true
}

View File

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

View File

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

View File

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

View File

@ -1,15 +1,17 @@
var $ = Backbone.$,
ButtonGroup;
/**
* wp.media.view.ButtonGroup
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var $ = Backbone.$,
ButtonGroup;
ButtonGroup = wp.media.View.extend({
ButtonGroup = wp.media.View.extend(/** @lends wp.media.view.ButtonGroup.prototype */{
tagName: 'div',
className: 'button-group button-large media-button-group',

View File

@ -1,12 +1,14 @@
/**
* wp.media.view.Button
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.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',
className: 'media-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
*
* When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.DeleteSelectedButton
* @augments wp.media.view.Button
@ -10,11 +16,7 @@
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
DeleteSelected = wp.media.view.DeleteSelectedButton,
DeleteSelectedPermanently;
DeleteSelectedPermanently = DeleteSelected.extend({
DeleteSelectedPermanently = DeleteSelected.extend(/** @lends wp.media.view.DeleteSelectedPermanentlyButton.prototype */{
initialize: function() {
DeleteSelected.prototype.initialize.apply( this, arguments );
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
*
* A button that handles bulk Delete/Trash logic
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Button
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
DeleteSelected;
DeleteSelected = Button.extend({
DeleteSelected = Button.extend(/** @lends wp.media.view.DeleteSelectedButton.prototype */{
initialize: function() {
Button.prototype.initialize.apply( this, arguments );
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
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Button
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var Button = wp.media.view.Button,
l10n = wp.media.view.l10n,
SelectModeToggle;
SelectModeToggle = Button.extend({
SelectModeToggle = Button.extend(/** @lends wp.media.view.SelectModeToggle.prototype */{
initialize: function() {
_.defaults( this.options, {
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
*
@ -7,18 +13,14 @@
* wp.customize.HeaderControl.calculateImageSelectOptions via
* wp.customize.HeaderControl.openMM.
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var View = wp.media.View,
UploaderStatus = wp.media.view.UploaderStatus,
l10n = wp.media.view.l10n,
$ = jQuery,
Cropper;
Cropper = View.extend({
Cropper = View.extend(/** @lends wp.media.view.Cropper.prototype */{
className: 'crop-content',
template: wp.template('crop-content'),
initialize: function() {

View File

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

View File

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

View File

@ -1,12 +1,14 @@
/**
* wp.media.view.Embed
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.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',
initialize: function() {

View File

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

View File

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

View File

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

View File

@ -4,6 +4,8 @@
* A frame is a composite view consisting of one or more regions and one or more
* states.
*
* @memberOf wp.media.view
*
* @see wp.media.controller.State
* @see wp.media.controller.Region
*
@ -13,7 +15,7 @@
* @augments Backbone.View
* @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() {
_.defaults( this.options, {
mode: [ 'select' ]
@ -141,7 +143,7 @@ var Frame = wp.media.View.extend({
/**
* Frame mode deactivation event.
*
* @event this#{mode}:deactivate
* @event wp.media.view.Frame#{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
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select
@ -11,13 +19,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
AudioDetails;
AudioDetails = MediaDetails.extend({
AudioDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.AudioDetails.prototype */{
defaults: {
id: 'audio',
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
*
@ -7,6 +13,8 @@
*
* Requires an attachment model to be passed in the options hash under `model`.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.Frame
* @augments wp.media.View
@ -14,13 +22,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Frame = wp.media.view.Frame,
MediaFrame = wp.media.view.MediaFrame,
$ = jQuery,
EditAttachments;
EditAttachments = MediaFrame.extend({
EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAttachments.prototype */{
className: '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
*
* A media frame for manipulating an image that's already been inserted
* into a post.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
@ -13,11 +19,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
ImageDetails;
ImageDetails = Select.extend({
ImageDetails = Select.extend(/** @lends wp.media.view.MediaFrame.ImageDetails.prototype */{
defaults: {
id: 'image',
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
*
@ -5,6 +11,8 @@
*
* Used in the media grid view.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
@ -13,15 +21,9 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var MediaFrame = wp.media.view.MediaFrame,
Library = wp.media.controller.Library,
$ = Backbone.$,
Manage;
Manage = MediaFrame.extend({
Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{
/**
* @global wp.Uploader
* @constructs
*/
initialize: function() {
_.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
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
@ -10,11 +16,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
MediaDetails;
MediaDetails = Select.extend({
MediaDetails = Select.extend(/** @lends wp.media.view.MediaFrame.MediaDetails.prototype */{
defaults: {
id: 'media',
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
*
* The frame for manipulating media on the Edit Post page.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
@ -12,12 +19,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Select = wp.media.view.MediaFrame.Select,
Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
Post;
Post = Select.extend({
Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{
initialize: function() {
this.counts = {
audio: {
@ -443,6 +445,7 @@ Post = Select.extend({
requires: { selection: true },
/**
* @callback
* @fires wp.media.controller.State#insert
*/
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
*
* A frame for selecting an item or items from the media library.
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
@ -11,12 +17,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var MediaFrame = wp.media.view.MediaFrame,
l10n = wp.media.view.l10n,
Select;
Select = MediaFrame.extend({
Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype */{
initialize: function() {
// Call 'initialize' directly on the parent class.
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
*
* @memberOf wp.media.view.MediaFrame
*
* @class
* @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select
@ -11,12 +18,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
VideoDetails;
VideoDetails = MediaDetails.extend({
VideoDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.VideoDetails.prototype */{
defaults: {
id: 'video',
url: '',

View File

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

View File

@ -1,12 +1,14 @@
/**
* wp.media.view.Label
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.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',
className: 'screen-reader-text',

View File

@ -1,8 +1,13 @@
/* global MediaElementPlayer */
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
$ = jQuery,
MediaDetails;
/**
* wp.media.view.MediaDetails
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings
@ -10,11 +15,7 @@
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
$ = jQuery,
MediaDetails;
MediaDetails = AttachmentDisplay.extend({
MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{
initialize: function() {
_.bindAll(this, 'success');
this.players = [];
@ -86,9 +87,6 @@ MediaDetails = AttachmentDisplay.extend({
this.scriptXhr = false;
},
/**
* @global MediaElementPlayer
*/
setPlayer : function() {
var src;
@ -144,7 +142,7 @@ MediaDetails = AttachmentDisplay.extend({
resetFocus: function() {
this.$( '.embed-media-settings' ).scrollTop( 0 );
}
}, {
},/** @lends wp.media.view.MediaDetails */{
instances : 0,
/**
* 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
*
* The frame used to create the media modal.
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.Frame
* @augments wp.media.View
@ -10,11 +16,7 @@
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
*/
var Frame = wp.media.view.Frame,
$ = jQuery,
MediaFrame;
MediaFrame = Frame.extend({
MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
className: 'media-frame',
template: wp.template('media-frame'),
regions: ['menu','title','content','toolbar','router'],
@ -24,7 +26,7 @@ MediaFrame = Frame.extend({
},
/**
* @global wp.Uploader
* @constructs
*/
initialize: function() {
Frame.prototype.initialize.apply( this, arguments );
@ -232,6 +234,38 @@ MediaFrame = Frame.extend({
// Map some of the modal's methods to the frame.
_.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
*/
MediaFrame.prototype[ method ] = function() {

View File

@ -1,15 +1,17 @@
var $ = jQuery,
MenuItem;
/**
* wp.media.view.MenuItem
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var $ = jQuery,
MenuItem;
MenuItem = wp.media.View.extend({
MenuItem = wp.media.View.extend(/** @lends wp.media.view.MenuItem.prototype */{
tagName: 'a',
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
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.PriorityList
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
*/
var MenuItem = wp.media.view.MenuItem,
PriorityList = wp.media.view.PriorityList,
Menu;
Menu = PriorityList.extend({
Menu = PriorityList.extend(/** @lends wp.media.view.Menu.prototype */{
tagName: 'div',
className: 'media-menu',
property: 'state',

View File

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

View File

@ -1,12 +1,14 @@
/**
* wp.media.view.PriorityList
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.View
* @augments wp.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',
initialize: function() {

View File

@ -1,13 +1,15 @@
/**
* wp.media.view.RouterItem
*
* @memberOf wp.media.view
*
* @class
* @augments wp.media.view.MenuItem
* @augments wp.media.View
* @augments wp.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.
*/

View File

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

View File

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

View File

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

View File

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

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