mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
Timer/blinking and blackout buttons (#406)
*feat: timer blink *feat: blackout --------- Co-authored-by: Fabian Posenau <fabian@fphome.de> Co-authored-by: cv <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Message } from 'ontime-types';
|
||||
|
||||
import { eventStore } from '../../stores/EventStore.js';
|
||||
import { TimerMessage } from 'ontime-types/src/definitions/runtime/MessageControl.type.js';
|
||||
|
||||
let instance;
|
||||
|
||||
class MessageService {
|
||||
timerMessage: Message;
|
||||
timerMessage: TimerMessage;
|
||||
publicMessage: Message;
|
||||
lowerMessage: Message;
|
||||
onAir: boolean;
|
||||
@@ -21,6 +22,8 @@ class MessageService {
|
||||
this.timerMessage = {
|
||||
text: '',
|
||||
visible: false,
|
||||
timerBlink: false,
|
||||
timerBlackout: false,
|
||||
};
|
||||
|
||||
this.publicMessage = {
|
||||
@@ -103,6 +106,34 @@ class MessageService {
|
||||
return this.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description set state of timer blink, toggles if parameters are offered
|
||||
*/
|
||||
|
||||
setTimerBlink(status?: boolean) {
|
||||
if (typeof status === 'undefined') {
|
||||
this.timerMessage.timerBlink = !this.timerMessage.timerBlink;
|
||||
} else {
|
||||
this.timerMessage.timerBlink = status;
|
||||
}
|
||||
eventStore.set('timerMessage', this.timerMessage);
|
||||
return this.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description set state of timer blackout, toggles if parameters are offered
|
||||
*/
|
||||
|
||||
setTimerBlackout(status?: boolean) {
|
||||
if (typeof status === 'undefined') {
|
||||
this.timerMessage.timerBlackout = !this.timerMessage.timerBlackout;
|
||||
} else {
|
||||
this.timerMessage.timerBlackout = status;
|
||||
}
|
||||
eventStore.set('timerMessage', this.timerMessage);
|
||||
return this.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns feature data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user