From d9344fc349e8c5765898c90bf5061e56cd21c8a0 Mon Sep 17 00:00:00 2001 From: svncommit Date: Tue, 15 Apr 2008 21:22:00 +0000 Subject: HTML editing fixes, upgrade to TinyMCE v3.0.6 --- program/js/tiny_mce/utils/validate.js | 438 +++++++++++++++++----------------- 1 file changed, 219 insertions(+), 219 deletions(-) (limited to 'program/js/tiny_mce/utils/validate.js') diff --git a/program/js/tiny_mce/utils/validate.js b/program/js/tiny_mce/utils/validate.js index 92b44edc0..cde4c9798 100644 --- a/program/js/tiny_mce/utils/validate.js +++ b/program/js/tiny_mce/utils/validate.js @@ -1,219 +1,219 @@ -/** - * $Id: validate.js 162 2007-01-03 16:16:52Z spocke $ - * - * Various form validation methods. - * - * @author Moxiecode - * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. - */ - -/** - // String validation: - - if (!Validator.isEmail('myemail')) - alert('Invalid email.'); - - // Form validation: - - var f = document.forms['myform']; - - if (!Validator.isEmail(f.myemail)) - alert('Invalid email.'); -*/ - -var Validator = { - isEmail : function(s) { - return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); - }, - - isAbsUrl : function(s) { - return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); - }, - - isSize : function(s) { - return this.test(s, '^[0-9]+(px|%)?$'); - }, - - isId : function(s) { - return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); - }, - - isEmpty : function(s) { - var nl, i; - - if (s.nodeName == 'SELECT' && s.selectedIndex < 1) - return true; - - if (s.type == 'checkbox' && !s.checked) - return true; - - if (s.type == 'radio') { - for (i=0, nl = s.form.elements; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i