0
0
mirror of https://github.com/openwrt/luci.git synced 2025-04-13 14:23:58 +00:00
Files
Mustafa Can Elmacı ae8bbb814f 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>
2024-11-22 22:39:46 +01:00

43 lines
1.2 KiB
Plaintext

{#
Copyright 2022 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-#}
{% const rollback = dispatcher.rollback_pending() %}
{% if (rollback || trigger_apply || trigger_revert): %}
<script>
document.addEventListener("luci-loaded", function() {
{% if (trigger_apply): %}
L.ui.changes.apply(true);
{% elif (trigger_revert): %}
L.ui.changes.revert();
{% else %}
L.ui.changes.confirm(true, Date.now() + {{rollback.remaining * 1000}}, {{sprintf('%J', rollback.token)}});
{% endif %}
});
</script>
{% endif %}
{% if (media_error): %}
<script>
L.require('ui').then(function(ui) {
ui.showIndicator('media_error', _('Theme fallback'), function(ev) {
ui.showModal(_('Error loading theme'), [
E('p', [
_('A fallback is used since the configured theme failed to load with the error below.')
]),
E('hr'),
E('div', { 'style': 'white-space:pre-line' }, {{ sprintf('%J', trim(media_error)) }}),
E('div', { 'class': 'right' }, [
E('button', { 'class': 'btn cbi-button', 'click': ui.hideModal }, _('Dismiss'))
])
]);
});
});
</script>
{% endif %}
{% include(`themes/${theme}/footer`) %}
<!-- Lua compatibility mode active: {{ lua_active ? 'yes' : 'no' }} -->