0.9.0 - the ZapV version updated to current php standards. Brave search used, while Bing and Google search api are deprecated
This commit is contained in:
parent
3d4298fe8b
commit
4ddaddda3d
31 changed files with 1778 additions and 1 deletions
33
www/js/display.js
Executable file
33
www/js/display.js
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
var go = function(b, img_id, interval) {
|
||||
var i = 0;
|
||||
var img0 = document.getElementById(img_id[0]);
|
||||
var img1 = document.getElementById(img_id[1]);
|
||||
var img = [img0, img1];
|
||||
var activeImage = 1; // index of visible image
|
||||
var url = 'index.php?mode=zap';
|
||||
|
||||
if (isNaN(interval)) {
|
||||
interval = 5000;
|
||||
}
|
||||
|
||||
// Trigger the next image fetch after the current one has loaded.
|
||||
img[0].onload = img[1].onload = function() {
|
||||
var inactiveImage = activeImage === 0 ? 1 : 0;
|
||||
img[activeImage].style.display = 'none';
|
||||
img[inactiveImage].style.display = '';
|
||||
activeImage = inactiveImage;
|
||||
|
||||
setTimeout(function() {
|
||||
img[inactiveImage].src = url + '&i=' + (i++);
|
||||
}, interval);
|
||||
};
|
||||
|
||||
// When the backend signals completion it returns a small HTML page.
|
||||
// Show the ready link and stop fetching new images.
|
||||
img[0].onerror = img[1].onerror = function() {
|
||||
document.getElementById('ready').innerHTML = '<a href="/">Ready</a>';
|
||||
};
|
||||
|
||||
// Kick off the first request.
|
||||
img[activeImage].src = url + '&i=' + (i++);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue