Skip to content

Instantly share code, notes, and snippets.

View ingmarh's full-sized avatar

Ingmar Hergst ingmarh

View GitHub Profile
@ingmarh
ingmarh / cordova_environment.js
Last active August 29, 2015 14:07 — forked from tvandervossen/environment.js
Basic environment flags for Cordova apps with installed Device plugin. Note that the Device plugin is not available before the Cordova "deviceready" event has been fired.
env = (function(){
var flags = {}, i, osVersion = device.version + '', androidVersion,
el = document.createElement('div'), root = document.documentElement
function flag(names) {
names = names.split(' ')
for (i = 0; i < names.length; i++) flags[names[i]] = true
}
function classnames() {