Fix to work with rollup and remove semi-colons
This commit is contained in:
parent
d2f97eaed0
commit
b430d80c41
@ -1,11 +1,13 @@
|
|||||||
import { $ } from 'dollr/dollr'
|
import { $ } from 'dollr'
|
||||||
|
|
||||||
|
import './process'
|
||||||
|
|
||||||
import Timer from './components/Timer'
|
import Timer from './components/Timer'
|
||||||
|
|
||||||
// request permission on page load
|
// request permission on page load
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
if (!Notification) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import markoWidgets from 'marko-widgets'
|
import markoWidgets from 'marko-widgets'
|
||||||
import template from './template.marko'
|
import template from './template.marko.js'
|
||||||
|
|
||||||
import timeFilter from '../../util/time-filter'
|
import timeFilter from '../../util/time-filter'
|
||||||
|
|
||||||
|
|||||||
7
src/process.js
Normal file
7
src/process.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
window.process = {
|
||||||
|
browser: true,
|
||||||
|
env: {},
|
||||||
|
nextTick: (fnc) => {
|
||||||
|
setTimeout(fnc)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,19 +1,17 @@
|
|||||||
'use strict';
|
const divs = [ 60, 100, 10 ]
|
||||||
|
|
||||||
const divs = [ 60, 100, 10 ];
|
export default function (time) {
|
||||||
|
const arr = []
|
||||||
module.exports = function (time) {
|
|
||||||
const arr = [];
|
|
||||||
for (let i = 0; i < divs.length; i++) {
|
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;
|
time = time - result * nbr
|
||||||
//this.timerElements[i].textContent = result;
|
//this.timerElements[i].textContent = result
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr;
|
return arr
|
||||||
};
|
}
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
'use strict';
|
import splitTime from './split-time'
|
||||||
|
import twoDigits from './two-digits'
|
||||||
|
|
||||||
const splitTime = require('./split-time');
|
export default function (time) {
|
||||||
const twoDigits = require('./two-digits');
|
const arr = splitTime(time).map(twoDigits)
|
||||||
|
|
||||||
module.exports = function (time) {
|
return arr.join(':')
|
||||||
const arr = splitTime(time).map(twoDigits);
|
}
|
||||||
|
|
||||||
return arr.join(':');
|
|
||||||
};
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
'use strict';
|
export default function twoDigits(val) {
|
||||||
|
return val >= 10 ? val : '0' + val
|
||||||
module.exports = function twoDigits(val) {
|
}
|
||||||
return val >= 10 ? val : '0' + val;
|
|
||||||
};
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user