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() {
  // On OS X it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  if (process.platform != 'darwin') {
    app.quit();
  }
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
  // Create the browser window.
  mainWindow = new BrowserWindow({
    'width': 800,
    'height': 600,
    'min-width': 400,
    'min-height': 400,
    'auto-hide-menu-bar': true
  });

  // and load the index.html of the app.
  mainWindow.loadUrl('file://' + __dirname + '/imageviewer.html');

  // Open the devtools.
  //mainWindow.openDevTools();

  // Emitted when the window is closed.
  mainWindow.on('closed', function() {
    // De-reference 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;
  });
});

@@ -23,46 +23,9 @@
 '); 
-// Module to control application life.
+ 
 %0Avar
@@ -72,263 +72,8 @@
 '); 
-// Module to create native browser window.%0A// Report crashes to our server.%0A//require('crash-reporter').start();%0A%0A// Keep a global reference of the window object, if you don't, the window will%0A// be closed automatically when the JavaScript object is GCed.
 %0Avar
@@ -98,11 +98,15 @@
 ;%0A%0A/
-/ Q
+**%0A * q
 uit 
@@ -120,17 +120,16 @@
 l window
-s
  are clo
@@ -131,17 +131,21 @@
 e closed
-.
+%0A **/
 %0Aapp.on(
@@ -182,135 +182,8 @@
 ) %7B%0A
-  // On OS X it is common for applications and their menu bar%0A  // to stay active until the user quits explicitly with Cmd + Q%0A
   if
@@ -246,51 +246,28 @@
 ;%0A%0A/
-/ This method will be called
+**%0A *
  when 
-E
+e
 lectron 
 has 
@@ -266,20 +266,16 @@
 ron 
-has 
 finished
 %0A// 
@@ -274,11 +274,8 @@
 shed
-%0A//
  ini
@@ -289,109 +289,42 @@
 tion
- and is ready to create browser windows.%0Aapp.on('ready', function() %7B%0A  // Create the browser window.
+%0A **/%0Aapp.on('ready', function() %7B
 %0A  m
@@ -479,49 +479,8 @@
 );%0A%0A
-  // and load the index.html of the app.%0A
   ma
@@ -546,343 +546,49 @@
 ');%0A
-%0A
   
-// Open the devtools.%0A  //mainWindow.openDevTools();%0A%0A  // Emitted when the window is closed.%0A  mainWindow.on('closed', function() %7B%0A    // De-reference the window object, usually you would store windows%0A    // in an array if your app supports multi windows, this is the time%0A    // when you should delete the corresponding element.
+%0A  mainWindow.on('closed', function() %7B
 %0A   

clean up code