[Pkg-javascript-commits] [backbone] 113/211: merging in Ender.js support
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:00:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.5.0
in repository backbone.
commit 4070364e4d5f3d77300d23a00356d9cd1491a681
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Mon Apr 18 09:34:51 2011 -0400
merging in Ender.js support
---
backbone.js | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/backbone.js b/backbone.js
index eccf12a..c565eb6 100644
--- a/backbone.js
+++ b/backbone.js
@@ -11,10 +11,10 @@
// Save a reference to the global object.
var root = this;
-
+
// Save the previous value of the `Backbone` variable.
var previousBackbone = root.Backbone;
-
+
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both CommonJS and the browser.
var Backbone;
@@ -28,11 +28,11 @@
Backbone.VERSION = '0.3.3';
// Require Underscore, if we're on the server, and it's not already present.
- var _ = root.$ && root.$.ender ? root.$ : root._;
+ var _ = root._ || root.$;
if (!_ && (typeof require !== 'undefined')) _ = require('underscore')._;
- // For Backbone's purposes, either jQuery or Zepto owns the `$` variable.
- var $ = root.$ && root.$.ender ? root.$ : (root.jQuery || root.Zepto);
+ // For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
+ var $ = root.jQuery || root.Zepto || root.$;
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
// to its previous owner. Returns a reference to this Backbone object.
@@ -40,7 +40,7 @@
root.Backbone = previousBackbone;
return this;
};
-
+
// Turn on `emulateHTTP` to use support legacy HTTP servers. Setting this option will
// fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and set a
// `X-Http-Method-Override` header.
@@ -733,6 +733,9 @@
// Cached regex for cleaning hashes.
var hashStrip = /^#*/;
+ // Cached regex for detecting MSIE.
+ var isExplorer = /msie [\w.]+/;
+
// Has the history handling already been started?
var historyStarted = false;
@@ -753,7 +756,7 @@
start : function() {
if (historyStarted) throw new Error("Backbone.history has already been started");
var docMode = document.documentMode;
- var oldIE = (navigator.userAgent.toLowerCase().match(/msie [\w.]+/) && (!docMode || docMode <= 7));
+ var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
if (oldIE) {
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list