From feba48ffb52ab8bc432da4a75503525e90914705 Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Fri, 10 Dec 2021 16:38:20 +0100 Subject: [PATCH] clickable "update" label --- default-dynamic.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/default-dynamic.js b/default-dynamic.js index ac96a3e..03fe28d 100644 --- a/default-dynamic.js +++ b/default-dynamic.js @@ -1,4 +1,4 @@ -let current = "3.2"; +let current = "3.3"; function waitForElement(els, func, timeout = 100) { const queries = els.map((el) => document.querySelector(el)); @@ -285,8 +285,11 @@ registerCoverListener(); .then((data) => { if (data.tag_name > current) { document.querySelector("#main-topBar-moon-div").classList.add("main-topBarUpdateAvailable"); - document.querySelector("#main-topBar-moon-button").append(`NEW v${data.tag_name} available`); - document.querySelector("#main-topBar-moon-button").setAttribute("title", `Changes: ${data.name}`); + let updateLink = document.createElement("a"); + updateLink.setAttribute("title", `Changes: ${data.name}`); + updateLink.setAttribute("href", "https://github.com/JulienMaille/spicetify-dynamic-theme/releases/latest"); + updateLink.innerHTML = `v${data.tag_name} available`; + document.querySelector("#main-topBar-moon-button").append(updateLink); } }) .catch((err) => {