-
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add ReloadModal for when uninstalling extensions,
ESLint
- Loading branch information
1 parent
b4b82ef
commit 843f720
Showing
8 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
let reloadContainer; | ||
|
||
// const MODAL_SUBTITLE = "Reload needed to complete uninstall"; | ||
const MODAL_TITLE = "Reload required"; | ||
|
||
// eslint-disable-next-line no-unused-vars, no-redeclare | ||
function openReloadModal() { | ||
if (reloadContainer) { | ||
Spicetify.PopupModal.display({ | ||
title: MODAL_TITLE, | ||
content: reloadContainer, | ||
}); | ||
return; | ||
} | ||
|
||
reloadContainer = document.createElement("div"); | ||
reloadContainer.id = "marketplace-reload-container"; | ||
|
||
// const optionHeader = document.createElement("h2"); | ||
// optionHeader.innerText = MODAL_SUBTITLE; | ||
|
||
const paragraph = document.createElement("p"); | ||
paragraph.innerText = "A page reload is required to complete uninstall."; | ||
|
||
const buttonContainer = document.createElement("div"); | ||
buttonContainer.classList.add("marketplace-reload-modal__button-container"); | ||
|
||
const okayBtn = document.createElement("button"); | ||
okayBtn.id = "marketplace-reload-okay"; | ||
// TODO: add our own classes for styling? | ||
okayBtn.innerText = "Reload now"; | ||
okayBtn.classList.add("main-buttons-button", "main-button-secondary", "main-playlistEditDetailsModal-save"); | ||
okayBtn.onclick = () => { | ||
Spicetify.PopupModal.hide(); | ||
location.reload(); | ||
}; | ||
|
||
const cancelBtn = document.createElement("button"); | ||
cancelBtn.id = "marketplace-reload-cancel"; | ||
cancelBtn.innerText = "Reload later"; | ||
cancelBtn.classList.add("main-buttons-button", "main-button-secondary", "main-playlistEditDetailsModal-save"); | ||
cancelBtn.onclick = () => { | ||
Spicetify.PopupModal.hide(); | ||
}; | ||
|
||
buttonContainer.append(okayBtn, cancelBtn); | ||
|
||
reloadContainer.append( | ||
paragraph, | ||
buttonContainer, | ||
); | ||
|
||
Spicetify.PopupModal.display({ | ||
title: MODAL_TITLE, | ||
content: reloadContainer, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"OptionsMenu.js", | ||
"SortBox.js", | ||
"TabBar.js", | ||
"Settings.js" | ||
"Settings.js", | ||
"ReloadModal.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters