Installierbar und Settings bearbeitet
This commit is contained in:
parent
cd917c0f2d
commit
396b651fc5
@ -1 +1 @@
|
|||||||
<div></div>
|
<div><p></div>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<link href="css/foundation.css" media="screen,print" rel="stylesheet" type="text/css">
|
<link href="css/foundation.css" media="screen,print" rel="stylesheet" type="text/css">
|
||||||
<link href="css/wordRotator.css" media="screen,print" rel="stylesheet" type="text/css">
|
<link href="css/wordRotator.css" media="screen,print" rel="stylesheet" type="text/css">
|
||||||
</head>
|
</head>
|
||||||
<body class='blue'>
|
<body class='black'>
|
||||||
|
|
||||||
<div id='print-content'>
|
<div id='print-content'>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4605,15 +4605,15 @@ InitPromise.addPromise(function(app){
|
|||||||
|
|
||||||
class InstallManager {
|
class InstallManager {
|
||||||
static init() {
|
static init() {
|
||||||
console.log("init");
|
|
||||||
window.addEventListener('beforeinstallprompt', e => {
|
window.addEventListener('beforeinstallprompt', e => {
|
||||||
console.log("beforeinstallprompt", e);
|
|
||||||
this.deferredPromt = e;
|
this.deferredPromt = e;
|
||||||
|
e.preventDefault();
|
||||||
if (this.canInstallListener) {
|
if (this.canInstallListener) {
|
||||||
this.canInstallListener(this.deferredPromt);
|
this.canInstallListener(this.deferredPromt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static setCanInstallListener(listener, callIfCanInstall) {
|
static setCanInstallListener(listener, callIfCanInstall) {
|
||||||
this.canInstallListener = listener;
|
this.canInstallListener = listener;
|
||||||
callIfCanInstall = Helper.nonNull(callIfCanInstall, true);
|
callIfCanInstall = Helper.nonNull(callIfCanInstall, true);
|
||||||
@ -4623,10 +4623,8 @@ class InstallManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallManager.init();
|
InstallManager.init();
|
||||||
window.addEventListener("load", () => {
|
|
||||||
console.log("loaded");
|
|
||||||
});
|
|
||||||
|
|
||||||
class Matomo {
|
class Matomo {
|
||||||
|
|
||||||
@ -6802,6 +6800,11 @@ class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
|||||||
let installButton = this.findBy("#install-button");
|
let installButton = this.findBy("#install-button");
|
||||||
installButton.addEventListener("click", () => {
|
installButton.addEventListener("click", () => {
|
||||||
e.prompt();
|
e.prompt();
|
||||||
|
e["userChoice"].then(res => {
|
||||||
|
if (res["outcome"] === 'accepted') {
|
||||||
|
installButton.classList.add("hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
installButton.classList.remove("hidden");
|
installButton.classList.remove("hidden");
|
||||||
});
|
});
|
||||||
|
|||||||
@ -10,15 +10,15 @@ class DelayPromise extends Promise {
|
|||||||
|
|
||||||
class InstallManager {
|
class InstallManager {
|
||||||
static init() {
|
static init() {
|
||||||
console.log("init");
|
|
||||||
window.addEventListener('beforeinstallprompt', e => {
|
window.addEventListener('beforeinstallprompt', e => {
|
||||||
console.log("beforeinstallprompt", e);
|
|
||||||
this.deferredPromt = e;
|
this.deferredPromt = e;
|
||||||
|
e.preventDefault();
|
||||||
if (this.canInstallListener) {
|
if (this.canInstallListener) {
|
||||||
this.canInstallListener(this.deferredPromt);
|
this.canInstallListener(this.deferredPromt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static setCanInstallListener(listener, callIfCanInstall) {
|
static setCanInstallListener(listener, callIfCanInstall) {
|
||||||
this.canInstallListener = listener;
|
this.canInstallListener = listener;
|
||||||
callIfCanInstall = Helper.nonNull(callIfCanInstall, true);
|
callIfCanInstall = Helper.nonNull(callIfCanInstall, true);
|
||||||
@ -28,10 +28,8 @@ class InstallManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallManager.init();
|
InstallManager.init();
|
||||||
window.addEventListener("load", () => {
|
|
||||||
console.log("loaded");
|
|
||||||
});
|
|
||||||
|
|
||||||
class Matomo {
|
class Matomo {
|
||||||
|
|
||||||
|
|||||||
@ -1 +1,3 @@
|
|||||||
<div></div>
|
<div>
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
@ -65,6 +65,11 @@ export class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
|||||||
let installButton = this.findBy("#install-button");
|
let installButton = this.findBy("#install-button");
|
||||||
installButton.addEventListener("click", () => {
|
installButton.addEventListener("click", () => {
|
||||||
e.prompt();
|
e.prompt();
|
||||||
|
e["userChoice"].then(res => {
|
||||||
|
if (res["outcome"] === 'accepted') {
|
||||||
|
installButton.classList.add("hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
installButton.classList.remove("hidden");
|
installButton.classList.remove("hidden");
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user