'use strict'; const BaseSection = require(__dirname + '/base-section.js'); const shell = require('electron').shell; class ShortcutsSection extends BaseSection { constructor(props) { super(); this.props = props; } templateMac() { const userOSKey = '⌘'; return `
Application Shortcuts
${userOSKey}, Settings
${userOSKey}K Keyboard Shortcuts
${userOSKey} + Shift + M Toggle Do Not Disturb
Shift${userOSKey}D Reset App Settings
${userOSKey}L Log Out
${userOSKey}H Hide Zulip
Option${userOSKey}H Hide Others
${userOSKey}Q Quit Zulip
Edit Shortcuts
${userOSKey}Z Undo
Shift${userOSKey}Z Redo
${userOSKey}X Cut
${userOSKey}C Copy
${userOSKey}V Paste
Shift${userOSKey}V Paste and Match Style
${userOSKey}A Select All
Control${userOSKey}Space Emoji & Symbols
View Shortcuts
${userOSKey}R Reload
Shift${userOSKey}R Hard Reload
Control${userOSKey}F Enter Full Screen
${userOSKey}+ Zoom In
${userOSKey}- Zoom Out
${userOSKey}0 Actual Size
${userOSKey} + Shift + S Toggle Sidebar
Option${userOSKey}I Toggle DevTools for Zulip App
Option${userOSKey}U Toggle DevTools for Active Tab
History Shortcuts
${userOSKey} Back
${userOSKey} Forward
Window Shortcuts
${userOSKey}M Minimize
${userOSKey}W Close
settingsTip: These desktop app shortcuts extend the Zulip webapp's keyboard shortcuts.
`; } templateWinLin() { const userOSKey = 'Ctrl'; return `
Application Shortcuts
${userOSKey} + , Settings
${userOSKey} + K Keyboard Shortcuts
${userOSKey} + Shift + M Toggle Do Not Disturb
${userOSKey} + L Log Out
${userOSKey} + Q Quit Zulip
Edit Shortcuts
${userOSKey} + Z Undo
${userOSKey} + Y Redo
${userOSKey} + X Cut
${userOSKey} + C Copy
${userOSKey} + V Paste
${userOSKey} + Shift + V Paste and Match Style
${userOSKey} + A Select All
View Shortcuts
${userOSKey} + R Reload
${userOSKey} + Shift + R Hard Reload
F11 Toggle Full Screen
${userOSKey} + = Zoom In
${userOSKey} + - Zoom Out
${userOSKey} + 0 Actual Size
${userOSKey} + Shift + S Toggle Sidebar
${userOSKey} + Shift + I Toggle DevTools for Zulip App
${userOSKey} + Shift + U Toggle DevTools for Active Tab
History Shortcuts
Alt + Back
Alt + Forward
Window Shortcuts
${userOSKey} + M Minimize
${userOSKey} + W Close
lightbulb_outlineTip: These desktop app shortcuts extend the Zulip webapp's keyboard shortcuts.
`; } openHotkeysExternalLink() { const link = 'https://zulipchat.com/help/keyboard-shortcuts'; const externalCreateNewOrgEl = document.getElementById('open-hotkeys-link'); externalCreateNewOrgEl.addEventListener('click', () => { shell.openExternal(link); }); } init() { this.props.$root.innerHTML = (process.platform === 'darwin') ? this.templateMac() : this.templateWinLin(); this.openHotkeysExternalLink(); } } module.exports = ShortcutsSection;