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
'use strict'; | |
var login = {}; | |
login.vm = (function() { | |
var vm = {}; | |
vm.init = function() { | |
vm.username = m.prop(''); | |
vm.password = m.prop(''); |
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
'use strict'; | |
var m = require('mithril'); | |
var pouchdb = require('pouchdb'); | |
var submodule = require('./helpers/submodule')(); | |
var migration = require('./migration')(); | |
var app = { | |
vm: { | |
apiPath: '/api/v1/', |
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 _ = require('lodash'); | |
module.exports = function() { | |
return { | |
list: [], | |
add: function(template) { | |
this.list.push(template); | |
}, | |
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
campaigns.aip_reduce = function(list) { | |
var stats = { "active" : 0, "pending" : 0, "inactive" : 0 }; | |
list.forEach(function(curr) { | |
switch (curr.status) { | |
case "active": | |
stats.active += 1; | |
break; | |
case "pending": | |
stats.pending += 1; | |
break; |
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 _ = require('lodash'), | |
config = require('../config'); | |
module.exports = list = { | |
active: m.prop(''), | |
list: m.prop([]), | |
init: function(items, active) { | |
list(items); | |
active(active); |
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 focusElement = function(element) { | |
element.focus(); | |
} | |
var inputFinished = function(month, event) { | |
if (event && event.keyCode === 13) { | |
month.setName(editingMonthName()); | |
} | |
editingMonthName = null; | |
} |
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 versioning(paths) { | |
let versions = Object.keys(paths); | |
let defaultPath = versions[0]; | |
return function(request, reply) { | |
if (versions.contains(request.headers['accept-header'])) { | |
return paths[request.headers['accept-header']](request, reply); | |
} | |
return paths[defaultPath](request, reply); | |
} |
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
/* eslint-disable */ | |
var knex = require('knex') | |
var config = { | |
connection: { | |
host: '127.0.0.1', | |
}, | |
pool: { | |
min: 1, | |
max: 1, |
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 socket = require('../socket') | |
const m = require('mithril') | |
const Status = { | |
oninit: function() { | |
this.current = [] | |
this.connected = socket.connected | |
this.status = { | |
connected: false, | |
playing: false, |
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 myItems = [1,2,3,4,5,6] | |
for (var i = 0; i < myItems.length; i++) { | |
myTest(myItems, i) | |
} | |
function myTest(items, i) { | |
console.log('outside setTimeout: ' + items[i]) | |
setTimeout(function() { console.log('inside setTimeout: ' + items[i]) }, 5000) | |
} |
OlderNewer