diff options
author | 2021-10-20 10:49:47 +0530 | |
---|---|---|
committer | 2021-10-20 10:49:47 +0530 | |
commit | 9a64b4322adadbe18929c2da114eb0813426c4f9 (patch) | |
tree | e9dfa8b9e14b38720fa4487b7175ed26a8076da7 /src/lib | |
parent | 5.6.3-nightly.38 [skip ci] (diff) | |
download | ferdium-app-9a64b4322adadbe18929c2da114eb0813426c4f9.tar.gz ferdium-app-9a64b4322adadbe18929c2da114eb0813426c4f9.tar.zst ferdium-app-9a64b4322adadbe18929c2da114eb0813426c4f9.zip |
Co-authored-by: Markus Hatvan <markus_hatvan@aon.at>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index b1cbaf992..1495fc80e 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -313,7 +313,7 @@ const menuItems = defineMessages({ | |||
313 | }); | 313 | }); |
314 | 314 | ||
315 | function getActiveService() { | 315 | function getActiveService() { |
316 | return window.ferdi.stores.services.active; | 316 | return window['ferdi'].stores.services.active; |
317 | } | 317 | } |
318 | 318 | ||
319 | const _titleBarTemplateFactory = (intl, locked) => [ | 319 | const _titleBarTemplateFactory = (intl, locked) => [ |
@@ -375,7 +375,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
375 | label: intl.formatMessage(menuItems.openQuickSwitch), | 375 | label: intl.formatMessage(menuItems.openQuickSwitch), |
376 | accelerator: `${cmdOrCtrlShortcutKey()}+S`, | 376 | accelerator: `${cmdOrCtrlShortcutKey()}+S`, |
377 | click() { | 377 | click() { |
378 | window.ferdi.features.quickSwitch.state.isModalVisible = true; | 378 | window['ferdi'].features.quickSwitch.state.isModalVisible = true; |
379 | }, | 379 | }, |
380 | }, | 380 | }, |
381 | { | 381 | { |
@@ -391,7 +391,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
391 | // Focus webview so find in page popup gets focused | 391 | // Focus webview so find in page popup gets focused |
392 | service.webview.focus(); | 392 | service.webview.focus(); |
393 | 393 | ||
394 | window.ferdi.actions.service.sendIPCMessage({ | 394 | window['ferdi'].actions.service.sendIPCMessage({ |
395 | serviceId: service.id, | 395 | serviceId: service.id, |
396 | channel: 'find-in-page', | 396 | channel: 'find-in-page', |
397 | args: {}, | 397 | args: {}, |
@@ -457,12 +457,12 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
457 | label: intl.formatMessage(menuItems.toggleDarkMode), | 457 | label: intl.formatMessage(menuItems.toggleDarkMode), |
458 | type: 'checkbox', | 458 | type: 'checkbox', |
459 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, | 459 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, |
460 | checked: window.ferdi.stores.settings.app.darkMode, | 460 | checked: window['ferdi'].stores.settings.app.darkMode, |
461 | click: () => { | 461 | click: () => { |
462 | window.ferdi.actions.settings.update({ | 462 | window['ferdi'].actions.settings.update({ |
463 | type: 'app', | 463 | type: 'app', |
464 | data: { | 464 | data: { |
465 | darkMode: !window.ferdi.stores.settings.app.darkMode, | 465 | darkMode: !window['ferdi'].stores.settings.app.darkMode, |
466 | }, | 466 | }, |
467 | }); | 467 | }); |
468 | }, | 468 | }, |
@@ -579,13 +579,13 @@ class FranzMenu { | |||
579 | // need to clone object so we don't modify computed (cached) object | 579 | // need to clone object so we don't modify computed (cached) object |
580 | const serviceTpl = Object.assign([], this.serviceTpl()); | 580 | const serviceTpl = Object.assign([], this.serviceTpl()); |
581 | 581 | ||
582 | // Don't initialize when window.ferdi is undefined | 582 | // Don't initialize when window['ferdi'] is undefined |
583 | if (window.ferdi === undefined) { | 583 | if (window['ferdi'] === undefined) { |
584 | console.log('skipping menu init'); | 584 | console.log('skipping menu init'); |
585 | return; | 585 | return; |
586 | } | 586 | } |
587 | 587 | ||
588 | const { intl } = window.ferdi; | 588 | const { intl } = window['ferdi']; |
589 | const tpl = _titleBarTemplateFactory(intl, this.stores.settings.app.locked); | 589 | const tpl = _titleBarTemplateFactory(intl, this.stores.settings.app.locked); |
590 | const { actions } = this; | 590 | const { actions } = this; |
591 | 591 | ||
@@ -593,13 +593,13 @@ class FranzMenu { | |||
593 | tpl[1].submenu.push({ | 593 | tpl[1].submenu.push({ |
594 | label: intl.formatMessage(menuItems.autohideMenuBar), | 594 | label: intl.formatMessage(menuItems.autohideMenuBar), |
595 | type: 'checkbox', | 595 | type: 'checkbox', |
596 | checked: window.ferdi.stores.settings.app.autohideMenuBar, | 596 | checked: window['ferdi'].stores.settings.app.autohideMenuBar, |
597 | click: () => { | 597 | click: () => { |
598 | window.ferdi.actions.settings.update({ | 598 | window['ferdi'].actions.settings.update({ |
599 | type: 'app', | 599 | type: 'app', |
600 | data: { | 600 | data: { |
601 | autohideMenuBar: | 601 | autohideMenuBar: |
602 | !window.ferdi.stores.settings.app.autohideMenuBar, | 602 | !window['ferdi'].stores.settings.app.autohideMenuBar, |
603 | }, | 603 | }, |
604 | }); | 604 | }); |
605 | }, | 605 | }, |
@@ -893,7 +893,7 @@ class FranzMenu { | |||
893 | } | 893 | } |
894 | 894 | ||
895 | serviceTpl() { | 895 | serviceTpl() { |
896 | const { intl } = window.ferdi; | 896 | const { intl } = window['ferdi']; |
897 | const { user, services, settings } = this.stores; | 897 | const { user, services, settings } = this.stores; |
898 | if (!user.isLoggedIn) return []; | 898 | if (!user.isLoggedIn) return []; |
899 | const menu = []; | 899 | const menu = []; |
@@ -988,7 +988,7 @@ class FranzMenu { | |||
988 | workspacesMenu() { | 988 | workspacesMenu() { |
989 | const { workspaces, activeWorkspace, isWorkspaceDrawerOpen } = | 989 | const { workspaces, activeWorkspace, isWorkspaceDrawerOpen } = |
990 | workspaceStore; | 990 | workspaceStore; |
991 | const { intl } = window.ferdi; | 991 | const { intl } = window['ferdi']; |
992 | const menu = []; | 992 | const menu = []; |
993 | 993 | ||
994 | // Add new workspace item: | 994 | // Add new workspace item: |
@@ -1050,7 +1050,7 @@ class FranzMenu { | |||
1050 | 1050 | ||
1051 | todosMenu() { | 1051 | todosMenu() { |
1052 | const { isTodosPanelVisible, isFeatureEnabledByUser } = this.stores.todos; | 1052 | const { isTodosPanelVisible, isFeatureEnabledByUser } = this.stores.todos; |
1053 | const { intl } = window.ferdi; | 1053 | const { intl } = window['ferdi']; |
1054 | const menu = []; | 1054 | const menu = []; |
1055 | 1055 | ||
1056 | const drawerLabel = isTodosPanelVisible | 1056 | const drawerLabel = isTodosPanelVisible |
@@ -1084,7 +1084,7 @@ class FranzMenu { | |||
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | debugMenu() { | 1086 | debugMenu() { |
1087 | const { intl } = window.ferdi; | 1087 | const { intl } = window['ferdi']; |
1088 | 1088 | ||
1089 | return [ | 1089 | return [ |
1090 | { | 1090 | { |
@@ -1107,7 +1107,7 @@ class FranzMenu { | |||
1107 | { | 1107 | { |
1108 | label: intl.formatMessage(menuItems.publishDebugInfo), | 1108 | label: intl.formatMessage(menuItems.publishDebugInfo), |
1109 | click: () => { | 1109 | click: () => { |
1110 | window.ferdi.features.publishDebugInfo.state.isModalVisible = true; | 1110 | window['ferdi'].features.publishDebugInfo.state.isModalVisible = true; |
1111 | }, | 1111 | }, |
1112 | }, | 1112 | }, |
1113 | ]; | 1113 | ]; |