Browse Source

changes roach

master
Flo Smilari 4 years ago
parent
commit
2dd8f74417
2 changed files with 53 additions and 8 deletions
  1. 15
    0
      wwwroot/css/app.css
  2. 38
    8
      wwwroot/index.html

+ 15
- 0
wwwroot/css/app.css View File

@@ -313,3 +313,18 @@ div.mat-select.required span#outlined-select-label.mdc-floating-label::after {
opacity: 1;
}
}
.ios-prompt {
background-color: #fcfcfc;
border: 1px solid #666;
display: none;
padding: 0.8rem 1rem 0 0.5rem;
text-decoration: none;
font-size: 16px;
color: #555;
position: absolute;
margin: 0 auto 1rem;
left: 1rem;
right: 1rem;
bottom: 0;
}

+ 38
- 8
wwwroot/index.html View File

@@ -27,17 +27,22 @@
<body>
<app>Loading...</app>
<app>App wird geladen...</app>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
Unbehandelter Fehler ist aufgetreten.
<a href="" class="reload">Neu laden</a>
<a class="dismiss">🗙</a>
</div>
<!-- The actual snackbar -->
<div id="snackbarDiv">
<div id="snackbar">A new version of this app is available. Click <a id="reload" style="color:deepskyblue">here</a> to update. Eventually you have to restart it manually.</div>
<div id="snackbar">Eine neue Version der App ist verfügbar. Klicken Sie <a id="reload" style="color:deepskyblue">hier</a> um die App zu aktualisieren. Eventuell müssen Sie die App neu starten.</div>
</div>
<div class="ios-prompt">
<span style="color: rgb(187, 187, 187); float: right; margin-top: -14px; margin-right: -11px;">&times;</span>
<p style="margin-top: -3px; line-height: 1.3rem;">Um die App auf dem Homebildschirm zu installieren, klicken Sie auf <img src="images/ios-share-icon.png" style="display: inline-block; margin-top: 0px; margin-bottom: 4px; height: 16px; width: auto;"> und dann "Zum Home-Bildschirm".</p>
</div>
<script src="_framework/blazor.webassembly.js"></script>
@@ -129,7 +134,7 @@
}
dotNetObjRef.invokeMethodAsync("GeoLocationPermissionChanged", result.state);
return result.state;
});
return "";
}
@@ -202,7 +207,7 @@
var theEvent = window.event;
var activeElement = document.activeElement;
var regex = new RegExp(activeElement.pattern);
if (!ignoredKeys.includes(key) && !regex.test(activeElement.value + key)) {
if (!ignoredKeys.includes(key) && !regex.test(activeElement.value + key)) {
theEvent.returnValue = false;
if (theEvent.preventDefault) theEvent.preventDefault();
}
@@ -214,8 +219,33 @@
crossorigin="">
</script>
</body>
<!-- ----------------- iOS Support for home screen ----------------- -->
<script>
function showIosInstall() {
let iosPrompt = document.querySelector(".ios-prompt");
iosPrompt.style.display = "block";
iosPrompt.addEventListener("click", () => {
iosPrompt.style.display = "none";
});
}
function iOSInstallerCheck() {
// Detects if device is on iOS
const isIOS = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
return /iphone|ipad|ipod/.test(userAgent);
}
// Detects if device is in standalone mode
const isInStandaloneMode = () => ('standalone' in window.navigator) && (window.navigator.standalone);
// Checks if should display install popup notification:
if (isIOS() && !isInStandaloneMode()) {
showIosInstall();
}
}
iOSInstallerCheck();
</script>
</body>
</html>

Loading…
Cancel
Save