User interface improvements part #3
authorSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 11:50:44 +0000 (11:50 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 11:50:44 +0000 (11:50 +0000)
14 files changed:
i18n/english/luasrc/i18n/admin-core.en.lua
i18n/german/luasrc/i18n/admin-core.de.lua
libs/cbi/htdocs/luci-static/resources/cbi.js
libs/cbi/htdocs/luci-static/resources/cbi/download.gif [new file with mode: 0644]
libs/cbi/htdocs/luci-static/resources/cbi/key.gif [new file with mode: 0644]
libs/cbi/htdocs/luci-static/resources/cbi/link.gif [new file with mode: 0644]
libs/cbi/htdocs/luci-static/resources/cbi/user.gif [new file with mode: 0644]
modules/admin-core/luasrc/view/sysauth.htm
modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua
themes/fledermaus/htdocs/luci-static/fledermaus/cascade.css
themes/openwrt-light/htdocs/luci-static/openwrt-light/cascade.css
themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css

index 762fc50179b14248db988707f517f1afce91ecd1..7676087221a3959886b2ec827abfb3a398885fe0 100644 (file)
@@ -159,8 +159,10 @@ a_w_apisolation1 = "Prevents Client to Client communication"
 a_w_hideessid = "Hide ESSID"
 a_w_ap = "Access Point"
 a_w_adhoc = "Ad-Hoc"
+a_w_ahdemo = "Pseudo Ad-Hoc (ahdemo)"
 a_w_client = "Client"
 a_w_wds = "WDS"
+a_w_monitor = "Monitor"
 
 dhcp_desc = "Dnsmasq is a combined DHCP-Server and DNS-Forwarder for NAT firewalls"
 dhcp_dnsmasq_domainneeded = "Domain required"
index a1ea18308f0543d2de6f57637722c821f1279dfc..8a06f70988b30d815240336477b110df2476cdec 100644 (file)
@@ -145,6 +145,8 @@ Kommunikation.]]
 a_w_ap = "Access Point"
 a_w_adhoc = "Ad-Hoc"
 a_w_client = "Client"
+a_w_ahdemo = "Pseudo Ad-Hoc (ahdemo)"
+a_w_monitor = "Monitor"
 a_w_wds = "WDS"
 accept = [[Annehmen]]
 aliases = [[Aliasse]]
index e42193cffcd407dea2fc3654480e1b9ed66f892c..78a9e90bf6a420fd13eef15d953302beb8c907ea 100644 (file)
@@ -7,7 +7,16 @@ function cbi_d_add(field, target, value) {
        if (!cbi_d[target][value]) {
                cbi_d[target][value] = [];
        }
-       cbi_d[target][value].push(field);
+       
+       var obj = document.getElementById(field);
+       if (obj) {
+               var entry = {
+                       "node": obj,
+                       "parent": obj.parentNode,
+                       "next": obj.nextSibling 
+               } 
+               cbi_d[target][value].unshift(entry);
+       }
 }
 
 function cbi_d_update(target) {
@@ -17,16 +26,34 @@ function cbi_d_update(target) {
        
        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 entry = cbi_d[target][x][i];
+                       if (entry.node.parentNode) {
+                               entry.parent.removeChild(entry.node)
+                       }
                }
        }
        
        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])
