Add luci, based upon commit : ae8ddb0ca6dfe98cb842fe2c01b36c4df55a0894
[librecmc/librecmc.git] / package / luci / modules / luci-base / luasrc / view / cbi / value.htm
1 <%+cbi/valueheader%>
2         <%- if self.password then -%>
3                 <input type="password" style="position:absolute; left:-100000px" aria-hidden="true" tabindex="-1"<%=
4                         attr("name", "password." .. cbid)
5                 %> />
6         <%- end -%>
7         <input data-update="change"<%=
8                 attr("id", cbid) ..
9                 attr("name", cbid) ..
10                 attr("type", self.password and "password" or "text") ..
11                 attr("class", self.password and "cbi-input-password" or "cbi-input-text") ..
12                 attr("value", self:cfgvalue(section) or self.default) ..
13                 ifattr(self.password, "autocomplete", "new-password") ..
14                 ifattr(self.size, "size") ..
15                 ifattr(self.placeholder, "placeholder") ..
16                 ifattr(self.readonly, "readonly") ..
17                 ifattr(self.maxlength, "maxlength") ..
18                 ifattr(self.datatype, "data-type", self.datatype) ..
19                 ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
20                 ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
21                 ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
22         %> />
23         <%- if self.password then -%>
24                 <button class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" aria-label="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'; event.preventDefault()">∗</button>
25         <% end %>
26 <%+cbi/valuefooter%>