snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit aea121ca93771eec5601813f7c6ac4ce0380d89e
parent 82de30525be720083020c53a676f79e5f49c6d55
Author: RobinLinus <robinlinus@users.noreply.github.com>
Date:   Wed, 13 Mar 2019 01:21:44 +0100

Cleanup

Diffstat:
Mclient/manifest.json | 13+++++++------
Mclient/scripts/ui.js | 20+++++++++++---------
2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/client/manifest.json b/client/manifest.json @@ -5,20 +5,20 @@ "src": "images/favicon-96x96.png", "sizes": "96x96", "type": "image/png" - }, { + },{ "src": "images/apple-touch-icon.png", "sizes": "152x152", "type": "image/png" - }, { + },{ "src": "images/mstile-150x150.png", "sizes": "144x144", "type": "image/png" - }, { + },{ "src": "images/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" - }, { - "src": "logo_transparent_white_512x512.png", + },{ + "src": "images/logo_transparent_white_512x512.png", "sizes": "512x512", "type": "image/png" }], @@ -26,4 +26,4 @@ "start_url": "/", "display": "minimal-ui", "theme_color": "#3367d6" -} +} +\ No newline at end of file diff --git a/client/scripts/ui.js b/client/scripts/ui.js @@ -361,7 +361,7 @@ class Notifications { }); } - _notify(message, body, closeTimeout = 10000) { + _notify(message, body, closeTimeout = 20000) { const config = { body: body, icon: '/images/logo_transparent_128x128.png', @@ -376,8 +376,8 @@ class Notifications { } // Notification is persistent on Android. We have to close it manually - if(closeTimeout){ - setTimeout( _ => notification.close(), closeTimeout); + if (closeTimeout) { + setTimeout(_ => notification.close(), closeTimeout); } return notification; @@ -422,24 +422,25 @@ class Notifications { } -class NetworkStatusUI{ +class NetworkStatusUI { constructor() { window.addEventListener('offline', e => this._showOfflineMessage(), false); window.addEventListener('online', e => this._showOnlineMessage(), false); - if(!navigator.onLine) this._showOfflineMessage(); + if (!navigator.onLine) this._showOfflineMessage(); } - _showOfflineMessage(){ - Events.fire('notify-user','You are offline'); + _showOfflineMessage() { + Events.fire('notify-user', 'You are offline'); } - _showOnlineMessage(){ - Events.fire('notify-user','You are back online'); + _showOnlineMessage() { + Events.fire('notify-user', 'You are back online'); } } + class Snapdrop { constructor() { const server = new ServerConnection(); @@ -452,6 +453,7 @@ class Snapdrop { const toast = new Toast(); const notifications = new Notifications(); const networkStatusUI = new NetworkStatusUI(); + const webShareTargetUI = new WebShareTargetUI(); }) } }