|
:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
class= codeBody " prettyprint " del id= " codeSnippet731347 " del >var FORM_MANAGER_CONDITION_SEPARATOR = “Y”;
var FORM_MANAGER_POSSIBILITY_SEPARATOR = “O”;
var FORM_MANAGER_NAME_VALUE_SEPARATOR = “SIENDO”;
el var FORM_MANAGER_DEPENDS = “DEPENDE DE”;
el var FORM_MANAGER_CONFLICTS = “ESTÁ EN CONFLICTO CON”;
el var FORM_MANAGER_EMPTY = “VACIA”;
función addEvent (EL, ev, f) {
si (el.addEventListener)
el.addEventListener (ev, f, falsas);
si (el.attachEvent) {
var t = función () {
f.apply (EL);
};
addEvent.events.push ({“elemento”: EL, “acontecimiento”: ev, “tratante”: f});
el.attachEvent ("ON" + ev, t);
}
EL ["ON" + ev] = f;
}
addEvents de la función (els, evs, f) {
para (var i = 0; i < els.length; ++i)
para (var j = 0; j < evs.length; ++j)
addEvent (els [i], evs [j], f);
}
addEvent.events = [];
¡si (typeof window.event! == “indefinido”)
addEvent (la ventana, “descarga”, función () {
para (var i = 0, e = addEvent.events; i < e.length; ++i)
e [i] .element.detachEvent ("ON" + e [i] .event, e [i] .handler);
}
);
getRadioValue de la función (EL) {
¡si (! vuelta de el.length) nula;
para (var i = 0; i < el.length; ++i)
si (EL [i] .checked) EL de vuelta [i] .value;
falta de información de vuelta;
}
getSelectValue de la función (EL) {
¡si (! el.tagName || ¡el.tagName.toLowerCase ()! el == “selecciona”)
falta de información de vuelta;
el.options de vuelta [el.selectedIndex] .value;
}
isElementValue de la función (EL, v) {
si (=== FORM_MANAGER_EMPTY de v) v = '';
volver (
== v del getRadioValue (EL) ||
== v del getSelectValue (EL) ||
(
&& de el.tagName
¡el.tagName.toLowerCase ()! el == “selecciona” el &&
== v de el.value
)
);
}
setupDependencies de la función () {
showEl = función del var () {
this.style.display = "";
si == “etiqueta” (de this.parentNode.tagName.toLowerCase ())
this.parentNode.style.display = "";
};
hideEl = función del var () {
this.style.display = “ningunos”;
¡si (typeof this.checked! == “indefinido”) this.checked = falso;
otro this.value = "";
si == “etiqueta” (de this.parentNode.tagName.toLowerCase ())
this.parentNode.style.display = “ningunos”;
this.hidden = verdad;
};
calcDeps = función del var () {
para (var i = 0, e = this.elements; i < e.length; ++i) {
e [i] .hidden = falso;
para (var j = 0, f = e [i] .className.split (FORM_MANAGER_CONDITION_SEPARATOR); j < f.length; ++j)
si === 0 (de f [j] .indexOf (FORM_MANAGER_DEPENDS)) {
para (var k = 0, g = f [j] .substr (FORM_MANAGER_DEPENDS.length) .split (FORM_MANAGER_POSSIBILITY_SEPARATOR); k < g.length; ++k)
si === -1 (de g [k] .indexOf (FORM_MANAGER_NAME_VALUE_SEPARATOR)) {
si (e [g [k]] rotura del && e [g [k]] .checked);
si (k + 1 == g.length)
e [i] .hide ();
} {
var n = g [k] .split (FORM_MANAGER_NAME_VALUE_SEPARATOR),
v = n [1];
n = n [0];
si (e [n])
si (isElementValue (e [n], v)) rotura;
si (k + 1 == g.length) e [i] .hide ();
}
} si === 0 (de f [j] .indexOf (FORM_MANAGER_CONFLICTS)) {
si === -1 (de f [j] .indexOf (FORM_MANAGER_NAME_VALUE_SEPARATOR)) {
si (e [f [j] .substr (FORM_MANAGER_CONFLICTS.length)] && e [f [j] .substr (FORM_MANAGER_CONFLICTS.length)].checked) {
e [i] .hide ();
rotura;
}
} {
var n = f [j] .substr (FORM_MANAGER_CONFLICTS.length) .split (FORM_MANAGER_NAME_VALUE_SEPARATOR),
v = n [1];
n = n [0];
si (e [n]) {
si (isElementValue (e [n], v)) {
e [i] .hide ();
rotura;
}
}
}
}
¡si (! e [i] .hidden) e [i] .show ();
}
};
changeHandler = función del var () {
this.form.calculateDependencies ();
de vuelta verdad;
};
para (var i = 0; i < arguments.length; ++i) {
para (var j = 0, e = window.document.forms [discusiones [i]] .elements; j < e.length; ++j) {
addEvents ([e [j]], [“cambio”, “keyup”, “foco”, “tecleo”, “keydown”], changeHandler);
e [j] .hide = hideEl;
e [j] .show = showEl;
}
(e = window.document.forms [discusiones [i]]) .calculateDependencies = calcDeps;
e.calculateDependencies ();
}
}
class= claro " lineNumbers " >1 del >
< codeBody del " prettyprint " del class= del id= " codeSnippet731346 " del >
Contenido-Tipo " texto/HTML del http-equiv= " del
Document Untitled
src= " FormManager.js " del
type= " texto/Javascript " del
Seleccionar por favor su campus y disciplina académica.
name= " weboptions " del "" del action= del
class= >
" claro " de