Format fixes for js with biome.
This commit is contained in:
parent
089a0de6e0
commit
2f6becec53
10 changed files with 28 additions and 36 deletions
|
|
@ -17,15 +17,19 @@
|
|||
form.classList.remove('hidden');
|
||||
|
||||
// Wait for a mouse to move, indicating they are human.
|
||||
document.body.addEventListener('mousemove', activateForm, {once: true});
|
||||
document.body.addEventListener('mousemove', activateForm, { once: true });
|
||||
// Wait for a touch move event, indicating that they are human.
|
||||
document.body.addEventListener('touchmove', activateForm, {once: true});
|
||||
document.body.addEventListener('touchmove', activateForm, { once: true });
|
||||
// A tab or enter key pressed can also indicate they are human.
|
||||
document.body.addEventListener('keydown', function (e) {
|
||||
if ((e.key === 'Tab') || (e.key === 'Enter')) {
|
||||
activateForm();
|
||||
}
|
||||
}, {once: true});
|
||||
document.body.addEventListener(
|
||||
'keydown',
|
||||
function (e) {
|
||||
if (e.key === 'Tab' || e.key === 'Enter') {
|
||||
activateForm();
|
||||
}
|
||||
},
|
||||
{ once: true },
|
||||
);
|
||||
|
||||
// Mark the form as submitted.
|
||||
button.addEventListener('click', () => form.classList.add('js-submitted'));
|
||||
|
|
@ -42,5 +46,4 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@
|
|||
button.addEventListener('click', function () {
|
||||
if (button.getAttribute('data-consent') === 'true') {
|
||||
localStorage.setItem('cookieconsent', 'accept');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
localStorage.setItem('cookieconsent', 'decline');
|
||||
}
|
||||
cookiebanner.classList.remove('js-cookieconsent-open');
|
||||
|
|
@ -37,5 +36,4 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,13 +7,12 @@
|
|||
document.addEventListener('DOMContentLoaded', function () {
|
||||
renderMathInElement(document.body, {
|
||||
delimiters: [
|
||||
{left: '\\[', right: '\\]', display: true}, // block
|
||||
{left: '$$', right: '$$', display: true}, // block
|
||||
{left: '\\(', right: '\\)', display: false}, // inline
|
||||
{left: '$', right: '$', display: false} // inline
|
||||
{ left: '\\[', right: '\\]', display: true }, // block
|
||||
{ left: '$$', right: '$$', display: true }, // block
|
||||
{ left: '\\(', right: '\\)', display: false }, // inline
|
||||
{ left: '$', right: '$', display: false }, // inline
|
||||
],
|
||||
throwOnError: false
|
||||
throwOnError: false,
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
const toggle = document.querySelector('.mobile-nav__toggle');
|
||||
|
||||
function navopen() {
|
||||
nav.dataset.navopen='true';
|
||||
nav.dataset.navopen = 'true';
|
||||
sheet.setAttribute('aria-hidden', 'false');
|
||||
toggle.setAttribute('aria-expanded', 'true');
|
||||
document.body.addEventListener('keydown', closeonesc);
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
if (e.key === 'Escape') {
|
||||
navclose();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Toggle the mobile nav sheet.
|
||||
const toggles = document.querySelectorAll('.mobile-nav__cover, .mobile-nav__toggle');
|
||||
|
|
@ -36,8 +36,7 @@
|
|||
e.preventDefault();
|
||||
if (nav.dataset.navopen) {
|
||||
navclose();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
navopen();
|
||||
}
|
||||
});
|
||||
|
|
@ -56,5 +55,4 @@
|
|||
const lastlink = [].slice.call(links).pop();
|
||||
lastlink.addEventListener('blur', () => toggle.focus());
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -6,5 +6,4 @@
|
|||
(function () {
|
||||
// Add a js class to the html-tag when JavsScript is active.
|
||||
document.querySelector('html').classList.replace('nojs', 'js');
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,5 @@
|
|||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
// Place your code here.
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ import * as params from '@params';
|
|||
document: {
|
||||
id: 'id',
|
||||
index: ['title', 'tags', 'content', 'date'],
|
||||
store: ['title', 'summary', 'date', 'permalink']
|
||||
store: ['title', 'summary', 'date', 'permalink'],
|
||||
},
|
||||
tokenize: 'forward'
|
||||
tokenize: 'forward',
|
||||
});
|
||||
|
||||
function showResults(items) {
|
||||
|
|
@ -42,7 +42,7 @@ import * as params from '@params';
|
|||
const results = index.search({
|
||||
query: query,
|
||||
enrich: true,
|
||||
limit: params.searchLimit
|
||||
limit: params.searchLimit,
|
||||
});
|
||||
const items = {};
|
||||
results.forEach(function (result) {
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@
|
|||
const cells = row.querySelectorAll('td');
|
||||
|
||||
cells.forEach(function (cell, i) {
|
||||
cell.setAttribute('role','cell');
|
||||
cell.setAttribute('role', 'cell');
|
||||
if (headers[i].innerText) {
|
||||
cell.setAttribute('aria-label', headers[i].innerText);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
* A JavaScript file for analytic tracking.
|
||||
*/
|
||||
|
||||
|
||||
import * as params from '@params';
|
||||
|
||||
const cookiebanner = params.cookieConsent;
|
||||
|
|
@ -13,9 +12,8 @@ const matomoTrackingApiUrl = 'https://' + params.piwikTrackerUrl + '/matomo.php'
|
|||
const googleAnalytics = params.GoogleAnalytics;
|
||||
|
||||
if (idSite) {
|
||||
// biome-ignore lint/style/useConst: Google code.
|
||||
// biome-ignore lint/suspicious/noAssignInExpressions: Google code.
|
||||
let _paq = window._paq = window._paq || [];
|
||||
// biome-ignore lint: Google code.
|
||||
let _paq = (window._paq = window._paq || []);
|
||||
|
||||
if (cookiebanner) {
|
||||
_paq.push(['requireConsent']);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
"ignoreUnknown": true,
|
||||
"include": ["assets/**/*.js"],
|
||||
"ignore": ["**/*.min.js", "assets/libs/**/*.js"]
|
||||
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
|
|
@ -34,7 +33,8 @@
|
|||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single"
|
||||
"quoteStyle": "single",
|
||||
"lineWidth": 100
|
||||
},
|
||||
"globals": ["define", "htmx", "jQuery", "Alpine"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue