From f72aa0c4c8d9ef8a17e521a940c6fbb1f902ef26 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 21 Nov 2010 02:27:13 +0000 Subject: [PATCH] libs/web: implement "unspecified" option for netlist widget --- libs/web/luasrc/view/cbi/network_netlist.htm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 %> -- 2.25.1