This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webappDetect = () => ("standalone" in window.navigator) && window.navigator.standalone; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = (message, filename, lineno, colno, error) => { | |
function stack() { | |
return (`${(error.stack).replace(/(\r\n|\n|\r)/gm," ")} in ${navigator.userAgent}`) | |
} | |
function nostack() { | |
return (`${message} on line ${lineno} for ${filename} in ${navigator.userAgent}`) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isTouch = function () { | |
return 'ontouchend' in document; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin sprite-background($name) | |
background-repeat: no-repeat | |
background-image: $standardImg | |
background-position: sprite-position($sprites, $name) | |
height: image-height(sprite-file($sprites, $name)) | |
width: image-width(sprite-file($sprites, $name)) | |
@media (-webkit-min-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5) | |
background-image: $retinaImg | |
background-position: 0 round(nth(sprite-position($sprites2x, $name), 2) / 2) | |
height: round(image-height(sprite-file($sprites2x, $name)) / 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oldBrowser = (reContainsAll([/mozilla\/5.0/i, /android/i, /applewebkit/i], navigator.userAgent) | |
|| reContainsAll([/mozilla\/5.0/i, /iphone os (5|4|3|2|1){1}/i, /applewebkit/i], navigator.userAgent)) | |
&& !reContainsAll([/chrome/i], navigator.userAgent); | |
Backbone.History.prototype._updateHash = function(location, fragment, replace) { | |
var base = location.toString().replace(/(javascript:|#).*$/, '') + '#'; | |
if (replace) { | |
if (oldBrowser) { | |
window.history.replaceState({}, document.title, base + fragment); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
db = {}; | |
db.map = { | |
'jobs': { | |
'create': { | |
'sql': 'CREATE TABLE "jobs" (id unique, json)' | |
}, | |
'insert': { | |
'sql': 'INSERT INTO "jobs" (id, json) VALUES (?,?)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype.assign = Object.assign || function(obj1, obj2) { | |
var obj3 = obj1; | |
for (var attrname in obj2) { | |
if (typeof(obj2[attrname]) !== 'function') { | |
obj3[attrname] = obj2[attrname]; | |
} | |
} | |
return obj3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
var fo = window.fo = window.fo || {}, | |
eventHandler = fo.eventHandler = fo.eventHandler || {}; | |
eventHandler.events = {}; | |
eventHandler.publish = function (event, data) { | |
var events = event.split(' '), | |
key, func; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toCapitalize = function() { | |
return this.toLowerCase().replace(/^\.|\s\S/g, function(a) { | |
return a.toUpperCase(); | |
}); | |
}; |
OlderNewer