mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 08:33:36 +00:00
34 lines
912 B
JavaScript
34 lines
912 B
JavaScript
'use strict';
|
|
const {spellChecker} = require('./spellchecker');
|
|
|
|
const logout = () => {
|
|
// Create the menu for the below
|
|
document.querySelector('.dropdown-toggle').click();
|
|
|
|
const nodes = document.querySelectorAll('.dropdown-menu li:last-child a');
|
|
nodes[nodes.length - 1].click();
|
|
};
|
|
|
|
const shortcut = () => {
|
|
// Create the menu for the below
|
|
const node = document.querySelector('a[data-overlay-trigger=keyboard-shortcuts]');
|
|
// Additional check
|
|
if (node.text.trim().toLowerCase() === 'keyboard shortcuts') {
|
|
node.click();
|
|
} else {
|
|
// Atleast click the dropdown
|
|
document.querySelector('.dropdown-toggle').click();
|
|
}
|
|
};
|
|
|
|
process.once('loaded', () => {
|
|
global.logout = logout;
|
|
global.shortcut = shortcut;
|
|
});
|
|
|
|
// To prevent failing this script on linux we need to load it after the document loaded
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
// Init spellchecker
|
|
spellChecker();
|
|
});
|