diff --git a/README.md b/README.md index 0f122c7..a442567 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Temps > Temps is a modern and minimal menubar application based on Electron with actual weather information and forecast for Windows, Mac and Linux. -![temps screenshot](assets/screenshot.png) +![temps screenshot](assets/screenshot.jpg) ## Features @@ -29,6 +29,8 @@ Temps * Global shortcut ```Cmd``` + ```Shift``` + ```W``` * Minimal and colorful design +![temps screenshot](assets/screenshot-overview.png) + ## Development ### Run app diff --git a/TODO.md b/TODO.md index 2f4add6..1ff6d82 100644 --- a/TODO.md +++ b/TODO.md @@ -20,16 +20,16 @@ * hourly forecast usability improvement * show weather icon for hourly forecast * Only change icons if data has changed -* Open at startup option +* ~~Open at startup option~~ * Clean up code * forecast graph color bug * outsource configs * Windows menubar icon white -* Open external browser ## v0.6.0 * city autocomplete * auto updates * testing * web demo +* Open external browser * Less, ECMAScript 5 diff --git a/app.js b/app.js index 7b32ab6..321269b 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,8 @@ var Tray = electron.Tray; // be closed automatically when the JavaScript object is garbage collected. var mainWindow = null; +var autoLaunch = true; + // Quit when all windows are closed. app.on('window-all-closed', function() { // On OS X it is common for applications and their menu bar @@ -60,9 +62,6 @@ mb.on('ready', function ready () { console.log('registration failed') } - // Check whether a shortcut is registered. - console.log(globalShortcut.isRegistered('CommandOrControl+Shift+W')); - ipcMain.on('no-title', function(event, args) { mb.tray.setToolTip('temps'); mb.tray.setTitle(''); @@ -84,18 +83,33 @@ mb.on('ready', function ready () { app.quit(); }); - mb.window.on('will-navigate', function(e, url) { - e.preventDefault(); - electron.shell.openExternal(url); + ipcMain.on('auto-launch', function(event, args) { + + // appLauncher.isEnabled() not working for now + console.log(appLauncher.isEnabled()); + if (autoLaunch) { + appLauncher.disable(); + autoLaunch = false; + console.log('disable auto-launch'); + } else { + appLauncher.enable(); + autoLaunch = true; + console.log('enable auto-launch'); + } }); + + //ToDo: open links in external browser + // mb.on('will-navigate', function(e, url) { + // console.log('navigate'); + // e.preventDefault(); + // electron.shell.openExternal(url); + // }); }); mb.on('show', function show () { mb.window.webContents.send('show'); }); - - var appLauncher = new AutoLaunch({ name: 'temps' }); diff --git a/assets/screenshot-overview.png b/assets/screenshot-overview.png new file mode 100644 index 0000000..590a557 Binary files /dev/null and b/assets/screenshot-overview.png differ diff --git a/assets/screenshot.jpg b/assets/screenshot.jpg new file mode 100644 index 0000000..244e48e Binary files /dev/null and b/assets/screenshot.jpg differ diff --git a/index.html b/index.html index d85c2f4..56e1050 100644 --- a/index.html +++ b/index.html @@ -66,17 +66,26 @@

- You need an api key from openweathermap for your weather data. + You need a free api key from openweathermap. -
- Format - °C - °F +
+
Format
+
+ °C + °F +
-
-