luci/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm
Helge Mader 7a9957e727 luci-app-ddns: fix HTML page rendering in globals section
Signed-off-by: Helge Mader <ma@dev.tdt.de>
2018-05-16 06:45:04 +02:00

33 lines
1.4 KiB
HTML

<!-- ++ BEGIN ++ Dynamic DNS ++ global_value.htm ++ -->
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
// event handler on changed date
function onkeyup_date(value) {
var obj = document.getElementById("cbid.ddns.global.ddns_dateformat.help");
if ( !obj ) { return; } // security check
if ( value == "" || value.length == 0 ) { value = "%F %R"; }
var now = new Date();
var txt = now.toLocaleFormat(value);
// handle newline(%n) and tab(%t) needs to be converted to HTML
txt = txt.replace(new RegExp('\r?\n','g'), '<br />');
txt = txt.replace(new RegExp('\t','g'), '&nbsp;&nbsp;&nbsp;&nbsp;');
obj.innerHTML = "<%:Current setting%>: <strong>" + txt + "<\/strong>";
}
//]]></script>
<input type="text" class="cbi-input-text" onchange="cbi_d_update(this.id)" onkeyup="onkeyup_date(this.value)"
<%=
attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) ..
ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder")
%>
/>
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="<%=resource%>/cbi/help.gif" alt="<%:help%>" /></span><%=self.description%>
<br /><%:Current setting%>: <strong><%=self.date_string%></strong>
</div> <!-- div class="cbi-value-description" -->
</div> <!-- div class="cbi-value-field" -->
</div> <!-- div class="cbi-value cbi-value-last" -->
<!-- ++ END ++ Dynamic DNS ++ global_value.htm ++ -->