inlinevalue.htm 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. <div style="display: inline-block;">
  2. <!-- <%- if self.title then -%>
  3. <label class="cbi-value-title"<%= attr("for", cbid) %>>
  4. <%- if self.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=self.titleref%>"><%- end -%>
  5. <%-=self.title-%>
  6. <%- if self.titleref then -%></a><%- end -%>
  7. </label>
  8. <%- end -%> -->
  9. <%- if self.password then -%>
  10. <input type="password" style="position:absolute; left:-100000px" aria-hidden="true"<%=
  11. attr("name", "password." .. cbid)
  12. %> />
  13. <%- end -%>
  14. <input data-update="change"<%=
  15. attr("id", cbid) ..
  16. attr("name", cbid) ..
  17. attr("type", self.password and "password" or "text") ..
  18. attr("class", self.password and "cbi-input-password" or "cbi-input-text") ..
  19. attr("value", self:cfgvalue(section) or self.default) ..
  20. ifattr(self.password, "autocomplete", "new-password") ..
  21. ifattr(self.size, "size") ..
  22. ifattr(self.placeholder, "placeholder") ..
  23. ifattr(self.readonly, "readonly") ..
  24. ifattr(self.maxlength, "maxlength") ..
  25. ifattr(self.datatype, "data-type", self.datatype) ..
  26. ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
  27. ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
  28. ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
  29. %> />
  30. <%- if self.password then -%>
  31. <div class="btn cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'"></div>
  32. <% end %>
  33. </div>