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
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