External Libraries: Update the Backbone.js library to version `1.6.0`.

This updates the `backbone` library from version `1.5.0` to `1.6.0`. This is a minor bug fix release.

The full list of changes can be found in the Backbone.js change log: https://backbonejs.org/#changelog.

Props manooweb mardroid.
Fixes #60512.
Built from https://develop.svn.wordpress.org/trunk@58872


git-svn-id: http://core.svn.wordpress.org/trunk@58268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2024-08-08 19:37:19 +00:00
parent c834d20762
commit 32bf860db4
4 changed files with 28 additions and 10 deletions

View File

@ -1,6 +1,6 @@
// Backbone.js 1.5.0 // Backbone.js 1.6.0
// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud // (c) 2010-2024 Jeremy Ashkenas and DocumentCloud
// Backbone may be freely distributed under the MIT license. // Backbone may be freely distributed under the MIT license.
// For all details and documentation: // For all details and documentation:
// http://backbonejs.org // http://backbonejs.org
@ -44,7 +44,7 @@
var slice = Array.prototype.slice; var slice = Array.prototype.slice;
// Current version of the library. Keep in sync with `package.json`. // Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.5.0'; Backbone.VERSION = '1.6.0';
// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable. // the `$` variable.
@ -1085,7 +1085,7 @@
var success = options.success; var success = options.success;
options.success = function(m, resp, callbackOpts) { options.success = function(m, resp, callbackOpts) {
if (wait) { if (wait) {
m.off('error', this._forwardPristineError, this); m.off('error', collection._forwardPristineError, collection);
collection.add(m, callbackOpts); collection.add(m, callbackOpts);
} }
if (success) success.call(callbackOpts.context, m, resp, callbackOpts); if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
@ -1985,7 +1985,10 @@
current = this.getHash(this.iframe.contentWindow); current = this.getHash(this.iframe.contentWindow);
} }
if (current === this.fragment) return false; if (current === this.fragment) {
if (!this.matchRoot()) return this.notfound();
return false;
}
if (this.iframe) this.navigate(current); if (this.iframe) this.navigate(current);
this.loadUrl(); this.loadUrl();
}, },
@ -1995,14 +1998,22 @@
// returns `false`. // returns `false`.
loadUrl: function(fragment) { loadUrl: function(fragment) {
// If the root doesn't match, no routes can match either. // If the root doesn't match, no routes can match either.
if (!this.matchRoot()) return false; if (!this.matchRoot()) return this.notfound();
fragment = this.fragment = this.getFragment(fragment); fragment = this.fragment = this.getFragment(fragment);
return _.some(this.handlers, function(handler) { return _.some(this.handlers, function(handler) {
if (handler.route.test(fragment)) { if (handler.route.test(fragment)) {
handler.callback(fragment); handler.callback(fragment);
return true; return true;
} }
}); }) || this.notfound();
},
// When no route could be matched, this method is called internally to
// trigger the `'notfound'` event. It returns `false` so that it can be used
// in tail position.
notfound: function() {
this.trigger('notfound');
return false;
}, },
// Save a fragment into the hash history, or replace the URL state if the // Save a fragment into the hash history, or replace the URL state if the
@ -2133,5 +2144,12 @@
}; };
}; };
// Provide useful information when things go wrong. This method is not meant
// to be used directly; it merely provides the necessary introspection for the
// external `debugInfo` function.
Backbone._debug = function() {
return {root: root, _: _};
};
return Backbone; return Backbone;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1040,7 +1040,7 @@ function wp_default_scripts( $scripts ) {
did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' ); did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' );
$scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.13.4', 1 ); $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.13.4', 1 );
$scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.5.0', 1 ); $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.6.0', 1 );
$scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 ); $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 );
did_action( 'init' ) && $scripts->localize( did_action( 'init' ) && $scripts->localize(

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.7-alpha-58871'; $wp_version = '6.7-alpha-58872';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.