-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/metanomial/ctznry into me…
…tanomial-master
- Loading branch information
Showing
23 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if ('serviceWorker' in navigator) { | ||
window.addEventListener('load', () => | ||
navigator.serviceWorker | ||
.register('/service-worker.js') | ||
.catch(console.error) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"short_name": "CTZN", | ||
"name": "CTZN", | ||
"icons": [ | ||
{ | ||
"src": "/img/favicon.png", | ||
"sizes": "32x32", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/img/icon-144.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/img/icon-192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/img/icon-512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "index.html", | ||
"background_color": "#f9fafb", | ||
"theme_color": "#ffffff", | ||
"display": "standalone" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const CACHE_NAME = 'ctznry-0' | ||
const CACHE_LIST = [ | ||
'/', | ||
'/account', | ||
'/communities', | ||
'/forgot-password', | ||
'/manifest.json', | ||
'/notifications', | ||
'/search', | ||
'/signup', | ||
'/css/common.css', | ||
'/css/fontawesome.css', | ||
'/css/tailwind.css', | ||
'/img/default-user-thumb.jpg', | ||
'/img/favicon.png', | ||
'/img/img-placeholder.png', | ||
'/img/spinner.gif', | ||
'/js/main.build.js', | ||
'/js/signup.build.js', | ||
'/js/user.build.js', | ||
'/js/post.build.js', | ||
'/js/notifications.build.js', | ||
'/js/communities.build.js', | ||
'/js/account.build.js', | ||
'/js/forgot-password.build.js', | ||
'/webfonts/fa-brands-400.woff2', | ||
'/webfonts/fa-regular-400.woff2', | ||
'/webfonts/fa-solid-900.woff2' | ||
] | ||
|
||
async function install () { | ||
const cache = await caches.open(CACHE_NAME) | ||
cache.addAll(CACHE_LIST) | ||
} | ||
|
||
async function activate () { | ||
|
||
// Delete old caches | ||
const keyList = await caches.keys() | ||
const cacheDeletions = keyList | ||
.filter(key => key != CACHE_NAME) | ||
.map(key => caches.delete(key)) | ||
await Promise.all(cacheDeletions) | ||
} | ||
|
||
async function cacheFetch (event) { | ||
|
||
// Attempt response from cache | ||
const cachedResponse = await caches.match(event.request) | ||
if (cachedResponse) return cachedResponse | ||
|
||
// Fetch over network | ||
return fetch(event.request) | ||
} | ||
|
||
self.addEventListener('install', event => { | ||
event.waitUntil(install()) | ||
}) | ||
|
||
self.addEventListener('activate', event => { | ||
event.waitUntil(activate()) | ||
}) | ||
|
||
self.addEventListener('fetch', event => { | ||
event.respondWith(cacheFetch(event)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters