only detect ie outside the browser

This commit is contained in:
Sami Samhuri 2010-11-28 22:40:21 -08:00
parent ee61b0f95a
commit 22af769100

View file

@ -9,19 +9,25 @@
// - authentication and write APIs // - authentication and write APIs
(function() { (function() {
var ie = (function() { var global = this
var undef , isBrowser = 'document' in global
, v = 3 , ie
, div = document.createElement('div')
, all = div.getElementsByTagName('i')
while ( if (isBrowser) {
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', ie = (function() {
all[0] var undef
); , v = 3
, div = document.createElement('div')
, all = div.getElementsByTagName('i')
return v > 4 ? v : undef while (
}()) div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : undef
}())
}
var inherits var inherits
if ('create' in Object) { if ('create' in Object) {
@ -55,10 +61,8 @@
} }
} }
var global = this // when running in the browser request is set later
, isBrowser = 'document' in global var request = isBrowser ? null : require('request')
// when running in the browser request is set later
, request = isBrowser ? null : require('request')
, Blob, Branch, Commit, Raw, Repo, Tree, User , Blob, Branch, Commit, Raw, Repo, Tree, User
, api , api