Make WordPress Core

Changeset 46157


Ignore:
Timestamp:
09/17/2019 05:18:32 PM (5 years ago)
Author:
adamsilverstein
Message:

External Libraries: Update Backbone.js to 1.4.0.

Upgrade Backbone to the latest stable version. Fix some issues in Media with listenTo which changed in this version, see https://backbonejs.org/#changelog.

Props desrosj, priyankkpatel, pierlo.
Fixes #47478.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/package-lock.json

    r46095 r46157  
    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"
  • trunk/package.json

    r46095 r46157  
    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",
  • trunk/src/js/media/controllers/state-machine.js

    r43309 r46157  
    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};
    24 
    25 // Use Backbone's self-propagating `extend` inheritance method.
    26 StateMachine.extend = Backbone.Model.extend;
    2724
    2825_.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller.StateMachine.prototype */{
  • trunk/src/js/media/views/attachment.js

    r44640 r46157  
    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    /**
  • trunk/src/js/media/views/media-details.js

    r45524 r46157  
    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 );
  • trunk/src/wp-includes/script-loader.php

    r46111 r46157  
    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 );
Note: See TracChangeset for help on using the changeset viewer.