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-5.1.3 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.2.0 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-3.6.7 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.2.0.rc1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.2.0.b1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.3 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.0 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.0.rc1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.0.beta2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.1.0.beta1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-3.6.6 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-4.6.2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.0 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.0.rc2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.0.rc1 app/assets/javascripts/alchemy/alchemy.browser.js.coffee
alchemy_cms-5.0.0.beta2 app/assets/javascripts/alchemy/alchemy.browser.js.coffee