<commit_before>const {app, BrowserWindow, Menu, Tray, crashReporter, ipcMain} = require('electron');  // Module to control application life.
var util = require('util');

// Report crashes to our server.
// crashReporter.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 win = null;
var tray = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
  // if (process.platform != 'darwin')
    app.quit();
});

function createGmailWindow(url) {
  // Create the browser window.
  win = new BrowserWindow({
    width: 1200,
    height: 800,
    title: 'Gmail',
    icon: __dirname+'/gmail-icon-unread.png',
    "skip-taskbar": process.platform !== 'darwin'
  });

  win.maximize();

  // mainWindow.loadUrl('https://mail.google.com/');
  win.loadURL('file://'+__dirname+'/index.html');

  // Emitted when the window is closed.
  win.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.
    win = null;
  });

  win.on('minimize', function(event) {
    win.hide();
    event.preventDefault();
  });

}

function setupTray() {
  tray = new Tray(__dirname+'/gmail-icon-default.png');
  tray.setToolTip('No unread messages');
  var trayContextMenu = Menu.buildFromTemplate([
    {
      label: 'Show Inbox',
      click: function() { win.show(); }
    },
    {
      type: 'separator'
    },
    {
      label: 'Quit',
      click: function() { app.quit(); }
    },
  ]);
  tray.setContextMenu(trayContextMenu);

  tray.on('clicked', function() {
    win.show();
  });
}

function setupMenu() {
  var template = [
    {
      label: 'Gmail',
      submenu: [
        {
          label: 'Quit',
          accelerator: 'Command+Q',
          click: function() { app.quit(); }
        },
      ]
    },
    {
      label: 'Edit',
      submenu: [
        {
          label: 'Undo',
          accelerator: 'Command+Z',
          selector: 'undo:'
        },
        {
          label: 'Redo',
          accelerator: 'Shift+Command+Z',
          selector: 'redo:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Cut',
          accelerator: 'Command+X',
          selector: 'cut:'
        },
        {
          label: 'Copy',
          accelerator: 'Command+C',
          selector: 'copy:'
        },
        {
          label: 'Paste',
          accelerator: 'Command+V',
          selector: 'paste:'
        },
        {
          label: 'Select All',
          accelerator: 'Command+A',
          selector: 'selectAll:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Find',
          accelerator: 'Command+F',
          click: function() { BrowserWindow.getFocusedWindow().webContents.send('find'); }
        },
      ]
    },
    {
      label: 'View',
      submenu: [
        {
          label: 'Reload',
          accelerator: 'Command+R',
          click: function() { BrowserWindow.getFocusedWindow().reloadIgnoringCache(); }
        },
        {
          label: 'Toggle DevTools',
          accelerator: 'Alt+Command+I',
          click: function() { BrowserWindow.getFocusedWindow().toggleDevTools(); }
        },
      ]
    },
    {
      label: 'Window',
      submenu: [
        {
          label: 'Minimize',
          accelerator: 'Command+M',
          selector: 'performMiniaturize:'
        },
        {
          label: 'Close',
          accelerator: 'Command+W',
          selector: 'performClose:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Bring All to Front',
          selector: 'arrangeInFront:'<commit_msg>fix reloading with CMD+R<commit_after>const {app, BrowserWindow, Menu, Tray, crashReporter, ipcMain} = require('electron');  // Module to control application life.
var util = require('util');

// Report crashes to our server.
// crashReporter.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 win = null;
var tray = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
  // if (process.platform != 'darwin')
    app.quit();
});

function createGmailWindow(url) {
  // Create the browser window.
  win = new BrowserWindow({
    width: 1200,
    height: 800,
    title: 'Gmail',
    icon: __dirname+'/gmail-icon-unread.png',
    "skip-taskbar": process.platform !== 'darwin'
  });

  win.maximize();

  // mainWindow.loadUrl('https://mail.google.com/');
  win.loadURL('file://'+__dirname+'/index.html');

  // Emitted when the window is closed.
  win.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.
    win = null;
  });

  win.on('minimize', function(event) {
    win.hide();
    event.preventDefault();
  });

}

function setupTray() {
  tray = new Tray(__dirname+'/gmail-icon-default.png');
  tray.setToolTip('No unread messages');
  var trayContextMenu = Menu.buildFromTemplate([
    {
      label: 'Show Inbox',
      click: function() { win.show(); }
    },
    {
      type: 'separator'
    },
    {
      label: 'Quit',
      click: function() { app.quit(); }
    },
  ]);
  tray.setContextMenu(trayContextMenu);

  tray.on('clicked', function() {
    win.show();
  });
}

function setupMenu() {
  var template = [
    {
      label: 'Gmail',
      submenu: [
        {
          label: 'Quit',
          accelerator: 'Command+Q',
          click: function() { app.quit(); }
        },
      ]
    },
    {
      label: 'Edit',
      submenu: [
        {
          label: 'Undo',
          accelerator: 'Command+Z',
          selector: 'undo:'
        },
        {
          label: 'Redo',
          accelerator: 'Shift+Command+Z',
          selector: 'redo:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Cut',
          accelerator: 'Command+X',
          selector: 'cut:'
        },
        {
          label: 'Copy',
          accelerator: 'Command+C',
          selector: 'copy:'
        },
        {
          label: 'Paste',
          accelerator: 'Command+V',
          selector: 'paste:'
        },
        {
          label: 'Select All',
          accelerator: 'Command+A',
          selector: 'selectAll:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Find',
          accelerator: 'Command+F',
          click: function() { BrowserWindow.getFocusedWindow().webContents.send('find'); }
        },
      ]
    },
    {
      label: 'View',
      submenu: [
        {
          label: 'Reload',
          accelerator: 'Command+R',
          click: function() { BrowserWindow.getFocusedWindow().webContents.reloadIgnoringCache(); }
        },
        {
          label: 'Toggle DevTools',
          accelerator: 'Alt+Command+I',
          click: function() { BrowserWindow.getFocusedWindow().toggleDevTools(); }
        },
      ]
    },
    {
      label: 'Window',
      submenu: [
        {
          label: 'Minimize',
          accelerator: 'Command+M',
          selector: 'performMiniaturize:'
        },
        {
          label: 'Close',
          accelerator: 'Command+W',
          selector: 'performClose:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Bring All to Front',
          selector: 'arrangeInFront:'
{'fraction_non_alphanumeric': 0.14811942613416051, 'fraction_numerical': 0.0018094868812201111, 'mean_word_length': 1.845899227657227, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6750625', 'n_tokens_mistral': 2345, 'n_tokens_neox': 2309, 'n_words': 530}