summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm
blob: 3cbb66b4bf4cb4336fe4170be7896c9c18747c2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

<!-- ++ 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 ++ -->