diff --git a/src/renderer/main/events.js b/src/renderer/main/events.js
index 52191c5d..e0a3c45c 100644
--- a/src/renderer/main/events.js
+++ b/src/renderer/main/events.js
@@ -24,7 +24,7 @@ const Events = {
// CTRL + R
if (event.keyCode === 82 && event.ctrlKey) {
event.preventDefault()
- bootbox.confirm(app.getLz('term.reload'), (res)=>{
+ app.confirm(app.getLz('term.reload'), (res)=>{
if (res) {
window.location.reload()
}
@@ -69,8 +69,8 @@ const Events = {
// Prevent Scrolling on spacebar
if (event.keyCode === 32 && event.target === document.body) {
event.preventDefault()
- app.SpacePause()
-
+ app.SpacePause()
+
}
});
diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js
index a0c7fb55..0c6c02b6 100644
--- a/src/renderer/main/vueapp.js
+++ b/src/renderer/main/vueapp.js
@@ -952,22 +952,22 @@ const app = new Vue({
}
} catch (e) {
localStorage.setItem("playingBitrate", "256")
- }
+ }
if (!app.cfg.audio.normalization) {CiderAudio.hierarchical_loading();}
-
+
}
-
+
if (app.cfg.audio.normalization) {
// get unencrypted audio previews to get SoundCheck's normalization tag
try {
let previewURL = null
try {
- previewURL = app.mk.nowPlayingItem.previewURL
+ previewURL = app.mk.nowPlayingItem.previewURL
} catch (e) {
}
if (previewURL == null && ((app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)) != -1)) {
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/songs/${app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)}`).then((response) => {
- previewURL = response.data.data[0].attributes.previews[0].url
+ previewURL = response.data.data[0].attributes.previews[0].url
if (previewURL)
console.debug("[Cider][MaikiwiSoundCheck] previewURL response.data.data[0].attributes.previews[0].url: " + previewURL)
ipcRenderer.send('getPreviewURL', previewURL)
@@ -1173,7 +1173,7 @@ const app = new Vue({
}
},
unauthorize() {
- bootbox.confirm(app.getLz('term.confirmLogout'), function (result) {
+ this.confirm(app.getLz('term.confirmLogout'), function (result) {
if (result) {
app.mk.unauthorize()
document.location.reload()
@@ -1554,22 +1554,24 @@ const app = new Vue({
},
deletePlaylist(id) {
let self = this
- if (confirm(app.getLz('term.deletePlaylist'))) {
- app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, {}, {
- fetchOptions: {
- method: "DELETE"
- }
- }).then(res => {
- // remove this playlist from playlists.listing if it exists
- let found = self.playlists.listing.find(item => item.id == id)
- if (found) {
- self.playlists.listing.splice(self.playlists.listing.indexOf(found), 1)
- }
- setTimeout(() => {
- app.refreshPlaylists(false, false);
- }, 8000);
- })
- }
+ this.confirm(app.getLz('term.deletePlaylist'), (ok) => {
+ if (ok) {
+ app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, {}, {
+ fetchOptions: {
+ method: "DELETE"
+ }
+ }).then(res => {
+ // remove this playlist from playlists.listing if it exists
+ let found = self.playlists.listing.find(item => item.id == id)
+ if (found) {
+ self.playlists.listing.splice(self.playlists.listing.indexOf(found), 1)
+ }
+ setTimeout(() => {
+ app.refreshPlaylists(false, false);
+ }, 8000);
+ })
+ }
+ });
},
/**
* @param {string} url, href for the initial request
@@ -4624,6 +4626,29 @@ const app = new Vue({
app.mk._services.mediaItemPlayback._currentPlayer._playAssetURL(src, false)
}
}
+ },
+ confirm(message, callback) {
+ bootbox.confirm(this.getBootboxParams(null, message, callback));
+ },
+ prompt(title, callback) {
+ bootbox.prompt(this.getBootboxParams(title, null, callback));
+ },
+ getBootboxParams(title, message, callback) {
+ return {
+ title: title,
+ message: message,
+ buttons: {
+ confirm: {
+ label: app.getLz('dialog.ok'),
+ },
+ cancel: {
+ label: app.getLz('dialog.cancel'),
+ },
+ },
+ callback: function (result) {
+ if (callback) callback(result);
+ },
+ }
}
}
})
diff --git a/src/renderer/views/components/equalizer.ejs b/src/renderer/views/components/equalizer.ejs
index 64acca69..2e7639ca 100644
--- a/src/renderer/views/components/equalizer.ejs
+++ b/src/renderer/views/components/equalizer.ejs
@@ -280,7 +280,7 @@
},
deletePreset() {
let presets = this.$root.cfg.audio.equalizer.presets
- bootbox.confirm(app.getLz('term.deletepreset.warn'), (result) => {
+ app.confirm(app.getLz('term.deletepreset.warn'), (result) => {
if (result) {
this.changePreset("default")
// find the preset by id (preset) and remove it
@@ -351,7 +351,7 @@
},
addPreset() {
let self = this
- bootbox.prompt(app.getLz('term.newpreset.name'), (res) => {
+ app.prompt(app.getLz('term.newpreset.name'), (res) => {
if (res) {
let eqSettings = Clone(app.cfg.audio.equalizer)
let newPreset = new self.eqPreset()
@@ -386,7 +386,7 @@
},
importPreset() {
let self = this
- bootbox.prompt("Enter preset share code", (res) => {
+ app.prompt("Enter preset share code", (res) => {
if (res) {
let preset = JSON.parse(atob(res))
if (preset.frequencies && preset.gain && preset.Q && preset.mix && preset.vibrantBass) {
diff --git a/src/renderer/views/pages/installed-themes.ejs b/src/renderer/views/pages/installed-themes.ejs
index 6a4b2563..dbb99395 100644
--- a/src/renderer/views/pages/installed-themes.ejs
+++ b/src/renderer/views/pages/installed-themes.ejs
@@ -4,7 +4,7 @@
@@ -32,11 +32,11 @@
- -
-
+
{{theme.name}}
@@ -58,13 +58,13 @@
- -
-
+
{{packEntry.name}}
@@ -111,7 +111,7 @@
-
+
`,
props: {
@@ -244,7 +244,7 @@
name: app.getLz("settings.option.visual.theme.uninstall"),
disabled: true,
action: () => {
- bootbox.confirm(app.stringTemplateParser(app.getLz("settings.prompt.visual.theme.uninstallTheme"), {
+ app.confirm(app.stringTemplateParser(app.getLz("settings.prompt.visual.theme.uninstallTheme"), {
theme: theme.name ?? theme.file
}), (res) => {
if (res) {
@@ -317,7 +317,7 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), {
repo: repo.full_name
});
- bootbox.confirm(msg, (res) => {
+ app.confirm(msg, (res) => {
if (res) {
ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) {
@@ -334,7 +334,7 @@
},
installThemeURL() {
let self = this
- bootbox.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
+ app.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
if (result) {
ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) {
diff --git a/src/renderer/views/pages/keybinds.ejs b/src/renderer/views/pages/keybinds.ejs
index 26cc28e8..a8f685de 100644
--- a/src/renderer/views/pages/keybinds.ejs
+++ b/src/renderer/views/pages/keybinds.ejs
@@ -2,11 +2,11 @@
+
+
{{$root.getLz('settings.description.search')}}
@@ -86,7 +86,7 @@
+
{{$root.getLz('settings.description.private')}}
@@ -100,7 +100,7 @@
+
{{$root.getLz('settings.description.remote')}}
@@ -158,7 +158,7 @@
+
{{$root.getLz('term.zoomin')}}
@@ -194,7 +194,7 @@
+
{{$root.getLz('settings.description.developer')}}
@@ -210,7 +210,7 @@
{{$root.getLz('term.reset')}}
-
+
@@ -265,7 +265,7 @@
document.body.removeChild(blur);
clearTimeout(keyBindTimeout);
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
- bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
+ app.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
if (ok) ipcRenderer.invoke("relaunchApp")
})
} else {
@@ -296,7 +296,7 @@
app.cfg.general.keybindings.zoomrst = [app.platform == "darwin" ? "Command" : "Control", "num0"];
app.cfg.general.keybindings.openDeveloperTools = [app.platform == "darwin" ? "Command" : "Control", app.platform == "darwin" ? "Option" : "Shift", "I"];
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
- bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
+ app.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
if (ok) ipcRenderer.invoke("relaunchApp")
})
},
diff --git a/src/renderer/views/pages/plugins-github.ejs b/src/renderer/views/pages/plugins-github.ejs
index 7d207ad3..15a08986 100644
--- a/src/renderer/views/pages/plugins-github.ejs
+++ b/src/renderer/views/pages/plugins-github.ejs
@@ -125,13 +125,13 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.plugin.github.install.confirm'), {
repo: repo.full_name
});
- bootbox.confirm(msg, (res) => {
+ app.confirm(msg, (res) => {
if (res) {
ipcRenderer.once("plugin-installed", (event, arg) => {
if (arg.success) {
self.themes = []
notyf.success(app.getLz('settings.notyf.visual.plugin.install.success'));
- bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
+ app.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if (ok) {
ipcRenderer.invoke("relaunchApp")
} else {
@@ -148,12 +148,12 @@
},
installThemeURL() {
let self = this
- bootbox.prompt(app.getLz('settings.prompt.visual.plugin.github.URL'), (result) => {
+ app.prompt(app.getLz('settings.prompt.visual.plugin.github.URL'), (result) => {
if (result) {
ipcRenderer.once("plugin-installed", (event, arg) => {
if (arg.success) {
self.themes = ipcRenderer.sendSync("get-themes")
- bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
+ app.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if (ok) {
ipcRenderer.invoke("relaunchApp")
} else {
diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs
index 4c2325c2..90e2d7df 100644
--- a/src/renderer/views/pages/settings.ejs
+++ b/src/renderer/views/pages/settings.ejs
@@ -1407,7 +1407,7 @@
}
},
reinstallWidevineCDM() {
- bootbox.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => {
+ app.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => {
if (ok) {
ipcRenderer.invoke("reinstall-widevine-cdm");
}
@@ -1450,7 +1450,7 @@
toggleAudioContext: function () {
if (app.cfg.advanced.AudioContext === true) {
if (navigator.hardwareConcurrency < 6) {
- bootbox.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) {
+ app.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) {
if (result) {
CiderAudio.init();
if (app.cfg.audio.normalization === true) {
@@ -1497,7 +1497,7 @@
},
promptForRelaunch() {
- bootbox.confirm(app.getLz('action.relaunch.confirm'), function (result) {
+ app.confirm(app.getLz('action.relaunch.confirm'), function (result) {
if (result) {
ipcRenderer.send('relaunchApp', '');
}
diff --git a/src/renderer/views/pages/themes-github.ejs b/src/renderer/views/pages/themes-github.ejs
index 95635852..afd9f895 100644
--- a/src/renderer/views/pages/themes-github.ejs
+++ b/src/renderer/views/pages/themes-github.ejs
@@ -146,7 +146,7 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), {
repo: repo.full_name
});
- bootbox.confirm(msg, (res) => {
+ app.confirm(msg, (res) => {
if (res) {
ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) {
@@ -163,7 +163,7 @@
},
installThemeURL() {
let self = this
- bootbox.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
+ app.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
if (result) {
ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) {