Skip to content

Commit 9329972

Browse files
committed
test 0.2.0
1 parent 1bebb66 commit 9329972

5 files changed

Lines changed: 81 additions & 8 deletions

File tree

browser/main/index.electron.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>CodeXen</title>
4+
<title>CodeXen v0.2.0</title>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
77

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
borderBox()
2+
box-sizing border-box
3+
14
noSelect()
25
-webkit-user-select none
36
-webkit-app-region drag
7+

main.js

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var app = require('app')
22
var BrowserWindow = require('browser-window')
33
var Menu = require('menu')
4+
var MenuItem = require('menu-item')
45
var Tray = require('tray')
56

67
require('crash-reporter').start()
@@ -10,11 +11,54 @@ var appIcon = null
1011
var menu = null
1112
var popUpWindow = null
1213

14+
var update = null
15+
1316
// app.on('window-all-closed', function () {
1417
// if (process.platform !== 'darwin') app.quit()
1518
// })
1619

20+
var version = '0.2.0'
21+
var nn = require('node-notifier')
22+
var autoUpdater = require('auto-updater')
23+
24+
autoUpdater
25+
.on('error', function (err, message) {
26+
nn.notify({
27+
title: 'Boost Update Center Ver. ' + version,
28+
message: message
29+
})
30+
})
31+
.on('checking-for-update', function () {
32+
nn.notify({
33+
title: 'Boost Update Center Ver. ' + version,
34+
message: 'Hello from Main processor, Mr. User!'
35+
})
36+
})
37+
.on('update-available', function () {
38+
nn.notify({
39+
title: 'Boost Update Center Ver. ' + version,
40+
message: 'Update is available. Starting download latest build...'
41+
})
42+
})
43+
.on('update-not-available', function () {
44+
nn.notify({
45+
title: 'Boost Update Center Ver. ' + version,
46+
message: 'Latest Build :D'
47+
})
48+
})
49+
.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) {
50+
nn.notify({
51+
title: 'Boost Update Center Ver. ' + version,
52+
message: 'Ready to Update: ' + releaseName
53+
})
54+
update = quitAndUpdate
55+
})
56+
57+
1758
app.on('ready', function () {
59+
console.log('Version ' + version)
60+
autoUpdater.setFeedUrl('http://localhost:8000/testcat/test/latest?version=' + version)
61+
autoUpdater.checkForUpdates()
1862
// menu start
1963
var template = require('./modules/menu-template')
2064

@@ -24,12 +68,32 @@ app.on('ready', function () {
2468
// menu end
2569
appIcon = new Tray(__dirname + '/tray-icon.png')
2670
appIcon.setToolTip('Codexen')
27-
appIcon.on('clicked', function () {
28-
if (mainWindow == null) {
29-
makeNewMainWindow()
71+
72+
var trayMenu = new Menu()
73+
trayMenu.append(new MenuItem({
74+
label: 'Open main window',
75+
click: function () {
76+
if (mainWindow == null) {
77+
makeNewMainWindow()
78+
}
79+
mainWindow.show()
3080
}
31-
mainWindow.show()
32-
})
81+
}))
82+
trayMenu.append(new MenuItem({
83+
label: 'Update App',
84+
click: function () {
85+
if (update != null) {
86+
update()
87+
}
88+
}
89+
}))
90+
trayMenu.append(new MenuItem({
91+
label: 'Quit',
92+
click: function () {
93+
app.quit()
94+
}
95+
}))
96+
appIcon.setContextMenu(trayMenu)
3397

3498
makeNewMainWindow()
3599

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "CodeXen App",
55
"main": "main.js",
66
"scripts": {
7-
"start": "npm run serve | npm run dev",
7+
"start": "electron ./main.js",
8+
"web": "npm run serve | npm run dev",
89
"serve": "./node_modules/.bin/http-server ./browser -p 8080",
910
"dev": "webpack-dev-server --progress --colors --port 8090"
1011
},
@@ -39,6 +40,7 @@
3940
"moment": "^2.10.3",
4041
"nib": "^1.1.0",
4142
"node-jsx": "^0.13.3",
43+
"node-notifier": "^4.2.3",
4244
"react": "^0.13.3",
4345
"react-router": "^0.13.3",
4446
"react-select": "^0.5.4",
@@ -58,6 +60,9 @@
5860
"standard": {
5961
"ignore": [
6062
"/browser/ace/"
63+
],
64+
"global": [
65+
"localStorage"
6166
]
6267
}
6368
}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CodeXen app
1+
# CodeXen app 0.2.0
22
![CodeXen](app-logo.png)
33

44
Short code(Snippet/Templatefile/Command) storage + boosting service

0 commit comments

Comments
 (0)