From: Jo-Philipp Wich Date: Sun, 21 Nov 2010 02:27:13 +0000 (+0000) Subject: libs/web: implement "unspecified" option for netlist widget X-Git-Tag: 0.10.0~393 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f72aa0c4c8d9ef8a17e521a940c6fbb1f902ef26;p=oweals%2Fluci.git libs/web: implement "unspecified" option for netlist widget --- diff --git a/libs/web/luasrc/view/cbi/network_netlist.htm b/libs/web/luasrc/view/cbi/network_netlist.htm index 46da88fd1..4be92b940 100644 --- a/libs/web/luasrc/view/cbi/network_netlist.htm +++ b/libs/web/luasrc/view/cbi/network_netlist.htm @@ -35,7 +35,7 @@ $Id$ <% for _, net in ipairs(networks) do if net:name() ~= "loopback" and net:name() ~= self.exclude then %>
  • - " onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. net:name()) .. attr("name", cbid) .. attr("value", net:name()) .. @@ -59,12 +59,25 @@ $Id$ <% if self.widget ~= "checkbox" and not self.nocreate then %>
  • - />   + " onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value, "checked", "checked")%> />  
    ><%:unspecified -or- create:%>  onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
  • + <% elseif self.widget ~= "checkbox" and self.unspecified then %> +
  • + " onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= + attr("type", self.widget or "radio") .. + attr("id", cbid .. "_uns") .. + attr("name", cbid) .. + attr("value", "") .. + ifattr(not value or #value == 0, "checked", "checked") + %> />   +
    + ><%:unspecified%> +
    +
  • <% end %>