Skip to content

Commit

Permalink
treewide: HTML Cleanup
Browse files Browse the repository at this point in the history
* 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ı <[email protected]>
  • Loading branch information
Rupurudu authored and systemcrash committed Nov 22, 2024
1 parent aa955d6 commit ae8bbb8
Show file tree
Hide file tree
Showing 54 changed files with 106 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</div>
</div>

<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<script type="text/javascript">//<![CDATA[
<script src="<%=resource%>/bmx7/js/polling.js"></script>
<script>
new TablePooler(10,"/cgi-bin/bmx7-info", {'originators':''}, "nodes_div", function(st){
var originators = st.originators;
var res = Array();
Expand All @@ -37,4 +37,4 @@
});
return res;
});
//]]></script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
-%>

<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/bmx7/js/polling.js"></script>


<style>
Expand Down Expand Up @@ -88,7 +88,7 @@ <h2>Mesh nodes</h2>

</div>

<script type="text/javascript">//<![CDATA[
<script>
var displayExtraInfo = function ( id ) {
document.getElementById('extra-info').innerHTML = document.getElementById(id).innerHTML;
}
Expand Down Expand Up @@ -150,6 +150,6 @@ <h2>Mesh nodes</h2>
});
return res;
});
//]]></script>
</script>

<%+footer%>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/bmx7/js/polling.js"></script>

<div class="cbi-map">
<center>
Expand Down Expand Up @@ -87,7 +87,7 @@

</div>

<script type="text/javascript">//<![CDATA[
<script>
new TablePooler(10,"/cgi-bin/bmx7-info", {'info':''}, "config_div", function(st){
var res = Array();
var sta = st.info[0].status;
Expand Down Expand Up @@ -125,6 +125,6 @@
return res;
});

//]]></script>
</script>

<%+footer%>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%+header%>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.min.js" integrity="sha512-uy3foVtL4u0+5430l7zZt4PHjVtICfrbu3mtzdanR425sKD7kS5264djeZAzNIV0l4vc1QkFpW2+G5i5KoJIFQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/netjsongraph.js"></script>
<script src="<%=resource%>/bmx7/js/netjsongraph.js"></script>

<link href="<%=resource%>/bmx7/css/netjsongraph.css" rel="stylesheet">
<style type="text/css">
<style>
body {
font-family: Arial, sans-serif;
font-size: 13px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@


<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/bmx7/js/polling.js"></script>

<div class="cbi-map">
<h2>Gateway announcements</h2>
Expand All @@ -50,7 +50,7 @@ <h2>Gateway announcements</h2>

</div>

<script type="text/javascript">//<![CDATA[
<script>
new TablePooler(5,"/cgi-bin/bmx7-info", {'tunnels':''}, "tunnels_div", function(st){
var tunicon = "<%=resource%>/icons/tunnel.png";
var tunicon_dis = "<%=resource%>/icons/tunnel_disabled.png";
Expand All @@ -71,6 +71,6 @@ <h2>Gateway announcements</h2>
}
return res;
});
//]]></script>
</script>

