<commit_before>var gui = require('nw.gui');
var win = gui.Window.get();   

// load file system module
var fs = require("fs");

var menubar = new gui.Menu({ type: 'menubar' });
var file = new gui.Menu();
             
win.setResizable(false);

win.menu = menubar;
win.menu.insert(new gui.MenuItem({ label: 'File', submenu: file }), 1);

// TODO: gotta be a better way of adding menu items by index number...
menubar.items[0].submenu.append(new gui.MenuItem({
   	label: "New Project",
   	click: function () {
		console.log("new project from menubar");
      	global.jQuery("#projectDirectory").trigger("click");
   	}
}));
menubar.items[0].submenu.append(new gui.MenuItem({
   	label: "Open Project",
   	click: function () {
      	console.log("open project from menubar");
		global.jQuery("#openProject").trigger("click");
   	}
}));

var help = new gui.Menu();
win.menu.append(new gui.MenuItem({ label: 'Help', submenu: help }));

menubar.items[menubar.items.length-1].submenu.append(new gui.MenuItem({
   	label: "How to use",
   	click: function () {
   	    gui.Shell.openExternal("https://github.com/hermwong/phonegap-gui/wiki/PhoneGap-GUI-Overview");    // opens user's default browser & loads page
   	}
}));

/*
// comment out tray code - since tray click is not supported on OSX
// Create a tray icon
//var tray = new gui.Tray({ title: 'Tray', icon: 'img/icon.png' });
var tray = new gui.Tray({title: 'Tray'});

// Give the tray a menu
var menu = new gui.Menu();
menu.append(new gui.MenuItem({ type: 'normal', label: 'tray test', click: function() { alert("tray menu item test"); } }));
tray.menu = menu;

// remove tray when clicked
tray.on('click', function() {
	console.log("tray clicked");
});
*/<commit_msg>update the file menu's new project & open project handlers to use the same methods as the add new project & open existing project dialog's methods<commit_after>var gui = require('nw.gui');
var win = gui.Window.get();   

// load file system module
var fs = require("fs");

var menubar = new gui.Menu({ type: 'menubar' });
var file = new gui.Menu();
             
win.setResizable(false);

win.menu = menubar;
win.menu.insert(new gui.MenuItem({ label: 'File', submenu: file }), 1);

// TODO: gotta be a better way of adding menu items by index number...
menubar.items[0].submenu.append(new gui.MenuItem({
   	label: "New Project",
   	click: function () {
		console.log("new project from menubar");
		// create a new project
		createProject();
   	}
}));
menubar.items[0].submenu.append(new gui.MenuItem({
   	label: "Open Project",
   	click: function () {
      	console.log("open project from menubar");
		// open an existing project
		openProject();
   	}
}));

var help = new gui.Menu();
win.menu.append(new gui.MenuItem({ label: 'Help', submenu: help }));

menubar.items[menubar.items.length-1].submenu.append(new gui.MenuItem({
   	label: "How to use",
   	click: function () {
   	    gui.Shell.openExternal("https://github.com/hermwong/phonegap-gui/wiki/PhoneGap-GUI-Overview");    // opens user's default browser & loads page
   	}
}));

/*
// comment out tray code - since tray click is not supported on OSX
// Create a tray icon
//var tray = new gui.Tray({ title: 'Tray', icon: 'img/icon.png' });
var tray = new gui.Tray({title: 'Tray'});

// Give the tray a menu
var menu = new gui.Menu();
menu.append(new gui.MenuItem({ type: 'normal', label: 'tray test', click: function() { alert("tray menu item test"); } }));
tray.menu = menu;

// remove tray when clicked
tray.on('click', function() {
	console.log("tray clicked");
});
*/
{'fraction_non_alphanumeric': 0.17008139208532136, 'fraction_numerical': 0.002245298905416784, 'mean_word_length': 3.610608020698577, 'pattern_counts': {'":': 0, '<': 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': '2920629', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1196, 'n_words': 345}