Desktop markdown wiki app. Built with node, Electron Framework and AngularJS.

app.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var app = require('app'); // Module to control application life.
  2. var BrowserWindow = require('browser-window'); // Module to create native browser window.
  3. // Keep a global reference of the window object, if you don't, the window will
  4. // be closed automatically when the JavaScript object is garbage collected.
  5. var mainWindow = null;
  6. // Quit when all windows are closed.
  7. app.on('window-all-closed', function() {
  8. // On OS X it is common for applications and their menu bar
  9. // to stay active until the user quits explicitly with Cmd + Q
  10. if (process.platform != 'darwin') {
  11. app.quit();
  12. }
  13. });
  14. // This method will be called when Electron has finished
  15. // initialization and is ready to create browser windows.
  16. app.on('ready', function() {
  17. // Create the browser window.
  18. mainWindow = new BrowserWindow({
  19. width: 1000,
  20. height: 700,
  21. 'min-width': 500,
  22. 'min-height': 200,
  23. 'accept-first-mouse': true,
  24. 'title-bar-style': 'hidden',
  25. 'fullscreen' : true
  26. });
  27. // and load the index.html of the app.
  28. mainWindow.loadUrl('file://' + __dirname + '/app/index.html');
  29. // Open the DevTools.
  30. //mainWindow.openDevTools();
  31. // Emitted when the window is closed.
  32. mainWindow.on('closed', function() {
  33. // Dereference the window object, usually you would store windows
  34. // in an array if your app supports multi windows, this is the time
  35. // when you should delete the corresponding element.
  36. mainWindow = null;
  37. });
  38. });