From 22d3794d226e0e1281a7d6331a7eaa447a167b61 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 4 Sep 2012 21:20:22 -0700 Subject: [PATCH] Update vendors. Former-commit-id: ad3284b1e77cfb0b17af99e0ddaf00618e4485b7 --- vendor/backbone/backbone.js | 32 ++-- vendor/backbone/test/router.js | 86 +++++++++- vendor/docdown/src/DocDown/Alias.php | 204 +++++++++++++++++++++++ vendor/docdown/src/DocDown/Entry.php | 203 ++++++++++++++++------ vendor/docdown/src/DocDown/Generator.php | 39 ++++- vendor/qunit/README.md | 14 +- vendor/qunit/qunit/qunit.css | 16 +- vendor/qunit/qunit/qunit.js | 89 +++++++--- vendor/underscore/test/utility.js | 12 ++ vendor/underscore/test/vendor/qunit.css | 55 +++--- vendor/underscore/test/vendor/qunit.js | 198 +++++++++++++++++----- vendor/underscore/underscore-min.js | 52 +++--- vendor/underscore/underscore.js | 72 ++++---- 13 files changed, 842 insertions(+), 230 deletions(-) create mode 100644 vendor/docdown/src/DocDown/Alias.php diff --git a/vendor/backbone/backbone.js b/vendor/backbone/backbone.js index cfa836155..9796cc04f 100644 --- a/vendor/backbone/backbone.js +++ b/vendor/backbone/backbone.js @@ -18,8 +18,10 @@ // restored later on, if `noConflict` is used. var previousBackbone = root.Backbone; - // Create a local reference to splice. - var splice = Array.prototype.splice; + // Create a local reference to array methods. + var ArrayProto = Array.prototype; + var slice = ArrayProto.slice; + var splice = ArrayProto.splice; // The top-level namespace. All public Backbone classes and modules will // be attached to this. Exported for both CommonJS and the browser. @@ -866,7 +868,9 @@ // Mix in each Underscore method as a proxy to `Collection#models`. _.each(methods, function(method) { Collection.prototype[method] = function() { - return _[method].apply(_, [this.models].concat(_.toArray(arguments))); + var args = slice.call(arguments); + args.unshift(this.models); + return _[method].apply(_, args); }; }); @@ -961,9 +965,12 @@ this.history = options && options.history || root.history; }; - // Cached regex for cleaning leading hashes and slashes . + // Cached regex for cleaning leading hashes and slashes. var routeStripper = /^[#\/]/; + // Cached regex for stripping leading and trailing slashes. + var rootStripper = /^\/+|\/+$/g; + // Cached regex for detecting MSIE. var isExplorer = /msie [\w.]+/; @@ -993,7 +1000,7 @@ if (fragment == null) { if (this._hasPushState || !this._wantsHashChange || forcePushState) { fragment = this.location.pathname; - var root = this.options.root.replace(trailingSlash, ''); + var root = this.root.replace(trailingSlash, ''); if (!fragment.indexOf(root)) fragment = fragment.substr(root.length); } else { fragment = this.getHash(); @@ -1011,6 +1018,7 @@ // Figure out the initial configuration. Do we need an iframe? // Is pushState desired ... is it available? this.options = _.extend({}, {root: '/'}, this.options, options); + this.root = this.options.root; this._wantsHashChange = this.options.hashChange !== false; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); @@ -1018,8 +1026,8 @@ var docMode = document.documentMode; var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); - // Normalize root to always include trailing slash - if (!trailingSlash.test(this.options.root)) this.options.root += '/'; + // Normalize root to always include a leading and trailing slash. + this.root = ('/' + this.root + '/').replace(rootStripper, '/'); if (oldIE && this._wantsHashChange) { this.iframe = Backbone.$('