From a0c2f8fa40208a461ba7549596ac97535f5b4b7c Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 4 Jun 2021 14:58:32 -0400 Subject: [PATCH] move pwa to web static, change desc --- static/pwa/serviceWorker.js | 11 ----------- {static => web/static}/pwa/icon-180.png | Bin {static => web/static}/pwa/icon-192.png | Bin {static => web/static}/pwa/icon-512.png | Bin {static => web/static}/pwa/icon.png | Bin {static => web/static}/pwa/manifest.json | 5 ++--- web/static/pwa/serviceWorker.js | 14 ++++++++++++++ web/webpack.config.js | 6 +++--- 8 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 static/pwa/serviceWorker.js rename {static => web/static}/pwa/icon-180.png (100%) rename {static => web/static}/pwa/icon-192.png (100%) rename {static => web/static}/pwa/icon-512.png (100%) rename {static => web/static}/pwa/icon.png (100%) rename {static => web/static}/pwa/manifest.json (75%) create mode 100644 web/static/pwa/serviceWorker.js diff --git a/static/pwa/serviceWorker.js b/static/pwa/serviceWorker.js deleted file mode 100644 index 4b30ed3e9..000000000 --- a/static/pwa/serviceWorker.js +++ /dev/null @@ -1,11 +0,0 @@ -// register service worker -if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('./serviceWorker.js').then(function(reg) { - // reg.scope must be '/' to allow '/' as start url - }).catch(function(err) { - // console.warn('Error whilst registering service worker', err); - }); -} - -// used to fetch the manifest file -self.addEventListener('fetch', () => {}); diff --git a/static/pwa/icon-180.png b/web/static/pwa/icon-180.png similarity index 100% rename from static/pwa/icon-180.png rename to web/static/pwa/icon-180.png diff --git a/static/pwa/icon-192.png b/web/static/pwa/icon-192.png similarity index 100% rename from static/pwa/icon-192.png rename to web/static/pwa/icon-192.png diff --git a/static/pwa/icon-512.png b/web/static/pwa/icon-512.png similarity index 100% rename from static/pwa/icon-512.png rename to web/static/pwa/icon-512.png diff --git a/static/pwa/icon.png b/web/static/pwa/icon.png similarity index 100% rename from static/pwa/icon.png rename to web/static/pwa/icon.png diff --git a/static/pwa/manifest.json b/web/static/pwa/manifest.json similarity index 75% rename from static/pwa/manifest.json rename to web/static/pwa/manifest.json index d4c244a21..a160dd5be 100644 --- a/static/pwa/manifest.json +++ b/web/static/pwa/manifest.json @@ -4,7 +4,7 @@ "theme_color": "#fa6164", "background_color": "#FAFAFA", "display": "minimal-ui", - "description": "Odysee is a place where you can find great videos, music, ebooks, and more: imagine a vast digital library that is available on all of your devices.", + "description": "Launch your own channel | Watch and share videos", "scope": "/", "start_url": "/", "icons": [ @@ -17,8 +17,7 @@ "src": "/public/pwa/icon-512.png", "type": "image/png", "sizes": "512x512" - } - , + }, { "src": "/public/pwa/icon-180.png", "type": "image/png", diff --git a/web/static/pwa/serviceWorker.js b/web/static/pwa/serviceWorker.js new file mode 100644 index 000000000..f2565b0ff --- /dev/null +++ b/web/static/pwa/serviceWorker.js @@ -0,0 +1,14 @@ +// register service worker +if ('serviceWorker' in navigator) { + navigator.serviceWorker + .register('./serviceWorker.js') + .then(function (reg) { + // reg.scope must be '/' to allow '/' as start url + }) + .catch(function (err) { + // console.warn('Error whilst registering service worker', err); + }); +} + +// used to fetch the manifest file +self.addEventListener('fetch', () => {}); diff --git a/web/webpack.config.js b/web/webpack.config.js index 8435d8ca2..cef25eac2 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -15,6 +15,7 @@ const CUSTOM_ROOT = path.resolve(__dirname, '../custom/'); const STATIC_ROOT = path.resolve(__dirname, '../static/'); const UI_ROOT = path.resolve(__dirname, '../ui/'); const DIST_ROOT = path.resolve(__dirname, 'dist/'); +const WEB_STATIC_ROOT = path.resolve(__dirname, 'static/'); const WEB_PLATFORM_ROOT = __dirname; const isProduction = process.env.NODE_ENV === 'production'; const hasSentryToken = process.env.SENTRY_AUTH_TOKEN !== undefined; @@ -58,12 +59,11 @@ const copyWebpackCommands = [ to: `${DIST_ROOT}/public/font/`, }, { - from: `${STATIC_ROOT}/pwa/`, + from: `${WEB_STATIC_ROOT}/pwa/`, to: `${DIST_ROOT}/public/pwa/`, }, - // move serviceWorker to directory root { - from: `${STATIC_ROOT}/pwa/serviceWorker.js`, + from: `${WEB_STATIC_ROOT}/pwa/serviceWorker.js`, to: `${DIST_ROOT}/`, }, ];