Bring the full EditmaskwithAI application into the repo under paintplus/ (429 files) so the service is self-contained — the installer copies the vendored source to ~/docker/paintplus/src instead of cloning at runtime. Rename to PaintPlus (service + branding; app logic untouched): - services/editmaskwithai.sh -> services/paintplus.sh (register_service paintplus, install_paintplus, ~/docker/paintplus, Caddy paintplus:8000, Authelia option preserved) - container names -> paintplus across docker-compose*.yml; dev network -> paintplus-network - browser <title> -> "PaintPlus - AI Image Editor"; README heading -> PaintPlus with upstream provenance note - README utilities table: editmaskwithai -> paintplus Backend/frontend code (help strings referencing the old container name, the ai_photo_edit.db filename) is intentionally left as-is to avoid touching application logic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nb2vJ8W7bHKx1JXVvpCraH
69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
|
|
//IMPORTANT - this file is not used !!!
|
|
|
|
|
|
// 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);
|
|
})
|
|
);
|
|
});
|