'use strict';

const {app, Menu, dialog, BrowserWindow} = require('electron');

const template = [
  {
    label: 'File',
    submenu: [
      {
        label: 'Open...',
        accelerator: 'CmdOrCtrl+O',
        click () {
          const focusedWindow = BrowserWindow.getFocusedWindow();
          if (focusedWindow) {
            const file = dialog.showOpenDialog({properties: ['openFile']});
            if (file) {
              focusedWindow.webContents.send('file-open', file[0]);
            }
          }
        }
      }
    ]
  },
  {
    label: 'view',
    submenu: [
      {
        role: 'reload'
      },
      {
        role: 'toggledevtools'
      },
      {
        type: 'separator'
      },
      {
        role: 'resetzoom'
      },
      {
        role: 'zoomin'
      },
      {
        role: 'zoomout'
      },
      {
        type: 'separator'
      },
      {
        role: 'togglefullscreen'
      }
    ]
  },
  {
    role: 'window',
    submenu: [
      {
        role: 'minimize'
      },
      {
        role: 'close'
      }
    ]
  },
  {
    role: 'help',
    submenu: [
      {
        label: 'Site',
        click () {
          require('electron').shell.openExternal(
            'https://github.com/trainto/Catalogger');
        }
      }
    ]
  }
];

if (process.platform === 'darwin') {
  template.unshift({
    label: app.getName(),
    submenu: [
      {
        role: 'about'
      },
      {
        type: 'separator'
      },
      {
        role: 'services',
        submenu: []
      },
      {
        type: 'separator'
      },
      {
        role: 'hide'
      },
      {
        role: 'hideothers'
      },
      {
        role: 'unhide'
      },
      {
        type: 'separator'
      },
      {
        role: 'quit'
      }
    ]
  });

  // Window menu.
  template[3].submenu = [
    {
      label: 'Close',
      accelerator: 'CmdOrCtrl+W',
      role: 'close'
    },
    {
      label: 'Minimize',
      accelerator: 'CmdOrCtrl+M',
      role: 'minimize'
    },
    {
      label: 'Zoom',
      role: 'zoom'
    },
    {
      type: 'separator'
    },
    {
      label: 'Bring All to Front',
      role: 'front'
    }
  ];
}

const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);

@@ -92,16 +92,17 @@
 ate = %5B%0A
+%0A
   %7B%0A    
@@ -540,24 +540,110 @@
  %5D%0A  %7D,%0A  %7B%0A
+    label: 'Edit',%0A    submenu: %5B%0A      %7B%0A        role: 'copy'%0A      %7D%0A    %5D%0A  %7D,%0A  %7B%0A
     label: '
@@ -1910,9 +1910,9 @@
 ate%5B
-3
+4
 %5D.su

Add copy menu