I'm working on a Presentation Control. I created some buttons for next, prev and start presentation controls. I want to implement too if possible a timer with countdown and count up showing the minutes in a text widget.
I don't know what the best way to do this. I tried some javascript scripts and I didn't manage to make them work. I don't see how and where to configure and put these scripts. In widgets or in a custom module.
In the project I have buttons to start the presentation, next slide, previous slide, a widget to show the minutes. On another tab a field to configure the minutes, a dropdown to choose between countdown and count up and buttons to start the timer, pause it and reset it.
Can anyone guide or help where to start?
TimerClicker.json (20.8 KB)
I suspect the Javascript would need to be in a custom module and use some kind of timer tick to update the text of the widget. I just recently saw an example of setInterval() that you could set to every second or every minute to do the update. I haven't fully studied the Javascript API but it looks like there is a .timeNow() method of the Date prototype. Saving that away at start and doing a bit of math at each setInterval() should get you a timer value to display.