diff options
author | Mustafa Can Elmacı <mustafacan@elmaci.net> | 2024-11-17 15:52:45 +0300 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-11-22 22:39:46 +0100 |
commit | ae8bbb814f16c2dc2a82e88d408bee1812ceda9c (patch) | |
tree | b48de027e4f3d6a366ef60025b980bc83ee5ae90 /modules | |
parent | aa955d6465b4d0f00cc713904e2de7bfb0cbd062 (diff) |
treewide: HTML Cleanup
* HTML Cleanup: Meta tags.
* Converted charset to shorthand.
* Removed meta tags with `Content-Script-Type` attribute. (Invalid in HTML5 spec.)
* HTML Cleanup: CSS tags.
* Removed `type` attribute with CSS files from link tags. (HTML5 spec recommends omitting it.)
* Removed `type` attribute from style tags. (Deprecated in HTML5 spec.)
https://html.spec.whatwg.org/#attr-link-type
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
* HTML Cleanup: Convert from XHTML to HTML5
* Removed XML declaration.
* Removed XML namespace.
* Changed doctype to HTML5.
* HTML Cleanup: CDATA tags.
* CDATA sections should not be used within HTML they are considered as comments and not displayed.
https://developer.mozilla.org/en-US/docs/Web/API/CDATASection
* HTML Cleanup: Script tags.
* Removed `language` attribute from script tags. (No longer valid in HTML5)
* Removed `type` attribute with JavaScript MIME type from script tags. (HTML5 spec recommends omitting it.)
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
https://mimesniff.spec.whatwg.org/#javascript-mime-type
Signed-off-by: Mustafa Can Elmacı <mustafacan@elmaci.net>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/root/www/index.html | 7 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/error500.ut | 2 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/footer.ut | 4 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/header.ut | 6 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/sysauth.ut | 4 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/view.ut | 2 | ||||
-rw-r--r-- | modules/luci-compat/luasrc/view/cbi/delegator.htm | 2 | ||||
-rw-r--r-- | modules/luci-compat/luasrc/view/cbi/footer.htm | 2 | ||||
-rw-r--r-- | modules/luci-compat/luasrc/view/cbi/ipaddr.htm | 2 | ||||
-rw-r--r-- | modules/luci-compat/luasrc/view/cbi/simpleform.htm | 2 | ||||
-rw-r--r-- | modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm | 6 | ||||
-rw-r--r-- | modules/luci-mod-status/ucode/template/admin_status/index.ut | 6 |
12 files changed, 22 insertions, 23 deletions
diff --git a/modules/luci-base/root/www/index.html b/modules/luci-base/root/www/index.html index 398e6e763c..625aebcc4f 100644 --- a/modules/luci-base/root/www/index.html +++ b/modules/luci-base/root/www/index.html @@ -1,13 +1,12 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<!DOCTYPE html> +<html> <head> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT" /> <meta http-equiv="refresh" content="0; URL=cgi-bin/luci/" /> - <style type="text/css"> + <style> body { background: white; font-family: arial, helvetica, sans-serif; } a { color: black; } diff --git a/modules/luci-base/ucode/template/error500.ut b/modules/luci-base/ucode/template/error500.ut index 39a0eec678..e0d4d48ab7 100644 --- a/modules/luci-base/ucode/template/error500.ut +++ b/modules/luci-base/ucode/template/error500.ut @@ -4,7 +4,7 @@ -#} <!--]]>--><!--'>--><!--">--> -<style type="text/css"> +<style> body { line-height: 1.5; font-size: 14px; diff --git a/modules/luci-base/ucode/template/footer.ut b/modules/luci-base/ucode/template/footer.ut index d0978594f8..0ab06ae0b9 100644 --- a/modules/luci-base/ucode/template/footer.ut +++ b/modules/luci-base/ucode/template/footer.ut @@ -5,7 +5,7 @@ {% const rollback = dispatcher.rollback_pending() %} {% if (rollback || trigger_apply || trigger_revert): %} - <script type="text/javascript"> + <script> document.addEventListener("luci-loaded", function() { {% if (trigger_apply): %} L.ui.changes.apply(true); @@ -19,7 +19,7 @@ {% endif %} {% if (media_error): %} - <script type="text/javascript"> + <script> L.require('ui').then(function(ui) { ui.showIndicator('media_error', _('Theme fallback'), function(ev) { ui.showModal(_('Error loading theme'), [ diff --git a/modules/luci-base/ucode/template/header.ut b/modules/luci-base/ucode/template/header.ut index 7dc3742a9d..81cb411dda 100644 --- a/modules/luci-base/ucode/template/header.ut +++ b/modules/luci-base/ucode/template/header.ut @@ -7,9 +7,9 @@ include(`themes/${theme}/header`); -%} -<script type="text/javascript" src="{{ resource }}/promis.min.js"></script> -<script type="text/javascript" src="{{ resource }}/luci.js"></script> -<script type="text/javascript"> +<script src="{{ resource }}/promis.min.js"></script> +<script src="{{ resource }}/luci.js"></script> +<script> L = new LuCI({{ replace(`${ { media : media, resource : resource, diff --git a/modules/luci-base/ucode/template/sysauth.ut b/modules/luci-base/ucode/template/sysauth.ut index 3c580949bb..7fe6e9d57d 100644 --- a/modules/luci-base/ucode/template/sysauth.ut +++ b/modules/luci-base/ucode/template/sysauth.ut @@ -52,7 +52,7 @@ )); %} -<script type="text/javascript">//<![CDATA[ +<script> var input = document.getElementsByName('luci_password')[0]; if (input) @@ -69,6 +69,6 @@ setTimeout(function() { img.src = '' }, 5000); }); } -//]]></script> +</script> {% include('footer') %} diff --git a/modules/luci-base/ucode/template/view.ut b/modules/luci-base/ucode/template/view.ut index 11ac824290..a8562844ba 100644 --- a/modules/luci-base/ucode/template/view.ut +++ b/modules/luci-base/ucode/template/view.ut @@ -2,7 +2,7 @@ <div id="view"> <div class="spinning">{{ _('Loading view…') }}</div> - <script type="text/javascript"> + <script> L.require('ui').then(function(ui) { ui.instantiateView('{{ view }}'); }); diff --git a/modules/luci-compat/luasrc/view/cbi/delegator.htm b/modules/luci-compat/luasrc/view/cbi/delegator.htm index 2606e7f6d7..0eb8f291fc 100644 --- a/modules/luci-compat/luasrc/view/cbi/delegator.htm +++ b/modules/luci-compat/luasrc/view/cbi/delegator.htm @@ -20,5 +20,5 @@ <input class="btn cbi-button cbi-button-back" type="submit" name="cbi.delg.back" value="<%:« Back%>" /> <% end %> <% end %> - <script type="text/javascript">cbi_d_update();</script> + <script>cbi_d_update();</script> </div> diff --git a/modules/luci-compat/luasrc/view/cbi/footer.htm b/modules/luci-compat/luasrc/view/cbi/footer.htm index c72102340f..3dc5c9a0ad 100644 --- a/modules/luci-compat/luasrc/view/cbi/footer.htm +++ b/modules/luci-compat/luasrc/view/cbi/footer.htm @@ -36,6 +36,6 @@ </form> -<script type="text/javascript">cbi_init();</script> +<script>cbi_init();</script> <%+footer%> diff --git a/modules/luci-compat/luasrc/view/cbi/ipaddr.htm b/modules/luci-compat/luasrc/view/cbi/ipaddr.htm index d34d8d9865..b861e19e9b 100644 --- a/modules/luci-compat/luasrc/view/cbi/ipaddr.htm +++ b/modules/luci-compat/luasrc/view/cbi/ipaddr.htm @@ -1,5 +1,5 @@ <%+cbi/valueheader%> - <script type="text/javascript"> + <script> function switchToCIDRList(ev) { var input = ev.target.previousElementSibling, usecidr = document.getElementById(input.id + '_usecidr'); diff --git a/modules/luci-compat/luasrc/view/cbi/simpleform.htm b/modules/luci-compat/luasrc/view/cbi/simpleform.htm index 9e1514546e..24c3e2558e 100644 --- a/modules/luci-compat/luasrc/view/cbi/simpleform.htm +++ b/modules/luci-compat/luasrc/view/cbi/simpleform.htm @@ -74,4 +74,4 @@ end %> -<script type="text/javascript">cbi_init();</script> +<script>cbi_init();</script> diff --git a/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm b/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm index f81ee19614..c4631decec 100644 --- a/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm +++ b/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm @@ -1,6 +1,6 @@ <%+cbi/valueheader%> -<script type="text/javascript">//<![CDATA[ +<script> var freqlist = <%= luci.http.write_json(self.iwinfo.freqlist) %>; var hwmodes = <%= luci.http.write_json(self.iwinfo.hwmodelist or {}) %>; var htmodes = <%= luci.http.write_json(self.iwinfo.htmodelist) %>; @@ -176,7 +176,7 @@ bwdt.value = <%= luci.http.write_json(self.map:get(section, "htmode")) %>; chan.value = <%= luci.http.write_json(self.map:get(section, "channel")) %>; } -//]]></script> +</script> <label style="float:left; margin-right:3px"> <%:Mode%><br /> @@ -196,6 +196,6 @@ </label> <br style="clear:left" /> -<script type="text/javascript">cbi_init_wifi('<%= cbid %>');</script> +<script>cbi_init_wifi('<%= cbid %>');</script> <%+cbi/valuefooter%> diff --git a/modules/luci-mod-status/ucode/template/admin_status/index.ut b/modules/luci-mod-status/ucode/template/admin_status/index.ut index 4d018a3efd..dafb427bf4 100644 --- a/modules/luci-mod-status/ucode/template/admin_status/index.ut +++ b/modules/luci-mod-status/ucode/template/admin_status/index.ut @@ -12,7 +12,7 @@ <div class="spinning">{{ _('Loading view…') }}</div> </div> -<script type="text/javascript">//<![CDATA[ +<script> function progressbar(query, value, max, byte) { var pg = document.querySelector(query), @@ -46,7 +46,7 @@ function renderBadge(icon, title) { ]); } -//]]></script> +</script> <div class="includes" style="display:none"> {% @@ -60,7 +60,7 @@ function renderBadge(icon, title) { %} </div> -<script type="text/javascript"> +<script> L.require('ui').then(function(ui) { ui.instantiateView('status/index'); }); |