mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
/* -----------------------------------------------------------------------------
|
|
Pi.Alert Common Javascript functions
|
|
----------------------------------------------------------------------------- */
|
|
|
|
// -----------------------------------------------------------------------------
|
|
var timerRefreshData = ''
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
function translateHTMLcodes (text) {
|
|
if (text == null) {
|
|
return null;
|
|
}
|
|
var text2 = text.replace(new RegExp(' ', 'g'), " ");
|
|
text2 = text2.replace(new RegExp('<', 'g'), "<");
|
|
return text2;
|
|
}
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
function stopTimerRefreshData () {
|
|
try {
|
|
clearTimeout (timerRefreshData);
|
|
} catch (e) {}
|
|
}
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
function newTimerRefreshData (refeshFunction) {
|
|
timerRefreshData = setTimeout (function() {
|
|
refeshFunction();
|
|
}, 5000);
|
|
}
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
function debugTimer () {
|
|
document.getElementById ('pageTitle').innerHTML = (new Date().getSeconds());
|
|
}
|