mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 02:36:36 +00:00
test 0.2.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>CodeXen</title>
|
<title>CodeXen v0.2.0</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
<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()
|
noSelect()
|
||||||
-webkit-user-select none
|
-webkit-user-select none
|
||||||
-webkit-app-region drag
|
-webkit-app-region drag
|
||||||
|
|
||||||
74
main.js
74
main.js
@@ -1,6 +1,7 @@
|
|||||||
var app = require('app')
|
var app = require('app')
|
||||||
var BrowserWindow = require('browser-window')
|
var BrowserWindow = require('browser-window')
|
||||||
var Menu = require('menu')
|
var Menu = require('menu')
|
||||||
|
var MenuItem = require('menu-item')
|
||||||
var Tray = require('tray')
|
var Tray = require('tray')
|
||||||
|
|
||||||
require('crash-reporter').start()
|
require('crash-reporter').start()
|
||||||
@@ -10,11 +11,54 @@ var appIcon = null
|
|||||||
var menu = null
|
var menu = null
|
||||||
var popUpWindow = null
|
var popUpWindow = null
|
||||||
|
|
||||||
|
var update = null
|
||||||
|
|
||||||
// app.on('window-all-closed', function () {
|
// app.on('window-all-closed', function () {
|
||||||
// if (process.platform !== 'darwin') app.quit()
|
// 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 () {
|
app.on('ready', function () {
|
||||||
|
console.log('Version ' + version)
|
||||||
|
autoUpdater.setFeedUrl('http://localhost:8000/testcat/test/latest?version=' + version)
|
||||||
|
autoUpdater.checkForUpdates()
|
||||||
// menu start
|
// menu start
|
||||||
var template = require('./modules/menu-template')
|
var template = require('./modules/menu-template')
|
||||||
|
|
||||||
@@ -24,12 +68,32 @@ app.on('ready', function () {
|
|||||||
// menu end
|
// menu end
|
||||||
appIcon = new Tray(__dirname + '/tray-icon.png')
|
appIcon = new Tray(__dirname + '/tray-icon.png')
|
||||||
appIcon.setToolTip('Codexen')
|
appIcon.setToolTip('Codexen')
|
||||||
appIcon.on('clicked', function () {
|
|
||||||
if (mainWindow == null) {
|
var trayMenu = new Menu()
|
||||||
makeNewMainWindow()
|
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()
|
makeNewMainWindow()
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"description": "CodeXen App",
|
"description": "CodeXen App",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"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",
|
"serve": "./node_modules/.bin/http-server ./browser -p 8080",
|
||||||
"dev": "webpack-dev-server --progress --colors --port 8090"
|
"dev": "webpack-dev-server --progress --colors --port 8090"
|
||||||
},
|
},
|
||||||
@@ -39,6 +40,7 @@
|
|||||||
"moment": "^2.10.3",
|
"moment": "^2.10.3",
|
||||||
"nib": "^1.1.0",
|
"nib": "^1.1.0",
|
||||||
"node-jsx": "^0.13.3",
|
"node-jsx": "^0.13.3",
|
||||||
|
"node-notifier": "^4.2.3",
|
||||||
"react": "^0.13.3",
|
"react": "^0.13.3",
|
||||||
"react-router": "^0.13.3",
|
"react-router": "^0.13.3",
|
||||||
"react-select": "^0.5.4",
|
"react-select": "^0.5.4",
|
||||||
@@ -58,6 +60,9 @@
|
|||||||
"standard": {
|
"standard": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"/browser/ace/"
|
"/browser/ace/"
|
||||||
|
],
|
||||||
|
"global": [
|
||||||
|
"localStorage"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user