Make WordPress Core

Changeset 29739


Ignore:
Timestamp:
09/12/2014 03:35:15 AM (11 years ago)
Author:
wonderboymusic
Message:

Add some @since annotations to media-views.js.

Props DrewAPicture.
See #28459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r29722 r29739  
    9797         * Activate a mode.
    9898         *
     99         * @since 3.5.0
     100         *
    99101         * @param {string} mode
    100102         *
     
    137139        /**
    138140         * Render a mode.
     141         *
     142         * @since 3.5.0
    139143         *
    140144         * @param {string} mode
     
    185189         * Get the region's view.
    186190         *
     191         * @since 3.5.0
     192         *
    187193         * @returns {wp.media.View}
    188194         */
     
    193199        /**
    194200         * Set the region's view as a subview of the frame.
     201         *
     202         * @since 3.5.0
    195203         *
    196204         * @param {Array|Object} views
     
    207215        /**
    208216         * Trigger regional view events on the frame.
     217         *
     218         * @since 3.5.0
    209219         *
    210220         * @param {string} event
     
    234244    /**
    235245     * wp.media.controller.StateMachine
     246     *
     247     * @since 3.5.0
    236248     *
    237249     * @constructor
     
    260272         *   can be used as a mixin.
    261273         *
     274         * @since 3.5.0
     275         *
    262276         * @param {string} id
    263277         * @returns {wp.media.controller.State} Returns a State model
     
    282296         * created the `states` collection, or are trying to select a state
    283297         * that does not exist.
     298         *
     299         * @since 3.5.0
    284300         *
    285301         * @param {string} id
     
    313329         * Call the `state()` method with no parameters to retrieve the current
    314330         * active state.
     331         *
     332         * @since 3.5.0
    315333         *
    316334         * @returns {wp.media.controller.State} Returns a State model
     
    350368     */
    351369    media.controller.State = Backbone.Model.extend({
     370        /**
     371         * Constructor.
     372         *
     373         * @since 3.5.0
     374         */
    352375        constructor: function() {
    353376            this.on( 'activate', this._preActivate, this );
     
    367390        /**
    368391         * @abstract
     392         * @since 3.5.0
    369393         */
    370394        ready: function() {},
     395
    371396        /**
    372397         * @abstract
     398         * @since 3.5.0
    373399         */
    374400        activate: function() {},
     401
    375402        /**
    376403         * @abstract
     404         * @since 3.5.0
    377405         */
    378406        deactivate: function() {},
     407
    379408        /**
    380409         * @abstract
     410         * @since 3.5.0
    381411         */
    382412        reset: function() {},
     413
    383414        /**
    384415         * @access private
     416         * @since 4.0.0
    385417         */
    386418        _ready: function() {
    387419            this._updateMenu();
    388420        },
     421
    389422        /**
    390423         * @access private
     424         * @since 3.5.0
    391425        */
    392426        _preActivate: function() {
    393427            this.active = true;
    394428        },
     429
    395430        /**
    396431         * @access private
     432         * @since 3.5.0
    397433         */
    398434        _postActivate: function() {
     
    410446            this._router();
    411447        },
     448
    412449        /**
    413450         * @access private
     451         * @since 3.5.0
    414452         */
    415453        _deactivate: function() {
     
    423461            this.off( 'change:toolbar', this._toolbar, this );
    424462        },
     463
    425464        /**
    426465         * @access private
     466         * @since 3.5.0
    427467         */
    428468        _title: function() {
    429469            this.frame.title.render( this.get('titleMode') || 'default' );
    430470        },
     471
    431472        /**
    432473         * @access private
     474         * @since 3.5.0
    433475         */
    434476        _renderTitle: function( view ) {
    435477            view.$el.text( this.get('title') || '' );
    436478        },
     479
    437480        /**
    438481         * @access private
     482         * @since 3.5.0
    439483         */
    440484        _router: function() {
     
    455499            }
    456500        },
     501
    457502        /**
    458503         * @access private
     504         * @since 3.5.0
    459505         */
    460506        _menu: function() {
     
    475521            }
    476522        },
     523
    477524        /**
    478525         * @access private
     526         * @since 3.5.0
    479527         */
    480528        _updateMenu: function() {
     
    490538            }
    491539        },
     540
    492541        /**
    493542         * @access private
     543         * @since 3.5.0
    494544         */
    495545        _renderMenu: function( view ) {
     
    527577
    528578    media.selectionSync = {
     579        /**
     580         * @since 3.5.0
     581         */
    529582        syncSelection: function() {
    530583            var selection = this.get('selection'),
     
    554607         * attachments that this specific selection considered invalid.
    555608         * Reset the difference and record the single attachment.
     609         *
     610         * @since 3.5.0
    556611         */
    557612        recordSelection: function() {
     
    608663         * If a library isn't provided, query all media items.
    609664         * If a selection instance isn't provided, create one.
     665         *
     666         * @since 3.5.0
    610667         */
    611668        initialize: function() {
     
    638695        },
    639696
     697        /**
     698         * @since 3.5.0
     699         */
    640700        activate: function() {
    641701            this.syncSelection();
     
    651711        },
    652712
     713        /**
     714         * @since 3.5.0
     715         */
    653716        deactivate: function() {
    654717            this.recordSelection();
     
    663726        },
    664727
     728        /**
     729         * @since 3.5.0
     730         */
    665731        reset: function() {
    666732            this.get('selection').reset();
     
    669735        },
    670736
     737        /**
     738         * @since 3.5.0
     739         */
    671740        resetDisplays: function() {
    672741            var defaultProps = media.view.settings.defaultProps;
     
    680749
    681750        /**
     751         * @since 3.5.0
     752         *
    682753         * @param {wp.media.model.Attachment} attachment
    683754         * @returns {Backbone.Model}
     
    693764
    694765        /**
     766         * @since 3.6.0
     767         *
    695768         * @param {wp.media.model.Attachment} attachment
    696769         * @returns {Object}
     
    705778
    706779        /**
     780         * @since 3.6.0
     781         *
    707782         * @param {wp.media.model.Attachment} attachment
    708783         * @returns {Boolean}
     
    725800         * content mode is not an option in the state's router (provided
    726801         * the state has a router), reset the content mode to the default.
     802         *
     803         * @since 3.5.0
    727804         */
    728805        refreshContent: function() {
     
    746823         * attachment in the upload queue).
    747824         *
     825         * @since 3.5.0
     826         *
    748827         * @param {wp.media.model.Attachment} attachment
    749828         */
     
    763842        /**
    764843         * Only track the browse router on library states.
     844         *
     845         * @since 3.5.0
    765846         */
    766847        saveContentMode: function() {
     
    801882        }, media.controller.Library.prototype.defaults ),
    802883
     884        /**
     885         * @since 3.9.0
     886         *
     887         * @param options Attributes
     888         */
    803889        initialize: function( options ) {
    804890            this.image = options.image;
     
    806892        },
    807893
     894        /**
     895         * @since 3.9.0
     896         */
    808897        activate: function() {
    809898            this.frame.modal.$el.addClass('image-details');
     
    845934        },
    846935
     936        /**
     937         * @since 3.9.0
     938         */
    847939        initialize: function() {
    848940            // If we haven't been provided a `library`, create a `Selection`.
     
    856948        },
    857949
     950        /**
     951         * since 3.9.0
     952         */
    858953        activate: function() {
    859954            var library = this.get('library');
     
    870965        },
    871966
     967        /**
     968         * @since 3.9.0
     969         */
    872970        deactivate: function() {
    873971            // Stop watching for uploaded attachments.
     
    879977        },
    880978
     979        /**
     980         * @since 3.9.0
     981         *
     982         * @param browser
     983         */
    881984        gallerySettings: function( browser ) {
    882985            if ( ! this.get('displaySettings') ) {
     
    9371040        }, media.controller.Library.prototype.defaults ),
    9381041
     1042        /**
     1043         * @since 3.9.0
     1044         */
    9391045        initialize: function() {
    9401046            // If we haven't been provided a `library`, create a `Selection`.
     
    9451051        },
    9461052
     1053        /**
     1054         * @since 3.9.0
     1055         */
    9471056        activate: function() {
    9481057            var library = this.get('library'),
     
    9991108        },
    10001109
     1110        /**
     1111         * @since 3.9.0
     1112         */
    10011113        initialize: function() {
    10021114            var collectionType = this.get('collectionType');
     
    10201132        },
    10211133
     1134        /**
     1135         * @since 3.9.0
     1136         */
    10221137        activate: function() {
    10231138            var library = this.get('library');
     
    10341149        },
    10351150
     1151        /**
     1152         * @since 3.9.0
     1153         */
    10361154        deactivate: function() {
    10371155            // Stop watching for uploaded attachments.
     
    10431161        },
    10441162
     1163        /**
     1164         * @since 3.9.0
     1165         *
     1166         * @param browser
     1167         */
    10451168        renderSettings: function( browser ) {
    10461169            var library = this.get('library'),
     
    11011224        }, media.controller.Library.prototype.defaults ),
    11021225
     1226        /**
     1227         * @since 3.9.0
     1228         */
    11031229        initialize: function() {
    11041230            var collectionType = this.get('collectionType');
     
    11191245        },
    11201246
     1247        /**
     1248         * @since 3.9.0
     1249         */
    11211250        activate: function() {
    11221251            var library = this.get('library'),
     
    11681297        }, media.controller.Library.prototype.defaults ),
    11691298
     1299        /**
     1300         * @since 3.5.0
     1301         */
    11701302        initialize: function() {
    11711303            var library, comparator;
     
    12011333        },
    12021334
     1335        /**
     1336         * @since 3.5.0
     1337         */
    12031338        activate: function() {
    12041339            this.updateSelection();
     
    12081343        },
    12091344
     1345        /**
     1346         * @since 3.5.0
     1347         */
    12101348        deactivate: function() {
    12111349            this.frame.off( 'open', this.updateSelection, this );
     
    12141352        },
    12151353
     1354        /**
     1355         * @since 3.5.0
     1356         */
    12161357        updateSelection: function() {
    12171358            var selection = this.get('selection'),
     
    12521393        }, media.controller.Library.prototype.defaults ),
    12531394
     1395        /**
     1396         * @since 3.9.0
     1397         *
     1398         * @param options
     1399         */
    12541400        initialize: function( options ) {
    12551401            var library, comparator;
     
    12861432        },
    12871433
     1434        /**
     1435         * @since 3.9.0
     1436         */
    12881437        activate: function() {
    12891438            this.updateSelection();
     
    12911440        },
    12921441
     1442        /**
     1443         * @since 3.9.0
     1444         */
    12931445        updateSelection: function() {
    12941446            var selection = this.get('selection'),
     
    13181470        },
    13191471
     1472        /**
     1473         * @since 3.9.0
     1474         */
    13201475        activate: function() {
    13211476            this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
    13221477        },
    13231478
     1479        /**
     1480         * @since 3.9.0
     1481         */
    13241482        deactivate: function() {
    13251483            this.stopListening( this.frame );
    13261484        },
    13271485
     1486        /**
     1487         * @since 3.9.0
     1488         */
    13281489        toolbar: function() {
    13291490            var frame = this.frame,
     
    13691530        }, media.controller.Library.prototype.defaults ),
    13701531
     1532        /**
     1533         * @since 3.9.0
     1534         *
     1535         * @param options
     1536         */
    13711537        initialize: function( options ) {
    13721538            this.media = options.media;
     
    13771543        },
    13781544
     1545        /**
     1546         * @since 3.9.0
     1547         */
    13791548        activate: function() {
    13801549            if ( media.frame.lastMime ) {
Note: See TracChangeset for help on using the changeset viewer.