Installierbar und Settings bearbeitet
This commit is contained in:
@@ -6756,7 +6756,7 @@ class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
||||
themeNameElem.removeAllChildren().appendChild(Translator.makePersistentTranslation(currentThemeName));
|
||||
this.findBy("#theme-chooser").addEventListener("click", async () => {
|
||||
let newTheme = await (new ChooseThemeDialog()).show();
|
||||
if (Helper.isNotNull(newTheme)){
|
||||
if (Helper.isNotNull(newTheme)) {
|
||||
SettingsManager.getInstance().setSetting("theme", newTheme);
|
||||
ThemeManager.changeCurrentTheme(newTheme);
|
||||
themeNameElem.removeAllChildren().appendChild(Translator.makePersistentTranslation(newTheme));
|
||||
@@ -6772,7 +6772,7 @@ class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
||||
WordRotatorDb.getInstance().removeAll(WordRotatorDb.OBJECT_STORE.LEVEL);
|
||||
});
|
||||
|
||||
if (location.hostname.includes("beta") || location.hostname.includes("127.0.0.1")){
|
||||
if (location.hostname.includes("beta") || location.hostname.includes("127.0.0.1")) {
|
||||
this.findBy("#reset-levels").classList.remove("hidden");
|
||||
}
|
||||
|
||||
@@ -6780,12 +6780,12 @@ class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
||||
playMusicButton.addEventListener("change", () => {
|
||||
let soundManager = SoundManager.getInstance();
|
||||
soundManager.set({muted: !playMusicButton.checked}, SoundManager.CHANNELS.MUSIC);
|
||||
if (playMusicButton.checked){
|
||||
if (playMusicButton.checked) {
|
||||
soundManager.play(SoundManager.CHANNELS.MUSIC);
|
||||
}
|
||||
});
|
||||
|
||||
this.findBy("#track-switch").addEventListener("change", function(e) {
|
||||
this.findBy("#track-switch").addEventListener("change", function (e) {
|
||||
Matomo.setTrack(this.checked === true);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -6798,6 +6798,14 @@ class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
||||
this.getSite().startSite(PrivacyPolicySite);
|
||||
});
|
||||
|
||||
InstallManager.setCanInstallListener((e) => {
|
||||
let installButton =this.findBy("#install-button");
|
||||
installButton.addEventListener("click", () => {
|
||||
e.prompt();
|
||||
});
|
||||
installButton.classList.remove("hidden");
|
||||
});
|
||||
|
||||
return super.onFirstStart();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user