mirror of
https://github.com/samsonjs/gitter.git
synced 2026-03-25 09:25:45 +00:00
only detect ie outside the browser
This commit is contained in:
parent
ee61b0f95a
commit
22af769100
1 changed files with 19 additions and 15 deletions
34
lib/index.js
34
lib/index.js
|
|
@ -9,19 +9,25 @@
|
|||
// - authentication and write APIs
|
||||
|
||||
(function() {
|
||||
var ie = (function() {
|
||||
var undef
|
||||
, v = 3
|
||||
, div = document.createElement('div')
|
||||
, all = div.getElementsByTagName('i')
|
||||
var global = this
|
||||
, isBrowser = 'document' in global
|
||||
, ie
|
||||
|
||||
while (
|
||||
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
|
||||
all[0]
|
||||
);
|
||||
if (isBrowser) {
|
||||
ie = (function() {
|
||||
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
|
||||
if ('create' in Object) {
|
||||
|
|
@ -55,10 +61,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
var global = this
|
||||
, isBrowser = 'document' in global
|
||||
// when running in the browser request is set later
|
||||
, request = isBrowser ? null : require('request')
|
||||
// when running in the browser request is set later
|
||||
var request = isBrowser ? null : require('request')
|
||||
, Blob, Branch, Commit, Raw, Repo, Tree, User
|
||||
, api
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue