initial commit

This commit is contained in:
Paul Frazee 2015-06-24 10:41:17 -05:00
commit 7dbf0b46a5
3 changed files with 54 additions and 0 deletions

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

36
index.js Normal file
View File

@ -0,0 +1,36 @@
var app = require('app')
var Tray = require('tray')
var Menu = require('menu')
var shell = require('shell')
var config = require('ssb-config')
// Report crashes to our server.
//require('crash-reporter').start();
var tray
app.on('ready', function ready () {
// start sbot
require('scuttlebot').init(config, function (err, sbot) {
// setup tray icon
tray = new Tray('./icon.png')
var contextMenu = Menu.buildFromTemplate([
{ label: 'Open App', click: onopen },
{ label: 'Quit', click: onquit }
])
tray.setContextMenu(contextMenu)
tray.setToolTip('Secure Scuttlebutt: Running on port 8008')
tray.on('double-clicked', onopen)
function onopen () {
shell.openExternal('http://localhost:8008')
}
function onquit () {
tray = null
sbot.close()
process.exit()
}
})
});

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "electron-scuttlebot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "electron ."
},
"author": "",
"license": "?",
"devDependencies": {
"electron-prebuilt": "^0.28.2"
},
"dependencies": {
"scuttlebot": "^4.2.3",
"ssb-config": "^1.0.3"
}
}