forked from viliusle/miniPaint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
viliusle#228 - Web app manifests (for offline usage)
- Loading branch information
Showing
12 changed files
with
129 additions
and
13 deletions.
There are no files selected for viewing
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "miniPaint", | ||
"short_name": "miniPaint", | ||
"start_url": "/", | ||
"display": "standalone", | ||
"orientation": "landscape", | ||
"background_color": "#666d6f", | ||
"description": "miniPaint is free online image editor using HTML5.", | ||
"icons": [ | ||
{ | ||
"src": "images/manifest/48x48.png", | ||
"sizes": "48x48", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/144x144.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/168x168.png", | ||
"sizes": "168x168", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
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,64 @@ | ||
// use a cacheName for cache versioning | ||
var cacheName = 'v1:static'; | ||
|
||
// during the install phase you usually want to cache static assets | ||
self.addEventListener('install', function(e) { | ||
// once the SW is installed, go ahead and fetch the resources to make this work offline | ||
e.waitUntil( | ||
caches.open(cacheName).then(function(cache) { | ||
return cache.addAll([ | ||
'./', | ||
'./dist/bundle.js', | ||
'./images/favicon.png', | ||
'./images/logo.svg', | ||
'./images/logo-colors.png', | ||
'./images/icons/animation.svg', | ||
'./images/icons/blur.svg', | ||
'./images/icons/bold.svg', | ||
'./images/icons/brush.svg', | ||
'./images/icons/bulge_pinch.svg', | ||
'./images/icons/clone.svg', | ||
'./images/icons/crop.svg', | ||
'./images/icons/delete.svg', | ||
'./images/icons/desaturate.svg', | ||
'./images/icons/erase.svg', | ||
'./images/icons/external.png', | ||
'./images/icons/fill.svg', | ||
'./images/icons/gradient.png', | ||
'./images/icons/grid.png', | ||
'./images/icons/italic.svg', | ||
'./images/icons/magic_erase.svg', | ||
'./images/icons/media.svg', | ||
'./images/icons/menu.svg', | ||
'./images/icons/pencil.svg', | ||
'./images/icons/pick_color.svg', | ||
'./images/icons/refresh.svg', | ||
'./images/icons/select.svg', | ||
'./images/icons/selection.svg', | ||
'./images/icons/shape.svg', | ||
'./images/icons/sharpen.svg', | ||
'./images/icons/strikethrough.svg', | ||
'./images/icons/text.svg', | ||
'./images/icons/underline.svg', | ||
'./images/icons/view.svg' | ||
]).then(function() { | ||
self.skipWaiting(); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
// when the browser fetches a url | ||
self.addEventListener('fetch', function(event) { | ||
// either respond with the cached object or go ahead and fetch the actual url | ||
event.respondWith( | ||
caches.match(event.request).then(function(response) { | ||
if (response) { | ||
// retrieve from cache | ||
return response; | ||
} | ||
// fetch as normal | ||
return fetch(event.request); | ||
}) | ||
); | ||
}); |
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