👽 Use badge instead of webiste icon

This commit is contained in:
Marcel Kapfer 2024-12-10 19:53:47 +01:00
parent 51f6781142
commit 75cfe0952d
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
3 changed files with 6 additions and 5 deletions

View file

@ -13,7 +13,7 @@
<tr> <tr>
<td>Name</td> <td>Name</td>
<td>URL</td> <td>URL</td>
<td>Icon URL</td> <td>Badge Color</td>
<td></td> <td></td>
</tr> </tr>
</thead> </thead>

View file

@ -19,7 +19,7 @@ function buildSpaceElement(app) {
tr.appendChild(buildInputRow("title", app.title)); tr.appendChild(buildInputRow("title", app.title));
tr.appendChild(buildInputRow("url", app.url)); tr.appendChild(buildInputRow("url", app.url));
tr.appendChild(buildInputRow("icon", app.icon)); tr.appendChild(buildInputRow("badgeBackgroundColor", app.badgeBackgroundColor));
const removeTd = document.createElement("td"); const removeTd = document.createElement("td");
const removeButton = document.createElement("button"); const removeButton = document.createElement("button");
@ -46,7 +46,7 @@ function addSpace() {
const newApp = { const newApp = {
title: "", title: "",
url: "", url: "",
icon: "", badgeBackgroundColor: "",
}; };
spaces.appendChild(buildSpaceElement(newApp)); spaces.appendChild(buildSpaceElement(newApp));
} }
@ -66,7 +66,7 @@ async function saveChanges(e) {
name: hashSpaceName(space.querySelector("input[name='url']").value), name: hashSpaceName(space.querySelector("input[name='url']").value),
title: space.querySelector("input[name='title']").value, title: space.querySelector("input[name='title']").value,
url: space.querySelector("input[name='url']").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); apps.push(app);
}); });

View file

@ -20,7 +20,8 @@ async function createSpaces() {
urls.push(app.url); urls.push(app.url);
await browser.spaces.create(app.name, app.url, { await browser.spaces.create(app.name, app.url, {
title: app.title, title: app.title,
defaultIcons: app.icon, badgeText: app.title.substring(0, 2),
badgeBackgroundColor: app.badgeBackgroundColor
}); });
}); });