gulp prettifyを実行

This commit is contained in:
Yuya Ochiai
2015-10-24 01:44:10 +09:00
parent 3004e117bb
commit 2bb5169f08
6 changed files with 209 additions and 208 deletions

View File

@@ -7,77 +7,65 @@ var createTemplate = function(mainWindow){
var template = [];
template.push({
label: first_menu_name,
submenu: [
{
submenu: [{
label: 'Settings',
click: function(item, focusedWindow) {
mainWindow.loadUrl('file://' + __dirname + '/settings.html');
}
},
{
}, {
label: 'Quit',
accelerator: 'CmdOrCtrl+Q',
click: function(item, focusedWindow) {
require('app').quit();
}
}
]
}]
});
template.push({
label: 'Edit',
submenu: [
{
submenu: [{
label: 'Undo',
accelerator: 'CmdOrCtrl+Z',
role: 'undo'
},
{
}, {
label: 'Redo',
accelerator: 'Shift+CmdOrCtrl+Z',
role: 'redo'
},
{
}, {
type: 'separator'
},
{
}, {
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
role: 'cut'
},
{
}, {
label: 'Copy',
accelerator: 'CmdOrCtrl+C',
role: 'copy'
},
{
}, {
label: 'Paste',
accelerator: 'CmdOrCtrl+V',
role: 'paste'
},
{
}, {
label: 'Select All',
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
},
]
}, ]
});
template.push({
label: 'View',
submenu: [
{
submenu: [{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: function(item, focusedWindow) {
if (focusedWindow)
focusedWindow.reload();
}
},
{
}, {
label: 'Toggle Full Screen',
accelerator: (function() {
if (process.platform === 'darwin') {
return 'Ctrl+Command+F';
} else {
}
else {
return 'F11';
}
})(),
@@ -86,13 +74,13 @@ var createTemplate = function(mainWindow){
focusedWindow.setFullScreen(!focusedWindow.isFullScreen());
}
}
},
{
}, {
label: 'Toggle Developer Tools',
accelerator: (function() {
if (process.platform === 'darwin') {
return 'Alt+Command+I';
} else {
}
else {
return 'Ctrl+Shift+I';
}
})(),
@@ -101,8 +89,7 @@ var createTemplate = function(mainWindow){
focusedWindow.toggleDevTools();
}
}
},
]
}, ]
});
return template;
};
@@ -111,4 +98,6 @@ var createMenu = function(mainWindow){
return Menu.buildFromTemplate(createTemplate(mainWindow));
};
module.exports = { createMenu: createMenu };
module.exports = {
createMenu: createMenu
};

View File

@@ -1,9 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mattermost</title>
</head>
<body>
<!-- Modify src to your Mattermost url -->
<webview id="mainWebview" autosize="on" preload="webview/mattermost.js"></webview>
@@ -18,4 +20,5 @@
</style>
<script src="./index.js"></script>
</body>
</html>

View File

@@ -14,7 +14,8 @@ try{
else {
throw 'URL is not configured';
}
}catch(e){
}
catch (e) {
window.location.href = './settings.html';
}

View File

@@ -40,7 +40,10 @@ app.on('before-quit', function(){
// initialization and is ready to create browser windows.
app.on('ready', function() {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600});
mainWindow = new BrowserWindow({
width: 800,
height: 600
});
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');

View File

@@ -1,12 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Settings</title>
</head>
<body>
<h1>Settings</h1>
<p>URL: <input type="text" id="url"></p>
<p>URL:
<input type="text" id="url">
</p>
<input type="button" value="OK" onclick="saveSettings()">
<input type="button" value="Cancel" onclick="goBack()">
@@ -31,4 +35,5 @@
}
</script>
</body>
</html>