<commit_before>import BrowserWindow from 'browser-window';
import Dialog from 'dialog';
import Menu from 'menu';
import {createWindow} from './window-manager';

export function openFile() {
  Dialog.showOpenDialog({
    filters: [
      { name: 'Images', extensions: ['jpg', 'jpeg', 'png', 'gif'] }
    ],
    properties: ['openFile']
  }, function(files) {
    createWindow(files[0]);
  });
}

export function buildMenu() {

  let template = [
    {
      label: 'Refractor',
      submenu: [
        {
          label: 'About Refractor',
          selector: 'orderFrontStandardAboutPanel:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Services',
          submenu: []
        },
        {
          type: 'separator'
        },
        {
          label: 'Hide Refractor',
          accelerator: 'CmdOrCtrl+H',
          selector: 'hide:'
        },
        {
          label: 'Hide Others',
          accelerator: 'CmdOrCtrl+Shift+H',
          selector: 'hideOtherApplications:'
        },
        {
          label: 'Show All',
          selector: 'unhideAllApplications:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Quit',
          accelerator: 'CmdOrCtrl+Q',
          selector: 'terminate:'
        }
      ]
    },
    {
      label: 'File',
      submenu: [
        {
          label: 'Open',
          accelerator: 'CmdOrCtrl+O',
          click: openFile
        }
      ]
    }
  ];

  /* istanbul ignore next */
  if (process.env.NODE_ENV === 'production') { // eslint-disable-line no-process-env
    template.push({
      label: 'View',
      submenu: [
        {
          label: 'Reload',
          accelerator: 'CmdOrCtrl+R',
          click() {
            BrowserWindow.getFocusedWindow().reload();
          }
        },
        {
          label: 'Toggle DevTools',
          accelerator: 'Alt+CmdOrCtrl+I',
          click() {
            BrowserWindow.getFocusedWindow().toggleDevTools();
          }
        }
      ]
    });
  }
<commit_msg>Fix developer menu in developer mode<commit_after>import BrowserWindow from 'browser-window';
import Dialog from 'dialog';
import Menu from 'menu';
import {createWindow} from './window-manager';

export function openFile() {
  Dialog.showOpenDialog({
    filters: [
      { name: 'Images', extensions: ['jpg', 'jpeg', 'png', 'gif'] }
    ],
    properties: ['openFile']
  }, function(files) {
    createWindow(files[0]);
  });
}

export function buildMenu() {

  let template = [
    {
      label: 'Refractor',
      submenu: [
        {
          label: 'About Refractor',
          selector: 'orderFrontStandardAboutPanel:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Services',
          submenu: []
        },
        {
          type: 'separator'
        },
        {
          label: 'Hide Refractor',
          accelerator: 'CmdOrCtrl+H',
          selector: 'hide:'
        },
        {
          label: 'Hide Others',
          accelerator: 'CmdOrCtrl+Shift+H',
          selector: 'hideOtherApplications:'
        },
        {
          label: 'Show All',
          selector: 'unhideAllApplications:'
        },
        {
          type: 'separator'
        },
        {
          label: 'Quit',
          accelerator: 'CmdOrCtrl+Q',
          selector: 'terminate:'
        }
      ]
    },
    {
      label: 'File',
      submenu: [
        {
          label: 'Open',
          accelerator: 'CmdOrCtrl+O',
          click: openFile
        }
      ]
    }
  ];

  /* istanbul ignore next */
  if (process.env.NODE_ENV !== 'production') { // eslint-disable-line no-process-env
    template.push({
      label: 'View',
      submenu: [
        {
          label: 'Reload',
          accelerator: 'CmdOrCtrl+R',
          click() {
            BrowserWindow.getFocusedWindow().reload();
          }
        },
        {
          label: 'Toggle DevTools',
          accelerator: 'Alt+CmdOrCtrl+I',
          click() {
            BrowserWindow.getFocusedWindow().toggleDevTools();
          }
        }
      ]
    });
  }

{'fraction_non_alphanumeric': 0.13839825792402613, 'fraction_numerical': 0.0004839099927413501, 'mean_word_length': 1.517661388550548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7502851', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1195, 'n_words': 231}