SHARE
TWEET

Untitled

a guest Apr 16th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Check which Browser
  2. navigator.browserSpecs = do ->
  3.   ua = navigator.userAgent
  4.   tem = undefined
  5.   M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) or []
  6.   if /trident/i.test(M[1])
  7.     tem = /\brv[ :]+(\d+)/g.exec(ua) or []
  8.     return {
  9.       name: 'IE'
  10.       version: tem[1] or ''
  11.     }
  12.   if M[1] == 'Chrome'
  13.     tem = ua.match(/\b(OPR|Edge)\/(\d+)/)
  14.     if tem != null
  15.       return {
  16.         name: tem[1].replace('OPR', 'Opera')
  17.         version: tem[2]
  18.       }
  19.   M = if M[2] then [
  20.     M[1]
  21.     M[2]
  22.   ] else [
  23.     navigator.appName
  24.     navigator.appVersion
  25.     '-?'
  26.   ]
  27.   if (tem = ua.match(/version\/(\d+)/i)) != null
  28.     M.splice 1, 1, tem[1]
  29.   {
  30.     name: M[0]
  31.     version: M[1]
  32.   }
  33. # Add class to carousel slide on Firefox
  34. if navigator.browserSpecs.name == 'Firefox'
  35.   $('.featured-item figure').addClass 'isFF'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top