summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/root/www/luci-static
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-29 18:27:12 +0000
committerSteven Barth <steven@midlink.org>2008-05-29 18:27:12 +0000
commit8687547e47b7c90099013b903e89113300903d27 (patch)
tree215ae5a896e1806fb15724be4b41b78faf3fe8a1 /libs/cbi/root/www/luci-static
parent7f995fd0b68cf9416c3a1a74252cfef9f84f182d (diff)
* Bugfixes
* Moved cbi.js into the right directory * Added more debugging to dispatcher * Introduced about page
Diffstat (limited to 'libs/cbi/root/www/luci-static')
-rw-r--r--libs/cbi/root/www/luci-static/resources/cbi.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/libs/cbi/root/www/luci-static/resources/cbi.js b/libs/cbi/root/www/luci-static/resources/cbi.js
new file mode 100644
index 0000000000..a3a47aa45b
--- /dev/null
+++ b/libs/cbi/root/www/luci-static/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