mirror of
https://github.com/pierre42100/ComunicDesktop
synced 2024-11-23 12:39:22 +00:00
Added some shorcuts
This commit is contained in:
parent
64f82bf087
commit
cb3867584f
@ -14,6 +14,12 @@ const {app, Menu} = require('electron');
|
||||
*/
|
||||
module.exports.Get = function(window){
|
||||
|
||||
/**
|
||||
* Execute javascript quickly
|
||||
*/
|
||||
let js = function(code) {window.webContents.executeJavaScript(code)};
|
||||
|
||||
|
||||
return Menu.buildFromTemplate([
|
||||
|
||||
//File menu
|
||||
@ -33,6 +39,47 @@ module.exports.Get = function(window){
|
||||
},
|
||||
|
||||
|
||||
//Shorcuts menu
|
||||
{
|
||||
label: "Shorcuts",
|
||||
submenu: [
|
||||
|
||||
|
||||
//Latest posts
|
||||
{
|
||||
label: "Latest posts",
|
||||
click: () => {
|
||||
js("openPage('latest');");
|
||||
}
|
||||
},
|
||||
|
||||
//User page
|
||||
{
|
||||
label: "Your page",
|
||||
click: () => {
|
||||
js("openPage('user/' + userID());");
|
||||
}
|
||||
},
|
||||
|
||||
//Conversations
|
||||
{
|
||||
label: "Conversations",
|
||||
click: () => {
|
||||
js("openPage('conversations');");
|
||||
}
|
||||
},
|
||||
|
||||
//Groups
|
||||
{
|
||||
label: "Groups",
|
||||
click: () => {
|
||||
js("openPage('groups');");
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
//Settings menu
|
||||
{
|
||||
label: "Settings",
|
||||
@ -42,7 +89,7 @@ module.exports.Get = function(window){
|
||||
{
|
||||
label: "Toggle dark mode",
|
||||
click: () => {
|
||||
window.webContents.executeJavaScript("ComunicWeb.components.darkTheme.setEnabled(!ComunicWeb.components.darkTheme.isEnabled());");
|
||||
js("ComunicWeb.components.darkTheme.setEnabled(!ComunicWeb.components.darkTheme.isEnabled());");
|
||||
}
|
||||
},
|
||||
|
||||
@ -52,9 +99,19 @@ module.exports.Get = function(window){
|
||||
label: "Enable incognito mode",
|
||||
sublabel: "F6",
|
||||
click: () => {
|
||||
window.webContents.executeJavaScript("ComunicWeb.components.incognito.ui.confirmEnable();");
|
||||
js("ComunicWeb.components.incognito.ui.confirmEnable();");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//Account settings
|
||||
{
|
||||
label: "Account settings",
|
||||
click: () => {
|
||||
js("openPage('settings');");
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user