WordPress.org

Make WordPress Core

Ticket #47478: 47478.3.diff

File 47478.3.diff, 4.1 KB (added by adamsilverstein, 18 months ago)
  • package-lock.json

     
    43144314                        "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ=="
    43154315                },
    43164316                "backbone": {
    4317                         "version": "1.3.3",
    4318                         "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.3.3.tgz",
    4319                         "integrity": "sha1-TMgOp8sWMaxHSInOQPL4vGg7KZk=",
     4317                        "version": "1.4.0",
     4318                        "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz",
     4319                        "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==",
    43204320                        "requires": {
    43214321                                "underscore": ">=1.8.3"
    43224322                        }
  • package.json

     
    101101                "@wordpress/url": "2.5.0",
    102102                "@wordpress/viewport": "2.3.0",
    103103                "@wordpress/wordcount": "2.2.0",
    104                 "backbone": "1.3.3",
     104                "backbone": "1.4.0",
    105105                "clipboard": "2.0.4",
    106106                "element-closest": "^2.0.2",
    107107                "formdata-polyfill": "3.0.13",
  • src/js/media/controllers/state-machine.js

     
    1414 * @augments Backbone.Model
    1515 * @mixin
    1616 * @mixes Backbone.Events
    17  *
    18  * @param {Array} states
    1917 */
    20 var StateMachine = function( states ) {
    21         // @todo This is dead code. The states collection gets created in media.view.Frame._createStates.
    22         this.states = new Backbone.Collection( states );
     18var StateMachine = function() {
     19        return {
     20                // Use Backbone's self-propagating `extend` inheritance method.
     21                extend: Backbone.Model.extend
     22        };
    2323};
    2424
    25 // Use Backbone's self-propagating `extend` inheritance method.
    26 StateMachine.extend = Backbone.Model.extend;
    27 
    2825_.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller.StateMachine.prototype */{
    2926        /**
    3027         * Fetch a state.
  • src/js/media/views/attachment.js

     
    6666                        this.details( this.model, this.controller.state().get('selection') );
    6767                }
    6868
    69                 this.listenTo( this.controller, 'attachment:compat:waiting attachment:compat:ready', this.updateSave );
     69                this.listenTo( this.controller.states, 'attachment:compat:waiting attachment:compat:ready', this.updateSave );
    7070        },
    7171        /**
    7272         * @returns {wp.media.view.Attachment} Returns itself to allow chaining
  • src/js/media/views/media-details.js

     
    1919        initialize: function() {
    2020                _.bindAll(this, 'success');
    2121                this.players = [];
    22                 this.listenTo( this.controller, 'close', wp.media.mixin.unsetPlayers );
     22                this.listenTo( this.controller.states, 'close', wp.media.mixin.unsetPlayers );
    2323                this.on( 'ready', this.setPlayer );
    2424                this.on( 'media:setting:remove', wp.media.mixin.unsetPlayers, this );
    2525                this.on( 'media:setting:remove', this.render );
  • src/wp-includes/script-loader.php

     
    11701170        did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' );
    11711171
    11721172        $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.8.3', 1 );
    1173         $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.2.3', 1 );
     1173        $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.4.0', 1 );
    11741174
    11751175        $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 );
    11761176        did_action( 'init' ) && $scripts->localize(