Set time and message in document.title. And updated notification text and image.
This commit is contained in:
parent
256842e42d
commit
e1e53b8cbe
@ -1,6 +1,8 @@
|
|||||||
import markoWidgets from 'marko-widgets'
|
import markoWidgets from 'marko-widgets'
|
||||||
import template from './template.marko'
|
import template from './template.marko'
|
||||||
|
|
||||||
|
import timeFilter from '../../util/time-filter'
|
||||||
|
|
||||||
const length = 25 * 60 * 1000
|
const length = 25 * 60 * 1000
|
||||||
|
|
||||||
export default markoWidgets.defineComponent({
|
export default markoWidgets.defineComponent({
|
||||||
@ -43,6 +45,8 @@ export default markoWidgets.defineComponent({
|
|||||||
time = 0
|
time = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = timeFilter(time).slice(0, 5)
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
time
|
time
|
||||||
})
|
})
|
||||||
@ -54,12 +58,14 @@ export default markoWidgets.defineComponent({
|
|||||||
endTime: new Date()
|
endTime: new Date()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = 'Pling!'
|
||||||
|
|
||||||
if (Notification.permission !== 'granted')
|
if (Notification.permission !== 'granted')
|
||||||
Notification.requestPermission()
|
Notification.requestPermission()
|
||||||
else {
|
else {
|
||||||
const notification = new Notification('Notification title', {
|
const notification = new Notification('Pomodoro complete!', {
|
||||||
icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
|
icon: 'https://www.planetnatural.com/wp-content/uploads/2014/03/tomato-supplies.jpg',
|
||||||
body: 'Pomdoro is done!',
|
body: 'Time for a break!',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user