gulp prettifyを実行
This commit is contained in:
55
app-menu.js
55
app-menu.js
@@ -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
|
||||
};
|
||||
|
@@ -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>
|
3
index.js
3
index.js
@@ -14,7 +14,8 @@ try{
|
||||
else {
|
||||
throw 'URL is not configured';
|
||||
}
|
||||
}catch(e){
|
||||
}
|
||||
catch (e) {
|
||||
window.location.href = './settings.html';
|
||||
}
|
||||
|
||||
|
5
main.js
5
main.js
@@ -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');
|
||||
|
@@ -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>
|
Reference in New Issue
Block a user