Skip to content

Commit 1f6b8f2

Browse files
committed
General: Improve JavaScript inline code documentation part 3.
Fixes the JSDoc violations reported by the `lint:jsdoc` updated configuraiton after [63392]. Third part, Developed in WordPress#13251 Props afercia, westonruter. See #65951, #65939. git-svn-id: https://develop.svn.wordpress.org/trunk@63408 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 987d42d commit 1f6b8f2

25 files changed

Lines changed: 83 additions & 74 deletions

‎src/js/_enqueues/wp/media/models.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ window.wp = window.wp || {};
1717
* @namespace
1818
*
1919
* @param {Object} attributes The properties passed to the main media controller.
20-
* @return {wp.media.view.MediaFrame} A media workflow.
20+
* @return {void|wp.media.view.MediaFrame} A media workflow.
2121
*/
2222
media = wp.media = function( attributes ) {
2323
var MediaFrame = media.view.MediaFrame,
@@ -137,7 +137,7 @@ _.extend( media, /** @lends wp.media */{
137137
* Scales a set of dimensions to fit within bounding dimensions.
138138
*
139139
* @param {Object} dimensions
140-
* @return {Object}
140+
* @return {Object} The scaled dimensions.
141141
*/
142142
fit: function( dimensions ) {
143143
var width = dimensions.width,
@@ -209,7 +209,7 @@ _.extend( media, /** @lends wp.media */{
209209
*
210210
* @static
211211
* @param {string} id A string used to identify a model.
212-
* @return {wp.media.model.Attachment}
212+
* @return {wp.media.model.Attachment} The attachment model for the given id.
213213
*/
214214
media.attachment = function( id ) {
215215
return Attachment.get( id );
@@ -229,7 +229,7 @@ Attachments.all = new Attachments();
229229
* Shorthand for creating a new Attachments Query.
230230
*
231231
* @param {Object} [props]
232-
* @return {wp.media.model.Attachments}
232+
* @return {wp.media.model.Attachments} A collection of attachments matching the query.
233233
*/
234234
media.query = function( props ) {
235235
return new Attachments( null, {

‎src/js/_enqueues/wp/media/views.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ media.events = _.extend( {}, Backbone.Events );
4949
*
5050
* @param {string} selector
5151
* @param {number} sensitivity
52-
* @return {Promise}
52+
* @return {Promise} A promise that resolves when the transition has completed.
5353
*/
5454
media.transition = function( selector, sensitivity ) {
5555
var deferred = $.Deferred();

‎src/js/_enqueues/wp/widgets/custom-html.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* @namespace wp.customHtmlWidget
1111
* @memberOf wp
12+
*
13+
* @param {JQueryStatic} $ The jQuery object.
1214
*/
1315
wp.customHtmlWidgets = ( function( $ ) {
1416
'use strict';

‎src/js/_enqueues/wp/widgets/media-gallery.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
* View events.
7070
*
7171
* @since 4.9.0
72-
* @type {object}
72+
* @type {Object}
7373
*/
7474
events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
7575
'click .media-widget-gallery-preview': 'editMedia'

‎src/js/_enqueues/wp/widgets/media-image.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/**
3232
* View events.
3333
*
34-
* @type {object}
34+
* @type {Object}
3535
*/
3636
events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
3737
'click .media-widget-preview.populated': 'editMedia'

‎src/js/_enqueues/wp/widgets/media.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
/**
88
* @namespace wp.mediaWidgets
99
* @memberOf wp
10+
*
11+
* @param {JQueryStatic} $ The jQuery object.
1012
*/
1113
wp.mediaWidgets = ( function( $ ) {
1214
'use strict';

‎src/js/_enqueues/wp/widgets/text.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* @namespace wp.textWidgets
10+
*
11+
* @param {JQueryStatic} $ The jQuery object.
1012
*/
1113
wp.textWidgets = ( function( $ ) {
1214
'use strict';

‎src/js/media/controllers/collection-add.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Selection = wp.media.model.Selection,
1414
* @augments wp.media.controller.State
1515
* @augments Backbone.Model
1616
*
17-
* @param {object} [attributes] The attributes hash passed to the state.
17+
* @param {Object} [attributes] The attributes hash passed to the state.
1818
* @param {string} [attributes.id=library] Unique identifier.
1919
* @param {string} attributes.title Title for the state. Displays in the frame's title region.
2020
* @param {boolean|string} [attributes.multiple=add] Whether multi-select is enabled. Accepts 'add' or true.
@@ -33,7 +33,7 @@ var Selection = wp.media.model.Selection,
3333
* @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
3434
* @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection.
3535
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
36-
* @param {int} [attributes.priority=100] The priority for the state link in the media menu.
36+
* @param {number} [attributes.priority=100] The priority for the state link in the media menu.
3737
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
3838
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
3939
* @param {string} attributes.type The collection's media type. (e.g. 'video').

‎src/js/media/controllers/collection-edit.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Library = wp.media.controller.Library,
1616
* @augments wp.media.controller.State
1717
* @augments Backbone.Model
1818
*
19-
* @param {object} [attributes] The attributes hash passed to the state.
19+
* @param {Object} [attributes] The attributes hash passed to the state.
2020
* @param {string} attributes.title Title for the state. Displays in the media menu and the frame's title region.
2121
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to edit.
2222
* If one is not supplied, an empty media.model.Selection collection is created.
@@ -29,9 +29,9 @@ var Library = wp.media.controller.Library,
2929
* @param {boolean} [attributes.describe=true] Whether to offer UI to describe the attachments - e.g. captioning images in a gallery.
3030
* @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable.
3131
* @param {boolean} [attributes.dragInfoText] Instructional text about the attachments being sortable.
32-
* @param {int} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
32+
* @param {number} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
3333
* @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance.
34-
* @param {int} [attributes.priority=60] The priority for the state link in the media menu.
34+
* @param {number} [attributes.priority=60] The priority for the state link in the media menu.
3535
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
3636
* Defaults to false for this state, because the library passed in *is* the selection.
3737
* @param {view} [attributes.SettingsView] The view to edit the collection instance settings (e.g. Playlist settings with "Show tracklist" checkbox).
@@ -117,7 +117,7 @@ CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.pr
117117
*
118118
* @since 3.9.0
119119
*
120-
* @param {wp.media.view.attachmentsBrowser} The attachments browser view.
120+
* @param {wp.media.view.attachmentsBrowser} attachmentsBrowserView The attachments browser view.
121121
*/
122122
renderSettings: function( attachmentsBrowserView ) {
123123
var library = this.get('library'),

‎src/js/media/controllers/cropper.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe
170170
*
171171
* @since 4.2.0
172172
*
173+
* @param {wp.media.model.Attachment} attachment The image attachment.
173174
* @return {$.promise} A jQuery promise with the custom header crop details.
174175
*/
175176
doCrop: function( attachment ) {

0 commit comments

Comments
 (0)