Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: replace HTML5Validator by proof-html #37

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: HTML5Validator
uses: Cyb3r-Jak3/html5validator-action@master
- name: Validate HTML
uses: anishathalye/proof-html@v2
with:
root: www/
css: true
directory: www/

- uses: actions/setup-node@v4
with:
Expand Down
12 changes: 8 additions & 4 deletions www/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ header {
font-weight: 500;
width: 100%;
z-index: 1100;
box-shadow: 0em 0.125em 0.25em -0.06em rgba(0, 0, 0, 0.2),
box-shadow:
0em 0.125em 0.25em -0.06em rgba(0, 0, 0, 0.2),
0em 0.25em 0.3em 0em rgba(0, 0, 0, 0.14),
0em 0.06em 0.625em 0em rgba(0, 0, 0, 0.12);
}
Expand Down Expand Up @@ -119,7 +120,8 @@ header > div {
.container > div {
padding: 0.625em 20px;
text-align: left;
box-shadow: 0em 0.06em 0.19em 0em rgba(0, 0, 0, 0.2),
box-shadow:
0em 0.06em 0.19em 0em rgba(0, 0, 0, 0.2),
0em 0.06em 0.06em 0em rgba(0, 0, 0, 0.14),
0em 0.125em 0.06em -0.06em rgba(0, 0, 0, 0.12);
border-radius: 0.25em;
Expand Down Expand Up @@ -212,7 +214,8 @@ header > div {
letter-spacing: 0.05em;
display: inline-flex;
align-items: center;
box-shadow: 0em 0.06em 0.3em 0em rgba(0, 0, 0, 0.2),
box-shadow:
0em 0.06em 0.3em 0em rgba(0, 0, 0, 0.2),
0em 0.125em 0.125em 0em rgba(0, 0, 0, 0.14),
0em 0.19em 0.06em -0.125em rgba(0, 0, 0, 0.12);
color: #fff;
Expand Down Expand Up @@ -321,7 +324,8 @@ header > div {
letter-spacing: 0.05em;
display: inline-flex;
align-items: center;
box-shadow: 0em 0.06em 0.3em 0em rgba(0, 0, 0, 0.2),
box-shadow:
0em 0.06em 0.3em 0em rgba(0, 0, 0, 0.2),
0em 0.125em 0.125em 0em rgba(0, 0, 0, 0.14),
0em 0.19em 0.06em -0.125em rgba(0, 0, 0, 0.12);
color: #fff;
Expand Down
20 changes: 10 additions & 10 deletions www/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OpenWrt Firmware Selector</title>
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="index.css">
<link rel="icon" href="favicon.ico" />
<link rel="stylesheet" href="index.css" />
<script src="config.js"></script>
<script src="index.js"></script>
</head>
Expand All @@ -15,7 +15,7 @@
<header>
<div>
<a href="https://openwrt.org">
<img src="logo.svg" width="180" alt="Logo">
<img src="logo.svg" width="180" alt="Logo" />
</a>
<div style="flex-grow: 1"></div>

Expand Down Expand Up @@ -94,7 +94,7 @@ <h2 class="tr-load">Download OpenWrt Firmware for your Device</h2>
spellcheck="false"
autocapitalize="off"
autofocus
>
/>
<select id="versions" size="1"></select>
</div>

Expand Down Expand Up @@ -127,9 +127,9 @@ <h3 id="build-title" class="tr-version-build">About this build</h3>
<div class="row">
<div class="col1 tr-links">Links</div>
<div class="col2">
<a id="image-folder"></a>
<a id="image-info"></a>
<a id="image-link"></a>
<a id="image-folder" href="#"></a>
<a id="image-info" href="#"></a>
<a id="image-link" href="#"></a>
</div>
</div>
<div class="row">
Expand Down
36 changes: 20 additions & 16 deletions www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function buildAsuRequest(request_hash) {
showStatus(
`tr-${mobj.imagebuilder_status || "init"}`,
true,
"info"
"info",
);
setTimeout(buildAsuRequest.bind(null, mobj.request_hash), 5000);
});
Expand Down Expand Up @@ -187,8 +187,8 @@ function setupSelectList(select, items, onselection) {
(a + (a.indexOf("-") < 0 ? "-Z" : "")).localeCompare(
b + (b.indexOf("-") < 0 ? "-Z" : ""),
undefined,
{ numeric: true }
)
{ numeric: true },
),
);

for (const item of items) {
Expand Down Expand Up @@ -498,7 +498,7 @@ function createLink(mobj, image, image_url) {
}

return htmlToElement(
`<td><a href="${href}" class="download-link"><span></span>${label.toUpperCase()}</a></td>`
`<td><a href="${href}" class="download-link"><span></span>${label.toUpperCase()}</a></td>`,
);
}

Expand All @@ -517,7 +517,7 @@ function createExtra(image) {
(image.sha256
? `<div class="hash-content">sha256sum: ${image.sha256}</div>`
: "") +
"</td>"
"</td>",
);
}

Expand Down Expand Up @@ -564,7 +564,7 @@ function updateImages(mobj) {
.replace("{title}", encodeURI($("#models").value))
.replace("{target}", mobj.target)
.replace("{id}", mobj.id)
.replace("{version}", mobj.version_number)
.replace("{version}", mobj.version_number),
);

setValue(
Expand All @@ -575,7 +575,7 @@ function updateImages(mobj) {
"&target=" +
encodeURIComponent(mobj.target) +
"&id=" +
encodeURIComponent(mobj.id)
encodeURIComponent(mobj.id),
);

images.sort((a, b) => a.name.localeCompare(b.name));
Expand Down Expand Up @@ -604,7 +604,7 @@ function updateImages(mobj) {

link.onmouseover = function () {
links2.childNodes.forEach((e) =>
e.firstChild.classList.remove("download-link-hover")
e.firstChild.classList.remove("download-link-hover"),
);
link.firstChild.classList.add("download-link-hover");

Expand Down Expand Up @@ -633,7 +633,7 @@ function updateImages(mobj) {
"&target=" +
encodeURIComponent(mobj.target) +
"&id=" +
encodeURIComponent(mobj.id)
encodeURIComponent(mobj.id),
);

hide("#notfound");
Expand Down Expand Up @@ -763,7 +763,7 @@ async function init() {
return obj.json();
} else {
// .versions.json is optional
return {versions_list: []}
return { versions_list: [] };
}
})
.then((obj) => {
Expand All @@ -773,7 +773,7 @@ async function init() {
version.localeCompare("19.07.4", undefined, {
numeric: true,
sensitivity: "base",
}) >= 0
}) >= 0,
);

if (config.show_snapshots) {
Expand All @@ -787,8 +787,12 @@ async function init() {
};
});

config.versions ||= upstream_config.versions;
config.default_version ||= upstream_config.default_version;
if (!config.versions) {
config.versions = upstream_config.versions;
}
if (!config.default_version) {
config.default_version = upstream_config.default_version;
}
config.overview_urls = {};
config.image_urls = {};

Expand Down Expand Up @@ -838,7 +842,7 @@ async function init() {
for (let title of getModelTitles(profile.titles)) {
if (title.length == 0) {
console.warn(
`Empty device title for model id: ${profile.target}, ${profile.id}`
`Empty device title for model id: ${profile.target}, ${profile.id}`,
);
continue;
}
Expand All @@ -861,14 +865,14 @@ async function init() {
updateImages,
(selectList) => {
changeModel(version, obj, selectList.value);
}
},
);

// set model when selected version changes
setModel(
obj,
current_device["target"] || url_params.get("target"),
current_device["id"] || url_params.get("id")
current_device["id"] || url_params.get("id"),
);

// trigger update of current selected model
Expand Down
Loading