Fix to work with rollup and remove semi-colons

This commit is contained in:
Linus Miller 2016-09-15 11:18:51 +02:00
parent d2f97eaed0
commit b430d80c41
7 changed files with 32 additions and 29 deletions

View File

@ -1,11 +1,13 @@
import { $ } from 'dollr/dollr'
import { $ } from 'dollr'
import './process'
import Timer from './components/Timer'
// request permission on page load
document.addEventListener('DOMContentLoaded', () => {
if (!Notification) {
alert('Desktop notifications not available in your browser. Try Chromium.')
alert('Desktop notifications not available in your browser. Try Chromium, Chrome or Firefox.')
return
}

View File

@ -1,5 +1,5 @@
import markoWidgets from 'marko-widgets'
import template from './template.marko'
import template from './template.marko.js'
import timeFilter from '../../util/time-filter'

7
src/process.js Normal file
View File

@ -0,0 +1,7 @@
window.process = {
browser: true,
env: {},
nextTick: (fnc) => {
setTimeout(fnc)
}
}

View File

@ -1,19 +1,17 @@
'use strict';
const divs = [ 60, 100, 10 ]
const divs = [ 60, 100, 10 ];
module.exports = function (time) {
const arr = [];
export default function (time) {
const arr = []
for (let i = 0; i < divs.length; i++) {
const nbr = divs.slice(i).reduce((a, b) => a * b);
const nbr = divs.slice(i).reduce((a, b) => a * b)
const result = Math.floor(time / nbr);
const result = Math.floor(time / nbr)
arr.push(result);
arr.push(result)
time = time - result * nbr;
//this.timerElements[i].textContent = result;
time = time - result * nbr
//this.timerElements[i].textContent = result
}
return arr;
};
return arr
}

View File

@ -1,10 +1,8 @@
'use strict';
import splitTime from './split-time'
import twoDigits from './two-digits'
const splitTime = require('./split-time');
const twoDigits = require('./two-digits');
export default function (time) {
const arr = splitTime(time).map(twoDigits)
module.exports = function (time) {
const arr = splitTime(time).map(twoDigits);
return arr.join(':');
};
return arr.join(':')
}

View File

@ -1,5 +1,3 @@
'use strict';
module.exports = function twoDigits(val) {
return val >= 10 ? val : '0' + val;
};
export default function twoDigits(val) {
return val >= 10 ? val : '0' + val
}