diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/data-h2.sql | 1 | ||||
-rw-r--r-- | src/main/resources/static/sw.js | 47 | ||||
-rw-r--r-- | src/main/resources/templates/layouts/default.html | 4 |
3 files changed, 3 insertions, 49 deletions
diff --git a/src/main/resources/data-h2.sql b/src/main/resources/data-h2.sql index 818575e9..72615485 100644 --- a/src/main/resources/data-h2.sql +++ b/src/main/resources/data-h2.sql @@ -1,6 +1,7 @@ INSERT INTO users(id, nick, passw) VALUES(0, 'Anonymous', 'password'); INSERT INTO users(id, nick, passw) VALUES(2, 'juick', 'password'); INSERT INTO users(id, nick, passw) VALUES(5, 'archive', 'password'); +INSERT INTO telegram(user_id, tg_id) VALUES(5, '1'); INSERT INTO reactions (like_id, description) VALUES (1, 'like'); INSERT INTO reactions (like_id, description) VALUES (2, 'love'); INSERT INTO reactions (like_id, description) VALUES (3, 'lol'); diff --git a/src/main/resources/static/sw.js b/src/main/resources/static/sw.js deleted file mode 100644 index a64de7cc..00000000 --- a/src/main/resources/static/sw.js +++ /dev/null @@ -1,47 +0,0 @@ -/// <reference no-default-lib="true"/> -/// <reference lib="esnext" /> -/// <reference lib="WebWorker" /> - -var sw = /** @type {ServiceWorkerGlobalScope & typeof self} */ (self) -sw.addEventListener('install', function() { - sw.skipWaiting() -}) -sw.addEventListener('activate', function() { - sw.clients.claim() -}) -sw.addEventListener('push', function(evt) { - if (evt.data) { - const data = evt.data.json() - console.log('Push', data) - if (data.body) { - sw.registration.showNotification(data.title, { - body: data.body, - icon: data.custom.message.user.avatar, - tag: data.tag, - data: data.custom.message - }) - } - } -}) -sw.addEventListener('notificationclick', function(evt) { - evt.waitUntil( - sw.clients.matchAll().then(function(clientList) { - const message = evt.notification.data - const url = message.mid - ? message.rid - ? `https://juick.com/m/${message.mid}#${message.rid}` - : `https://juick.com/m/${message.mid}` - : 'https://juick.com/pm/inbox' - if (clientList.length > 0) { - for (var i = 0; i < clientList.length; i++) { - if (clientList[i].url === url) { - return clientList[i].focus() - } - } - clientList[0].navigate(url) - return clientList[0].focus() - } - return sw.clients.openWindow(url) - }) - ) -}) diff --git a/src/main/resources/templates/layouts/default.html b/src/main/resources/templates/layouts/default.html index 3b936e07..cb12ce38 100644 --- a/src/main/resources/templates/layouts/default.html +++ b/src/main/resources/templates/layouts/default.html @@ -16,7 +16,7 @@ <meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" /> <meta name="theme-color" content="#383838" media="(prefers-color-scheme: dark)" /> - <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="web-app-capable" content="yes" /> <link rel="apple-touch-icon" sizes="57x57" href="//i.juick.com/apple-icon-57x57.png" /> <link rel="apple-touch-icon" sizes="60x60" href="//i.juick.com/apple-icon-60x60.png" /> <link rel="apple-touch-icon" sizes="72x72" href="//i.juick.com/apple-icon-72x72.png" /> @@ -29,7 +29,7 @@ <link rel="icon" type="image/png" sizes="32x32" href="//i.juick.com/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="96x96" href="//i.juick.com/favicon-96x96.png" /> <link rel="icon" type="image/png" sizes="16x16" href="//i.juick.com/favicon-16x16.png" /> - <link rel="manifest" href="//i.juick.com/manifest.json" /> + <link rel="manifest" href="//i.juick.com/juick.webmanifest" /> </head> <body id="body"> |