Skip to content
describe('add()', function() {
var tests = [
{bool: true, name: 'lol'},
{bool: true, name: 'a'},
{bool: true, name: 'b'},
{bool: true, name: 'b'}
];
tests.forEach(function(test) {
it('correctly adds ' + test.name + ' args', function() {
http://howtocenterincss.com/
// MODIFIED FROM: http://stackoverflow.com/a/722732/1365289
function process(key, value) {
if (key === 'myKey') {
console.error(key, value);
}
}
function traverse(o, func) {
for (var i in o) {
// From: http://stackoverflow.com/questions/1129216/sort-array-of-objects-by-property-value-in-javascript
function compare(a,b) {
if (a.last_nom < b.last_nom)
return -1;
if (a.last_nom > b.last_nom)
return 1;
return 0;
}
// From: http://stackoverflow.com/questions/2315408/how-do-i-format-a-timestamp-in-javascript-to-display-it-in-graphs-utc-is-fine
function formatDate(date, fmt) {
function pad(value) {
return (value.toString().length < 2) ? '0' + value : value;
}
return fmt.replace(/%([a-zA-Z])/g, function (_, fmtCode) {
switch (fmtCode) {
case 'Y':
return date.getUTCFullYear();
function onKey(evt) {
var key = evt.which || evt.charCode || evt.keyCode;
switch (key) {
case 67:
break;
case 18:
break;
default:
break;
}
function generateGUID() {
var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
return guid;
}
function changeTemplate(newHTML) {
var parentElem = document.getElementById('app');
if (parentElem !== undefined) {
parentElem.innerHTML = newHTML;
} else {
document.body.innerHTML = newHTML;
}
}
var history = [];
var navigation = {
back: function() {
if (history.length > 1) {
this.show(history[history.length - 2]);
history.pop();
}
},
forward: function(menu) {
history.push(menu);
var store = {
name: 'default_key_name',
get: function(_key) {
var key = _key || this.name;
return JSON.parse(localStorage.getItem(key) || '[]');
},
set: function(value, _key) {
var key = _key || this.name;
localStorage.setItem(key, JSON.stringify(value));
}
Something went wrong with that request. Please try again.