Sha256: 50765232dbd0dfc82b4b042826c6e0b8d5ffb9fbd62ecaeae5d9058e9de8c8f8

Contents?: true

Size: 1.12 KB

Versions: 178

Compression:

Stored size: 1.12 KB

Contents

window.Alchemy = {} if typeof(Alchemy) is "undefined"

Alchemy.Browser =
  isiPhone: navigator.userAgent.match(/iPhone/i) isnt null
  isiPad: navigator.userAgent.match(/iPad/i) isnt null
  isiPod: navigator.userAgent.match(/iPod/i) isnt null
  isiOS: navigator.userAgent.match(/iPad|iPhone|iPod/i) isnt null
  isFirefox: navigator.userAgent.match(/Firefox/i) isnt null
  isChrome: navigator.userAgent.match(/Chrome/i) isnt null
  isSafari: navigator.userAgent.match(/AppleWebKit/) and not navigator.userAgent.match(/Chrome/)
  isIE: navigator.userAgent.match(/MSIE/i) isnt null
  getVersion: (browser) ->
    if Alchemy.Browser["is" + browser]
      parseInt(navigator.userAgent.match(new RegExp(browser + ".[0-9]+", "i"))[0].replace(new RegExp(browser + "."), ""), 10)
    else
      null

Alchemy.Browser.ChromeVersion = Alchemy.Browser.getVersion("Chrome")
Alchemy.Browser.FirefoxVersion = Alchemy.Browser.getVersion("Firefox")
Alchemy.Browser.SafariVersion = Alchemy.Browser.getVersion("Safari")
Alchemy.Browser.IEVersion = Alchemy.Browser.getVersion("MSIE")
Alchemy.Browser.isWebKit = Alchemy.Browser.isChrome || Alchemy.Browser.isSafari

Version data entries

178 entries across 178 versions & 2 rubygems

Version Path
alchemy_cms-6.1.10 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.9 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.8 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.7 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.6 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-7.0.0.pre.c app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-7.0.0.pre.b app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.5 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.0.14 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.4 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-7.0.0.pre.a app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.0.13 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.3 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.1.0 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.0.12 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.0.11 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-6.0.10 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.3.8 app/assets/javascripts/alchemy/alchemy.browser.js.coffee