global_value.htm 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!-- ++ BEGIN ++ Dynamic DNS ++ global_value.htm ++ -->
  2. <%+cbi/valueheader%>
  3. <script type="text/javascript">//<![CDATA[
  4. // event handler on changed date
  5. function onkeyup_date(value) {
  6. var obj = document.getElementById("cbid.ddns.global.date_format.help");
  7. if ( !obj ) { return; } // security check
  8. if ( value == "" || value.length == 0 ) { value = "%F %R"; }
  9. var now = new Date();
  10. var txt = now.toLocaleFormat(value);
  11. // handle newline(%n) and tab(%t) needs to be converted to HTML
  12. txt = txt.replace(new RegExp('\r?\n','g'), '<br />');
  13. txt = txt.replace(new RegExp('\t','g'), '&nbsp;&nbsp;&nbsp;&nbsp;');
  14. obj.innerHTML = "<%:Current setting%>: <strong>" + txt + "<\/strong>";
  15. }
  16. //]]></script>
  17. <input type="text" class="cbi-input-text" onchange="cbi_d_update(this.id)" onkeyup="onkeyup_date(this.value)"
  18. <%=
  19. attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) ..
  20. ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder")
  21. %>
  22. />
  23. <br />
  24. <div class="cbi-value-description">
  25. <span class="cbi-value-helpicon"><img src="<%=resource%>/cbi/help.gif" alt="<%:help%>" /><%=self.description%></span>
  26. <br />
  27. <span id="<%=cbid%>.help" class="cbi-value-helpicon"><%:Current setting%>: <strong><%=self.date_string%></strong></span>
  28. </div> <!-- div class="cbi-value-description" -->
  29. </div> <!-- div class="cbi-value-field" -->
  30. </div> <!-- div class="cbi-value cbi-value-last" -->
  31. <!-- ++ END ++ Dynamic DNS ++ global_value.htm ++ -->