diff --git a/wp-includes/js/backbone.js b/wp-includes/js/backbone.js index 2f8db37212..aa36f1e0f0 100644 --- a/wp-includes/js/backbone.js +++ b/wp-includes/js/backbone.js @@ -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. // For all details and documentation: // http://backbonejs.org @@ -44,7 +44,7 @@ var slice = Array.prototype.slice; // 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 // the `$` variable. @@ -1085,7 +1085,7 @@ var success = options.success; options.success = function(m, resp, callbackOpts) { if (wait) { - m.off('error', this._forwardPristineError, this); + m.off('error', collection._forwardPristineError, collection); collection.add(m, callbackOpts); } if (success) success.call(callbackOpts.context, m, resp, callbackOpts); @@ -1985,7 +1985,10 @@ 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); this.loadUrl(); }, @@ -1995,14 +1998,22 @@ // returns `false`. loadUrl: function(fragment) { // 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); return _.some(this.handlers, function(handler) { if (handler.route.test(fragment)) { handler.callback(fragment); 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 @@ -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; }); diff --git a/wp-includes/js/backbone.min.js b/wp-includes/js/backbone.min.js index b674cc22b7..40246777a2 100644 --- a/wp-includes/js/backbone.min.js +++ b/wp-includes/js/backbone.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){function a(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);othis.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},l=e.add,c=e.merge,u=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;gthis.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,l=e.merge,c=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;gadd_data( 'json2', 'conditional', 'lt IE 8' ); $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 ); did_action( 'init' ) && $scripts->localize( diff --git a/wp-includes/version.php b/wp-includes/version.php index d93724149e..b1ad4173fb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.