Sha256: 61a1a86de7d6d116a30dbf3e4c29ba174600c1e63414423be458edf4a9d3d0c3

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 Bytes

Contents

/**
* Quick & dirty browser sniff to detect mobile devices.
*/

var html = document.getElementsByTagName('html')[0];
var staticClass = 'static-site'
var dynamicClass = 'dynamic-site'

if (
  navigator.userAgent.match(/Android/i) ||
  navigator.userAgent.match(/webOS/i) ||
  navigator.userAgent.match(/iPhone/i) ||
  navigator.userAgent.match(/iPod/i) ||
  navigator.userAgent.match(/iPad/i) ||
  navigator.userAgent.match(/BlackBerry/i) ||
  navigator.userAgent.match(/IEMobile/i) ||
  navigator.userAgent.match(/Opera Mini/i)
) {
  window.isMobile = true;
}

var addClass = window.isMobile ? staticClass : dynamicClass;
html.className += html.className ? ' ' + addClass : addClass;

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
labelup_faq-0.0.12 app/assets/javascripts/labelup_faq/browser.sniff.js
labelup_faq-0.0.11 app/assets/javascripts/labelup_faq/browser.sniff.js
labelup_faq-0.0.10 app/assets/javascripts/labelup_faq/browser.sniff.js
labelup_faq-0.0.9 app/assets/javascripts/labelup_faq/browser.sniff.js