From: Ansuel Smith Date: Sat, 14 Mar 2020 12:38:37 +0000 (+0100) Subject: luci-app-ddns: fix invalid markup X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=03af89a24b52c152a97b4624098a64b597327b87;p=project%2Fluci.git luci-app-ddns: fix invalid markup Fix invalid markup to be XHTML compliant in order to prevent exceptions when opening DDNS pages with luci-theme-openwrt. Signed-off-by: Ansuel Smith Ref: https://forum.openwrt.org/t/19-07-luci-app-ddns-broken/57596 Fixes: 34fa5122f ("luci-app-ddns: convert to client side implementatio") [reword commit message, drop unrelated ui.js changes] Signed-off-by: Jo-Philipp Wich --- diff --git a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js index 2a0f2200f5..392cf239b7 100644 --- a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js +++ b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js @@ -69,7 +69,7 @@ return L.view.extend({ E('div', {}, status['_enabled'] ? _('DDNS Autostart enabled') : [ _('DDNS Autostart disabled'), E('div', { 'class' : 'cbi-value-description' }, - _("Currently DDNS updates are not started at boot or on interface events.") + "
" + + _("Currently DDNS updates are not started at boot or on interface events.") + "
" + _("This is the default if you run DDNS scripts by yourself (i.e. via cron with force_interval set to '0')")) ]),]); }); @@ -103,8 +103,8 @@ return L.view.extend({ service_status = '' + _('Running') + ' : ' + service[section_id].pid; } - cfg_detail_ip.innerHTML = host + '
' + ip; - cfg_update.innerHTML = last_update + '
' + next_update; + cfg_detail_ip.innerHTML = host + '
' + ip; + cfg_update.innerHTML = last_update + '
' + next_update; cfg_status.innerHTML = service_status; } @@ -160,13 +160,13 @@ return L.view.extend({ o.cfgvalue = function() { var res = status[this.option]; if (!res) { - this.description = _("Currently DDNS updates are not started at boot or on interface events.") + "
" + + this.description = _("Currently DDNS updates are not started at boot or on interface events.") + "
" + _("This is the default if you run DDNS scripts by yourself (i.e. via cron with force_interval set to '0')") } return res ? _('DDNS Autostart enabled') : _('DDNS Autostart disabled') }; - o = s.option(form.DummyValue, '_toggle', ' '); + o = s.option(form.DummyValue, '_toggle', ' '); o.cfgvalue = function() { var action = status['_enabled'] ? 'stop' : 'start'; return E([], [ @@ -182,7 +182,7 @@ return L.view.extend({ }, _(action.toUpperCase() + ' DDns'))]); }; - o = s.option(form.DummyValue, '_restart', ' '); + o = s.option(form.DummyValue, '_restart', ' '); o.cfgvalue = function() { return E([], [ E('button', { @@ -199,8 +199,8 @@ return L.view.extend({ o = s.option(form.DummyValue, '_no_ipv6'); o.rawhtml = true; o.title = '' + _("IPv6 not supported") + ''; - o.cfgvalue = function() { return _("IPv6 is currently not (fully) supported by this system") + "
" + - _("Please follow the instructions on OpenWrt's homepage to enable IPv6 support") + "
" + + o.cfgvalue = function() { return _("IPv6 is currently not (fully) supported by this system") + "
" + + _("Please follow the instructions on OpenWrt's homepage to enable IPv6 support") + "
" + _("or update your system to the latest OpenWrt Release")}; } @@ -391,7 +391,7 @@ return L.view.extend({ return '' + section_id + ''; } - o = s.option(form.DummyValue, '_cfg_detail_ip', _('Lookup Hostname') + "
" + _('Registered IP')); + o = s.option(form.DummyValue, '_cfg_detail_ip', _('Lookup Hostname') + "
" + _('Registered IP')); o.rawhtml = true; o.modalonly = false; o.textvalue = function(section_id) { @@ -400,7 +400,7 @@ return L.view.extend({ if (resolved[section_id] && resolved[section_id].ip) ip = resolved[section_id].ip; - return host + '
' + ip; + return host + '
' + ip; }; o = s.option(form.Flag, 'enabled', _('Enabled')); @@ -408,7 +408,7 @@ return L.view.extend({ o.editable = true; o.modalonly = false; - o = s.option(form.DummyValue, '_cfg_update', _('Last Update') + "
" + _('Next Update')); + o = s.option(form.DummyValue, '_cfg_update', _('Last Update') + "
" + _('Next Update')); o.rawhtml = true; o.modalonly = false; o.textvalue = function(section_id) { @@ -420,7 +420,7 @@ return L.view.extend({ next_update = NextUpdateStrings[resolved[section_id].next_update] || resolved[section_id].next_update; } - return last_update + '
' + next_update; + return last_update + '
' + next_update; }; s.modaltitle = function(section_id) { @@ -586,7 +586,7 @@ return L.view.extend({ o = s.taboption('basic', form.Value, 'cacert', _("Path to CA-Certificate"), - _("directory or path/file") + "
" + + _("directory or path/file") + "
" + _("or") + '' + " IGNORE " + '' + _("to run HTTPS without verification of server certificates (insecure)")); o.modalonly = true; @@ -650,8 +650,8 @@ return L.view.extend({ // ip_url o = s.taboption('advanced', form.Value, 'ip_url', _("URL to detect"), - _("Defines the Web page to read systems IP-Address from" + '
' + - _('Example for IPv4' + ': http://checkip.dyndns.com') + '
' + + _("Defines the Web page to read systems IP-Address from" + '
' + + _('Example for IPv4' + ': http://checkip.dyndns.com') + '
' + _('Example for IPv6' + ': http://checkipv6.dyndns.com'))); o.depends("ip_source", "web") @@ -708,7 +708,7 @@ return L.view.extend({ if (env['has_bindnet']) { o = s.taboption('advanced', widgets.ZoneSelect, 'bind_network', _("Bind Network"), - _('OPTIONAL: Network to use for communication') + '
' + + _('OPTIONAL: Network to use for communication') + '
' + _("Network on which the ddns-updater scripts will be started")); o.depends("ip_source", "web"); o.optional = true; @@ -783,7 +783,7 @@ return L.view.extend({ o.optional = true; o.modalonly = true; o.cfgvalue = function(section_id) { - this.description = _("Writes detailed messages to log file. File will be truncated automatically.") + "
" + + this.description = _("Writes detailed messages to log file. File will be truncated automatically.") + "
" + _("File") + ': "' + logdir + '/' + section_id + '.log"'; return uci.get('ddns', section_id, 'use_logfile'); }; @@ -907,7 +907,7 @@ return L.view.extend({ o.modalonly = true; o.update_log = L.bind(function(view, log_data) { - return document.getElementById('log_area').innerHTML = log_data.result; + return document.getElementById('log_area').textContent = log_data.result; }, o, this) o.render = L.bind(function() { @@ -942,7 +942,7 @@ return L.view.extend({ o = s.option(form.Value, 'ddns_dateformat', _('Date format')); o.description = '' + _("For supported codes look here") - + '
' + + + '
' + _('Current setting: ') + '' + status['_curr_dateformat'] + ''; o.default = "%F %R" o.optional = true;