* Copyright: See COPYING files that comes with this distribution
********************************************************************************/
+function ta_onfocus(obj) {
+ obj.setAttribute('rows', '10');
+}
+
+function ta_onblur(obj) {
+ obj.setAttribute('rows', '2');
+}
+
function text_onfocus(object,val) {
if(object.value == val)
object.value = '';
Node.removeChild(Node.childNodes[nbChilds]);
}
-function getElement(obj) {
- return getNthElement(obj,0);
-}
-
-function getNthElement(obj, index) {
- if(document.getElementsByName)
- return document.getElementsByName(obj)[index];
+function getElement(obj, index) {
+ if(document.getElementById)
+ return document.getElementById(obj);
if(document.all)
- return document.all[obj][index];
+ return document.all[obj];
}
/********** ORDER FORM FUNCTIONS **********/
}
function newAction() {
- createActionRow(getElement('actions_row'), 0);
+ createActionRow(getElement('actionsRow'), [-1]);
}
/********** RULE.MATCH FORM FUNCTIONS **********/
}
function newMatch() {
- createMatchRow(getElement('matches_row'), 0);
+ createMatchRow(getElement('matchesRow'), [-1]);
}
/********** RULE FORM FUNCTIONS **********/
getElement('rule[id]').value = index;
getElement('rule[name]').value = current_rule.name;
- getNthElement('rule[all]',[1-current_rule.all]).checked = true;
+ var c = (current_rule.all ? '1' : '0');
+ getElement('rule[all'+c+']').checked = true;
getElement('rule[block]').checked = current_rule.block;
- var mr = getElement('matches_row');
+ var mr = getElement('matchesRow');
cleanChilds(mr,0);
for(i=0; i<current_rule.matches.length; i++)
createMatchRow(mr, current_rule.matches[i]);
- var ar = getElement('actions_row');
+ var ar = getElement('actionsRow');
cleanChilds(ar,0);
for(i=0; i<current_rule.actions.length; i++)
createActionRow(ar, current_rule.actions[i]);