Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
96 additions
and
1,396 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,4 @@ RUBY VERSION | |
ruby 2.3.1p112 | ||
|
||
BUNDLED WITH | ||
1.13.2 | ||
1.13.3 |
This file was deleted.
Oops, something went wrong.
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
Empty file.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
footer[role="footer"] | ||
footer[role="contentinfo"] | ||
opacity: 0.6 | ||
margin-left: rhythm(4) | ||
margin-top: rhythm(2) | ||
|
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) { | ||
navigator.serviceWorker.register('/service-worker.js').then(function () { | ||
console.log('ServiceWorker registered successfully'); | ||
}).catch(function (err) { | ||
console.log('Service worker registration failed: ', err); | ||
}); | ||
} |
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,16 @@ | ||
{ | ||
"name": "Ethan Turkeltaub", | ||
"short_name": "Ethan Turkeltaub", | ||
"start_url": ".", | ||
"lang": "en-US", | ||
"display": "browser", | ||
"background_color": "#c7d4be", | ||
"description": "The website of software developer Ethan Turkeltaub.", | ||
"icons": [ | ||
{ | ||
"src": "favicon.png", | ||
"sizes": "50x50", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
const PRECACHE = 'precache-v1'; | ||
const RUNTIME = 'runtime'; | ||
|
||
const PRECACHE_URLS = [ | ||
'assets/application.css', | ||
'index.html', | ||
'./', | ||
]; | ||
|
||
self.addEventListener('install', event => { | ||
event.waitUntil( | ||
caches.open(PRECACHE) | ||
.then(cache => cache.addAll(PRECACHE_URLS)) | ||
.then(self.skipWaiting()) | ||
); | ||
}); | ||
|
||
self.addEventListener('activate', event => { | ||
const currentCaches = [PRECACHE, RUNTIME]; | ||
|
||
event.waitUntil( | ||
caches.keys().then(cacheNames => { | ||
return cacheNames.filter(cacheName => !currentCaches.includes(cacheName)); | ||
}).then(cachesToDelete => { | ||
return Promise.all(cachesToDelete.map(cacheToDelete => { | ||
return caches.delete(cacheToDelete); | ||
})); | ||
}).then(() => self.clients.claim()) | ||
); | ||
}); | ||
|
||
self.addEventListener('fetch', event => { | ||
if (event.request.url.startsWith(self.location.origin)) { | ||
event.respondWith( | ||
caches.match(event.request).then(cachedResponse => { | ||
if (cachedResponse) { | ||
return cachedResponse; | ||
} | ||
|
||
return caches.open(RUNTIME).then(cache => { | ||
return fetch(event.request).then(response => { | ||
return cache.put(event.request, response.clone()).then(() => { | ||
return response; | ||
}); | ||
}); | ||
}); | ||
}) | ||
); | ||
} | ||
}); |
Oops, something went wrong.