mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
test 0.2.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CodeXen</title>
|
||||
<title>CodeXen v0.2.0</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
borderBox()
|
||||
box-sizing border-box
|
||||
|
||||
noSelect()
|
||||
-webkit-user-select none
|
||||
-webkit-app-region drag
|
||||
|
||||
74
main.js
74
main.js
@@ -1,6 +1,7 @@
|
||||
var app = require('app')
|
||||
var BrowserWindow = require('browser-window')
|
||||
var Menu = require('menu')
|
||||
var MenuItem = require('menu-item')
|
||||
var Tray = require('tray')
|
||||
|
||||
require('crash-reporter').start()
|
||||
@@ -10,11 +11,54 @@ var appIcon = null
|
||||
var menu = null
|
||||
var popUpWindow = null
|
||||
|
||||
var update = null
|
||||
|
||||
// app.on('window-all-closed', function () {
|
||||
// if (process.platform !== 'darwin') app.quit()
|
||||
// })
|
||||
|
||||
var version = '0.2.0'
|
||||
var nn = require('node-notifier')
|
||||
var autoUpdater = require('auto-updater')
|
||||
|
||||
autoUpdater
|
||||
.on('error', function (err, message) {
|
||||
nn.notify({
|
||||
title: 'Boost Update Center Ver. ' + version,
|
||||
message: message
|
||||
})
|
||||
})
|
||||
.on('checking-for-update', function () {
|
||||
nn.notify({
|
||||
title: 'Boost Update Center Ver. ' + version,
|
||||
message: 'Hello from Main processor, Mr. User!'
|
||||
})
|
||||
})
|
||||
.on('update-available', function () {
|
||||
nn.notify({
|
||||
title: 'Boost Update Center Ver. ' + version,
|
||||
message: 'Update is available. Starting download latest build...'
|
||||
})
|
||||
})
|
||||
.on('update-not-available', function () {
|
||||
nn.notify({
|
||||
title: 'Boost Update Center Ver. ' + version,
|
||||
message: 'Latest Build :D'
|
||||
})
|
||||
})
|
||||
.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) {
|
||||
nn.notify({
|
||||
title: 'Boost Update Center Ver. ' + version,
|
||||
message: 'Ready to Update: ' + releaseName
|
||||
})
|
||||
update = quitAndUpdate
|
||||
})
|
||||
|
||||
|
||||
app.on('ready', function () {
|
||||
console.log('Version ' + version)
|
||||
autoUpdater.setFeedUrl('http://localhost:8000/testcat/test/latest?version=' + version)
|
||||
autoUpdater.checkForUpdates()
|
||||
// menu start
|
||||
var template = require('./modules/menu-template')
|
||||
|
||||
@@ -24,12 +68,32 @@ app.on('ready', function () {
|
||||
// menu end
|
||||
appIcon = new Tray(__dirname + '/tray-icon.png')
|
||||
appIcon.setToolTip('Codexen')
|
||||
appIcon.on('clicked', function () {
|
||||
if (mainWindow == null) {
|
||||
makeNewMainWindow()
|
||||
|
||||
var trayMenu = new Menu()
|
||||
trayMenu.append(new MenuItem({
|
||||
label: 'Open main window',
|
||||
click: function () {
|
||||
if (mainWindow == null) {
|
||||
makeNewMainWindow()
|
||||
}
|
||||
mainWindow.show()
|
||||
}
|
||||
mainWindow.show()
|
||||
})
|
||||
}))
|
||||
trayMenu.append(new MenuItem({
|
||||
label: 'Update App',
|
||||
click: function () {
|
||||
if (update != null) {
|
||||
update()
|
||||
}
|
||||
}
|
||||
}))
|
||||
trayMenu.append(new MenuItem({
|
||||
label: 'Quit',
|
||||
click: function () {
|
||||
app.quit()
|
||||
}
|
||||
}))
|
||||
appIcon.setContextMenu(trayMenu)
|
||||
|
||||
makeNewMainWindow()
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"description": "CodeXen App",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "npm run serve | npm run dev",
|
||||
"start": "electron ./main.js",
|
||||
"web": "npm run serve | npm run dev",
|
||||
"serve": "./node_modules/.bin/http-server ./browser -p 8080",
|
||||
"dev": "webpack-dev-server --progress --colors --port 8090"
|
||||
},
|
||||
@@ -39,6 +40,7 @@
|
||||
"moment": "^2.10.3",
|
||||
"nib": "^1.1.0",
|
||||
"node-jsx": "^0.13.3",
|
||||
"node-notifier": "^4.2.3",
|
||||
"react": "^0.13.3",
|
||||
"react-router": "^0.13.3",
|
||||
"react-select": "^0.5.4",
|
||||
@@ -58,6 +60,9 @@
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"/browser/ace/"
|
||||
],
|
||||
"global": [
|
||||
"localStorage"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user