Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/js/_enqueues/wp/media/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ window.wp = window.wp || {};
* @namespace
*
* @param {Object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow.
* @return {void|wp.media.view.MediaFrame} A media workflow.
*/
media = wp.media = function( attributes ) {
var MediaFrame = media.view.MediaFrame,
Expand Down Expand Up @@ -137,7 +137,7 @@ _.extend( media, /** @lends wp.media */{
* Scales a set of dimensions to fit within bounding dimensions.
*
* @param {Object} dimensions
* @return {Object}
* @return {Object} The scaled dimensions.
*/
fit: function( dimensions ) {
var width = dimensions.width,
Expand Down Expand Up @@ -209,7 +209,7 @@ _.extend( media, /** @lends wp.media */{
*
* @static
* @param {string} id A string used to identify a model.
* @return {wp.media.model.Attachment}
* @return {wp.media.model.Attachment} The attachment model for the given id.
*/
media.attachment = function( id ) {
return Attachment.get( id );
Expand All @@ -229,7 +229,7 @@ Attachments.all = new Attachments();
* Shorthand for creating a new Attachments Query.
*
* @param {Object} [props]
* @return {wp.media.model.Attachments}
* @return {wp.media.model.Attachments} A collection of attachments matching the query.
*/
media.query = function( props ) {
return new Attachments( null, {
Expand Down
2 changes: 1 addition & 1 deletion src/js/_enqueues/wp/media/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ media.events = _.extend( {}, Backbone.Events );
*
* @param {string} selector
* @param {number} sensitivity
* @return {Promise}
* @return {Promise} A promise that resolves when the transition has completed.
*/
media.transition = function( selector, sensitivity ) {
var deferred = $.Deferred();
Expand Down
2 changes: 2 additions & 0 deletions src/js/_enqueues/wp/widgets/custom-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/**
* @namespace wp.customHtmlWidget
* @memberOf wp
*
* @param {JQueryStatic} $ The jQuery object.
*/
wp.customHtmlWidgets = ( function( $ ) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/js/_enqueues/wp/widgets/media-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
* View events.
*
* @since 4.9.0
* @type {object}
* @type {Object}
*/
events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
'click .media-widget-gallery-preview': 'editMedia'
Expand Down
2 changes: 1 addition & 1 deletion src/js/_enqueues/wp/widgets/media-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* View events.
*
* @type {object}
* @type {Object}
*/
events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
'click .media-widget-preview.populated': 'editMedia'
Expand Down
2 changes: 2 additions & 0 deletions src/js/_enqueues/wp/widgets/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/**
* @namespace wp.mediaWidgets
* @memberOf wp
*
* @param {JQueryStatic} $ The jQuery object.
*/
wp.mediaWidgets = ( function( $ ) {
'use strict';
Expand Down
2 changes: 2 additions & 0 deletions src/js/_enqueues/wp/widgets/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* @namespace wp.textWidgets
*
* @param {JQueryStatic} $ The jQuery object.
*/
wp.textWidgets = ( function( $ ) {
'use strict';
Expand Down
4 changes: 2 additions & 2 deletions src/js/media/controllers/collection-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var Selection = wp.media.model.Selection,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=library] Unique identifier.
* @param {string} attributes.title Title for the state. Displays in the frame's title region.
* @param {boolean|string} [attributes.multiple=add] Whether multi-select is enabled. Accepts 'add' or true.
Expand All @@ -33,7 +33,7 @@ var Selection = wp.media.model.Selection,
* @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
* @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection.
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
* @param {int} [attributes.priority=100] The priority for the state link in the media menu.
* @param {number} [attributes.priority=100] The priority for the state link in the media menu.
* @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.
* @param {string} attributes.type The collection's media type. (e.g. 'video').
Expand Down
8 changes: 4 additions & 4 deletions src/js/media/controllers/collection-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var Library = wp.media.controller.Library,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} attributes.title Title for the state. Displays in the media menu and the frame's title region.
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to edit.
* If one is not supplied, an empty media.model.Selection collection is created.
Expand All @@ -29,9 +29,9 @@ var Library = wp.media.controller.Library,
* @param {boolean} [attributes.describe=true] Whether to offer UI to describe the attachments - e.g. captioning images in a gallery.
* @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable.
* @param {boolean} [attributes.dragInfoText] Instructional text about the attachments being sortable.
* @param {int} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
* @param {number} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
* @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance.
* @param {int} [attributes.priority=60] The priority for the state link in the media menu.
* @param {number} [attributes.priority=60] The priority for the state link in the media menu.
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
* Defaults to false for this state, because the library passed in *is* the selection.
* @param {view} [attributes.SettingsView] The view to edit the collection instance settings (e.g. Playlist settings with "Show tracklist" checkbox).
Expand Down Expand Up @@ -117,7 +117,7 @@ CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.pr
*
* @since 3.9.0
*
* @param {wp.media.view.attachmentsBrowser} The attachments browser view.
* @param {wp.media.view.attachmentsBrowser} attachmentsBrowserView The attachments browser view.
*/
renderSettings: function( attachmentsBrowserView ) {
var library = this.get('library'),
Expand Down
1 change: 1 addition & 0 deletions src/js/media/controllers/cropper.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe
*
* @since 4.2.0
*
* @param {wp.media.model.Attachment} attachment The image attachment.
* @return {$.promise} A jQuery promise with the custom header crop details.
*/
doCrop: function( attachment ) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/media/controllers/edit-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var l10n = wp.media.view.l10n,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} attributes The attributes hash passed to the state.
* @param {Object} attributes The attributes hash passed to the state.
* @param {wp.media.model.Attachment} attributes.model The attachment.
* @param {string} [attributes.id=edit-image] Unique identifier.
* @param {string} [attributes.title=Edit Image] Title for the state. Displays in the media menu and the frame's title region.
Expand Down
6 changes: 3 additions & 3 deletions src/js/media/controllers/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ var l10n = wp.media.view.l10n,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} attributes The attributes hash passed to the state.
* @param {Object} attributes The attributes hash passed to the state.
* @param {string} [attributes.id=embed] Unique identifier.
* @param {string} [attributes.title=Insert From URL] Title for the state. Displays in the media menu and the frame's title region.
* @param {string} [attributes.content=embed] Initial mode for the content region.
* @param {string} [attributes.menu=default] Initial mode for the menu region.
* @param {string} [attributes.toolbar=main-embed] Initial mode for the toolbar region.
* @param {string} [attributes.menu=false] Initial mode for the menu region.
* @param {int} [attributes.priority=120] The priority for the state link in the media menu.
* @param {number} [attributes.priority=120] The priority for the state link in the media menu.
* @param {string} [attributes.type=link] The type of embed. Currently only link is supported.
* @param {string} [attributes.url] The embed URL.
* @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
* @param {Object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set.
*/
Embed = wp.media.controller.State.extend(/** @lends wp.media.controller.Embed.prototype */{
defaults: {
Expand Down
4 changes: 2 additions & 2 deletions src/js/media/controllers/featured-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var Attachment = wp.media.model.Attachment,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=featured-image] Unique identifier.
* @param {string} [attributes.title=Set Featured Image] Title for the state. Displays in the media menu and the frame's title region.
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
Expand All @@ -26,7 +26,7 @@ var Attachment = wp.media.model.Attachment,
* @param {string} [attributes.menu=default] Initial mode for the menu region.
* @param {string} [attributes.router=browse] Initial mode for the router region.
* @param {string} [attributes.toolbar=featured-image] Initial mode for the toolbar region.
* @param {int} [attributes.priority=60] The priority for the state link in the media menu.
* @param {number} [attributes.priority=60] The priority for the state link in the media menu.
* @param {boolean} [attributes.searchable=true] Whether the library is searchable.
* @param {boolean|string} [attributes.filterable=false] Whether the library is filterable, and if so what filters should be shown.
* Accepts 'all', 'uploaded', or 'unattached'.
Expand Down
6 changes: 3 additions & 3 deletions src/js/media/controllers/image-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var State = wp.media.controller.State,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=image-details] Unique identifier.
* @param {string} [attributes.title=Image Details] Title for the state. Displays in the frame's title region.
* @param {wp.media.model.Attachment} attributes.image The image's model.
Expand All @@ -24,7 +24,7 @@ var State = wp.media.controller.State,
* @param {string|false} [attributes.router=false] Initial mode for the router region.
* @param {string|false} [attributes.toolbar=image-details] Initial mode for the toolbar region.
* @param {boolean} [attributes.editing=false] Unused.
* @param {int} [attributes.priority=60] Unused.
* @param {number} [attributes.priority=60] Unused.
*
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
* however this may not do anything.
Expand All @@ -44,7 +44,7 @@ ImageDetails = State.extend(/** @lends wp.media.controller.ImageDetails.prototyp
/**
* @since 3.9.0
*
* @param options Attributes
* @param {Object} options Attributes.
*/
initialize: function( options ) {
this.image = options.image;
Expand Down
10 changes: 5 additions & 5 deletions src/js/media/controllers/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var l10n = wp.media.view.l10n,
* @augments Backbone.Model
* @mixes media.selectionSync
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=library] Unique identifier.
* @param {string} [attributes.title=Media library] Title for the state. Displays in the media menu and the frame's title region.
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
Expand Down Expand Up @@ -153,7 +153,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 3.5.0
*
* @param {wp.media.model.Attachment} attachment
* @return {Backbone.Model}
* @return {Backbone.Model} A model representing the display settings for the attachment.
*/
display: function( attachment ) {
var displays = this._displays;
Expand All @@ -170,7 +170,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 3.6.0
*
* @param {wp.media.model.Attachment} attachment
* @return {Object}
* @return {Object} The default display settings for the attachment.
*/
defaultDisplaySettings: function( attachment ) {
var settings = _.clone( this._defaultDisplaySettings );
Expand All @@ -191,7 +191,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 4.4.1
*
* @param {wp.media.model.Attachment} attachment
* @return {boolean}
* @return {boolean} True if the attachment is an image, false otherwise.
*/
isImageAttachment: function( attachment ) {
// If uploading, we know the filename but not the mime type.
Expand All @@ -208,7 +208,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 3.6.0
*
* @param {wp.media.model.Attachment} attachment
* @return {boolean}
* @return {boolean} True if the attachment can be embedded, false otherwise.
*/
canEmbed: function( attachment ) {
// If uploading, we know the filename but not the mime type.
Expand Down
2 changes: 1 addition & 1 deletion src/js/media/controllers/media-library.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MediaLibrary = Library.extend(/** @lends wp.media.controller.MediaLibrary.protot
/**
* @since 3.9.0
*
* @param options
* @param {Object} options Attributes.
*/
initialize: function( options ) {
this.media = options.media;
Expand Down
8 changes: 4 additions & 4 deletions src/js/media/controllers/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ _.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{
* Region view creation takes place in an event callback on the frame.
*
* @event wp.media.controller.Region#create
* @type {object}
* @property {object} view
* @type {Object}
* @property {Object} view
*/
this.trigger( 'create', set );
view = set.view;
Expand All @@ -106,7 +106,7 @@ _.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{
* Region view creation takes place in an event callback on the frame.
*
* @event wp.media.controller.Region#render
* @type {object}
* @type {Object}
*/
this.trigger( 'render', view );
if ( view ) {
Expand All @@ -120,7 +120,7 @@ _.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{
*
* @since 3.5.0
*
* @return {wp.media.View}
* @return {wp.media.View} Returns the region's view.
*/
get: function() {
return this.view.views.first( this.selector );
Expand Down
6 changes: 3 additions & 3 deletions src/js/media/controllers/replace-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var Library = wp.media.controller.Library,
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=replace-image] Unique identifier.
* @param {string} [attributes.title=Replace Image] Title for the state. Displays in the media menu and the frame's title region.
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
Expand All @@ -25,7 +25,7 @@ var Library = wp.media.controller.Library,
* @param {string} [attributes.menu=default] Initial mode for the menu region.
* @param {string} [attributes.router=browse] Initial mode for the router region.
* @param {string} [attributes.toolbar=replace] Initial mode for the toolbar region.
* @param {int} [attributes.priority=60] The priority for the state link in the media menu.
* @param {number} [attributes.priority=60] The priority for the state link in the media menu.
* @param {boolean} [attributes.searchable=true] Whether the library is searchable.
* @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown.
* Accepts 'all', 'uploaded', or 'unattached'.
Expand All @@ -50,7 +50,7 @@ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.protot
/**
* @since 3.9.0
*
* @param options
* @param {Object} options Attributes.
*/
initialize: function( options ) {
var library, comparator;
Expand Down
4 changes: 2 additions & 2 deletions src/js/media/controllers/state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ _.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller
*
* @since 3.5.0
*
* @return {wp.media.controller.State} Returns a State model from
* the StateMachine collection.
* @return {void|wp.media.controller.State} Returns a State model from
* the StateMachine collection.
*/
lastState: function() {
if ( this._lastState ) {
Expand Down
1 change: 1 addition & 0 deletions src/js/media/controllers/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype
},

/**
* @param {media.view.Title} view The title view.
* @since 3.5.0
* @access private
*/
Expand Down
Loading
Loading