1. Import
This commit is contained in:
103
html/js/ticker.js.php
Normal file
103
html/js/ticker.js.php
Normal file
@@ -0,0 +1,103 @@
|
||||
|
||||
// *** Ticker (BEGIN) ****************************************************
|
||||
|
||||
var tickerActive = false;
|
||||
var max = 0;
|
||||
|
||||
function textlist() {
|
||||
max = textlist.arguments.length;
|
||||
for (i=0; i<max; i++) {
|
||||
this[i] = textlist.arguments[i];
|
||||
};
|
||||
}
|
||||
|
||||
<?php if ($usedFramework == "2") : ?>
|
||||
|
||||
// Prototype.Request
|
||||
function ticker_request(url, data) {
|
||||
var myAjax = new Ajax.Request(
|
||||
url,
|
||||
{method: 'post', parameters: data, onSuccess: ticker_response}
|
||||
);
|
||||
}
|
||||
|
||||
// Prototype.Response
|
||||
function ticker_response(originalRequest) {
|
||||
eval(originalRequest.responseText);
|
||||
}
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
// JQuery.Request
|
||||
function ticker_request(url, data) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: data,
|
||||
success: function(msg){ticker_response(msg);}
|
||||
});
|
||||
}
|
||||
|
||||
// JQuery.Response
|
||||
function ticker_response(msg) {
|
||||
eval(msg);
|
||||
}
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
include_once ("../include/ajaxReqTickerMsgs.php");
|
||||
?>
|
||||
|
||||
|
||||
var x = 0; pos = 0;
|
||||
var msgLen = 0;
|
||||
if (max > 0) {
|
||||
msgLen = tl[0].length;
|
||||
} else {
|
||||
}
|
||||
var initInterval = 0;
|
||||
|
||||
function ticker(elem_id) {
|
||||
if (tickerActive) {
|
||||
content = ' ' + tl[x].substring(0,pos);
|
||||
if (elem_id == '' || elem_id == undefined) {elem_id = 'tickerOut';};
|
||||
vSetElementContent(elem_id, content);
|
||||
if (pos++ == msgLen) {
|
||||
pos = 0;
|
||||
// setTimeout("ticker()",5000);
|
||||
setTimeout("ticker('"+elem_id+"')",5000);
|
||||
x++;
|
||||
if (x == max) {
|
||||
x = 0;
|
||||
initInterval++;
|
||||
if (initInterval == 5) {
|
||||
ticker_request('../include/ajaxReqTickerMsgs.php', 'tickerHeader=1');
|
||||
initInterval = 0;
|
||||
};
|
||||
};
|
||||
msgLen = tl[x].length;
|
||||
} else {
|
||||
// setTimeout("ticker()",50);
|
||||
setTimeout("ticker('"+elem_id+"')",50);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function switchTicker(mode) {
|
||||
if (mode == 'on') {tickerActive = false;};
|
||||
if (mode == 'off') {tickerActive = true;};
|
||||
if (tickerActive) {
|
||||
tickerActive = false;
|
||||
myhide('tickerOut');
|
||||
} else {
|
||||
tickerActive = true;
|
||||
myshow('tickerOut');
|
||||
ticker('tickerOut');
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// *** Ticker (END) ****************************************************
|
||||
Reference in New Issue
Block a user