139 lines
5.9 KiB
HTML
139 lines
5.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<!--
|
|
If you are serving your web app in a path other than the root, change the
|
|
href value below to reflect the base path you are serving from.
|
|
|
|
The path provided below has to start and end with a slash "/" in order for
|
|
it to work correctly.
|
|
|
|
For more details:
|
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
-->
|
|
<base href="/">
|
|
|
|
<meta charset="UTF-8">
|
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
|
<meta name="description" content="A new Flutter application.">
|
|
|
|
<!-- iOS meta tags & icons -->
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="apple-mobile-web-app-title" content="manager_app">
|
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
|
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
|
|
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
|
|
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
|
|
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
|
|
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
|
|
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
|
|
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
|
|
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
|
|
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
|
|
<link rel="manifest" href="/manifest.json">
|
|
<meta name="msapplication-TileColor" content="#ffffff">
|
|
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
|
|
<meta name="theme-color" content="#ffffff">
|
|
|
|
<title>MyMuseum - Manager</title>
|
|
<link rel="manifest" href="manifest.json">
|
|
</head>
|
|
<body>
|
|
<!-- This script installs service_worker.js to provide PWA functionality to
|
|
application. For more information, see:
|
|
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
|
<script>
|
|
var serviceWorkerVersion = null;
|
|
var scriptLoaded = false;
|
|
function loadMainDartJs() {
|
|
if (scriptLoaded) {
|
|
return;
|
|
}
|
|
scriptLoaded = true;
|
|
var scriptTag = document.createElement('script');
|
|
scriptTag.src = 'main.dart.js';
|
|
scriptTag.type = 'application/javascript';
|
|
document.body.append(scriptTag);
|
|
}
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
// Service workers are supported. Use them.
|
|
window.addEventListener('load', function () {
|
|
// Wait for registration to finish before dropping the <script> tag.
|
|
// Otherwise, the browser will load the script multiple times,
|
|
// potentially different versions.
|
|
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
|
|
navigator.serviceWorker.register(serviceWorkerUrl)
|
|
.then((reg) => {
|
|
function waitForActivation(serviceWorker) {
|
|
serviceWorker.addEventListener('statechange', () => {
|
|
if (serviceWorker.state == 'activated') {
|
|
console.log('Installed new service worker.');
|
|
loadMainDartJs();
|
|
}
|
|
});
|
|
}
|
|
if (!reg.active && (reg.installing || reg.waiting)) {
|
|
// No active web worker and we have installed or are installing
|
|
// one for the first time. Simply wait for it to activate.
|
|
waitForActivation(reg.installing ?? reg.waiting);
|
|
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
|
|
// When the app updates the serviceWorkerVersion changes, so we
|
|
// need to ask the service worker to update.
|
|
console.log('New service worker available.');
|
|
reg.update();
|
|
waitForActivation(reg.installing);
|
|
} else {
|
|
// Existing service worker is still good.
|
|
console.log('Loading app from service worker.');
|
|
loadMainDartJs();
|
|
}
|
|
});
|
|
|
|
// If service worker doesn't succeed in a reasonable amount of time,
|
|
// fallback to plaint <script> tag.
|
|
setTimeout(() => {
|
|
if (!scriptLoaded) {
|
|
console.warn(
|
|
'Failed to load app from service worker. Falling back to plain <script> tag.',
|
|
);
|
|
loadMainDartJs();
|
|
}
|
|
}, 4000);
|
|
});
|
|
} else {
|
|
// Service workers not supported. Just drop the <script> tag.
|
|
loadMainDartJs();
|
|
}
|
|
</script>
|
|
<script type="module">
|
|
// Import the functions you need from the SDKs you need
|
|
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
|
|
import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-analytics.js";
|
|
// TODO: Add SDKs for Firebase products that you want to use
|
|
// https://firebase.google.com/docs/web/setup#available-libraries
|
|
|
|
// Your web app's Firebase configuration
|
|
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
|
|
const firebaseConfig = {
|
|
apiKey: "AIzaSyCFXuDsslqHiPpK6WTcxdIvTDP3ioaaxp4",
|
|
authDomain: "mymuseum-3b97f.firebaseapp.com",
|
|
projectId: "mymuseum-3b97f",
|
|
storageBucket: "mymuseum-3b97f.appspot.com",
|
|
messagingSenderId: "1034665398515",
|
|
appId: "1:1034665398515:web:688e2a7b3465e621d6a786",
|
|
measurementId: "G-EKKHJLJ1E9"
|
|
};
|
|
|
|
// Initialize Firebase
|
|
const app = initializeApp(firebaseConfig);
|
|
const analytics = getAnalytics(app);
|
|
</script>
|
|
</body>
|
|
</html>
|