tinycm view lib/functions.js @ rev 121

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 12:26:25 2019 +0100 (2019-02-26)
parents 9d0f7be12384
children
line source
2 // Insert HTML code into editor text area.
3 function addCode(code) {
4 document.forms["editor"]["content"].value =
5 document.forms["editor"]["content"].value += code;
6 document.forms["editor"]["content"].focus();
7 }
9 // Check form to avoid empty values and bad email.
10 function checkSignup() {
11 if(document.forms["signup"]["name"].value == "")
12 {
13 alert("Please enter your real name");
14 document.forms["signup"]["name"].focus();
15 return false;
16 }
17 if(document.forms["signup"]["user"].value == "")
18 {
19 alert("Please fill in your user name");
20 document.forms["signup"]["user"].focus();
21 return false;
22 }
23 var x=document.forms["signup"]["mail"].value;
24 var atpos=x.indexOf("@");
25 var dotpos=x.lastIndexOf(".");
26 if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
27 {
28 alert("Missing or not a valid email address");
29 return false;
30 }
31 }
33 // Check for empty messages on Community Wall
34 function checkWall() {
35 if(document.forms["wall"]["message"].value == "")
36 {
37 alert("Empty message box :-) Write down and then press ENTER");
38 document.forms["signup"]["message"].focus();
39 return false;
40 }
41 }