From 75cfe0952d41d470c9bfd2f18b7b7ac0d64c8071 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 10 Dec 2024 19:53:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=20Use=20badge=20instead=20of=20web?= =?UTF-8?q?iste=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/options.html | 2 +- options/options.js | 6 +++--- scripts/spaces.mjs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/options/options.html b/options/options.html index 4f2c506..f410971 100644 --- a/options/options.html +++ b/options/options.html @@ -13,7 +13,7 @@ Name URL - Icon URL + Badge Color diff --git a/options/options.js b/options/options.js index 94e2ecc..50fbc3c 100644 --- a/options/options.js +++ b/options/options.js @@ -19,7 +19,7 @@ function buildSpaceElement(app) { tr.appendChild(buildInputRow("title", app.title)); tr.appendChild(buildInputRow("url", app.url)); - tr.appendChild(buildInputRow("icon", app.icon)); + tr.appendChild(buildInputRow("badgeBackgroundColor", app.badgeBackgroundColor)); const removeTd = document.createElement("td"); const removeButton = document.createElement("button"); @@ -46,7 +46,7 @@ function addSpace() { const newApp = { title: "", url: "", - icon: "", + badgeBackgroundColor: "", }; spaces.appendChild(buildSpaceElement(newApp)); } @@ -66,7 +66,7 @@ async function saveChanges(e) { name: hashSpaceName(space.querySelector("input[name='url']").value), title: space.querySelector("input[name='title']").value, url: space.querySelector("input[name='url']").value, - icon: space.querySelector("input[name='icon']").value, + badgeBackgroundColor: space.querySelector("input[name='badgeBackgroundColor']").value, }; apps.push(app); }); diff --git a/scripts/spaces.mjs b/scripts/spaces.mjs index d278cc3..c43e7a5 100644 --- a/scripts/spaces.mjs +++ b/scripts/spaces.mjs @@ -20,7 +20,8 @@ async function createSpaces() { urls.push(app.url); await browser.spaces.create(app.name, app.url, { title: app.title, - defaultIcons: app.icon, + badgeText: app.title.substring(0, 2), + badgeBackgroundColor: app.badgeBackgroundColor }); });