summaryrefslogtreecommitdiffhomepage
path: root/web/root/www/resources/cbi.js
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-27 08:14:24 +0000
committerSteven Barth <steven@midlink.org>2008-05-27 08:14:24 +0000
commitb8124f18f88fe11158eb122a1e362cfbd512cf4f (patch)
tree2d7e9044ddb656c83de73415240c4ded59622389 /web/root/www/resources/cbi.js
parentd4399bf6189977336a94795f25986fb89a22a5e7 (diff)
* Separated the MVC-Webframework from core
* Separated i18n from core to prepare translations
Diffstat (limited to 'web/root/www/resources/cbi.js')
-rw-r--r--web/root/www/resources/cbi.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/web/root/www/resources/cbi.js b/web/root/www/resources/cbi.js
new file mode 100644
index 0000000000..a3a47aa45b
--- /dev/null
+++ b/web/root/www/resources/cbi.js
@@ -0,0 +1,42 @@
+var cbi_d = {};
+
+function cbi_d_add(field, target, value) {
+ if (!cbi_d[target]) {
+ cbi_d[target] = {};
+ }
+ if (!cbi_d[target][value]) {
+ cbi_d[target][value] = [];
+ }
+ cbi_d[target][value].push(field);
+}
+
+function cbi_d_update(target) {
+ if (!cbi_d[target]) {
+ return;
+ }
+
+ for (var x in cbi_d[target]) {
+ for (var i=0; i<cbi_d[target][x].length; i++) {
+ var y = document.getElementById(cbi_d[target][x][i])
+ y.style.display = "none";
+ }
+ }
+
+ var t = document.getElementById(target);
+ if (t && t.value && cbi_d[target][t.value]) {
+ for (var i=0; i<cbi_d[target][t.value].length; i++) {
+ var y = document.getElementById(cbi_d[target][t.value][i])
+ if (!y.value) {
+ y.style.display = "table-row";
+ } else {
+ y.style.display = "block";
+ }
+ }
+ }
+}
+
+function cbi_d_init() {
+ for (var x in cbi_d) {
+ cbi_d_update(x);
+ }
+} \ No newline at end of file