Make WordPress Core

Ticket #30469: 30469.diff

File 30469.diff, 12.3 KB (added by ericlewis, 12 years ago)
  • src/wp-admin/js/common.js

    diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
    index 9d8af9b..9c49be8 100644
    $(document).ready( function() {  
    247247                $( document ).trigger( 'wp-collapse-menu', { state: state } );
    248248        });
    249249
     250        /**
     251         * Ensure an admin submenu is within the visual viewport.
     252         *
     253         * @since 4.1.0
     254         *
     255         * @param {jQuery} $menuItem The parent menu item containing the submenu.
     256         */
    250257        function adjustSubmenu( $menuItem ) {
    251258                var bottomOffset, pageHeight, adjustment, theFold, menutop, wintop, maxtop,
    252259                        $submenu = $menuItem.find( '.wp-submenu' );
  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index 7b9f7b1..23fa4f5 100644
     
    3535        /**
    3636         * Watch all changes to Value properties, and bubble changes to parent Values instance
    3737         *
     38         * @since 4.1.0
     39         *
    3840         * @param {wp.customize.Class} instance
    39          * @param {Array} properties  The names of the Value instances to watch.
     41         * @param {Array}              properties  The names of the Value instances to watch.
    4042         */
    4143        bubbleChildValueChanges = function ( instance, properties ) {
    4244                $.each( properties, function ( i, key ) {
    … …  
    5153        /**
    5254         * Expand a panel, section, or control and focus on the first focusable element.
    5355         *
    54          * @param {Object} [params]
     56         * @since 4.1.0
     57         *
     58         * @param {Object}   [params]
     59         * @param {Callback} [params.completeCallback]
    5560         */
    5661        focus = function ( params ) {
    5762                var construct, completeCallback, focus;
    … …  
    8287         *
    8388         * If a.priority() === b.priority(), then sort by their respective params.instanceNumber.
    8489         *
     90         * @since 4.1.0
     91         *
    8592         * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a
    8693         * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b
    8794         * @returns {Number}
    … …  
    97104        /**
    98105         * Return whether the supplied Event object is for a keydown event but not the Enter key.
    99106         *
     107         * @since 4.1.0
     108         *
    100109         * @param {jQuery.Event} event
    101110         * @returns {boolean}
    102111         */
    … …  
    107116        /**
    108117         * Return whether the two lists of elements are the same and are in the same order.
    109118         *
     119         * @since 4.1.0
     120         *
    110121         * @param {Array|jQuery} listA
    111122         * @param {Array|jQuery} listB
    112123         * @returns {boolean}
    … …  
    125136        };
    126137
    127138        /**
    128          * Base class for Panel and Section
     139         * Base class for Panel and Section.
     140         *
     141         * @since 4.1.0
    129142         *
    130143         * @class
    131144         * @augments wp.customize.Class
    … …  
    134147                defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
    135148                defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop },
    136149
     150                /**
     151                 * @since 4.1.0
     152                 *
     153                 * @param {String} id
     154                 * @param {Object} options
     155                 */
    137156                initialize: function ( id, options ) {
    138157                        var container = this;
    139158                        container.id = id;
    … …  
    174193                },
    175194
    176195                /**
     196                 * @since 4.1.0
     197                 *
    177198                 * @abstract
    178199                 */
    179200                ready: function() {},
    … …  
    181202                /**
    182203                 * Get the child models associated with this parent, sorting them by their priority Value.
    183204                 *
     205                 * @since 4.1.0
     206                 *
    184207                 * @param {String} parentType
    185208                 * @param {String} childType
    186209                 * @returns {Array}
    … …  
    199222
    200223                /**
    201224                 * To override by subclass, to return whether the container has active children.
     225                 *
     226                 * @since 4.1.0
     227                 *
    202228                 * @abstract
    203229                 */
    204230                isContextuallyActive: function () {
    … …  
    207233
    208234                /**
    209235                 * Handle changes to the active state.
     236                 *
    210237                 * This does not change the active state, it merely handles the behavior
    211238                 * for when it does change.
    212239                 *
    213240                 * To override by subclass, update the container's UI to reflect the provided active state.
    214241                 *
     242                 * @since 4.1.0
     243                 *
    215244                 * @param {Boolean} active
    216                  * @param {Object} args  merged on top of this.defaultActiveArguments
     245                 * @param {Object}  args
     246                 * @param {Object}  args.duration
     247                 * @param {Object}  args.completeCallback
    217248                 */
    218249                onChangeActive: function ( active, args ) {
    219250                        var duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
    … …  
    229260                },
    230261
    231262                /**
     263                 * @since 4.1.0
     264                 *
    232265                 * @params {Boolean} active
    233                  * @param {Object} [params]
     266                 * @param {Object}   [params]
    234267                 * @returns {Boolean} false if state already applied
    235268                 */
    236269                _toggleActive: function ( active, params ) {
    … …  
    316349        });
    317350
    318351        /**
     352         * @since 4.1.0
     353         *
    319354         * @class
    320355         * @augments wp.customize.Class
    321356         */
    322357        api.Section = Container.extend({
    323358
    324359                /**
     360                 * @since 4.1.0
     361                 *
    325362                 * @param {String} id
    326                  * @param {Array} options
     363                 * @param {Array}  options
    327364                 */
    328365                initialize: function ( id, options ) {
    329366                        var section = this;
    … …  
    345382
    346383                /**
    347384                 * Embed the container in the DOM when any parent panel is ready.
     385                 *
     386                 * @since 4.1.0
    348387                 */
    349388                embed: function () {
    350389                        var section = this, inject;
    … …  
    378417                },
    379418
    380419                /**
    381                  * Add behaviors for the accordion section
     420                 * Add behaviors for the accordion section.
     421                 *
     422                 * @since 4.1.0
    382423                 */
    383424                attachEvents: function () {
    384425                        var section = this;
    … …  
    401442                /**
    402443                 * Return whether this section has any active controls.
    403444                 *
    404                  * @returns {boolean}
     445                 * @since 4.1.0
     446                 *
     447                 * @returns {Boolean}
    405448                 */
    406449                isContextuallyActive: function () {
    407450                        var section = this,
    … …  
    418461                /**
    419462                 * Get the controls that are associated with this section, sorted by their priority Value.
    420463                 *
     464                 * @since 4.1.0
     465                 *
    421466                 * @returns {Array}
    422467                 */
    423468                controls: function () {
    … …  
    425470                },
    426471
    427472                /**
    428                  * Update UI to reflect expanded state
     473                 * Update UI to reflect expanded state.
     474                 *
     475                 * @since 4.1.0
    429476                 *
    430477                 * @param {Boolean} expanded
    431                  * @param {Object} args
     478                 * @param {Object}  args
    432479                 */
    433480                onChangeExpanded: function ( expanded, args ) {
    434481                        var section = this,
    … …  
    471518        });
    472519
    473520        /**
     521         * @since 4.1.0
     522         *
    474523         * @class
    475524         * @augments wp.customize.Class
    476525         */
    477526        api.Panel = Container.extend({
     527                /**
     528                 * @since 4.1.0
     529                 *
     530                 * @param  {String} id
     531                 * @param  {Object} options
     532                 */
    478533                initialize: function ( id, options ) {
    479534                        var panel = this;
    480535                        Container.prototype.initialize.call( panel, id, options );
    … …  
    486541
    487542                /**
    488543                 * Embed the container in the DOM when any parent panel is ready.
     544                 *
     545                 * @since 4.1.0
    489546                 */
    490547                embed: function () {
    491548                        var panel = this,
    … …  
    498555                },
    499556
    500557                /**
    501                  *
     558                 * @since 4.1.0
    502559                 */
    503560                attachEvents: function () {
    504561                        var meta, panel = this;
    … …  
    542599                /**
    543600                 * Get the sections that are associated with this panel, sorted by their priority Value.
    544601                 *
     602                 * @since 4.1.0
     603                 *
    545604                 * @returns {Array}
    546605                 */
    547606                sections: function () {
    … …  
    551610                /**
    552611                 * Return whether this panel has any active sections.
    553612                 *
     613                 * @since 4.1.0
     614                 *
    554615                 * @returns {boolean}
    555616                 */
    556617                isContextuallyActive: function () {
    … …  
    568629                /**
    569630                 * Update UI to reflect expanded state
    570631                 *
    571                  * @param {Boolean} expanded
    572                  * @param {Object} args  merged with this.defaultExpandedArguments
     632                 * @since 4.1.0
     633                 *
     634                 * @param {Boolean}  expanded
     635                 * @param {Object}   args
     636                 * @param {Boolean}  args.unchanged
     637                 * @param {Callback} args.completeCallback
    573638                 */
    574639                onChangeExpanded: function ( expanded, args ) {
    575640
    … …  
    791856                },
    792857
    793858                /**
    794                  * Bring the containing section and panel into view and then this control into view, focusing on the first input
     859                 * Bring the containing section and panel into view and then
     860                 * this control into view, focusing on the first input.
    795861                 */
    796862                focus: focus,
    797863
    … …  
    800866                 * This does not change the active state, it merely handles the behavior
    801867                 * for when it does change.
    802868                 *
    803                  * @param {Boolean} active
    804                  * @param {Object} args  merged on top of this.defaultActiveArguments
     869                 * @since 4.1.0
     870                 *
     871                 * @param {Boolean}  active
     872                 * @param {Object}   args
     873                 * @param {Number}   args.duration
     874                 * @param {Callback} args.completeCallback
    805875                 */
    806876                onChangeActive: function ( active, args ) {
    807877                        if ( ! $.contains( document, this.container ) ) {
    … …  
    816886                },
    817887
    818888                /**
    819                  * @deprecated alias of onChangeActive
     889                 * @deprecated 4.1.0 Use this.onChangeActive() instead.
    820890                 */
    821891                toggle: function ( active ) {
    822892                        return this.onChangeActive( active, this.defaultActiveArguments );
    … …  
    825895                /**
    826896                 * Shorthand way to enable the active state.
    827897                 *
     898                 * @since 4.1.0
     899                 *
    828900                 * @param {Object} [params]
    829901                 * @returns {Boolean} false if already active
    830902                 */
    … …  
    833905                /**
    834906                 * Shorthand way to disable the active state.
    835907                 *
     908                 * @since 4.1.0
     909                 *
    836910                 * @param {Object} [params]
    837911                 * @returns {Boolean} false if already inactive
    838912                 */
    … …  
    879953                 * Render the control from its JS template, if it exists.
    880954                 *
    881955                 * The control's container must already exist in the DOM.
     956                 *
     957                 * @since 4.1.0
    882958                 */
    883959                renderContent: function () {
    884960                        var template,
    … …  
    12901366        // Change objects contained within the main customize object to Settings.
    12911367        api.defaultConstructor = api.Setting;
    12921368
    1293         // Create the collection of Control objects.
     1369        // Create the collections for Controls, Sections and Panels.
    12941370        api.control = new api.Values({ defaultConstructor: api.Control });
    12951371        api.section = new api.Values({ defaultConstructor: api.Section });
    12961372        api.panel = new api.Values({ defaultConstructor: api.Panel });
    … …  
    14941570        }());
    14951571
    14961572        /**
    1497          * Set the document title of the customizer
     1573         * Set the document title of the customizer.
     1574         *
     1575         * @since 4.1.0
    14981576         *
    14991577         * @param {string} documentTitle
    15001578         */
    … …  
    16271705                        // Update the URL when the iframe sends a URL message.
    16281706                        this.bind( 'url', this.previewUrl );
    16291707
    1630                         // Update the document title when the preview changes
     1708                        // Update the document title when the preview changes.
    16311709                        this.bind( 'documentTitle', function ( title ) {
    16321710                                api.setDocumentTitle( title );
    16331711                        } );
    … …  
    17661844                        }
    17671845                });
    17681846
    1769                 // Expand/Collapse the main customizer customize info
     1847                // Expand/Collapse the main customizer customize info.
    17701848                $( '#customize-info' ).find( '> .accordion-section-title' ).on( 'click keydown', function( event ) {
    17711849                        if ( isKeydownButNotEnterEvent( event ) ) {
    17721850                                return;
    … …  
    19412019
    19422020                /**
    19432021                 * Sort panels, sections, controls by priorities. Hide empty sections and panels.
     2022                 *
     2023                 * @since 4.1.0
    19442024                 */
    19452025                api.reflowPaneContents = _.bind( function () {
    19462026
  • src/wp-admin/js/customize-widgets.js

    diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
    index d649b6b..93585ab 100644
     
    409409                        completeCallback: $.noop
    410410                },
    411411
     412                /**
     413                 * @since 4.1.0
     414                 */
    412415                initialize: function ( id, options ) {
    413416                        var control = this;
    414417                        api.Control.prototype.initialize.call( control, id, options );
    … …  
    800803                 *
    801804                 * Overrides api.Control.toggle()
    802805                 *
    803                  * @param {Boolean} active
    804                  * @param {Object} args
     806                 * @since 4.1.0
     807                 *
     808                 * @param {Boolean}   active
     809                 * @param {Object}    args
     810                 * @param {Callback}  args.completeCallback
    805811                 */
    806812                onChangeActive: function ( active, args ) {
    807813                        // Note: there is a second 'args' parameter being passed, merged on top of this.defaultActiveArguments
    … …  
    11341140                },
    11351141
    11361142                /**
     1143                 * @since 4.1.0
     1144                 *
    11371145                 * @param {Boolean} expanded
    11381146                 * @param {Object} [params]
    11391147                 * @returns {Boolean} false if state already applied
    … …  
    11411149                _toggleExpanded: api.Section.prototype._toggleExpanded,
    11421150
    11431151                /**
     1152                 * @since 4.1.0
     1153                 *
    11441154                 * @param {Object} [params]
    11451155                 * @returns {Boolean} false if already expanded
    11461156                 */
    … …  
    11491159                /**
    11501160                 * Expand the widget form control
    11511161                 *
    1152                  * @deprecated alias of expand()
     1162                 * @deprecated 4.1.0 Use this.expand() instead.
    11531163                 */
    11541164                expandForm: function() {
    11551165                        this.expand();
    11561166                },
    11571167
    11581168                /**
     1169                 * @since 4.1.0
     1170                 *
    11591171                 * @param {Object} [params]
    11601172                 * @returns {Boolean} false if already collapsed
    11611173                 */
    … …  
    11641176                /**
    11651177                 * Collapse the widget form control
    11661178                 *
    1167                  * @deprecated alias of expand()
     1179                 * @deprecated 4.1.0 Use this.collapse() instead.
    11681180                 */
    11691181                collapseForm: function() {
    11701182                        this.collapse();
    … …  
    13781390
    13791391                /**
    13801392                 * Sync the section's active state back to the Backbone model's is_rendered attribute
     1393                 *
     1394                 * @since 4.1.0
    13811395                 */
    13821396                ready: function () {
    13831397                        var section = this, registeredSidebar;