1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/resources/views/index/index.blade.php

161 lines
4.6 KiB
PHP
Raw Normal View History

<!DOCTYPE html>
2021-08-20 11:04:16 +02:00
<html data-report-errors="{{ $report_errors }}" data-rc="{{ $rc }}" data-build="{{ $build }}">
<head>
2021-08-18 00:04:31 +02:00
<!-- Source: https://github.com/invoiceninja/invoiceninja -->
<!-- Version: {{ config('ninja.app_version') }} -->
<meta charset="UTF-8">
2021-08-18 00:04:31 +02:00
<title>Invoice Ninja</title>
2020-05-11 19:21:23 +02:00
<meta name="google-signin-client_id" content="{{ config('services.google.client_id') }}">
2020-11-13 12:52:11 +01:00
<link rel="manifest" href="manifest.json?v={{ config('ninja.app_version') }}">
2021-07-29 23:36:11 +02:00
<script src="{{ asset('js/pdf.min.js') }}"></script>
<script type="text/javascript">
pdfjsLib.GlobalWorkerOptions.workerSrc = "{{ asset('js/pdf.worker.min.js') }}";
</script>
2021-08-18 00:04:31 +02:00
</head>
<body style="background-color:#888888;">
2020-07-07 00:35:28 +02:00
<style>
2021-08-18 00:04:31 +02:00
/* fix for blurry fonts
flt-glass-pane {
image-rendering: pixelated;
}
*/
2020-07-07 00:35:28 +02:00
/* https://projects.lukehaas.me/css-loaders/ */
.loader,
.loader:before,
.loader:after {
border-radius: 50%;
width: 2.5em;
height: 2.5em;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation: load7 1.8s infinite ease-in-out;
animation: load7 1.8s infinite ease-in-out;
}
.loader {
2021-08-18 00:04:31 +02:00
color: #ffffff;
2020-07-07 00:35:28 +02:00
font-size: 10px;
margin: 80px auto;
position: relative;
text-indent: -9999em;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation-delay: -0.40s;
animation-delay: -0.40s;
}
.loader:before,
.loader:after {
content: '';
position: absolute;
top: 0;
}
.loader:before {
left: -3.5em;
-webkit-animation-delay: -0.80s;
animation-delay: -0.80s;
}
.loader:after {
left: 3.5em;
}
@-webkit-keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
@keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
2021-08-18 00:04:31 +02:00
2020-07-07 00:35:28 +02:00
</style>
2021-08-18 00:04:31 +02:00
<script>
2021-01-04 11:49:28 +01:00
@if (request()->clear_local)
2020-08-18 01:02:17 +02:00
window.onload = function() {
window.localStorage.clear();
}
@endif
2021-08-18 00:04:31 +02:00
2021-08-13 05:26:44 +02:00
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
2021-08-18 00:04:31 +02:00
navigator.serviceWorker.register('flutter_service_worker.js?v={{ config('ninja.app_version') }}');
});
}
document.addEventListener('DOMContentLoaded', function(event) {
document.getElementById('loader').style.display = 'none';
});
function invokeServiceWorkerUpdateFlow() {
// you have a better UI here, reloading is not a great user experince here.
const confirmed = alert('New version of the app is available. Refresh now');
if (confirmed == true) {
window.location.reload();
}
}
async function handleServiceWorker() {
if ('serviceWorker' in navigator) {
// get the ServiceWorkerRegistration instance
const registration = await navigator.serviceWorker.getRegistration();
// (it is also returned from navigator.serviceWorker.register() function)
if (registration) {
// detect Service Worker update available and wait for it to become installed
registration.addEventListener('updatefound', () => {
if (registration.installing) {
// wait until the new Service worker is actually installed (ready to take over)
registration.installing.addEventListener('statechange', () => {
if (registration.waiting) {
// if there's an existing controller (previous Service Worker), show the prompt
if (navigator.serviceWorker.controller) {
invokeServiceWorkerUpdateFlow(registration);
} else {
// otherwise it's the first install, nothing to do
console.log('Service Worker initialized for the first time');
}
2020-11-23 13:55:04 +01:00
}
});
}
2021-08-18 00:04:31 +02:00
});
let refreshing = false;
// detect controller change and refresh the page
navigator.serviceWorker.addEventListener('controllerchange', () => {
if (!refreshing) {
window.location.reload();
refreshing = true;
2020-11-23 13:55:04 +01:00
}
});
2021-08-18 00:04:31 +02:00
}
}
2020-11-23 13:55:04 +01:00
}
2021-08-18 00:04:31 +02:00
handleServiceWorker();
</script>
2021-08-18 00:04:31 +02:00
2021-08-20 11:10:33 +02:00
<script defer src="{{ $path }}?v={{ config('ninja.app_version') }}" type="application/javascript"></script>
2021-08-20 11:04:16 +02:00
2021-08-18 00:04:31 +02:00
2020-07-07 00:35:28 +02:00
<center style="padding-top: 150px" id="loader">
<div class="loader"></div>
</center>
2021-08-18 00:04:31 +02:00
</body>
2020-07-07 00:35:28 +02:00
</html>