-                       y.style.display = "block";
+       var value
+       
+       if (!t || !t.value) {
+               value = "";
+       } else {
+               value = t.value;
+               
+               if (t.type == "checkbox") {
+                       value = t.checked ? value : "";
+               }
+       }
+       
+       if (cbi_d[target][value]) {
+               for (var i=0; i<cbi_d[target][value].length; i++) {             
+                       var entry = cbi_d[target][value][i];
+                       if (!entry.next) {
+                               entry.parent.appendChild(entry.node);
+                       } else {
+                               entry.parent.insertBefore(entry.node, entry.next);
+                       }
                }
        }
 }
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/download.gif b/libs/cbi/htdocs/luci-static/resources/cbi/download.gif
new file mode 100644 (file)
index 0000000..f99a538
Binary files /dev/null and b/libs/cbi/htdocs/luci-static/resources/cbi/download.gif differ
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/key.gif b/libs/cbi/htdocs/luci-static/resources/cbi/key.gif
new file mode 100644 (file)
index 0000000..e3853e5
Binary files /dev/null and b/libs/cbi/htdocs/luci-static/resources/cbi/key.gif differ
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/link.gif b/libs/cbi/htdocs/luci-static/resources/cbi/link.gif
new file mode 100644 (file)
index 0000000..1b2a923
Binary files /dev/null and b/libs/cbi/htdocs/luci-static/resources/cbi/link.gif differ
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/user.gif b/libs/cbi/htdocs/luci-static/resources/cbi/user.gif
new file mode 100644 (file)
index 0000000..dcb5c2a
Binary files /dev/null and b/libs/cbi/htdocs/luci-static/resources/cbi/user.gif differ
index 7b6163e5495c3cec12ba2890b214a2d29baf399a..236ec7e6a733597540048eefec0813008d131252 100644 (file)
@@ -24,16 +24,16 @@ $Id$
                <div class="cbi-section-node">
                        <div class="cbi-value">
                                <div class="cbi-value-title"><%:username%></div>
-                               <div class="cbi-value-field"><input type="text" name="username" value="<%=duser%>" /></div>
+                               <div class="cbi-value-field"><input class="cbi-input-user" type="text" name="username" value="<%=duser%>" /></div>
                        </div>
                        <div class="cbi-value">
                                <div class="cbi-value-title"><%:password%></div>
-                               <div class="cbi-value-field"><input type="password" name="password" /></div>
+                               <div class="cbi-value-field"><input class="cbi-input-key" type="password" name="password" /></div>
                        </div>
                        <br />
                        <div>
-                               <input type="submit" value="<%:login%>" />
-                               <input type="reset" value="<%:reset%>" />
+                               <input type="submit" class="cbi-button cbi-button-apply" value="<%:login%>" />
+                               <input type="reset" class="cbi-button cbi-button-reset" value="<%:reset%>" />
                        </div>
                </div>
 </form>
index b50b05cb3969a4be8c3f83c160bc66328ee5f59e..1c9ae396ae08a30c2cd248e3308f77b02053d1c5 100644 (file)
@@ -47,7 +47,8 @@ s:option(Flag, "dynamicdhcp").rmempty = true
 
 s:option(Value, "name", translate("name")).optional = true
 
-s:option(Flag, "ignore").optional = true
+ignore = s:option(Flag, "ignore")
+ignore.optional = true
 
 s:option(Value, "netmask", translate("netmask")).optional = true
 
@@ -58,6 +59,14 @@ for i, line in pairs(luci.util.execl("dnsmasq --help dhcp")) do
        s:option(Value, "dhcp"..k, v).optional = true
 end
 
+
+for i, n in ipairs(s.children) do
+       if n ~= iface and n ~= ignore then
+               n:depends("ignore", "")
+       end
+end
+
+
 m2 = Map("luci_ethers", translate("luci_ethers"))
 
 s = m2:section(TypedSection, "static_lease", "")
index ae5f2aeab8aadcde66af940631474df495838d63..6d1fb4f391bb1bc271aa9facff2edf04ad078b05 100644 (file)
@@ -113,6 +113,11 @@ mtu.isinteger = true
 mac = s:option(Value, "macaddr", translate("macaddress"))
 mac.optional = true
 
+
+srv = s:option(Value, "server", translate("network_interface_server"))
+srv:depends("proto", "pptp")
+srv.rmempty = true
+
 user = s:option(Value, "username", translate("username"))
 user.rmempty = true
 user:depends("proto", "pptp")
@@ -139,10 +144,6 @@ demand.rmempty = true
 demand:depends("proto", "pptp")
 demand:depends("proto", "pppoe")
 
-srv = s:option(Value, "server", translate("network_interface_server"))
-srv:depends("proto", "pptp")
-srv.rmempty = true
-
 
 
 
