SCSS refactor, theme cleanup

This commit is contained in:
Alex Janousek
2025-11-05 09:24:31 -05:00
parent 1566c70027
commit 937417480e
33 changed files with 269 additions and 223 deletions

View File

@@ -228,9 +228,9 @@
var userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
var url = type === 'service'
? `/services/${currentServiceId}/daily-stats.json?timezone=${encodeURIComponent(userTimezone)}`
: `/services/${currentServiceId}/daily-stats-by-user.json?timezone=${encodeURIComponent(userTimezone)}`;
var url = (type === 'service' ?
`/services/${currentServiceId}/daily-stats.json?timezone=${encodeURIComponent(userTimezone)}` :
`/services/${currentServiceId}/daily-stats-by-user.json?timezone=${encodeURIComponent(userTimezone)}`);
try {
const response = await fetch(url);
@@ -292,20 +292,20 @@
}
};
function startPolling() {
var startPolling = function() {
fetchData(currentType);
pollInterval = setInterval(() => {
fetchData(currentType);
}, POLL_INTERVAL_MS);
}
};
function stopPolling() {
var stopPolling = function() {
if (pollInterval) {
clearInterval(pollInterval);
pollInterval = null;
}
}
};
document.addEventListener('visibilitychange', () => {
if (document.hidden) {

View File

@@ -28,9 +28,9 @@
// Determine button label
const isMultiple = name !== thing;
const buttonLabel = isMultiple
? `Copy ${thing}`
: `Copy ${thing} to clipboard`;
const buttonLabel = (isMultiple ?
`Copy ${thing}` :
`Copy ${thing} to clipboard`);
const srSuffix = isMultiple ? ` for ${name}` : '';
// Create simple HTML structure

View File

@@ -27,10 +27,11 @@
var modules = this.find(container);
for (var i = 0, l = modules.length; i < l; i++) {
var type;
try {
var module;
var element = modules[i];
var type = this.camelCaseAndCapitalise(element.dataset.module);
type = this.camelCaseAndCapitalise(element.dataset.module);
var started = element.dataset.moduleStarted;
if (typeof window.NotifyModules[type] === 'function' && !started) {