Make WordPress Core

Ticket #37110: 37110.11.diff

File 37110.11.diff, 7.5 KB (added by westonruter, 5 years ago)
  • package-lock.json

     
    65026502                        }
    65036503                },
    65046504                "jquery": {
    6505                         "version": "1.12.4",
    6506                         "resolved": "https://registry.npmjs.org/jquery/-/jquery-1.12.4.tgz",
    6507                         "integrity": "sha1-AeHfuikP5z3rp3zurLD5ui/sngw="
     6505                        "version": "3.3.1",
     6506                        "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
     6507                        "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
    65086508                },
    65096509                "jquery-color": {
    65106510                        "version": "github:jquery/jquery-color#95402e5b2f1184ab2de7014aeef0a90f2bee0a40",
     
    65276527                        }
    65286528                },
    65296529                "jquery-migrate": {
    6530                         "version": "1.4.1",
    6531                         "resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-1.4.1.tgz",
    6532                         "integrity": "sha1-hRUvPsmalWJfT30Lz2LpuGOPWnY=",
     6530                        "version": "3.0.1",
     6531                        "resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.0.1.tgz",
     6532                        "integrity": "sha512-NYlhcFnRh4Bv9jvadPlcAKQdVGRE0+TSgFYxQ+ZnCxUUHbwd+SjbOg+Xvu1Oea9mpQJ+2VB1eCfcBORWNQsHaA==",
    65336533                        "dev": true
    65346534                },
    65356535                "jquery-ui": {
  • package.json

     
    3939                "grunt-sass": "2.0.0",
    4040                "grunt-webpack": "^3.0.2",
    4141                "ink-docstrap": "^1.3.0",
    42                 "jquery-migrate": "1.4.1",
     42                "jquery-migrate": "3.0.1",
    4343                "matchdep": "~1.0.0",
    4444                "webpack": "^3.6.0",
    4545                "webpack-dev-server": "^2.9.1"
     
    4747        "dependencies": {
    4848                "backbone": "1.3.3",
    4949                "imagesloaded": "3.2.0",
    50                 "jquery": "1.12.4",
     50                "jquery": "3.3.1",
    5151                "jquery-color": "github:jquery/jquery-color#2.1.1",
    5252                "jquery-form": "4.2.1",
    5353                "jquery-hoverintent": "1.8.3",
  • src/js/_enqueues/wp/customize/controls.js

     
    70947094                api.state.create( name );
    70957095        });
    70967096
    7097         $( function() {
     7097        /**
     7098         * Function which boots the Customizer controls app. This should be done at DOMContentLoaded.
     7099         *
     7100         * @since 5.0
     7101         */
     7102        api.ready = function ready() {
    70987103                api.settings = window._wpCustomizeSettings;
    70997104                api.l10n = window._wpCustomizeControlsL10n;
    71007105
     
    92649269
    92659270                body.addClass( 'ready' );
    92669271                api.trigger( 'ready' );
    9267         });
     9272        };
    92689273
    92699274})( wp, jQuery );
  • src/wp-includes/script-loader.php

     
    207207        $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) );
    208208
    209209        // jQuery
    210         $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4' );
    211         $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.4' );
    212         $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' );
     210        $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '3.3.1' );
     211        $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '3.3.1' );
     212        $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.0.1' );
    213213
    214214        // full jQuery UI
    215215        $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
     
    582582        $scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );
    583583        $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
    584584        $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
     585        did_action( 'init' ) && $scripts->add_inline_script( 'customize-controls', 'document.addEventListener( "DOMContentLoaded", wp.customize.ready );' );
    585586        did_action( 'init' ) && $scripts->localize(
    586587                'customize-controls', '_wpCustomizeControlsL10n', array(
    587588                        'activate'                => __( 'Activate & Publish' ),
  • tests/qunit/index.html

     
    7777                <script src="../../build/wp-includes/js/customize-models.js"></script>
    7878                <script src="../../build/wp-includes/js/shortcode.js"></script>
    7979                <script src="../../build/wp-admin/js/customize-controls.js"></script>
     80                <script>
     81                        document.addEventListener( 'DOMContentLoaded', wp.customize.ready );
     82                </script>
    8083                <script src="../../build/wp-includes/js/api-request.js"></script>
    8184                <script src="../../build/wp-includes/js/wp-api.js"></script>
    8285
  • tests/qunit/wp-admin/js/customize-controls.js

     
    66        }
    77});
    88
    9 jQuery( window ).load( function (){
     9jQuery( window ).on( 'load', function () {
    1010        'use strict';
    1111
    1212        var controlId, controlLabel, controlType, controlContent, controlDescription, controlData, mockControl,
     
    430430        settingId = 'new_blogname';
    431431        settingValue = 'Hello World';
    432432
    433         test( 'Create a new setting', function () {
    434                 mockSetting = wp.customize.create(
     433        function createMockSetting() {
     434                if ( wp.customize.has( settingId ) ) {
     435                        return wp.customize( settingId );
     436                }
     437                return wp.customize.create(
    435438                        settingId,
    436439                        settingId,
    437440                        settingValue,
     
    440443                                previewer: wp.customize.previewer
    441444                        }
    442445                );
     446        }
     447
     448        test( 'Create a new setting', function () {
     449                mockSetting = createMockSetting();
    443450                equal( mockSetting(), settingValue );
    444451                equal( mockSetting.id, settingId );
    445452        } );
     
    546553                mockControl.section( mockSection.id );
    547554                equal( mockControl.section(), mockSection.id );
    548555        });
    549         test( 'Associating a control with a section allows it to be embedded', function () {
    550                 equal( mockControl.deferred.embedded.state(), 'resolved' );
     556        test( 'Associating a control with a section allows it to be embedded', function ( assert ) {
     557                createMockSetting(); // In case this test is being tested in isolation.
     558                mockControl.section( mockSection.id );
     559                ok( wp.customize.has( 'new_blogname' ) );
     560                equal( mockControl.deferred.embedded.state(), 'resolved' ); // @todo Why is this not resolved?
    551561        });
    552562
    553563        test( 'Control is now available on section.controls()', function () {
  • tests/qunit/wp-admin/js/customize-nav-menus.js

     
    11/* global wp */
    2 jQuery( window ).load( function (){
     2jQuery( window ).on( 'load', function () {
    33
    44        var api = wp.customize,
    55                primaryMenuId = 3,
  • tests/qunit/wp-admin/js/customize-widgets.js

     
    11/* global wp */
    2 jQuery( window ).load( function() {
     2jQuery( window ).on( 'load', function () {
    33
    44        var api = wp.customize, $ = jQuery;
    55