[fix] login PWA styling, [add] login local link, [add] home local link
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-10-30 19:23:38 -04:00
parent 5880d3beb6
commit aacf5a7195
11 changed files with 84 additions and 21 deletions

View File

@@ -22,7 +22,7 @@
media="(prefers-color-scheme: dark)"
/>
<title>Book Manager - Offline</title>
<title>Book Manager - Local</title>
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/assets/style.css" />
@@ -32,7 +32,7 @@
<script src="/assets/lib/idb-keyval.js"></script>
<script src="/assets/lib/sw-helper.js"></script>
<script src="/assets/index.js"></script>
<script src="/assets/offline/index.js"></script>
<script src="/assets/local/index.js"></script>
<style>
/* ----------------------------- */
@@ -87,7 +87,7 @@
<body class="bg-gray-100 dark:bg-gray-800">
<div class="flex items-center justify-between w-full h-16">
<h1 class="text-xl font-bold dark:text-white px-6 lg:ml-48">
Offline Documents
Local Documents
</h1>
</div>

View File

@@ -12,8 +12,8 @@ async function handleLoad() {
handleOnlineChange();
// If SW Redirected
if (document.location.pathname !== "/offline")
window.history.replaceState(null, null, "/offline");
if (document.location.pathname !== "/local")
window.history.replaceState(null, null, "/local");
// Create Upload Listener
let uploadButton = document.querySelector("button");

View File

@@ -49,7 +49,7 @@ async function initReader() {
**/
function populateMetadata(data) {
let documentLocation =
data.type == "LOCAL" ? "/offline" : "/documents/" + data.id;
data.type == "LOCAL" ? "/local" : "/documents/" + data.id;
let documentCoverLocation =
data.type == "LOCAL"

View File

@@ -769,6 +769,10 @@ video {
margin-top: 0.5rem;
}
.mt-4 {
margin-top: 1rem;
}
.mt-6 {
margin-top: 1.5rem;
}

View File

@@ -35,7 +35,7 @@ const CACHE_UPDATE_ASYNC = "CACHE_UPDATE_ASYNC";
* Return cache if exists & update cache in background.
**/
const ROUTES = [
{ route: "/offline", type: CACHE_UPDATE_ASYNC },
{ route: "/local", type: CACHE_UPDATE_ASYNC },
{ route: "/reader", type: CACHE_UPDATE_ASYNC },
{ route: "/manifest.json", type: CACHE_UPDATE_ASYNC },
{ route: /^\/assets\//, type: CACHE_UPDATE_ASYNC },
@@ -50,7 +50,7 @@ const ROUTES = [
{
route: /.*/,
type: CACHE_NEVER,
fallback: (event) => caches.match("/offline"),
fallback: (event) => caches.match("/local"),
},
];
@@ -58,10 +58,10 @@ const ROUTES = [
* These are assets that are cached on initial service worker installation.
**/
const PRECACHE_ASSETS = [
// Offline & Reqder Assets
"/offline",
// Offline & Reader Assets
"/local",
"/reader",
"/assets/offline/index.js",
"/assets/local/index.js",
"/assets/reader/index.js",
"/assets/images/no-cover.jpg",
"/assets/reader/readerThemes.css",