plugin settings and eyecandy

This commit is contained in:
Olaf
2026-08-25 08:12:39 +02:00
parent f6077f0063
commit 1cba4e8649
7 changed files with 58 additions and 3 deletions
+21 -1
View File
@@ -16,15 +16,35 @@ header h1 {
font-size: 1.2rem;
}
header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 14px;
}
.extension-logo {
display: block;
width: 150px;
height: 42px;
margin-bottom: 14px;
margin-bottom: 0;
object-fit: contain;
object-position: left center;
}
.feed-link {
color: #b4befe;
font-family: 'Asset', 'Avenir Next', sans-serif;
font-size: 0.95rem;
font-weight: 700;
text-decoration: none;
}
.feed-link:hover {
color: #cba6f7;
text-decoration: underline;
}
label {
display: block;
margin-bottom: 12px;
+2 -1
View File
@@ -8,7 +8,8 @@
<body>
<main class="popup-shell">
<header>
<img class="extension-logo" src="logo.svg" alt="LinkLog" />
<img class="extension-logo" src="logo.svg" alt="LinkLog" />
<a id="feed-link" class="feed-link hidden" href="/" target="_blank" rel="noopener noreferrer">LinkLog</a>
</header>
<div id="status" class="status hidden" aria-live="polite"></div>
+14
View File
@@ -6,6 +6,7 @@ const commentInput = document.getElementById('comment');
const openSettingsButton = document.getElementById('open-settings');
const existingTags = document.getElementById('existing-tags');
const newTagsInput = document.getElementById('new-tags');
const feedLink = document.getElementById('feed-link');
function setStatus(message, isError = false) {
statusEl.textContent = message;
@@ -23,6 +24,18 @@ async function getSettings() {
return result;
}
async function updateFeedLink() {
const settings = await browser.storage.local.get(['backendUrl', 'username', 'accessToken']);
if (!settings.backendUrl || !settings.username || !settings.accessToken) return;
try {
const backend = new URL(settings.backendUrl);
feedLink.href = `${backend.origin}/${encodeURIComponent(settings.username)}/`;
feedLink.classList.remove('hidden');
} catch (error) {
feedLink.classList.add('hidden');
}
}
async function loadExistingTags() {
const settings = await getSettings();
if (!settings.backendUrl || !settings.accessToken) {
@@ -128,3 +141,4 @@ openSettingsButton.addEventListener('click', () => browser.runtime.openOptionsPa
form.addEventListener('submit', handleSubmit);
populateCurrentTab();
loadExistingTags();
updateFeedLink();