mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
feat: event timer
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
const Timer = require('./Timer');
|
||||
|
||||
/*
|
||||
* EventTimer adds functions specific to APP
|
||||
* namely:
|
||||
* - Presenter message, text and status
|
||||
* - Public message, text and status
|
||||
*
|
||||
*/
|
||||
|
||||
class EventTimer extends Timer {
|
||||
presenter = {
|
||||
text: '',
|
||||
visible: false,
|
||||
};
|
||||
public = {
|
||||
text: '',
|
||||
visible: false,
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
set presenterText(text) {
|
||||
this.presenter.text = text;
|
||||
}
|
||||
|
||||
set presenterVisible(state) {
|
||||
this.presenter.visible = state;
|
||||
}
|
||||
|
||||
set publicText(text) {
|
||||
this.public.text = text;
|
||||
}
|
||||
|
||||
set publicVisible(state) {
|
||||
this.public.visible = state;
|
||||
}
|
||||
|
||||
get presenter() {
|
||||
return this.presenter;
|
||||
}
|
||||
|
||||
get public() {
|
||||
return this.public;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = EventTimer;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* Timer implements simple countdown timer functions
|
||||
* User needs to use setup function to be able to use
|
||||
*
|
||||
*/
|
||||
|
||||
class Timer {
|
||||
_current = null;
|
||||
_finishAt = null;
|
||||
@@ -116,5 +122,4 @@ class Timer {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = Timer;
|
||||
|
||||
Reference in New Issue
Block a user