index ae4f84b9f5599ca1ceeeb758fe4bc84c9dd789ea..4b2179a8f4fe56cc916bea06a52e8aeba7a4af08 100644 (file)
@@ -37,8 +37,10 @@ luci.model.uci.foreach("network", "interface",
 mode = s:option(ListValue, "mode", translate("mode"))
 mode:value("ap", translate("a_w_ap"))
 mode:value("adhoc", translate("a_w_adhoc"))
+mode:value("ahdemo", translate("a_w_ahdemo"))
 mode:value("sta", translate("a_w_client"))
 mode:value("wds", translate("a_w_wds"))
+mode:value("monitor", translate("a_w_monitor"))
 
 s:option(Value, "bssid", "BSSID").optional = true
 
index c12a9e4060388522740a068a001e94102b063002..537b2ea8e63ee7d379fd5e37b495f2109e2dc56b 100644 (file)
@@ -248,7 +248,7 @@ select:focus,
 select:hover,
 textarea:focus,
 textarea:hover {
-       background: #f2f3f9;
+       background-color: #f2f3f9;
 }
 
 select,
@@ -263,35 +263,67 @@ td input[type=password] {
        width: 99%;
 }
 
-input.cbi-button {
+input.cbi-input-user {
+       background: url('../resources/cbi/user.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+}
+
+input.cbi-input-key {
+       background: url('../resources/cbi/key.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
-       padding-right: 1px;
 }
 
+input.cbi-input-add,
 input.cbi-button-add {
-       background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-fieldadd,
 input.cbi-button-fieldadd {
-       background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-reset,
 input.cbi-button-reset {
-       background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-save,
 input.cbi-button-save {
-       background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-apply,
 input.cbi-button-apply {
-       background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-remove,
 div.cbi-section-remove input {
-       background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
        padding-right: 1px;
+}
+
+div.cbi-section-remove input {
        border-bottom: none;
 }
 
index 25d5e27411741106c31f93ace840806c4f8f3261..ddc3bdc06f3d4ca0255acd957f0c7f4b035e373c 100644 (file)
@@ -233,7 +233,7 @@ select:focus,
 select:hover,
 textarea:focus,
 textarea:hover {
-       background: #ffffff;
+       background-color: #ffffff;
 }
 
 select,
@@ -248,35 +248,67 @@ td input[type=password] {
        width: 99%;
 }
 
-input.cbi-button {
+input.cbi-input-user {
+       background: url('../resources/cbi/user.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+}
+
+input.cbi-input-key {
+       background: url('../resources/cbi/key.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
-       padding-right: 1px;
 }
 
+input.cbi-input-add,
 input.cbi-button-add {
-       background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-fieldadd,
 input.cbi-button-fieldadd {
-       background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-reset,
 input.cbi-button-reset {
-       background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-save,
 input.cbi-button-save {
-       background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-apply,
 input.cbi-button-apply {
-       background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-remove,
 div.cbi-section-remove input {
-       background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
        padding-right: 1px;
+}
+
+div.cbi-section-remove input {
        border-bottom: none;
 }
 
index 2b1946c0fb20908d89d6cd0eedec37d75e78853d..f86a837ee10460d8b6185a8569727b5bbe4883c4 100644 (file)
@@ -241,7 +241,7 @@ select:focus,
 select:hover,
 textarea:focus,
 textarea:hover {
-       background: #ffffff;
+       background-color: #ffffff;
 }
 
 select,
@@ -256,35 +256,67 @@ td input[type=password] {
        width: 99%;
 }
 
-input.cbi-button {
+input.cbi-input-user {
+       background: url('../resources/cbi/user.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+}
+
+input.cbi-input-key {
+       background: url('../resources/cbi/key.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
-       padding-right: 1px;
 }
 
+input.cbi-input-add,
 input.cbi-button-add {
-       background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/add.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-fieldadd,
 input.cbi-button-fieldadd {
-       background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-reset,
 input.cbi-button-reset {
-       background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-save,
 input.cbi-button-save {
-       background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/save.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-apply,
 input.cbi-button-apply {
-       background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center;
+       background-color: inherit;
+       padding-left: 17px;
+       padding-right: 1px;
 }
 
+input.cbi-input-remove,
 div.cbi-section-remove input {
-       background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center;
+       background-color: inherit;
        padding-left: 17px;
        padding-right: 1px;
+}
+
+div.cbi-section-remove input {
        border-bottom: none;
 }