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++);
|
||||
};
|
||||
54
www/js/main.js
Executable file
54
www/js/main.js
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
function IsNumeric(sText) {
|
||||
var ValidChars = "0123456789";
|
||||
var IsNumber=true;
|
||||
var Char;
|
||||
for (i = 0; i < sText.length && IsNumber == true; i++) {
|
||||
Char = sText.charAt(i);
|
||||
if (ValidChars.indexOf(Char) == -1) {
|
||||
IsNumber = false;
|
||||
}
|
||||
}
|
||||
return IsNumber;
|
||||
}
|
||||
|
||||
function form1Submit() {
|
||||
//check if form is well filled
|
||||
//Minimum of two words required
|
||||
var word1 = document.getElementById('word01').value;
|
||||
var word2 = document.getElementById('word02').value;
|
||||
var width = document.getElementById('width').value;
|
||||
var height = document.getElementById('height').value;
|
||||
if (word1.length <= 0) {
|
||||
document.getElementById('status').innerHTML = 'Minimum of two words required';
|
||||
return;
|
||||
}
|
||||
if (word2.length <= 0) {
|
||||
document.getElementById('status').innerHTML = 'Minimum of two words required';
|
||||
return;
|
||||
}
|
||||
if (width.length <= 0) {
|
||||
document.getElementById('status').innerHTML = 'Value <b>width</b> required';
|
||||
return;
|
||||
}
|
||||
if (height.length <= 0) {
|
||||
document.getElementById('status').innerHTML = 'Value <b>height</b> required';
|
||||
return;
|
||||
}
|
||||
if (!IsNumeric(width)) {
|
||||
document.getElementById('status').innerHTML = 'Value <b>width</b> needs numeric input';
|
||||
return;
|
||||
}
|
||||
if (!IsNumeric(height)) {
|
||||
document.getElementById('status').innerHTML = 'Value <b>height</b> needs numeric input';
|
||||
return;
|
||||
}
|
||||
//tests ok
|
||||
document.getElementById('status').innerHTML = ' ';
|
||||
//download image visible and form invisible
|
||||
document.getElementById('loading').style.visibility = 'visible';
|
||||
document.getElementById('form1').style.visibility = 'hidden';
|
||||
//document.getElementById('inpNrs').style.visibility = 'hidden';
|
||||
|
||||
//go for it!
|
||||
document.getElementById('form1').submit();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue