2 <input data-update="change"<%=
5 attr("type", self.password and "password" or "text") ..
6 attr("class", self.password and "cbi-input-password" or "cbi-input-text") ..
7 attr("value", self:cfgvalue(section) or self.default) ..
8 ifattr(self.size, "size") ..
9 ifattr(self.placeholder, "placeholder") ..
10 ifattr(self.readonly, "readonly") ..
11 ifattr(self.maxlength, "maxlength") ..
12 ifattr(self.datatype, "data-type", self.datatype) ..
13 ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
14 ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
15 ifattr(#self.keylist > 0, "data-choices", luci.util.serialize_json({ self.keylist, self.vallist }))
17 <% 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 %>