PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html lang="de-ch">
  3. <head>
  4. <title>Caritas PWA</title>
  5. <base href="/" />
  6. <meta charset="utf-8" />
  7. <meta name="description" content="Caritas PWA, developed by INTEGRATE AG, Switzerland">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes" />
  9. <meta name="apple-mobile-web-app-status-bar" content="#db001b">
  10. <meta name="theme-color" content="#db001b">
  11. <script src="_content/BlazorAnimate/blazorAnimateInterop.js"></script>
  12. <script src="_content/MatBlazor/dist/matBlazor.js"></script>
  13. <link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" />
  14. <link href="css/united/bootstrap.min.css" rel="stylesheet" />
  15. <link href="css/united/_bootswatch.min.css" rel="stylesheet" />
  16. <link href="css/united/_variables.min.css" rel="stylesheet" />
  17. <link href="css/app.css" rel="stylesheet" />
  18. <link href="manifest.json" rel="manifest" />
  19. <link rel="apple-touch-icon" href="icons/icon-60@3x.png" />
  20. <link href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" rel="stylesheet"
  21. integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
  22. crossorigin="" />
  23. </head>
  24. <body>
  25. <app>Loading...</app>
  26. <div id="blazor-error-ui">
  27. An unhandled error has occurred.
  28. <a href="" class="reload">Reload</a>
  29. <a class="dismiss">🗙</a>
  30. </div>
  31. <script src="_framework/blazor.webassembly.js"></script>
  32. <script src="_content/TG.Blazor.IndexedDB/indexedDb.Blazor.js"></script>
  33. <script>
  34. if ('serviceWorker' in navigator) {
  35. navigator.serviceWorker.register('service-worker.js')
  36. .then((reg) => console.log('Service worker registered.', reg))
  37. .catch((err) => console.log('Failed to register Service worker.', err));
  38. }
  39. </script>
  40. <script>
  41. function BlazorSetLocalStorage(key, value) {
  42. localStorage.setItem(key, value);
  43. }
  44. function BlazorGetLocalStorage(key) {
  45. return localStorage.getItem(key);
  46. }
  47. function BlazorRegisterStorageEvent(component) {
  48. window.addEventListener("storage", async e => {
  49. await component.invokeMethodAsync("OnStorageUpdated", e.key);
  50. });
  51. }
  52. function registerOnlineStatusHandler(dotNetObjRef) {
  53. function onlineStatusHandler() {
  54. dotNetObjRef.invokeMethodAsync("SetOnlineStatus", navigator.onLine);
  55. };
  56. onlineStatusHandler();
  57. window.addEventListener("online", onlineStatusHandler);
  58. window.addEventListener("offline", onlineStatusHandler);
  59. }
  60. function RemoveScrollLock(dotNetObjRef) {
  61. document.querySelector("body.mdc-dialog-scroll-lock")?.classList.remove("mdc-dialog-scroll-lock");
  62. }
  63. function MoveCursorToNextInput(dotNetObjRef, key) {
  64. if (key == "Enter" || key == "ArrowRight") {
  65. var activeElement = document.activeElement;
  66. var inputs = getKeyboardFocusableElements();
  67. var arr = Array.prototype.slice.call(inputs)
  68. var index = arr.indexOf(activeElement);
  69. if (index + 1 < arr.length && CanNavigateForward(activeElement, key)) {
  70. activeElement.dispatchEvent(new Event('focusout'));
  71. setTimeout(function () { arr[index + 1].focus(); }, 50);
  72. if (arr[index + 1].localName.includes('input') || arr[index + 1].localName.includes('textarea')) {
  73. setTimeout(function () { arr[index + 1].select(); }, 50);
  74. }
  75. }
  76. }
  77. }
  78. function MoveCursorToPreviousInput(dotNetObjRef) {
  79. var activeElement = document.activeElement;
  80. var inputs = getKeyboardFocusableElements();
  81. var arr = Array.prototype.slice.call(inputs)
  82. var index = arr.indexOf(activeElement);
  83. if (index - 1 >= 0 && CanNavigateBack(activeElement)) {
  84. activeElement.dispatchEvent(new Event('focusout'));
  85. setTimeout(function () { arr[index + 1].focus(); }, 50);
  86. if (arr[index - 1].localName.includes('input') || arr[index - 1].localName.includes('textarea')) {
  87. setTimeout(function () { arr[index - 1].select(); }, 50);
  88. }
  89. }
  90. }
  91. function DispatchKeyboardEvent(dotNetObjRef, key) {
  92. window.dispatchEvent(new KeyboardEvent('keydown', { 'key': key }));
  93. }
  94. function getKeyboardFocusableElements(element = document) {
  95. return [...element.querySelectorAll('input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')]
  96. .filter(el => el.localName !='li' && !el.getAttribute("aria-hidden"))
  97. }
  98. function CanNavigateForward(element, key) {
  99. if (element.getAttribute('class').includes('select') || element.getAttribute('class').includes('button')) {
  100. if (key == "Enter") {
  101. return false;
  102. }
  103. return true;
  104. } else {
  105. return key == "Enter" || element.selectionStart == element.value.length
  106. || (element.selectionStart == 0 && element.selectionEnd == element.value.length);
  107. }
  108. }
  109. function CanNavigateBack(element) {
  110. if (element.getAttribute('class').includes('select') || element.getAttribute('class').includes('button')) {
  111. return true;
  112. } else {
  113. return element.selectionStart == null ||element.selectionStart == 0;
  114. }
  115. }
  116. </script>
  117. <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
  118. integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
  119. crossorigin="">
  120. </script>
  121. </body>
  122. </html>