/* SVN FILE: $Id$ */ /** * Glizy javascript core. * * This file is part of the GLIZY framework. * Copyright (c) 2005-2006 Daniele Ugoletti * * For the full copyright and license information, please view the COPYRIGHT.txt * file that was distributed with this source code. * * @copyright Copyright (c) 2005, 2006 Daniele Ugoletti * @link http://www.glizy.org Glizy Project * @license http://www.gnu.org/copyleft/lesser.html GNU LESSER GENERAL PUBLIC LICENSE * @package glizy * @subpackage javascript * @author Daniele Ugoletti * @category javascript * @since Glizy v 0.01 * @version $Rev$ * @modifiedby $LastChangedBy$ * @lastmodified $Date$ */ var tinyMCE = undefined; var Glizy = new Object(); Glizy = { Onload: new Array(), Onunload: new Array(), Onbeforeunload: new Array(), windowsList: new Array(), slideShowSpeed: 20, start : function() { var oldonload = window.onload; var oldunonload = window.onunload; var onbeforeunload = window.onbeforeunload; window.onload = function () { if (typeof oldonload == 'function') { oldonload(); } for (var i=0;i'; html += '

'+text+'

'; html += '
  • '+messages.join('
  • ')+'
'; } var el = typeof( box ) == "string" ? Glizy.$(box) : box; if (el) { el.innerHTML = html; if (document.documentElement && document.documentElement.scrollTop) document.documentElement.scrollTop = 0; else if (document.body) document.body.scrollTop = 0; } }, showSuccessMessage: function(messages) { box = 'message-box' html = '
'; html += ''+GlizyLocale.SUCCESS+''+messages+''; html += '
'; var el = Glizy.$(box); if (el) { el.innerHTML = html; if (document.documentElement && document.documentElement.scrollTop) document.documentElement.scrollTop = 0; else if (document.body) document.body.scrollTop = 0; } }, validateForm: function(elValue, elName, elType, message) { elValue = unescape(elValue); var resultState = true; switch (elType) { case 'date': resultState = elValue!=''; break; case 'text': case 'longtext': case 'editableSelect': //var regExp = new RegExp("([a-zA-Z\ ]{3,})"); //resultState = regExp.test(elValue); resultState = elValue!=''; break; case 'select': case 'multipleselect': resultState = elValue!=''; break; case 'colorPicker': var regExp = new RegExp("^(#){1}([a-fA-F0-9]){6}$"); resultState = regExp.test(elValue); break; } //alert("validateForm "+elName+" "+(!resultState ? (!message ? message : elName) : '')) return !resultState ? (!message ? message : elName) : ''; }, tableruler: function() { if (document.getElementById && document.createTextNode) { var tables=document.getElementsByTagName("table"); for (var i=0;i