diff options
author | Steven Barth <steven@midlink.org> | 2008-05-27 09:33:52 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-05-27 09:33:52 +0000 |
commit | 93ff578ac8f0cd4772285a6ea983cf02cc9be620 (patch) | |
tree | f766e8c0be94fe317673cefee879fbf73bc8cbd9 /libs/cbi/root/www | |
parent | 30c8b259e1b7012f7c16c1ee5aeb1997e44dcbdc (diff) |
* 3rd Package reorgnaisation
* Moved core, web, cbi to libs
* Refactored OpenWRT Makefile to separate Libraries, Webinterface Components, Freifunk packages
Diffstat (limited to 'libs/cbi/root/www')
-rw-r--r-- | libs/cbi/root/www/resources/cbi.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libs/cbi/root/www/resources/cbi.js b/libs/cbi/root/www/resources/cbi.js new file mode 100644 index 0000000000..a3a47aa45b --- /dev/null +++ b/libs/cbi/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 |