diff --git a/src/main.js b/src/main.js
new file mode 100644
index 00000000..19d27145
--- /dev/null
+++ b/src/main.js
@@ -0,0 +1,33 @@
+var app = require('app'); // Module to control application life.
+var BrowserWindow = require('browser-window'); // Module to create native browser window.
+
+// Report crashes to our server.
+require('crash-reporter').start();
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the javascript object is GCed.
+var mainWindow = null;
+
+// Quit when all windows are closed.
+app.on('window-all-closed', function() {
+ if (process.platform != 'darwin')
+ app.quit();
+});
+
+// This method will be called when Electron has done everything
+// initialization and ready for creating browser windows.
+app.on('ready', function() {
+ // Create the browser window.
+ mainWindow = new BrowserWindow({width: 1000, height: 600, frame: true, transparent: false });
+
+ // and load the index.html of the app.
+ mainWindow.loadUrl('file://' + __dirname + '/note.html');
+
+ // 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;
+ });
+});
\ No newline at end of file
diff --git a/src/node_modules/gui.js b/src/node_modules/gui.js
new file mode 100644
index 00000000..83cd32ec
--- /dev/null
+++ b/src/node_modules/gui.js
@@ -0,0 +1,22 @@
+var remote = require('remote');
+var Menu = remote.require('menu');
+var MenuItem = remote.require('menu-item');
+
+var gui = {
+ Menu: Menu,
+ MenuItem: MenuItem,
+ remote: remote,
+
+ getSeparatorMenu: function() {
+ return new MenuItem({ type: 'separator' });
+ },
+ getCurrentWindow: function() {
+ return remote.getCurrentWindow();
+ },
+ Shell: require('shell'),
+ on: function(type, callback) {
+
+ }
+};
+
+module.exports = gui;
\ No newline at end of file
diff --git a/src/node_modules/note.js b/src/node_modules/note.js
index 2cfde1df..bc3908ea 100644
--- a/src/node_modules/note.js
+++ b/src/node_modules/note.js
@@ -19,6 +19,8 @@ function log(o) {
console.log(o);
}
+// Web.alertWeb('alert(process.type);');
+
/*
type NoteOrContent struct {
NotebookId string
@@ -42,6 +44,9 @@ var Note = {
// 更新笔记
updateNoteOrContent: function(noteOrContent, callback) {
var me = this;
+
+ // Web.alertWeb(process.type); // render
+
var userId = User.getCurActiveUserId();
noteOrContent['UserId'] = userId;
diff --git a/src/node_modules/server.js b/src/node_modules/server.js
index 2e211066..936c0715 100644
--- a/src/node_modules/server.js
+++ b/src/node_modules/server.js
@@ -44,6 +44,7 @@ var Server = {
if(me._started) {
return;
}
+ return;
var basePath = process.cwd();
var server = http.createServer(function (request, response) {
var pathname = url.parse(request.url).pathname;
diff --git a/src/note.html b/src/note.html
index db0ad87b..3a98da74 100755
--- a/src/note.html
+++ b/src/note.html
@@ -635,22 +635,27 @@ window.require = undefined;
-
+
+
+
+-->