Make WordPress Core

Changeset 63516


Ignore:
Timestamp:
09/07/2026 02:26:49 PM (83 minutes ago)
Author:
afercia
Message:

General: Add missing descriptions to several JS docblocks in the media directory.

Part of the effort to improve JS inline documentation for 7.2. Preparation for the introduction of the JSDoc rule jsdoc/require-description.

Developed in https://github.com/WordPress/wordpress-develop/pull/13423

See #66033.

Location:
trunk/src/js/media
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/controllers/collection-add.js

    r63408 r63516  
    5252
    5353        /**
     54         * Initializes the CollectionAdd controller.
     55         *
    5456         * @since 3.9.0
    5557         */
     
    7375
    7476        /**
     77         * Activates the CollectionAdd controller.
     78         *
    7579         * @since 3.9.0
    7680         */
  • trunk/src/js/media/controllers/collection-edit.js

    r63408 r63516  
    5858
    5959        /**
     60         * Initializes the CollectionEdit controller.
     61         *
    6062         * @since 3.9.0
    6163         */
     
    8284
    8385        /**
     86         * Activates the CollectionEdit controller.
     87         *
    8488         * @since 3.9.0
    8589         */
     
    99103
    100104        /**
     105         * Deactivates the CollectionEdit controller.
     106         *
    101107         * @since 3.9.0
    102108         */
  • trunk/src/js/media/controllers/featured-image.js

    r63408 r63516  
    4949
    5050        /**
     51         * Initializes the FeaturedImage controller.
     52         *
    5153         * @since 3.5.0
    5254         */
     
    8587
    8688        /**
     89         * Activates the FeaturedImage controller.
     90         *
    8791         * @since 3.5.0
    8892         */
     
    9498
    9599        /**
     100         * Deactivates the FeaturedImage controller.
     101         *
    96102         * @since 3.5.0
    97103         */
     
    103109
    104110        /**
     111         * Updates the selection to match the current featured image.
     112         *
    105113         * @since 3.5.0
    106114         */
  • trunk/src/js/media/controllers/image-details.js

    r63408 r63516  
    4343
    4444        /**
     45         * Initializes the ImageDetails controller.
     46         *
    4547         * @since 3.9.0
    4648         *
     
    5355
    5456        /**
     57         * Activates the ImageDetails controller.
     58         *
    5559         * @since 3.9.0
    5660         */
  • trunk/src/js/media/controllers/library.js

    r63408 r63516  
    5959
    6060        /**
     61         * Initializes the Library controller.
     62         *
    6163         * If a library isn't provided, query all media items.
    6264         * If a selection instance isn't provided, create one.
     
    9092
    9193        /**
     94         * Activates the Library controller.
     95         *
    9296         * @since 3.5.0
    9397         */
     
    106110
    107111        /**
     112         * Deactivates the Library controller.
     113         *
    108114         * @since 3.5.0
    109115         */
     
    121127
    122128        /**
    123          * Reset the library to its initial state.
     129         * Resets the library to its initial state.
    124130         *
    125131         * @since 3.5.0
     
    132138
    133139        /**
    134          * Reset the attachment display settings defaults to the site options.
     140         * Resets the attachment display settings defaults to the site options.
    135141         *
    136142         * If site options don't define them, fall back to a persistent user setting.
     
    149155
    150156        /**
    151          * Create a model to represent display settings (alignment, etc.) for an attachment.
     157         * Creates a model to represent display settings (alignment, etc.) for an attachment.
    152158         *
    153159         * @since 3.5.0
     
    166172
    167173        /**
    168          * Given an attachment, create attachment display settings properties.
     174         * Given an attachment, creates attachment display settings properties.
    169175         *
    170176         * @since 3.6.0
     
    187193
    188194        /**
    189          * Whether an attachment is image.
     195         * Determines whether an attachment is an image.
    190196         *
    191197         * @since 4.4.1
     
    204210
    205211        /**
    206          * Whether an attachment can be embedded (audio or video).
     212         * Determines whether an attachment can be embedded (audio or video).
    207213         *
    208214         * @since 3.6.0
     
    225231
    226232        /**
     233         * Resets the content mode to the default.
     234         *
    227235         * If the state is active, no items are selected, and the current
    228236         * content mode is not an option in the state's router (provided
     
    271279
    272280        /**
    273          * Persist the mode of the content region as a user setting.
     281         * Persists the mode of the content region as a user setting.
    274282         *
    275283         * @since 3.5.0
  • trunk/src/js/media/controllers/media-library.js

    r63408 r63516  
    2323
    2424        /**
     25         * Initializes the MediaLibrary controller.
     26         *
    2527         * @since 3.9.0
    2628         *
     
    3638
    3739        /**
     40         * Activates the MediaLibrary controller.
     41         *
    3842         * @since 3.9.0
    3943         */
  • trunk/src/js/media/controllers/replace-image.js

    r63408 r63516  
    4949
    5050        /**
     51         * Initializes the ReplaceImage controller.
     52         *
    5153         * @since 3.9.0
    5254         *
     
    8890
    8991        /**
     92         * Activates the ReplaceImage controller.
     93         *
    9094         * @since 3.9.0
    9195         */
     
    97101
    98102        /**
     103         * Deactivates the ReplaceImage controller.
     104         *
    99105         * @since 5.9.0
    100106         */
     
    106112
    107113        /**
     114         * Updates the selection to match the current image.
     115         *
    108116         * @since 3.9.0
    109117         */
  • trunk/src/js/media/controllers/state-machine.js

    r63408 r63516  
    107107_.each([ 'on', 'off', 'trigger' ], function( method ) {
    108108        /**
     109         * Binds an event listener to events in the StateMachine's states collection.
     110         *
    109111         * @function on
    110112         * @memberOf wp.media.controller.StateMachine
     
    113115         */
    114116        /**
     117         * Unbinds an event listener from the StateMachine's states collection.
     118         *
    115119         * @function off
    116120         * @memberOf wp.media.controller.StateMachine
     
    119123         */
    120124        /**
     125         * Triggers an event on the StateMachine's states collection.
     126         *
    121127         * @function trigger
    122128         * @memberOf wp.media.controller.StateMachine
  • trunk/src/js/media/controllers/state.js

    r63408 r63516  
    7272
    7373        /**
     74         * Ready event callback.
     75         *
    7476         * @since 3.5.0
    7577         * @access private
     
    8082
    8183        /**
     84         * Pre-activate event callback.
     85         *
    8286         * @since 3.5.0
    8387         * @access private
     
    8892
    8993        /**
     94         * Post-activate event callback.
     95         *
    9096         * @since 3.5.0
    9197         * @access private
     
    107113
    108114        /**
     115         * Deactivate event callback.
     116         *
    109117         * @since 3.5.0
    110118         * @access private
     
    122130
    123131        /**
     132         * Renders the frame's title using the titleMode property.
     133         *
     134         *
    124135         * @since 3.5.0
    125136         * @access private
     
    130141
    131142        /**
     143         * Renders the title in the media frame.
     144         *
    132145         * @param {media.view.Title} view The title view.
    133146         * @since 3.5.0
     
    139152
    140153        /**
     154         * Renders and manages the router region.
     155         *
    141156         * @since 3.5.0
    142157         * @access private
     
    161176
    162177        /**
     178         * Renders and manages the menu region.
     179         *
    163180         * @since 3.5.0
    164181         * @access private
     
    190207
    191208        /**
     209         * Updates the menu.
     210         *
    192211         * @since 3.5.0
    193212         * @access private
     
    207226
    208227        /**
    209          * Create a view in the media menu for the state.
     228         * Creates a view in the media menu for the state.
    210229         *
    211230         * @since 3.5.0
     
    235254});
    236255
     256/**
     257 * Creates render methods for frame regions.
     258 */
    237259_.each(['toolbar','content'], function( region ) {
    238260        /**
     261         * Renders the region in the media frame.
     262         *
    239263         * @access private
    240264         */
  • trunk/src/js/media/models/attachment.js

    r63408 r63516  
    114114        },
    115115        /**
     116         * Save attachment details using the `save-attachment-compat` action.
     117         *
    116118         * @param {Object} data The properties to be saved.
    117119         * @param {Object} options Sync options. e.g. patch, wait, success, error.
  • trunk/src/js/media/models/attachments.js

    r63408 r63516  
    2929        model: wp.media.model.Attachment,
    3030        /**
     31         * Initializes the Attachments collection.
     32         *
    3133         * @param {Array} [models=[]] Array of models used to populate the collection.
    3234         * @param {Object} [options={}]
     
    6668        },
    6769        /**
    68          * Sort the collection when the order attribute changes.
     70         * Sorts the collection when the order attribute changes.
    6971         *
    7072         * @access private
     
    7678        },
    7779        /**
    78          * Set the default comparator only when the `orderby` property is set.
     80         * Sets the default comparator only when the `orderby` property is set.
    7981         *
    8082         * @access private
     
    9698        },
    9799        /**
    98          * If the `query` property is set to true, query the server using
    99          * the `props` values, and sync the results to this collection.
     100         * Queries the server using the `props` values and syncs the results to this collection if the `query` property is set to true.
    100101         *
    101102         * @access private
     
    113114        },
    114115        /**
     116         * Updates the collection when a property that has a filter is changed.
     117         *
    115118         * @access private
    116119         *
     
    174177        },
    175178        /**
    176          * Add or remove an attachment to the collection depending on its validity.
     179         * Adds or removes an attachment to the collection depending on its validity.
    177180         *
    178181         * @param {wp.media.model.Attachment} attachment
     
    194197
    195198        /**
    196          * Add or remove all attachments from another collection depending on each one's validity.
     199         * Adds or removes all attachments from another collection depending on each one's validity.
    197200         *
    198201         * @param {wp.media.model.Attachments} attachments
     
    216219        },
    217220        /**
    218          * Start observing another attachments collection change events
    219          * and replicate them on this collection.
     221         * Starts observing another attachments collection change events and replicates them on this collection.
    220222         *
    221223         * @param {wp.media.model.Attachments} attachments The attachments collection to observe.
     
    232234        },
    233235        /**
    234          * Stop replicating collection change events from another attachments collection.
     236         * Stops replicating collection change events from another attachments collection.
    235237         *
    236238         * @param {wp.media.model.Attachments} attachments The attachments collection to stop observing.
     
    252254        },
    253255        /**
    254          * Update total attachment count when items are added to a collection.
     256         * Updates total attachment count when items are added to a collection.
    255257         *
    256258         * @access private
     
    264266        },
    265267        /**
    266          * Update total attachment count when items are added to a collection.
     268         * Updates total attachment count when items are added to a collection.
    267269         *
    268270         * @access private
     
    276278        },
    277279        /**
     280         * Validates an attachment against the collection's rules.
     281         *
    278282         * @access private
    279283         *
     
    294298        },
    295299        /**
     300         * Validates all attachments in a collection against the collection's rules.
     301         *
    296302         * @access private
    297303         *
     
    304310        },
    305311        /**
    306          * Start mirroring another attachments collection, clearing out any models already
    307          * in the collection.
     312         * Starts mirroring another attachments collection, clearing out any models already in the collection.
    308313         *
    309314         * @param {wp.media.model.Attachments} attachments The attachments collection to mirror.
     
    334339        },
    335340        /**
    336          * Stop mirroring another attachments collection.
     341         * Stops mirroring another attachments collection.
    337342         */
    338343        unmirror: function() {
     
    345350        },
    346351        /**
    347          * Retrieve more attachments from the server for the collection.
     352         * Retrieves more attachments from the server for the collection.
    348353         *
    349354         * Only works if the collection is mirroring a Query Attachments collection,
     
    380385        },
    381386        /**
    382          * Whether there are more attachments that haven't been sync'd from the server
    383          * that match the collection's query.
     387         * Checks whether there are more attachments that haven't been sync'd from the server that match the collection's query.
    384388         *
    385389         * Only works if the collection is mirroring a Query Attachments collection,
     
    450454
    451455        /**
    452          * If the collection is a query, create and mirror an Attachments Query collection.
     456         * Creates and mirrors an Attachments Query collection if the collection is a query.
    453457         *
    454458         * @access private
     
    462466        },
    463467        /**
    464          * If this collection is sorted by `menuOrder`, recalculates and saves
    465          * the menu order to the database.
     468         * If this collection is sorted by `menuOrder`, recalculates and saves the menu order to the database.
    466469         *
    467470         * @return {undefined|Promise} Returns a promise if the menu order is saved, otherwise undefined.
     
    534537        filters: {
    535538                /**
     539                 * Filters attachments based on a search query.
     540                 *
    536541                 * @static
    537542                 * Note that this client-side searching is *not* equivalent
     
    555560                },
    556561                /**
     562                 * Filters attachments based on their type.
     563                 *
    557564                 * @static
    558565                 * @param {wp.media.model.Attachment} attachment
     
    582589                },
    583590                /**
     591                 * Filters attachments based on their uploadedTo property.
     592                 *
    584593                 * @static
    585594                 * @param {wp.media.model.Attachment} attachment
     
    598607                },
    599608                /**
     609                 * Filters attachments based on their status property.
     610                 *
    600611                 * @static
    601612                 * @param {wp.media.model.Attachment} attachment
  • trunk/src/js/media/models/query.js

    r63408 r63516  
    2323Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
    2424        /**
     25         * Initializes the Query collection.
     26         *
    2527         * @param {Array}  [models=[]]  Array of initial models to populate the collection.
    2628         * @param {Object} [options={}]
     
    237239
    238240                /**
     241                 * Creates and returns an Attachments Query collection given the properties.
     242                 *
    239243                 * @param {Object} [props]
    240244                 * @param {Object} [options]
  • trunk/src/js/media/utils/selection-sync.js

    r47122 r63516  
    1313var selectionSync = {
    1414        /**
     15         * Syncs the selection in this state with the master selection.
     16         *
    1517         * @since 3.5.0
    1618         */
  • trunk/src/js/media/views/attachment-compat.js

    r63409 r63516  
    3131
    3232        /**
     33         * Disposes of the view and its children.
     34         *
    3335         * @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining.
    3436         */
     
    4345        },
    4446        /**
     47         * Renders the view.
     48         *
    4549         * @return {void|wp.media.view.AttachmentCompat} Returns itself to allow chaining.
    4650         */
     
    5761        },
    5862        /**
     63         * Prevents the default action of the event.
     64         *
    5965         * @param {Object} event
    6066         */
     
    6369        },
    6470        /**
     71         * Saves the attachment compat data.
     72         *
    6573         * @param {Object} event
    6674         */
     
    8088        },
    8189
     90        /**
     91         * Triggers the `attachment:compat:ready` event on the controller after saving the compat data.
     92         */
    8293        postSave: function() {
    8394                this.controller.trigger( 'attachment:compat:ready', ['ready'] );
  • trunk/src/js/media/views/attachment-filters.js

    r43309 r63516  
    4040
    4141        /**
     42         * Creates the filters for the view.
     43         *
    4244         * @abstract
    4345         */
     
    4749
    4850        /**
    49          * When the selected filter changes, update the Attachment Query properties to match.
     51         * Updates the Attachment Query properties to match when the selected filter changes.
    5052         */
    5153        change: function() {
     
    5658        },
    5759
     60        /**
     61         * Selects the filter based on the Attachment Query properties.
     62         */
    5863        select: function() {
    5964                var model = this.model,
  • trunk/src/js/media/views/attachment.js

    r63409 r63516  
    571571}, function( method, setting ) {
    572572        /**
     573         * Updates the DOM when the model's caption changes.
     574         *
    573575         * @function _syncCaption
    574576         * @memberOf wp.media.view.Attachment
     
    580582         */
    581583        /**
     584         * Updates the DOM when the model's title changes.
     585         *
    582586         * @function _syncTitle
    583587         * @memberOf wp.media.view.Attachment
     
    589593         */
    590594        /**
     595         * Updates the DOM when the model's artist changes.
     596         *
    591597         * @function _syncArtist
    592598         * @memberOf wp.media.view.Attachment
     
    598604         */
    599605        /**
     606         * Updates the DOM when the model's album changes.
     607         *
    600608         * @function _syncAlbum
    601609         * @memberOf wp.media.view.Attachment
  • trunk/src/js/media/views/attachments/browser.js

    r63409 r63516  
    3434        className: 'attachments-browser',
    3535
     36        /**
     37         * Initializes the AttachmentsBrowser view.
     38         */
    3639        initialize: function() {
    3740                _.defaults( this.options, {
     
    148151        }, 200 ),
    149152
     153        /**
     154         * Edits the selection in the modal. This is used when the user clicks the "Edit" button in the modal.
     155         *
     156         * @param {wp.media.view.Modal} modal The modal view.
     157         */
    150158        editSelection: function( modal ) {
    151159                // When editing a selection, move focus to the "Go to library" button.
     
    154162
    155163        /**
     164         * Disposes of the view and its children.
     165         *
    156166         * @return {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining.
    157167         */
     
    162172        },
    163173
     174        /**
     175         * Creates the toolbar view.
     176         */
    164177        createToolbar: function() {
    165178                var LibraryViewSwitcher, Filters, toolbarOptions,
     
    411424        },
    412425
     426        /**
     427         * Updates the content of the attachments browser.
     428         */
    413429        updateContent: function() {
    414430                var view = this,
     
    442458        },
    443459
     460        /**
     461         * Creates the uploader view.
     462         */
    444463        createUploader: function() {
    445464                this.uploader = new wp.media.view.UploaderInline({
     
    454473        },
    455474
     475        /**
     476         * Toggles the uploader view.
     477         */
    456478        toggleUploader: function() {
    457479                if ( this.uploader.$el.hasClass( 'hidden' ) ) {
     
    479501        },
    480502
     503        /**
     504         * Creates the attachments view.
     505         */
    481506        createAttachments: function() {
    482507                this.attachments = new wp.media.view.Attachments({
     
    662687        },
    663688
     689        /**
     690         * Creates the attachments heading view.
     691         */
    664692        createAttachmentsHeading: function() {
    665693                this.attachmentsHeading = new wp.media.view.Heading( {
     
    671699        },
    672700
     701        /**
     702         * Creates the sidebar view.
     703         */
    673704        createSidebar: function() {
    674705                var options = this.options,
     
    695726        },
    696727
     728        /**
     729         * Creates the single attachment view.
     730         */
    697731        createSingle: function() {
    698732                var sidebar = this.sidebar,
     
    727761        },
    728762
     763        /**
     764         * Disposes of the single attachment view.
     765         */
    729766        disposeSingle: function() {
    730767                var sidebar = this.sidebar;
  • trunk/src/js/media/views/button.js

    r62963 r63516  
    4848        },
    4949        /**
     50         * Renders the button.
     51         *
    5052         * @return {wp.media.view.Button} Returns itself to allow chaining.
    5153         */
     
    7173        },
    7274        /**
     75         * Handles the click event.
     76         *
    7377         * @param {Object} event
    7478         */
  • trunk/src/js/media/views/embed.js

    r43309 r63516  
    99 * @augments Backbone.View
    1010 */
    11 var Embed = wp.media.View.extend(/** @lends wp.media.view.Ember.prototype */{
     11var Embed = wp.media.View.extend(/** @lends wp.media.view.Embed.prototype */{
    1212        className: 'media-embed',
    1313
     14        /**
     15         * Initializes the embed view.
     16         */
    1417        initialize: function() {
    1518                /**
     
    2831
    2932        /**
     33         * Sets the settings for the embed view.
     34         *
    3035         * @param {Object} view
    3136         */
     
    3843        },
    3944
     45        /**
     46         * Refreshes the embed view based on the type of embed.
     47         */
    4048        refresh: function() {
    4149                var type = this.model.get('type'),
     
    5765        },
    5866
     67        /**
     68         * Toggles the loading state of the embed view.
     69         */
    5970        loading: function() {
    6071                this.$el.toggleClass( 'embed-loading', this.model.get('loading') );
  • trunk/src/js/media/views/frame/manage.js

    r63409 r63516  
    2424Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{
    2525        /**
     26         * Initializes the manage frame.
     27         *
    2628         * @constructs
    2729         */
     
    8890        },
    8991
     92        /**
     93         * Binds the search input to the grid router.
     94         */
    9095        bindSearchHandler: function() {
    9196                var search = this.$( '#media-search-input' ),
     
    124129
    125130        /**
    126          * Create the default states for the frame.
     131         * Creates the default states for the frame.
    127132         */
    128133        createStates: function() {
     
    149154
    150155        /**
    151          * Bind region mode activation events to proper handlers.
     156         * Binds region mode activation events to proper handlers.
    152157         */
    153158        bindRegionModeHandlers: function() {
     
    161166        },
    162167
     168        /**
     169         * Handles keydown events for the frame.
     170         *
     171         * @param {JQuery.Event} e The keydown event.
     172         */
    163173        handleKeydown: function( e ) {
    164174                if ( 27 === e.which ) {
     
    168178        },
    169179
     180        /**
     181         * Binds the keydown event for the frame.
     182         */
    170183        bindKeydown: function() {
    171184                this.$body.on( 'keydown.select', _.bind( this.handleKeydown, this ) );
    172185        },
    173186
     187        /**
     188         * Unbinds the keydown event for the frame.
     189         */
    174190        unbindKeydown: function() {
    175191                this.$body.off( 'keydown.select' );
    176192        },
    177193
     194        /**
     195         * Fixes the position of the attachments browser when scrolling the page.
     196         */
    178197        fixPosition: function() {
    179198                var $browser, $toolbar;
     
    210229
    211230        /**
    212          * Open the Edit Attachment modal.
     231         * Opens the Edit Attachment modal.
    213232         *
    214233         * @param {wp.media.model.Attachment} model The attachment model to edit.
     
    229248
    230249        /**
    231          * Create an attachments browser view within the content region.
     250         * Creates an attachments browser view within the content region.
    232251         *
    233252         * @param {Object} contentRegion Basic object with a `view` property, which
     
    265284        },
    266285
     286        /**
     287         * Handles the visibility of the sidebar
     288         */
    267289        sidebarVisibility: function() {
    268290                this.browserView.$( '.media-sidebar' ).toggle( !! this.errors.length );
    269291        },
    270292
     293        /**
     294         * Binds the deferred object of the browser view to the startHistory method.
     295         */
    271296        bindDeferred: function() {
    272297                if ( ! this.browserView.dfd ) {
     
    276301        },
    277302
     303        /**
     304         * Starts the history for the frame, if supported.
     305         */
    278306        startHistory: function() {
    279307                // Verify pushState support and activate.
  • trunk/src/js/media/views/frame/post.js

    r60031 r63516  
    235235        },
    236236
     237        /**
     238         * Activates the frame.
     239         */
    237240        activate: function() {
    238241                // Hide menu items for states tied to particular media types if there are no items.
     
    244247        },
    245248
     249        /**
     250         * Handles the counts of media types.
     251         *
     252         * @param {wp.media.model.Attachments} model The attachment model that changed.
     253         * @param {string}                     attr  The attribute that changed on the model.
     254         */
    246255        mediaTypeCounts: function( model, attr ) {
    247256                if ( typeof this.counts[ attr ] !== 'undefined' && this.counts[ attr ].count < 1 ) {
     
    253262        // Menus.
    254263        /**
     264         * Handles the main menu for the frame.
     265         *
    255266         * @param {wp.Backbone.View} view
    256267         */
     
    267278        },
    268279
     280        /**
     281         * Handles the visibility of menu items for the frame.
     282         *
     283         * @param {string} state      The state to show or hide.
     284         * @param {string} visibility The visibility of the menu item, either 'show' or 'hide'.
     285         */
    269286        menuItemVisibility: function( state, visibility ) {
    270287                var menu = this.menu.get();
     
    276293        },
    277294        /**
     295         * Handles the gallery menu for the frame.
     296         *
    278297         * @param {wp.Backbone.View} view
    279298         */
     
    305324        },
    306325
     326        /**
     327         * Handles the playlist menu for the frame.
     328         *
     329         * @param {wp.Backbone.View} view The menu view.
     330         */
    307331        playlistMenu: function( view ) {
    308332                var lastState = this.lastState(),
     
    332356        },
    333357
     358        /**
     359         * Handles the video playlist menu for the frame.
     360         *
     361         * @param {wp.Backbone.View} view The menu view.
     362         */
    334363        videoPlaylistMenu: function( view ) {
    335364                var lastState = this.lastState(),
     
    360389
    361390        // Content.
     391        /**
     392         * Handles the embed content for the frame.
     393         */
    362394        embedContent: function() {
    363395                var view = new wp.media.view.Embed({
     
    369401        },
    370402
     403        /**
     404         * Handles the edit selection content for the frame.
     405         */
    371406        editSelectionContent: function() {
    372407                var state = this.state(),
     
    405440        },
    406441
     442        /**
     443         * Handles the edit image content for the frame.
     444         */
    407445        editImageContent: function() {
    408446                var image = this.state().get('image'),
     
    419457
    420458        /**
    421          * @param {wp.Backbone.View} view
     459         * Handles the selection status toolbar for the frame
     460         *
     461         * @param {wp.Backbone.View} view The toolbar view.
    422462         */
    423463        selectionStatusToolbar: function( view ) {
     
    438478
    439479        /**
    440          * @param {wp.Backbone.View} view
     480         * Handles the main insert toolbar for the frame.
     481         *
     482         * @param {wp.Backbone.View} view The toolbar view.
    441483         */
    442484        mainInsertToolbar: function( view ) {
     
    467509
    468510        /**
    469          * @param {wp.Backbone.View} view
     511         * Handles the main gallery toolbar for the frame.
     512         *
     513         * @param {wp.Backbone.View} view The toolbar view.
    470514         */
    471515        mainGalleryToolbar: function( view ) {
     
    499543        },
    500544
     545        /**
     546         * Handles the main playlist toolbar for the frame.
     547         *
     548         * @param {wp.Backbone.View} view The toolbar view.
     549         */
    501550        mainPlaylistToolbar: function( view ) {
    502551                var controller = this;
     
    529578        },
    530579
     580        /**
     581         * Handles the main video playlist toolbar for the frame.
     582         *
     583         * @param {wp.Backbone.View} view The toolbar view.
     584         */
    531585        mainVideoPlaylistToolbar: function( view ) {
    532586                var controller = this;
     
    559613        },
    560614
     615        /**
     616         * Handles the featured image toolbar for the frame.
     617         *
     618         * @param {wp.media.view.Toolbar} toolbar The toolbar view.
     619         */
    561620        featuredImageToolbar: function( toolbar ) {
    562621                this.createSelectToolbar( toolbar, {
     
    566625        },
    567626
     627        /**
     628         * Handles the main embed toolbar for the frame.
     629         *
     630         * @param {wp.media.view.Toolbar} toolbar The toolbar view.
     631         */
    568632        mainEmbedToolbar: function( toolbar ) {
    569633                toolbar.view = new wp.media.view.Toolbar.Embed({
     
    572636        },
    573637
     638        /**
     639         * Handles the edit image toolbar for the frame.
     640         */
    574641        galleryEditToolbar: function() {
    575642                var editing = this.state().get('editing');
     
    584651
    585652                                        /**
     653                                         * Handles the click event for the insert button.
     654                                         *
    586655                                         * @fires wp.media.controller.State#update
    587656                                         */
     
    602671        },
    603672
     673        /**
     674         * Handles the add to gallery toolbar for the frame.
     675         */
    604676        galleryAddToolbar: function() {
    605677                this.toolbar.set( new wp.media.view.Toolbar({
     
    613685
    614686                                        /**
     687                                         * Handles the click event for the insert button.
     688                                         *
    615689                                         * @fires wp.media.controller.State#reset
    616690                                         */
     
    631705        },
    632706
     707        /**
     708         * Handles the edit playlist toolbar for the frame.
     709         */
    633710        playlistEditToolbar: function() {
    634711                var editing = this.state().get('editing');
     
    643720
    644721                                        /**
     722                                         * Handles the click event for the insert button.
     723                                         *
    645724                                         * @fires wp.media.controller.State#update
    646725                                         */
     
    661740        },
    662741
     742        /**
     743         * Handles the add to playlist toolbar for the frame.
     744         */
    663745        playlistAddToolbar: function() {
    664746                this.toolbar.set( new wp.media.view.Toolbar({
     
    672754
    673755                                        /**
     756                                         * Handles the click event for the insert button.
     757                                         *
    674758                                         * @fires wp.media.controller.State#reset
    675759                                         */
     
    690774        },
    691775
     776        /**
     777         * Handles the edit video playlist toolbar for the frame.
     778         */
    692779        videoPlaylistEditToolbar: function() {
    693780                var editing = this.state().get('editing');
     
    720807        },
    721808
     809        /**
     810         * Handles the add to video playlist toolbar for the frame.
     811         */
    722812        videoPlaylistAddToolbar: function() {
    723813                this.toolbar.set( new wp.media.view.Toolbar({
  • trunk/src/js/media/views/iframe.js

    r46800 r63516  
    1212        className: 'media-iframe',
    1313        /**
     14         * Renders the iframe view.
     15         *
    1416         * @return {wp.media.view.Iframe} Returns itself to allow chaining.
    1517         */
  • trunk/src/js/media/views/media-details.js

    r63409 r63516  
    1717 */
    1818MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{
     19        /**
     20         * Initializes the media details view.
     21         */
    1922        initialize: function() {
    2023                _.bindAll(this, 'success');
     
    2932        },
    3033
     34        /**
     35         * Handle events for the media details view.
     36         *
     37         * @return {Object} The events object.
     38         */
    3139        events: function(){
    3240                return _.extend( {
     
    3846        },
    3947
     48        /**
     49         * Prepares the data for the media details view.
     50         *
     51         * @return {Object} The prepared data.
     52         */
    4053        prepare: function() {
    4154                return _.defaults({
     
    4558
    4659        /**
    47          * Remove a setting's UI when the model unsets it
     60         * Removes a setting's UI when the model unsets it
    4861         *
    4962         * @fires wp.media.view.MediaDetails#media:setting:remove
     
    6477
    6578        /**
     79         * Sets the tracks for the media details view.
    6680         *
    6781         * @fires wp.media.view.MediaDetails#media:setting:remove
     
    7892        },
    7993
     94        /**
     95         * Adds a source to the media details view.
     96         *
     97         * @param {JQuery.Event} e The event object.
     98         */
    8099        addSource : function( e ) {
    81100                this.controller.lastMime = $( e.currentTarget ).data( 'mime' );
     
    83102        },
    84103
     104        /**
     105         * Loads the media player for the media details view.
     106         */
    85107        loadPlayer: function () {
    86108                this.players.push( new MediaElementPlayer( this.media, this.settings ) );
     
    88110        },
    89111
     112        /**
     113         * Sets the media player for the media details view.
     114         */
    90115        setPlayer : function() {
    91116                var src;
     
    105130
    106131        /**
     132         * Sets the media for the media details view.
     133         *
    107134         * @abstract
    108135         */
     
    111138        },
    112139
     140        /**
     141         * Handles the success event for the media details view.
     142         *
     143         * @param {MediaElementPlayer} mejs The media element player instance.
     144         */
    113145        success : function(mejs) {
    114146                var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
     
    124156
    125157        /**
    126          * @return {media.view.MediaDetails} Returns itself to allow chaining.
     158         * Renders the media details view.
     159         *
     160         * @return {wp.media.view.MediaDetails} Returns itself to allow chaining.
    127161         */
    128162        render: function() {
     
    140174        },
    141175
     176        /**
     177         * Scrolls the media details view to the top.
     178         */
    142179        scrollToTop: function() {
    143180                this.$( '.embed-media-settings' ).scrollTop( 0 );
  • trunk/src/js/media/views/media-frame.js

    r61626 r63516  
    2828
    2929        /**
     30         * Initializes the media frame.
     31         *
    3032         * @constructs
    3133         */
     
    142144
    143145        /**
     146         * Renders the media frame.
     147         *
    144148         * @return {wp.media.view.MediaFrame} Returns itself to allow chaining.
    145149         */
     
    155159        },
    156160        /**
     161         * Creates the title view.
     162         *
    157163         * @param {Object} title
    158164         * @this wp.media.controller.Region
     
    165171        },
    166172        /**
     173         * Creates the menu view.
     174         *
    167175         * @param {Object} menu
    168176         * @this wp.media.controller.Region
     
    181189        },
    182190
     191        /**
     192         * Toggles the menu visibility.
     193         *
     194         * @param {JQuery.Event} event The click event.
     195         */
    183196        toggleMenu: function( event ) {
    184197                var menu = this.$el.find( '.media-menu' );
     
    189202
    190203        /**
     204         * Creates the toolbar view.
     205         *
    191206         * @param {Object} toolbar
    192207         * @this wp.media.controller.Region
     
    198213        },
    199214        /**
     215         * Creates the router view.
     216         *
    200217         * @param {Object} router
    201218         * @this wp.media.controller.Region
     
    214231        },
    215232        /**
     233         * Creates the iframe states.
     234         *
    216235         * @param {Object} options
    217236         */
     
    251270
    252271        /**
     272         * Creates the iframe content view.
     273         *
    253274         * @param {Object} content
    254275         * @this wp.media.controller.Region
     
    261282        },
    262283
     284        /**
     285         * Cleans up the iframe content view.
     286         */
    263287        iframeContentCleanup: function() {
    264288                this.$el.removeClass('hide-toolbar');
    265289        },
    266290
     291        /**
     292         * Creates the iframe menu.
     293         *
     294         * @param {wp.media.view.Menu} view The menu view.
     295         */
    267296        iframeMenu: function( view ) {
    268297                var views = {};
     
    282311        },
    283312
     313        /**
     314         * Hijacks the Thickbox close function to close the media modal.
     315         */
    284316        hijackThickbox: function() {
    285317                var frame = this;
     
    298330        },
    299331
     332        /**
     333         * Restores the Thickbox close function.
     334         */
    300335        restoreThickbox: function() {
    301336                if ( ! this._tb_remove ) {
     
    311346_.each(['open','close','attach','detach','escape'], function( method ) {
    312347        /**
     348         * Opens the media frame modal.
     349         *
    313350         * @function open
    314351         * @memberOf wp.media.view.MediaFrame
     
    318355         */
    319356        /**
     357         * Closes the media frame modal.
     358         *
    320359         * @function close
    321360         * @memberOf wp.media.view.MediaFrame
     
    325364         */
    326365        /**
     366         * Attaches the media frame to the DOM.
     367         *
    327368         * @function attach
    328369         * @memberOf wp.media.view.MediaFrame
     
    332373         */
    333374        /**
     375         * Detaches the media frame from the DOM.
     376         *
    334377         * @function detach
    335378         * @memberOf wp.media.view.MediaFrame
     
    339382         */
    340383        /**
     384         * Triggers the escape action on the media frame modal.
     385         *
    341386         * @function escape
    342387         * @memberOf wp.media.view.MediaFrame
  • trunk/src/js/media/views/menu-item.js

    r47122 r63516  
    3737        },
    3838
     39        /**
     40         * Handles the click event.
     41         */
    3942        click: function() {
    4043                var state = this.options.state;
     
    4851
    4952        /**
     53         * Renders the menu item.
     54         *
    5055         * @return {wp.media.view.MenuItem} returns itself to allow chaining.
    5156         */
  • trunk/src/js/media/views/menu.js

    r63409 r63516  
    2626        },
    2727
     28        /**
     29         * Initializes the menu view.
     30         */
    2831        initialize: function() {
    2932                this._views = {};
     
    4750
    4851        /**
     52         * Creates a view for the given options and id.
     53         *
    4954         * @param {Object} options
    5055         * @param {string} id
     
    5762        },
    5863
     64        /**
     65         * Updates the menu when the state changes.
     66         */
    5967        ready: function() {
    6068                /**
     
    6876        },
    6977
     78        /**
     79         * Sets the menu items.
     80         */
    7081        set: function() {
    7182                /**
     
    7687        },
    7788
     89        /**
     90         * Unsets the menu items.
     91         */
    7892        unset: function() {
    7993                /**
     
    8498        },
    8599
     100        /**
     101         * Updates the menu visibility.
     102         */
    86103        visibility: function() {
    87104                var region = this.region,
     
    98115        },
    99116        /**
    100          * @param {string} id
     117         * Selects the menu item with the given id.
     118         *
     119         * @param {string} id The menu item id.
    101120         */
    102121        select: function( id ) {
     
    114133        },
    115134
     135        /**
     136         * Deselects the menu items.
     137         */
    116138        deselect: function() {
    117139                this.$el.children().removeClass('active');
    118140        },
    119141
     142        /**
     143         * Hides the menu item with the given id.
     144         *
     145         * @param {string} id The menu item id.
     146         */
    120147        hide: function( id ) {
    121148                var view = this.get( id );
     
    128155        },
    129156
     157        /**
     158         * Shows the menu item with the given id.
     159         *
     160         * @param {string} id The menu item id.
     161         */
    130162        show: function( id ) {
    131163                var view = this.get( id );
  • trunk/src/js/media/views/search.js

    r46800 r63516  
    2525
    2626        /**
     27         * Renders the search input.
     28         *
    2729         * @return {wp.media.view.Search} Returns itself to allow chaining.
    2830         */
     
    3234        },
    3335
     36        /**
     37         * Searches the media library.
     38         *
     39         * @param {JQuery.Event} event The input event.
     40         */
    3441        search: _.debounce( function( event ) {
    3542                var searchTerm = event.target.value.trim();
  • trunk/src/js/media/views/settings.js

    r47029 r63516  
    2121        },
    2222
     23        /**
     24         * Initializes the settings view.
     25         */
    2326        initialize: function() {
    2427                this.model = this.model || new Backbone.Model();
     
    2629        },
    2730
     31        /**
     32         * Prepares the data for rendering.
     33         *
     34         * @return {Object} The data to be used in the template.
     35         */
    2836        prepare: function() {
    2937                return _.defaults({
     
    3240        },
    3341        /**
     42         * Renders the settings view.
     43         *
    3444         * @return {wp.media.view.Settings} Returns itself to allow chaining.
    3545         */
     
    4151        },
    4252        /**
     53         * Updates the selected value for a setting.
     54         *
    4355         * @param {string} key
    4456         */
     
    88100        },
    89101        /**
     102         * Updates the model when a setting is changed.
     103         *
    90104         * @param {Object} event
    91105         */
     
    117131        },
    118132
     133        /**
     134         * Updates the view when the model changes.
     135         *
     136         * @param {Backbone.Model} model The model that changed.
     137         */
    119138        updateChanges: function( model ) {
    120139                if ( model.hasChanged() ) {
  • trunk/src/js/media/views/settings/attachment-display.js

    r47266 r63516  
    1717        template:  wp.template('attachment-display-settings'),
    1818
     19        /**
     20         * Initializes the attachment display settings view.
     21         */
    1922        initialize: function() {
    2023                var attachment = this.options.attachment;
     
    3235        },
    3336
     37        /**
     38         * Disposes of the attachment display settings view.
     39         */
    3440        dispose: function() {
    3541                var attachment = this.options.attachment;
     
    4349        },
    4450        /**
     51         * Renders the attachment display settings view.
     52         *
    4553         * @return {wp.media.view.AttachmentDisplay} Returns itself to allow chaining.
    4654         */
     
    6169        },
    6270
     71        /**
     72         * Updates the linkTo setting.
     73         */
    6374        updateLinkTo: function() {
    6475                var linkTo = this.model.get('link'),
  • trunk/src/js/media/views/toolbar.js

    r63409 r63516  
    1919        className: 'media-toolbar',
    2020
     21        /**
     22         * Initializes the toolbar view.
     23         */
    2124        initialize: function() {
    2225                var state = this.controller.state(),
     
    5356        },
    5457        /**
     58         * Disposes of the toolbar view.
     59         *
    5560         * @return {wp.media.view.Toolbar} Returns itself to allow chaining
    5661         */
     
    6974        },
    7075
     76        /**
     77         * Prepares the data for rendering.
     78         */
    7179        ready: function() {
    7280                this.refresh();
     
    7482
    7583        /**
     84         * Sets a view by its ID.
     85         *
    7686         * @param {string} id
    7787         * @param {Backbone.View|Object} view
     
    119129        },
    120130        /**
     131         * Unsets a view by its ID.
     132         *
    121133         * @param {string} id
    122134         * @param {Object} options
     
    135147        },
    136148
     149        /**
     150         * Refreshes the toolbar view.
     151         */
    137152        refresh: function() {
    138153                var state = this.controller.state(),
  • trunk/src/js/media/views/view.js

    r47122 r63516  
    1818 */
    1919var View = wp.Backbone.View.extend(/** @lends wp.media.View.prototype */{
     20        /**
     21         * Constructor for the media view.
     22         *
     23         * @param {Object} [options] Options for the view.
     24         */
    2025        constructor: function( options ) {
    2126                if ( options && options.controller ) {
     
    2530        },
    2631        /**
     32         * Disposes of the media view.
     33         *
    2734         * @todo The internal comment mentions this might have been a stop-gap
    2835         *       before Backbone 0.9.8 came out. Figure out if Backbone core takes
     
    5562        },
    5663        /**
     64         * Removes the media view.
     65         *
    5766         * @return {wp.media.View} Returns itself to allow chaining.
    5867         */
Note: See TracChangeset for help on using the changeset viewer.