summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/view
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-17 18:32:53 +0000
committerSteven Barth <steven@midlink.org>2008-08-17 18:32:53 +0000
commit97ce1ad8adf935e2aa0d1b13f07b16d2d950053f (patch)
treed5eafec4b6996a6dc64046fd1d46a8f299cd4246 /libs/cbi/luasrc/view
parent1d08361bea91c11ba2f82f3ab3004c067ebabc85 (diff)
Preparing rewrite of WiFi configuration
Diffstat (limited to 'libs/cbi/luasrc/view')
-rw-r--r--libs/cbi/luasrc/view/cbi/cell_valuefooter.htm10
-rw-r--r--libs/cbi/luasrc/view/cbi/footer.htm2
-rw-r--r--libs/cbi/luasrc/view/cbi/full_valuefooter.htm10
-rw-r--r--libs/cbi/luasrc/view/cbi/lvalue.htm2
-rw-r--r--libs/cbi/luasrc/view/cbi/ucisection.htm13
5 files changed, 31 insertions, 6 deletions
diff --git a/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm
index 941214246..7d1ac4ee6 100644
--- a/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm
+++ b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm
@@ -25,7 +25,15 @@ $Id$
<% if #self.deps > 0 then -%>
<script type="text/javascript">
<% for j, d in ipairs(self.deps) do -%>
- cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
+ cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", {
+ <%-
+ for k,v in pairs(d.deps) do
+ -%>
+ <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
+ <%-
+ end
+ -%>
+ });
<%- end %>
</script>
<%- end %>
diff --git a/libs/cbi/luasrc/view/cbi/footer.htm b/libs/cbi/luasrc/view/cbi/footer.htm
index b71905820..a688fcddd 100644
--- a/libs/cbi/luasrc/view/cbi/footer.htm
+++ b/libs/cbi/luasrc/view/cbi/footer.htm
@@ -17,7 +17,7 @@ $Id$
<input class="cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:saveapply%>" />
<input class="cbi-button cbi-button-save" type="submit" value="<%:save%>" />
<input class="cbi-button cbi-button-reset" type="reset" value="<%:reset%>" />
- <script type="text/javascript">cbi_d_init();</script>
+ <script type="text/javascript">cbi_d_update();</script>
</div>
</form>
<%+footer%>
diff --git a/libs/cbi/luasrc/view/cbi/full_valuefooter.htm b/libs/cbi/luasrc/view/cbi/full_valuefooter.htm
index 5a52898d1..8084cfda9 100644
--- a/libs/cbi/luasrc/view/cbi/full_valuefooter.htm
+++ b/libs/cbi/luasrc/view/cbi/full_valuefooter.htm
@@ -34,7 +34,15 @@ $Id$
<% if #self.deps > 0 then -%>
<script type="text/javascript">
<% for j, d in ipairs(self.deps) do -%>
- cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
+ cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", {
+ <%-
+ for k,v in pairs(d.deps) do
+ -%>
+ <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
+ <%-
+ end
+ -%>
+ });
<%- end %>
</script>
<%- end %>
diff --git a/libs/cbi/luasrc/view/cbi/lvalue.htm b/libs/cbi/luasrc/view/cbi/lvalue.htm
index 5108e85c4..60dd68280 100644
--- a/libs/cbi/luasrc/view/cbi/lvalue.htm
+++ b/libs/cbi/luasrc/view/cbi/lvalue.htm
@@ -16,7 +16,7 @@ $Id$
<% if self.widget == "select" then %>
<select onchange="cbi_d_update(this.id)"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>>
<% for i, key in pairs(self.keylist) do -%>
- <option<%= attr("value", key) .. ifattr(self:cfgvalue(section) == key, "selected", "selected") %>><%=luci.util.pcdata(self.vallist[i])%></option>
+ <option id="cbi-<%=self.config.."-"..section.."-"..self.option.."-"..key%>"<%= attr("value", key) .. ifattr(self:cfgvalue(section) == key, "selected", "selected") %>><%=luci.util.pcdata(self.vallist[i])%></option>
<%- end %>
</select>
<% elseif self.widget == "radio" then
diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm
index 2ae856003..f8cf3d1bc 100644
--- a/libs/cbi/luasrc/view/cbi/ucisection.htm
+++ b/libs/cbi/luasrc/view/cbi/ucisection.htm
@@ -27,8 +27,17 @@ $Id$
<%- end %>
</select>
<script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %>
- <% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
- <% end %><% end %>
+ <% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do -%>
+ cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option..d.add%>", {
+ <%-
+ for k,v in pairs(d.deps) do
+ -%>
+ <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
+ <%-
+ end
+ -%>
+ });
+ <%- end %><% end %>
<% end %></script>
<% end %>
<input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:add%>" />