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