Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Check which Browser
- navigator.browserSpecs = do ->
- ua = navigator.userAgent
- tem = undefined
- M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) or []
- if /trident/i.test(M[1])
- tem = /\brv[ :]+(\d+)/g.exec(ua) or []
- return {
- name: 'IE'
- version: tem[1] or ''
- }
- if M[1] == 'Chrome'
- tem = ua.match(/\b(OPR|Edge)\/(\d+)/)
- if tem != null
- return {
- name: tem[1].replace('OPR', 'Opera')
- version: tem[2]
- }
- M = if M[2] then [
- M[1]
- M[2]
- ] else [
- navigator.appName
- navigator.appVersion
- '-?'
- ]
- if (tem = ua.match(/version\/(\d+)/i)) != null
- M.splice 1, 1, tem[1]
- {
- name: M[0]
- version: M[1]
- }
- # Add class to carousel slide on Firefox
- if navigator.browserSpecs.name == 'Firefox'
- $('.featured-item figure').addClass 'isFF'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement