mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +00:00
add update button to menu when an update is available
This commit is contained in:
parent
c6a7fa4e7d
commit
75be983c23
2 changed files with 9 additions and 4 deletions
|
|
@ -321,6 +321,11 @@ hookCoverChange(false);
|
|||
document.querySelector(".main-userWidget-box").append(upd)
|
||||
upd.append(`Theme UPD v${data.tag_name} avail.`)
|
||||
upd.setAttribute("title", `Changes: ${data.name}`)
|
||||
DribbblishShared.configButton.addItem(
|
||||
new Spicetify.Menu.Item("Update", false, (self) => {
|
||||
window.open("https://github.com/JulienMaille/dribbblish-dynamic-theme#install", "_blank");
|
||||
})
|
||||
);
|
||||
}
|
||||
}).catch(err => {
|
||||
// Do something for an error here
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
// Hide popover message
|
||||
// document.getElementById("popover-container").style.height = 0;
|
||||
const DribbblishShared = {
|
||||
configMenu: new Spicetify.Menu.SubMenu("Dribbblish", []),
|
||||
configButton: new Spicetify.Menu.SubMenu("Dribbblish", []),
|
||||
config: {
|
||||
register: (name, key, defaultValue, update) => {
|
||||
const menuItem = new Spicetify.Menu.Item(name, defaultValue, (self) => {
|
||||
self.setState(!self.isEnabled);
|
||||
DribbblishShared.config.toggle(key);
|
||||
});
|
||||
DribbblishShared.configMenu.addItem(menuItem);
|
||||
DribbblishShared.configButton.addItem(menuItem);
|
||||
|
||||
if (localStorage.getItem(`dribbblish:config:${key}`) == null) localStorage.setItem(`dribbblish:config:${key}`, defaultValue);
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ const DribbblishShared = {
|
|||
menuItem.addItem(subItem);
|
||||
return subItem;
|
||||
});
|
||||
DribbblishShared.configMenu.addItem(menuItem);
|
||||
DribbblishShared.configButton.addItem(menuItem);
|
||||
menuItem.register();
|
||||
|
||||
if (localStorage.getItem(`dribbblish:config:${key}`) == null) localStorage.setItem(`dribbblish:config:${key}`, defaultChoice);
|
||||
|
|
@ -81,7 +81,7 @@ const DribbblishShared = {
|
|||
},
|
||||
configData: {}
|
||||
};
|
||||
DribbblishShared.configMenu.register();
|
||||
DribbblishShared.configButton.register();
|
||||
|
||||
// Initialize Config
|
||||
DribbblishShared.config.register("Right expanded cover", "rightBigCover", true, (value) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue