Add files via upload

This commit is contained in:
Kenneth Hendricks 2026-01-25 15:34:37 -05:00 committed by GitHub
parent b9ab108691
commit 39e8c01efa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 208 additions and 14 deletions

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Link-Hervorhebungsfarben anpassen",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Jetzt aktualisieren",
"description": "Update now button text"
},
"updating": {
"message": "Aktualisiere...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "Filterliste erfolgreich aktualisiert!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Aktualisierung fehlgeschlagen. Bitte erneut versuchen.",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Customize link highlighting colors",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Update Now",
"description": "Update now button text"
},
"updating": {
"message": "Updating...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "Filterlist updated successfully!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Update failed. Please try again.",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Personaliza los colores de resaltado de enlaces",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Actualizar ahora",
"description": "Update now button text"
},
"updating": {
"message": "Actualizando...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "¡Lista de filtros actualizada correctamente!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Error en la actualización. Inténtalo de nuevo.",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Personnaliser les couleurs de mise en évidence des liens",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Mettre à jour maintenant",
"description": "Update now button text"
},
"updating": {
"message": "Mise à jour...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "Liste de filtres mise à jour avec succès !",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Échec de la mise à jour. Veuillez réessayer.",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "リンクハイライトの色をカスタマイズ",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "今すぐ更新",
"description": "Update now button text"
},
"updating": {
"message": "更新中...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "フィルターリストが正常に更新されました!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "更新に失敗しました。もう一度お試しください。",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Personalizar cores de destaque de links",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Atualizar agora",
"description": "Update now button text"
},
"updating": {
"message": "Atualizando...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "Lista de filtros atualizada com sucesso!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Falha na atualização. Tente novamente.",
"description": "Filterlist update failed message"
}
}

View file

@ -354,5 +354,21 @@
"welcomeStep3Item5": {
"message": "Настройте цвета подсветки ссылок",
"description": "Welcome step 3 item 5"
},
"updateNow": {
"message": "Обновить сейчас",
"description": "Update now button text"
},
"updating": {
"message": "Обновление...",
"description": "Updating status text"
},
"filterlistUpdated": {
"message": "Список фильтров успешно обновлён!",
"description": "Filterlist update success message"
},
"updateFailed": {
"message": "Ошибка обновления. Попробуйте ещё раз.",
"description": "Filterlist update failed message"
}
}

View file

@ -675,7 +675,7 @@ function checkSiteAndUpdatePageAction(tabId, url) {
async function shouldUpdate() {
try {
const { lastUpdated } = await browserAPI.storage.local.get("lastUpdated");
const { updateFrequency = "daily" } = await browserAPI.storage.sync.get({
const { updateFrequency = "daily" } = await browserAPI.storage.local.get({
updateFrequency: "daily",
});
@ -703,7 +703,7 @@ async function setupUpdateSchedule() {
await browserAPI.alarms.clearAll();
// Get the user's preferred update frequency from storage
const { updateFrequency } = await browserAPI.storage.sync.get({
const { updateFrequency } = await browserAPI.storage.local.get({
updateFrequency: "daily",
});

View file

@ -196,15 +196,9 @@
.update-status {
font-size: 0.875rem;
color: var(--text-secondary);
text-align: right;
padding: 0.5rem 0.75rem;
background: rgba(255, 255, 255, 0.03);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 0.5rem;
margin-top: 1rem;
}
.update-icon {
@ -426,6 +420,63 @@
opacity: 0.95;
}
.update-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-top: 0.75rem;
min-height: 32px;
}
.update-now-btn {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.35rem 0.75rem;
border-radius: 5px;
border: 1px solid var(--section-border);
background: var(--card-bg);
color: var(--text-secondary);
font-family: inherit;
font-size: 0.8rem;
cursor: pointer;
transition: background 0.2s, border-color 0.2s, color 0.2s;
flex-shrink: 0;
}
.update-now-btn svg {
stroke: var(--text-secondary) !important;
}
.update-now-btn svg path {
stroke: inherit;
}
.update-now-btn:hover {
background: rgba(128, 128, 128, 0.15);
border-color: var(--accent-blue);
color: var(--text-primary);
}
.update-now-btn:hover svg {
stroke: var(--text-primary) !important;
}
.update-now-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.update-now-btn.updating svg {
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.btn:active {
transform: translateY(0);
}
@ -522,12 +573,18 @@
</div>
</div>
<div class="update-status" id="updateStatus">
<svg class="update-icon" viewBox="0 0 24 24" width="16" height="16">
<path fill="currentColor"
d="M12 4V2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12H20C20 16.418 16.418 20 12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4Z" />
</svg>
Next update scheduled for: Checking...
<div class="update-row">
<div class="update-status" id="updateStatus">
<svg class="update-icon" viewBox="0 0 24 24" width="16" height="16">
<path fill="currentColor"
d="M12 4V2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12H20C20 16.418 16.418 20 12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4Z" />
</svg>
Next update scheduled for: Checking...
</div>
<button id="updateNowBtn" class="update-now-btn">
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/><path d="M16 16h5v5"/></svg>
<span data-i18n="updateNow">Update Now</span>
</button>
</div>
</div>

View file

@ -15,6 +15,7 @@ document.addEventListener("DOMContentLoaded", () => {
const lastUpdated = document.getElementById("lastUpdated");
const updateStatus = document.getElementById("updateStatus");
const forceRefreshButton = document.getElementById("forceRefresh");
const updateNowBtn = document.getElementById("updateNowBtn");
// Get link highlighting elements
const highlightTrustedToggle = document.getElementById(
@ -441,5 +442,29 @@ document.addEventListener("DOMContentLoaded", () => {
}
});
// Update Now button handler
if (updateNowBtn) {
updateNowBtn.addEventListener("click", async () => {
updateNowBtn.disabled = true;
updateNowBtn.classList.add("updating");
const originalText = updateNowBtn.querySelector("span") || updateNowBtn;
const btnText = updateNowBtn.textContent;
updateNowBtn.querySelector("span").textContent = window.i18n ? window.i18n.getMessage("updating") : "Updating...";
try {
await browserAPI.runtime.sendMessage({ action: "forceUpdate" });
await loadFilterlistStats();
showNotification(window.i18n ? window.i18n.getMessage("filterlistUpdated") : "Filterlist updated successfully!");
} catch (error) {
console.error("Update failed:", error);
showNotification(window.i18n ? window.i18n.getMessage("updateFailed") : "Update failed. Please try again.");
} finally {
updateNowBtn.disabled = false;
updateNowBtn.classList.remove("updating");
updateNowBtn.querySelector("span").textContent = window.i18n ? window.i18n.getMessage("updateNow") : "Update Now";
}
});
}
setInterval(updateNextUpdateStatus, 60000);
});