summaryrefslogtreecommitdiff
path: root/htroot/js/WatchWebStructure.js
diff options
context:
space:
mode:
authormikeworks <mikeworks@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-26 22:28:32 +0000
committermikeworks <mikeworks@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-26 22:28:32 +0000
commit190de644ddbd387e060d160d5e81e9c7d7fbec72 (patch)
tree9b214a8804177761852fbbe7eade1550d13cc5a0 /htroot/js/WatchWebStructure.js
parentd5dc88a351368af74d8a31e4292a4a3b494da096 (diff)
de.lng: Added German translations for some missing table content on Network view
WatchWebStructure_p.html: Added JS verification of RGB color codes (currently only RGB value is checked but this could be enhanced to also check for websafe colors) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7195 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/js/WatchWebStructure.js')
-rw-r--r--htroot/js/WatchWebStructure.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/htroot/js/WatchWebStructure.js b/htroot/js/WatchWebStructure.js
index 9c9cb6d1a..7c9c6c8bd 100644
--- a/htroot/js/WatchWebStructure.js
+++ b/htroot/js/WatchWebStructure.js
@@ -5,4 +5,39 @@ function keydown(ev){
if(ev.which==13){
changeHost();
}
+}
+
+/* Check if the input matches some RGB hex values */
+function isValidColor(hexcolor) {
+ var strPattern = /^[0-9a-f]{3,6}$/i;
+ return strPattern.test(hexcolor);
+}
+
+function checkform(form) {
+ if (isValidColor(form.colorback.value)) {
+ if (isValidColor(form.colortext.value)) {
+ if (isValidColor(form.colorline.value)) {
+ if (isValidColor(form.colordot.value)) {
+ if (isValidColor(form.colorlineend.value)) {
+ return true;
+ } else {
+ alert("Invalid Dot-end value: " + form.colorlineend.value);
+ return false;
+ }
+ } else {
+ alert("Invalid Dot value: " + form.colordot.value);
+ return false;
+ }
+ } else {
+ alert("Invalid Line value: " + form.colorline.value);
+ return false;
+ }
+ } else {
+ alert("Invalid Text value: " + form.colortext.value);
+ return false;
+ }
+ } else {
+ alert("Invalid Background value: " + form.colorback.value);
+ return false;
+ }
} \ No newline at end of file