content/static: correct indentation in javascript
Fixes a couple whitespace issues and missing semicolons in details.tmpl,
and simplfies a conditional.
Corrects usage of == to ===
CI-Result: Cloud Build
@@ -101,9 +101,9 @@ if (copyButton) {
event.preventDefault();
const input = document.querySelector('#DetailsHeader-path');
input.select();
- document.execCommand("copy");
+ document.execCommand('copy');
input.blur(); // prevents jump to focused element in some browsers
- })
+ });
}
async function latest() {
@@ -112,16 +112,15 @@ async function latest() {
const res = await fetch(url);
if (!res.ok) {
// server-side error; do nothing
- return
- } else {
+ return;
+ }
const latestVersion = await res.json();
- if (latestVersion == latestBadge.getAttribute('data-version')) {
+ if (latestVersion === latestBadge.getAttribute('data-version')) {
latestBadge.classList.add('DetailsHeader-latest');
latestBadge.innerHTML = 'Latest';
} else {
latestBadge.classList.add('DetailsHeader-goToLatest');
- latestBadge.innerHTML = '<a href="/' + latestBadge.getAttribute('data-href') + '">Go to latest</a>'
- }
+ latestBadge.innerHTML = '<a href="/' + latestBadge.getAttribute('data-href') + '">Go to latest</a>';
}
}
