# HG changeset patch # User Christophe Lincoln # Date 1334152709 -7200 # Node ID 7914154807bbc47935bf1b82cfce8f7b19291540 # Parent fa494a9879e31f39035f3590476a1357b71177cb Add lib diff -r fa494a9879e3 -r 7914154807bb lib/functions.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/functions.js Wed Apr 11 15:58:29 2012 +0200 @@ -0,0 +1,31 @@ + +// Insert HTML code into editor textarea. +function addCode(code) { + document.forms["editor"]["content"].value = + document.forms["editor"]["content"].value += code; + document.forms["editor"]["content"].focus(); +} + +// Check form to avoid empty values and bad email. +function checkSignup() { + if(document.forms["signup"]["name"].value == "") + { + alert("Please enter your real name"); + document.forms["signup"]["name"].focus(); + return false; + } + if(document.forms["signup"]["user"].value == "") + { + alert("Please fill in your user name"); + document.forms["signup"]["user"].focus(); + return false; + } + var x=document.forms["signup"]["mail"].value; + var atpos=x.indexOf("@"); + var dotpos=x.lastIndexOf("."); + if (atpos<1 || dotpos=x.length) + { + alert("Missing or not a valid email address"); + return false; + } +} diff -r fa494a9879e3 -r 7914154807bb lib/header.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/header.html Wed Apr 11 15:58:29 2012 +0200 @@ -0,0 +1,18 @@ + + + + TinyCM %TITLE% + + + + + + + + + + +
diff -r fa494a9879e3 -r 7914154807bb lib/jseditor.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/jseditor.html Wed Apr 11 15:58:29 2012 +0200 @@ -0,0 +1,7 @@ + + +<p> +<pre> +<ul> +<table> +<link>