/* name : ClassBehaviours, the javascript framework based on class-name parsing update : 9.2.2 author : Maurice van Creij, Marc Molenwijk dependencies : jquery.classbehaviours.js info : http://www.classbehaviours.com/ This file is part of jQuery.classBehaviours. ClassBehaviours is a javascript framework based on class-name parsing. Copyright (C) 2008 Maurice van Creij ClassBehaviours is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ClassBehaviours is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ClassBehaviours. If not, see http://www.gnu.org/licenses/gpl.html. */ // create the jQuery object if it doesn't already exist if(typeof(jQuery)=='undefined') jQuery = function(){}; // create the root classbehaviours object if it doesn't already exist if(typeof(jQuery.classBehaviours)=='undefined') jQuery.classBehaviours = function(){}; // create the handlers child object if it doesn't already exist if(typeof(jQuery.classBehaviours.handlers)=='undefined') jQuery.classBehaviours.handlers = function(){} // AJAX interface jQuery.classBehaviours.ajax = { // properties queue: new Array(), // utilities getNodeValue: function(objNode){ //alert('Hola1'); strValue = (objNode.childNodes.length>0) ? objNode.firstChild.nodeValue : null ; return (isNaN(strValue) || strValue==null) ? strValue : parseInt(strValue); }, setNodeValue: function(objNode,strValue){ //alert('Hola2'); if(objNode.childNodes.length>0){ objNode.firstChild.nodeValue = strValue; }else{ var objNewNode = ajax.createTextNode(strValue); objNode.appendChild(objNewNode); } }, getChildNumber: function(objNode){ var objNodes = objNode.parentNode.childNodes; var intTextNodes = 0; //alert('Hola3'); for(var intA=0; intA-1) ? 'Loading: ' + Math.round(progressStatus * 100) + '%' : 'Error: ' + progressError ; }, defaultLoad: function(loadXml, loadNode, loadText){ //alert('Hola6'); loadNode.innerHTML = loadText.split('')[1].split('')[0]; }, // methods addSubmit: function(node, loadHandler, progressHandler, post, referingObject){ // default values //alert('Hola7'); loadHandler = (loadHandler==null) ? this.defaultLoad : loadHandler ; progressHandler = (progressHandler==null) ? this.defaultProgress : progressHandler ; post = (post==null) ? '' : post + '&' ; // get all elements of this form formNode = jQuery.classBehaviours.utilities.rootNode(node, 'FORM'); rootNode = jQuery.classBehaviours.utilities.rootNode(node, 'FIELDSET'); allNodes = rootNode.getElementsByTagName('*'); // for all elements for(var a=0; a