diff options
Diffstat (limited to 'modules/luci-base/luasrc/view/cbi')
19 files changed, 40 insertions, 98 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/cell_valuefooter.htm b/modules/luci-base/luasrc/view/cbi/cell_valuefooter.htm index 220ebd42b..786ee43d1 100644 --- a/modules/luci-base/luasrc/view/cbi/cell_valuefooter.htm +++ b/modules/luci-base/luasrc/view/cbi/cell_valuefooter.htm @@ -1,20 +1,2 @@ </div> -<div id="cbip-<%=self.config.."-"..section.."-"..self.option%>"></div> </td> - -<% 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..d.add%>", { - <%- - for k,v in pairs(d.deps) do - -%> - <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option%>"); - <%- end %> - </script> -<%- end %> diff --git a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm index 9e2e145dd..9c9c21814 100644 --- a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm +++ b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm @@ -1,2 +1,2 @@ <td class="cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %>"> -<div id="cbi-<%=self.config.."-"..section.."-"..self.option%>"> +<div id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm index e936c0c39..80cbee839 100644 --- a/modules/luci-base/luasrc/view/cbi/dynlist.htm +++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm @@ -6,7 +6,7 @@ local val = vals[i] if (val and #val > 0) or (i == 1) then %> - <input class="cbi-input-text" value="<%=pcdata(val)%>" onchange="cbi_d_update(this.id)" type="text"<%= + <input class="cbi-input-text" value="<%=pcdata(val)%>" data-update="change" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size") .. ifattr(i == 1 and self.placeholder, "placeholder", self.placeholder) %> /><br /> diff --git a/modules/luci-base/luasrc/view/cbi/firewall_zonelist.htm b/modules/luci-base/luasrc/view/cbi/firewall_zonelist.htm index 7973437f4..b3b454008 100644 --- a/modules/luci-base/luasrc/view/cbi/firewall_zonelist.htm +++ b/modules/luci-base/luasrc/view/cbi/firewall_zonelist.htm @@ -27,7 +27,7 @@ <ul style="margin:0; list-style-type:none; text-align:left"> <% if self.allowlocal then %> <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_empty") .. attr("name", cbid) .. attr("value", "") .. ifattr(checked[""], "checked", "checked")%> />   + <input class="cbi-input-radio" data-update="click change"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_empty") .. attr("name", cbid) .. attr("value", "") .. ifattr(checked[""], "checked", "checked")%> />   <label<%=attr("for", cbid .. "_empty")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge"> <strong><%:Device%></strong> <% if self.allowany and self.allowlocal then %>(<%:input%>)<% end %> @@ -36,7 +36,7 @@ <% end %> <% if self.allowany then %> <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_any") .. attr("name", cbid) .. attr("value", "*") .. ifattr(checked["*"], "checked", "checked")%> />   + <input class="cbi-input-radio" data-update="click change"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_any") .. attr("name", cbid) .. attr("value", "*") .. ifattr(checked["*"], "checked", "checked")%> />   <label<%=attr("for", cbid .. "_any")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge"> <strong><%:Any zone%></strong> <% if self.allowany and self.allowlocal then %>(<%:forward%>)<% end %> @@ -49,7 +49,7 @@ selected = selected or (value == zone:name()) %> <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(checked[zone:name()], "checked", "checked")%> />   + <input class="cbi-input-radio" data-update="click change"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(checked[zone:name()], "checked", "checked")%> />   <label<%=attr("for", cbid .. "." .. zone:name())%> style="background-color:<%=zone:get_color()%>" class="zonebadge"> <strong><%=zone:name()%>:</strong> <% @@ -77,7 +77,7 @@ <% if self.widget ~= "checkbox" and not self.nocreate then %> <li style="padding:0.5em"> - <input class="cbi-input-radio" 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 selected, "checked", "checked")%> />   + <input class="cbi-input-radio" data-update="click change" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> />   <div onclick="document.getElementById('<%=cbid%>_new').checked=true" class="zonebadge" style="background-color:<%=fwm.zone.get_color()%>"> <em><%:unspecified -or- create:%> </em> <input type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", luci.http.formvalue(cbid .. ".newzone") or self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" /> diff --git a/modules/luci-base/luasrc/view/cbi/footer.htm b/modules/luci-base/luasrc/view/cbi/footer.htm index 115250a82..42bf98bf2 100644 --- a/modules/luci-base/luasrc/view/cbi/footer.htm +++ b/modules/luci-base/luasrc/view/cbi/footer.htm @@ -19,7 +19,7 @@ <input class="cbi-button cbi-button-reset" type="button" value="<%:Reset%>" onclick="location.href='<%=REQUEST_URI%>'" /> <% end %> - <script type="text/javascript">cbi_d_update();</script> + <script type="text/javascript">cbi_init();</script> </div> <%- end -%> </form> diff --git a/modules/luci-base/luasrc/view/cbi/full_valuefooter.htm b/modules/luci-base/luasrc/view/cbi/full_valuefooter.htm index 4876fbcc9..f78093676 100644 --- a/modules/luci-base/luasrc/view/cbi/full_valuefooter.htm +++ b/modules/luci-base/luasrc/view/cbi/full_valuefooter.htm @@ -11,49 +11,3 @@ </div> <%- end -%> </div> - - -<% if #self.deps > 0 or #self.subdeps > 0 then -%> - <script type="text/javascript" id="cbip-<%=self.config.."-"..section.."-"..self.option%>"> - <% for j, d in ipairs(self.subdeps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - local depk - if k:find("!", 1, true) then - depk = string.format('"%s"', k) - elseif k:find(".", 1, true) then - depk = string.format('"cbid.%s"', k) - else - depk = string.format('"cbid.%s.%s.%s"', self.config, section, k) - end - -%> - <%-= depk .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option..d.add%>"); - <%- end %> - <% for j, d in ipairs(self.deps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - local depk - if k:find("!", 1, true) then - depk = string.format('"%s"', k) - elseif k:find(".", 1, true) then - depk = string.format('"cbid.%s"', k) - else - depk = string.format('"cbid.%s.%s.%s"', self.config, section, k) - end - -%> - <%-= depk .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option..d.add%>"); - <%- end %> - </script> -<%- end %> diff --git a/modules/luci-base/luasrc/view/cbi/full_valueheader.htm b/modules/luci-base/luasrc/view/cbi/full_valueheader.htm index aaf085473..10a554329 100644 --- a/modules/luci-base/luasrc/view/cbi/full_valueheader.htm +++ b/modules/luci-base/luasrc/view/cbi/full_valueheader.htm @@ -1,4 +1,4 @@ -<div class="cbi-value<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.last_child then %> cbi-value-last<% end %>" id="cbi-<%=self.config.."-"..section.."-"..self.option%>"> +<div class="cbi-value<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.last_child then %> cbi-value-last<% end %>" id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> <%- if self.title and #self.title > 0 then -%> <label class="cbi-value-title"<%= attr("for", cbid) %>> <%- if self.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=self.titleref%>"><%- end -%> diff --git a/modules/luci-base/luasrc/view/cbi/fvalue.htm b/modules/luci-base/luasrc/view/cbi/fvalue.htm index a1e0808e8..5eddcf22a 100644 --- a/modules/luci-base/luasrc/view/cbi/fvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/fvalue.htm @@ -2,7 +2,7 @@ <input type="hidden" value="1"<%= attr("name", "cbi.cbe." .. self.config .. "." .. section .. "." .. self.option) %> /> - <input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= + <input class="cbi-input-checkbox" data-update="click change" type="checkbox"<%= attr("id", cbid) .. attr("name", cbid) .. attr("value", self.enabled or 1) .. ifattr((self:cfgvalue(section) or self.default) == self.enabled, "checked", "checked") %> /> diff --git a/modules/luci-base/luasrc/view/cbi/lvalue.htm b/modules/luci-base/luasrc/view/cbi/lvalue.htm index 8cc086db4..ac63e9efd 100644 --- a/modules/luci-base/luasrc/view/cbi/lvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/lvalue.htm @@ -1,8 +1,8 @@ <%+cbi/valueheader%> <% if self.widget == "select" then %> - <select class="cbi-input-select" onchange="cbi_d_update(this.id)"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>> + <select class="cbi-input-select" data-update="change"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>> <% for i, key in pairs(self.keylist) do -%> - <option id="cbi-<%=self.config.."-"..section.."-"..self.option.."-"..key%>"<%= attr("value", key) .. ifattr(tostring(self:cfgvalue(section) or self.default) == key, "selected", "selected") %>><%=striptags(self.vallist[i])%></option> + <option id="cbi-<%=self.config.."-"..section.."-"..self.option.."-"..key%>"<%= attr("value", key) .. ifattr(tostring(self:cfgvalue(section) or self.default) == key, "selected", "selected") .. attr("data-index", i) .. attr("data-depends", self:deplist2json(section, self.deplist[i])) %>><%=striptags(self.vallist[i])%></option> <%- end %> </select> <% elseif self.widget == "radio" then @@ -10,8 +10,8 @@ for i, key in pairs(self.keylist) do c = c + 1 %> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr((self:cfgvalue(section) or self.default) == key, "checked", "checked") %> /> - <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label> + <input class="cbi-input-radio" data-update="click change" type="radio"<%= attr("id", cbid.."-"..key) .. attr("name", cbid) .. attr("value", key) .. ifattr((self:cfgvalue(section) or self.default) == key, "checked", "checked") .. attr("data-index", i) .. attr("data-depends", self:deplist2json(section, self.deplist[i])) %> /> + <label<%= attr("for", cbid.."-"..key) %>><%=self.vallist[i]%></label> <% if c == self.size then c = 0 %><% if self.orientation == "horizontal" then %> <% else %><br /><% end %> <% end end %> <% end %> diff --git a/modules/luci-base/luasrc/view/cbi/map.htm b/modules/luci-base/luasrc/view/cbi/map.htm index 7f256adf1..48403f1c3 100644 --- a/modules/luci-base/luasrc/view/cbi/map.htm +++ b/modules/luci-base/luasrc/view/cbi/map.htm @@ -10,10 +10,9 @@ <%- if firstmap and applymap then cbi_apply_xhr(self.config, parsechain, redirect) end -%> <% if self.tabbed then %> - <ul class="cbi-tabmenu"> + <ul class="cbi-tabmenu map"> <%- self.selected_tab = luci.http.formvalue("tab.m-" .. self.config) %> <% for i, section in ipairs(self.children) do %> - <script type="text/javascript">cbi_c['container.m-<%=self.config%>.<%=section.sectiontype%>'] = 1;</script> <%- if not self.selected_tab then self.selected_tab = section.sectiontype end %> <li id="tab.m-<%=self.config%>.<%=section.sectiontype%>" class="cbi-tab<%=(section.sectiontype == self.selected_tab) and '' or '-disabled'%>"> <a onclick="this.blur(); return cbi_t_switch('m-<%=self.config%>', '<%=section.sectiontype%>')" href="<%=REQUEST_URI%>?tab.m-<%=self.config%>=<%=section.sectiontype%>"><%=section.title or section.sectiontype %></a> diff --git a/modules/luci-base/luasrc/view/cbi/mvalue.htm b/modules/luci-base/luasrc/view/cbi/mvalue.htm index 5d092610e..79950cee2 100644 --- a/modules/luci-base/luasrc/view/cbi/mvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/mvalue.htm @@ -1,9 +1,9 @@ <% local v = self:valuelist(section) or {} -%> <%+cbi/valueheader%> <% if self.widget == "select" then %> - <select class="cbi-input-select" multiple="multiple" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. ifattr(self.size, "size") %>> + <select class="cbi-input-select" multiple="multiple" data-update="click change"<%= attr("name", cbid) .. ifattr(self.size, "size") %>> <% for i, key in pairs(self.keylist) do -%> - <option<%= attr("value", key) .. ifattr(luci.util.contains(v, key), "selected", "selected") %>><%=striptags(self.vallist[i])%></option> + <option<%= attr("id", cbid.."-"..key) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "selected", "selected") .. attr("data-index", i) .. attr("data-depends", self:deplist2json(section, self.deplist[i])) %>><%=striptags(self.vallist[i])%></option> <%- end %> </select> <% elseif self.widget == "checkbox" then @@ -11,8 +11,8 @@ for i, key in pairs(self.keylist) do c = c + 1 %> - <input class="cbi-input-checkbox" type="checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") %> /> - <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><% if not self.oneline then %><br /><% else %> <% end %> + <input class="cbi-input-checkbox" type="checkbox" data-update="click change"<%= attr("id", cbid.."-"..key) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") .. attr("data-index", i) .. attr("data-depends", self:deplist2json(section, self.deplist[i])) %> /> + <label<%= attr("for", cbid.."-"..key) %>><%=self.vallist[i]%></label><br /> <% if c == self.size then c = 0 %><br /> <% end end %> <% end %> diff --git a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm index 643d849a5..db6112992 100644 --- a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm +++ b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm @@ -41,7 +41,7 @@ iface:name() ~= self.exclude then %> <li> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= + <input class="cbi-input-<%=self.widget or "radio"%>" data-update="click change"<%= attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. iface:name()) .. attr("name", cbid) .. attr("value", iface:name()) .. @@ -63,7 +63,7 @@ <% end end %> <% if not self.nocreate then %> <li> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= + <input class="cbi-input-<%=self.widget or "radio"%>" data-update="click change"<%= attr("type", self.widget or "radio") .. attr("id", cbid .. "_custom") .. attr("name", cbid) .. diff --git a/modules/luci-base/luasrc/view/cbi/network_netlist.htm b/modules/luci-base/luasrc/view/cbi/network_netlist.htm index 4f186ca8e..f8a2b72f3 100644 --- a/modules/luci-base/luasrc/view/cbi/network_netlist.htm +++ b/modules/luci-base/luasrc/view/cbi/network_netlist.htm @@ -27,7 +27,7 @@ (not self.novirtual or not net:is_virtual()) then %> <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= + <input class="cbi-input-<%=self.widget or "radio"%>" data-update="click change"<%= attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. net:name()) .. attr("name", cbid) .. attr("value", net:name()) .. @@ -51,7 +51,7 @@ <% if not self.nocreate then %> <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value and self.widget ~= "checkbox", "checked", "checked")%> />   + <input class="cbi-input-<%=self.widget or "radio"%>" data-update="click change"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value and self.widget ~= "checkbox", "checked", "checked")%> />   <div style="padding:0.5em; display:inline"> <label<%=attr("for", cbid .. "_new")%>><em> <%- if self.widget == "checkbox" then -%> @@ -65,7 +65,7 @@ </li> <% elseif self.widget ~= "checkbox" and self.unspecified then %> <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= + <input class="cbi-input-<%=self.widget or "radio"%>" data-update="click change"<%= attr("type", self.widget or "radio") .. attr("id", cbid .. "_uns") .. attr("name", cbid) .. diff --git a/modules/luci-base/luasrc/view/cbi/tabmenu.htm b/modules/luci-base/luasrc/view/cbi/tabmenu.htm index b96ac9ce4..06c1414bf 100644 --- a/modules/luci-base/luasrc/view/cbi/tabmenu.htm +++ b/modules/luci-base/luasrc/view/cbi/tabmenu.htm @@ -2,7 +2,6 @@ <ul class="cbi-tabmenu"> <%- self.selected_tab = luci.http.formvalue("tab." .. self.config .. "." .. section) %> <%- for _, tab in ipairs(self.tab_names) do if #self.tabs[tab].childs > 0 then %> - <script type="text/javascript">cbi_c['container.<%=self.config%>.<%=section%>.<%=tab%>'] = <%=#self.tabs[tab].childs%>;</script> <%- if not self.selected_tab then self.selected_tab = tab end %> <li id="tab.<%=self.config%>.<%=section%>.<%=tab%>" class="cbi-tab<%=(tab == self.selected_tab) and '' or '-disabled'%>"> <a onclick="this.blur(); return cbi_t_switch('<%=self.config%>.<%=section%>', '<%=tab%>')" href="<%=REQUEST_URI%>?tab.<%=self.config%>.<%=section%>=<%=tab%>"><%=self.tabs[tab].title%></a> diff --git a/modules/luci-base/luasrc/view/cbi/tblsection.htm b/modules/luci-base/luasrc/view/cbi/tblsection.htm index d92879116..fcf216125 100644 --- a/modules/luci-base/luasrc/view/cbi/tblsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tblsection.htm @@ -99,7 +99,7 @@ end %> onclick="location.href='<%=self.extedit:format(section)%>'" <%- elseif type(self.extedit) == "function" then %> onclick="location.href='<%=self:extedit(section)%>'" - <%- end + <%- end %> alt="<%:Edit%>" title="<%:Edit%>" /> <%- end; if self.addremove then %> <input class="cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section'; return true" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" /> diff --git a/modules/luci-base/luasrc/view/cbi/tsection.htm b/modules/luci-base/luasrc/view/cbi/tsection.htm index 087548bf2..fcffbe0e7 100644 --- a/modules/luci-base/luasrc/view/cbi/tsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tsection.htm @@ -2,7 +2,9 @@ <% if self.title and #self.title > 0 then -%> <legend><%=self.title%></legend> <%- end %> - <div class="cbi-section-descr"><%=self.description%></div> + <% if self.description and #self.description > 0 then -%> + <div class="cbi-section-descr"><%=self.description%></div> + <%- end %> <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%> <% if self.addremove then -%> <div class="cbi-section-remove right"> diff --git a/modules/luci-base/luasrc/view/cbi/tvalue.htm b/modules/luci-base/luasrc/view/cbi/tvalue.htm index 4841c370a..d1e9e6672 100644 --- a/modules/luci-base/luasrc/view/cbi/tvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/tvalue.htm @@ -1,5 +1,5 @@ <%+cbi/valueheader%> - <textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") .. ifattr(self.readonly, "readonly") %>> + <textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> data-update="change"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") .. ifattr(self.readonly, "readonly") %>> <%-=pcdata(self:cfgvalue(section))-%> </textarea> <%+cbi/valuefooter%> diff --git a/modules/luci-base/luasrc/view/cbi/upload.htm b/modules/luci-base/luasrc/view/cbi/upload.htm index 157f3b36f..4fb5201aa 100644 --- a/modules/luci-base/luasrc/view/cbi/upload.htm +++ b/modules/luci-base/luasrc/view/cbi/upload.htm @@ -15,10 +15,10 @@ <% if not self.unsafeupload then %> <input type="hidden"<%= attr("value", v) .. attr("name", "cbi.rlf." .. section .. "." .. self.option) .. attr("id", "cbi.rlf." .. section .. "." .. self.option) %> /> <% end %> - + <% if (not s) or (s and not self.unsafeupload) then %> <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> /> <% end %> - <input type="text" class="cbi-input-text" onchange="cbi_d_update(this.id)"<%= + <input type="text" class="cbi-input-text" data-update="change"<%= attr("name", cbid .. ".textbox") .. attr("id", cbid .. ".textbox") .. attr("value", luci.cbi.AbstractValue.cfgvalue(self, section) or self.default) .. ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") .. ifattr(self.readonly, "readonly") .. ifattr(self.maxlength, "maxlength") %> /> <%+cbi/valuefooter%> diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm index c43dab5f4..9bb4f3b0f 100644 --- a/modules/luci-base/luasrc/view/cbi/value.htm +++ b/modules/luci-base/luasrc/view/cbi/value.htm @@ -1,8 +1,14 @@ <%+cbi/valueheader%> - <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%= - attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) .. - ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") .. - ifattr(self.readonly, "readonly") .. ifattr(self.maxlength, "maxlength") + <input data-update="change"<%= + attr("id", cbid) .. + attr("name", cbid) .. + attr("type", self.password and "password" or "text") .. + attr("class", self.password and "cbi-input-password" or "cbi-input-text") .. + attr("value", self:cfgvalue(section) or self.default) .. + ifattr(self.size, "size") .. + ifattr(self.placeholder, "placeholder") .. + ifattr(self.readonly, "readonly") .. + ifattr(self.maxlength, "maxlength") %> /> <% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %> <% if #self.keylist > 0 or self.datatype then -%> |