tinycm rev 4

Add lib
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 11 15:58:29 2012 +0200 (2012-04-11)
parents fa494a9879e3
children af7569371649
files lib/functions.js lib/header.html lib/jseditor.html
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/functions.js	Wed Apr 11 15:58:29 2012 +0200
     1.3 @@ -0,0 +1,31 @@
     1.4 +
     1.5 +// Insert HTML code into editor textarea.
     1.6 +function addCode(code) {
     1.7 +	document.forms["editor"]["content"].value = 
     1.8 +		document.forms["editor"]["content"].value += code;
     1.9 +	document.forms["editor"]["content"].focus();
    1.10 +}
    1.11 +
    1.12 +// Check form to avoid empty values and bad email.
    1.13 +function checkSignup() {
    1.14 +	if(document.forms["signup"]["name"].value == "")
    1.15 +    {
    1.16 +        alert("Please enter your real name");
    1.17 +        document.forms["signup"]["name"].focus();
    1.18 +        return false;
    1.19 +    }
    1.20 +    if(document.forms["signup"]["user"].value == "")
    1.21 +    {
    1.22 +        alert("Please fill in your user name");
    1.23 +        document.forms["signup"]["user"].focus();
    1.24 +        return false;
    1.25 +    }
    1.26 +	var x=document.forms["signup"]["mail"].value;
    1.27 +	var atpos=x.indexOf("@");
    1.28 +	var dotpos=x.lastIndexOf(".");
    1.29 +	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
    1.30 +	{
    1.31 +		alert("Missing or not a valid email address");
    1.32 +		return false;
    1.33 +	}
    1.34 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/lib/header.html	Wed Apr 11 15:58:29 2012 +0200
     2.3 @@ -0,0 +1,18 @@
     2.4 +<!DOCTYPE html>
     2.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     2.6 +<head>
     2.7 +	<title>TinyCM %TITLE%</title>
     2.8 +	<meta charset="utf-8" />
     2.9 +	<link rel="shortcut icon" href="favicon.ico" />
    2.10 +	<link rel="stylesheet" type="text/css" href="style.css" />
    2.11 +	<script type="text/javascript" src="lib/functions.js"></script>
    2.12 +</head>
    2.13 +<body>
    2.14 +
    2.15 +<div id="header">
    2.16 +	<div id="logo"></div>
    2.17 +	<h1><a href="index.cgi">Content Manager</a></h1>
    2.18 +</div>
    2.19 +
    2.20 +<!-- Content -->
    2.21 +<div id="content">
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/lib/jseditor.html	Wed Apr 11 15:58:29 2012 +0200
     3.3 @@ -0,0 +1,7 @@
     3.4 +
     3.5 +<!-- Javascript HTML Code Helper -->
     3.6 +<a href="#" onclick="addCode('\n<p>\n\n</p>');">&lt;p&gt;</a>
     3.7 +<a href="#" onclick="addCode('\n<pre>\n\n</pre>');">&lt;pre&gt;</a>
     3.8 +<a href="#" onclick="addCode('\n<ul>\n<li>...</li>\n</ul>');">&lt;ul&gt;</a>
     3.9 +<a href="#" onclick="addCode('\n<table>\n\n<tr>\n<td>...</td>\n</tr>\n\n</table>');">&lt;table&gt;</a>
    3.10 +<a href="#" onclick="addCode('[Link|path]');">&lt;link&gt;</a>