Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/sweetalert2/src/staticMethods/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import { animateTimerProgressBar, stopTimerProgressBar } from '../utils/dom/domUtils.js'
import globalState from '../globalState.js'
/**
* If `timer` parameter is set, returns number of milliseconds of timer remained.
* Otherwise, returns undefined.
*/
export const getTimerLeft = () => {
return globalState.timeout && globalState.timeout.getTimerLeft()
}
/**
* Stop timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/
export const stopTimer = () => {
if (globalState.timeout) {
stopTimerProgressBar()
return globalState.timeout.stop()
}
}
/**
* Resume timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/
export const resumeTimer = () => {
if (globalState.timeout) {
const remaining = globalState.timeout.start()
animateTimerProgressBar(remaining)
return remaining
}
}
/**
* Resume timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/
export const toggleTimer = () => {
const timer = globalState.timeout
return timer && (timer.running ? stopTimer() : resumeTimer())
}
/**
* Increase timer. Returns number of milliseconds of an updated timer.
* If `timer` parameter isn't set, returns undefined.
*/
export const increaseTimer = (n) => {
if (globalState.timeout) {
const remaining = globalState.timeout.increase(n)
animateTimerProgressBar(remaining, true)
return remaining
}
}
/**
* Check if timer is running. Returns true if timer is running
* or false if timer is paused or stopped.
* If `timer` parameter isn't set, returns undefined
*/
export const isTimerRunning = () => {
return globalState.timeout && globalState.timeout.isRunning()
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0037 ]-- |