Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
rebirth in version v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Sep 17, 2016
1 parent 6b59d83 commit a4c8769
Show file tree
Hide file tree
Showing 172 changed files with 1,571 additions and 218 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
@@ -0,0 +1,4 @@
language: node_js
node_js:
- 'node'
install: npm install standard
19 changes: 19 additions & 0 deletions LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2016 Konrad Michalik <hello@konradmichalik.eu>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,4 +4,4 @@ Simple menubar application based on Electron with actual weather information and
## Notes
Using the [openweathermap](http://openweathermap.org/) API and the [Animate.CSS](https://daneden.github.io/animate.css/) library.

![App Screenplay](/screenshot.gif "App Screenshot")
![App Screenplay](/screenshot.gif "App Screenshot")
73 changes: 39 additions & 34 deletions app.js
@@ -1,8 +1,14 @@
'use strict';

const electron = require('electron');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
var electron = require('electron');
var app = electron.app;
var BrowserWindow = electron.BrowserWindow;
var globalShortcut = electron.globalShortcut;
var AutoLaunch = require('auto-launch');
var menubar = require('menubar');
// var ipc = require('ipc');
var ipcMain = electron.ipcMain;
// var Tray = require('tray');

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand All @@ -17,51 +23,50 @@ app.on('window-all-closed', function() {
}
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
//app.on('ready', function() {
// Create the browser window.

// mainWindow = new BrowserWindow({width: 280, height: 500, resizable: false, titleBarStyle: 'hidden'});

// and load the index.html of the app.
// mainWindow.loadURL('file://' + __dirname + '/index.html');

// Open the DevTools.
//mainWindow.webContents.openDevTools();

// Emitted when the window is closed.
// mainWindow.on('closed', function() {
// // Dereference the window object, usually you would store windows
// // in an array if your app supports multi windows, this is the time
// // when you should delete the corresponding element.
// mainWindow = null;
// });
// });


var menubar = require('menubar');

var mb = menubar({
index: 'file://' + __dirname + '/index.html',
icon: __dirname + '/IconTemplate.png',
icon: __dirname + '/assets/IconTemplate@2x.png',
width: 280,
height: 465,
height: 480,
resizable: false,
'show-dock-icon': false,
'preload-window': true,
'transparent': true
});

mb.on('ready', function ready () {
console.log('app is ready');
// your app code here

mb.window.openDevTools();

ipcMain.on('no-title', function(event, args) {
mb.tray.setToolTip('temps');
mb.tray.setTitle('');
mb.tray.setImage(__dirname + '/assets/IconTemplate@2x.png')
});

ipcMain.on('set-title', function(event, args) {
var temperature = Math.round(args.temperature) + '°';
mb.tray.setToolTip(args.location + ' - ' + temperature);
mb.tray.setTitle(temperature);
mb.tray.setImage(__dirname + '/assets/icons/' + args.icon + '@2x.png')
});

ipcMain.on('close', function(event, args) {
app.quit();
});

mb.window.on('will-navigate', function(e, url) {
e.preventDefault();
electron.shell.openExternal(url);
});
});

var AutoLaunch = require('auto-launch');
mb.on('show', function show () {
mb.window.webContents.send('show');
});

var appLauncher = new AutoLaunch({
name: 'My NW.js or Electron app'
name: 'temps'
});

appLauncher.isEnabled().then(function(enabled){
Expand Down
Binary file added assets/IconTemplate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/IconTemplate@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d-5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions assets/icons/01d.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01d@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions assets/icons/01n.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/01n@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions assets/icons/02d.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02d@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/02n-1.png
Binary file added assets/icons/02n-2.png
Binary file added assets/icons/02n-3.png
Binary file added assets/icons/02n-4.png
Binary file added assets/icons/02n.png
19 changes: 19 additions & 0 deletions assets/icons/02n.svg
Binary file added assets/icons/02n@2x.png
Binary file added assets/icons/03d-1.png
Binary file added assets/icons/03d-2.png
Binary file added assets/icons/03d-3.png
Binary file added assets/icons/03d-4.png
Binary file added assets/icons/03d.png
16 changes: 16 additions & 0 deletions assets/icons/03d.svg
Binary file added assets/icons/03d@2x.png
Binary file added assets/icons/03n-1.png
Binary file added assets/icons/03n-2.png
Binary file added assets/icons/03n-3.png
Binary file added assets/icons/03n-4.png
Binary file added assets/icons/03n.png
17 changes: 17 additions & 0 deletions assets/icons/03n.svg
Binary file added assets/icons/03n@2x.png
Binary file added assets/icons/04d-1.png
Binary file added assets/icons/04d-2.png
Binary file added assets/icons/04d-3.png
Binary file added assets/icons/04d-4.png
Binary file added assets/icons/04d.png
18 changes: 18 additions & 0 deletions assets/icons/04d.svg
Binary file added assets/icons/04n-1.png
Binary file added assets/icons/04n-2.png
Binary file added assets/icons/04n-3.png
Binary file added assets/icons/04n-4.png
Binary file added assets/icons/04n.png
19 changes: 19 additions & 0 deletions assets/icons/04n.svg
Binary file added assets/icons/04n@2x.png
Binary file added assets/icons/09d-1.png
Binary file added assets/icons/09d-2.png
Binary file added assets/icons/09d-3.png
Binary file added assets/icons/09d-4.png
Binary file added assets/icons/09d.png
24 changes: 24 additions & 0 deletions assets/icons/09d.svg
Binary file added assets/icons/09d@2x.png
Binary file added assets/icons/09n-1.png
Binary file added assets/icons/09n-2.png
Binary file added assets/icons/09n-3.png
Binary file added assets/icons/09n-4.png
Binary file added assets/icons/09n.png
24 changes: 24 additions & 0 deletions assets/icons/09n.svg
Binary file added assets/icons/09n@2x.png
Binary file added assets/icons/10d-1.png
Binary file added assets/icons/10d-2.png
Binary file added assets/icons/10d-3.png
Binary file added assets/icons/10d-4.png
Binary file added assets/icons/10d.png

0 comments on commit a4c8769

Please sign in to comment.