<%+footer%>
4 changes: 2 additions & 2 deletions applications/luci-app-commands/ucode/template/commands.ut
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
` });
-%}

<script type="text/javascript">//<![CDATA[
<script>
function command_run(ev, id)
{
var field = document.getElementById(id);
Expand Down Expand Up @@ -113,7 +113,7 @@
ev.preventDefault();
}

//]]></script>
</script>

{%
const commands = [];
Expand Down
4 changes: 2 additions & 2 deletions applications/luci-app-cshark/luasrc/view/cshark.htm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<hr/>

<script type="text/javascript">//<![CDATA[
<script>

var capture_running = 0;
var pid_file = 0;
Expand Down Expand Up @@ -287,4 +287,4 @@

check_status();
link_list_update();
//]]></script>
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style type="text/css">
<style>
#docker_apply_overlay {
position: absolute;
top: 0;
Expand Down Expand Up @@ -42,7 +42,7 @@
}
</style>

<script type="text/javascript">//<![CDATA[
<script>
var xhr = new XHR(),
uci_apply_rollback = <%=math.max(luci.config and luci.config.apply and luci.config.apply.rollback or 90, 90)%>,
uci_apply_holdoff = <%=math.max(luci.config and luci.config.apply and luci.config.apply.holdoff or 4, 1)%>,
Expand Down Expand Up @@ -144,4 +144,4 @@
});
}

//]]></script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<li id="cbi-tab-container_logs"><a id="a-cbi-tab-container_logs" href=""><%:Logs%></a></li>
</ul>

<script type="text/javascript">
<script>
let re = /\/admin\/docker\/container\//
let p = window.location.href
let path = p.split(re)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="cbi-map">
<iframe id="terminal" style="width: 100%; min-height: 500px; border: none; border-radius: 3px;"></iframe>
</div>
<script type="text/javascript">
<script>
document.getElementById("terminal").src = "http://" + window.location.hostname + ":7682";
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
</div>

<script type="text/javascript">
<script>
let btnUpload = document.getElementById('upload')
btnUpload.onclick = function (e) {
let uploadArchive = document.getElementById('upload_archive')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="text/javascript">//<![CDATA[
<script>
let last_bw_tx
let last_bw_rx
let interval = 3
Expand Down Expand Up @@ -78,4 +78,4 @@
}

});
//]]></script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<input type="file" id="file_import" style="visibility:hidden; position: absolute;top: 0px; left: 0px;" />
</div>

<script type="text/javascript">
<script>
let btnImport = document.getElementById('btnimport')
let valISrc = document.getElementById('isrc')
let valITag = document.getElementById('itag')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<input type="button"" class="btn cbi-button cbi-button-add" id="btnload" name="load" value="<%:Load%>" />
<input type="file" id="file_load" style="visibility:hidden; position: absolute;top: 0px; left: 0px;" accept="application/x-tar" />
</div>
<script type="text/javascript">
<script>
let btnLoad = document.getElementById('btnload')
btnLoad.onclick = function (e) {
document.getElementById("file_load").click()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style type="text/css">
<style>
#dialog_reslov {
position: absolute;
top: 0;
Expand Down Expand Up @@ -50,7 +50,7 @@
}
</style>

<script type="text/javascript">
<script>
function close_reslov_dialog() {
document.body.classList.remove('dialog-reslov-active')
document.documentElement.style.overflowY = 'scroll'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="text/javascript">//<![CDATA[
<script>
XHR.poll(-1, '<%=url('admin/telephony/status')%>', null,
function(x, st)
{
Expand All @@ -14,7 +14,7 @@
}
}
);
//]]></script>
</script>

<fieldset class="cbi-section">
<legend><%:Current Telephony State%></legend>
Expand Down
4 changes: 1 addition & 3 deletions applications/luci-app-lxc/luasrc/view/lxc.htm
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ <h3><%:Create New Container%></h3>

<hr />

<script type="text/javascript">
//<![CDATA[
<script>
window.img = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" };
window.states = { "STOPPED" : "red", "RUNNING" : "green", "FROZEN" : "purple" };

Expand Down Expand Up @@ -502,5 +501,4 @@ <h3><%:Create New Container%></h3>
})

lxc_list_update();
//]]>
</script>
4 changes: 2 additions & 2 deletions applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<%+header%>

<script type="text/javascript">//<![CDATA[
<script>
var bwxhr = new XHR();

var RC = { };
Expand Down Expand Up @@ -120,7 +120,7 @@
}
}, 1000
);
//]]></script>
</script>

<h2 name="content"><%:Realtime Rate%></h2>

Expand Down
4 changes: 2 additions & 2 deletions applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="text/javascript">//<![CDATA[
<script>

function ocserv_disconnect(idx) {
(new XHR()).post('<%=url('admin/vpn/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
Expand Down Expand Up @@ -42,7 +42,7 @@
}
}
);
//]]></script>
</script>

<fieldset class="cbi-section">
<legend><%:Active OpenConnect Users%></legend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ call)

jsonreq4=$(
cat <<EOF
<script language='JavaScript1.2' type='text/javascript'>
<script>
EOF
# sed + txtinfo plugin
Expand Down
5 changes: 2 additions & 3 deletions applications/luci-app-olsr/htdocs/cgi-bin-status.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?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="refresh" content="0; URL=/cgi-bin/luci/freifunk/olsr/neighbors" />
</head>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<script type="text/javascript">
//<![CDATA[
<script>
function vpn_add()
{
var vpn_name = div_add.querySelector("#instance_name1").value.replace(/[^\x00-\x7F]|[\s\.!@#$%^&*()\-+=\[\]{};':"\\|,<>\/?]/g,'');
Expand Down Expand Up @@ -68,7 +67,6 @@
setTimeout(function(){ output.innerHTML=""}, timeout);
}
}
//]]>
</script>

<%+openvpn/ovpn_css%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style type="text/css">
<style>
h4
{
white-space: nowrap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- ++ BEGIN ++ Privoxy ++ detail_logview.htm ++ -->
<script type="text/javascript">//<![CDATA[
<script>
function onclick_logview(section, bottom) {
// get elements
var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea
Expand All @@ -18,7 +18,7 @@
txt.scrollTop = 0; }
);
}
//]]></script>
</script>

<%+cbi/valueheader%>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- ++ BEGIN ++ Privoxy ++ detail_startstop.htm ++ -->
<script type="text/javascript">//<![CDATA[
<script>

// show XHR.poll/XHR.get response on button
function _data2elements(x) {
Expand Down Expand Up @@ -30,7 +30,7 @@
function(x, data) { _data2elements(x); }
);

//]]></script>
</script>

<%+cbi/valueheader%>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- ++ BEGIN ++ Radicale ++ btn_startstop.htm ++ -->
<script type="text/javascript">//<![CDATA[
<script>

// show XHR.poll/XHR.get response on button
function _data2elements(x) {
Expand Down Expand Up @@ -30,7 +30,7 @@
function(x, data) { _data2elements(x); }
);

//]]></script>
</script>

<%+cbi/valueheader%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2 name="content"><%=self.title%></h2>
<%+cbi/apply_widget%>
<% cbi_apply_widget() %>
<div class="alert-message" id="cbi_apply_status" style="display:none"></div>
<script type="text/javascript">
<script>
document.addEventListener("DOMContentLoaded", function() {
<% if confirmmap then -%>
uci_confirm(true, Date.now() + <%=confirmmap%> * 1000);
Expand Down
Loading

0 comments on commit ae8bbb8

Please sign in to comment.