1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-30 20:39:46 +02:00

Compare commits

..

59 Commits

Author SHA1 Message Date
Laurent Cozic
76cd69ea16 Electron release v1.3.7 2020-10-20 12:01:12 +01:00
Laurent Cozic
45d4f277e2 Merge branch 'dev' into release-1.3 2020-10-20 12:00:39 +01:00
Naveen M V
fc2a52aa1a Desktop, Cli; Fix notebook search filter (#3946) 2020-10-20 11:54:46 +01:00
Roman Musin
b3e5a1e48d Android: do not show long press menu on press and drag (#3939) 2020-10-20 11:51:24 +01:00
Laurent Cozic
45eb902030 Fixed tests 2020-10-20 11:49:15 +01:00
Ian Slinger
456f7ac00c Desktop, Cli: Import <strike>,<s> tags (strikethrough) from Evernote (#3936) 2020-10-20 11:47:48 +01:00
Aaron
a93bda71fe All: Resolves #3691: Added support for a custom S3 URL (#3921) 2020-10-20 11:44:11 +01:00
Alkindi42
0f9d92dd3d Doc: add archlinux package for pre-release in docs (#3875) 2020-10-20 11:42:41 +01:00
Laurent Cozic
5543e9ef64 Merge branch 'release-1.3' of https://github.com/laurent22/joplin into release-1.3 2020-10-20 11:14:58 +01:00
Laurent Cozic
22dd613660 Revert "Plugins: Adding support for command boolean expressions"
This reverts commit f8f46db910.

Feature was implemented in 3a57cfea02
2020-10-20 11:13:56 +01:00
Laurent Cozic
f7502fe34b Electron release v1.3.6 2020-10-19 23:25:59 +01:00
Laurent Cozic
8254206f44 Desktop: Fixes #3893 (maybe): Trying to fix sidebar performance issue when there are many notebooks or tags 2020-10-19 23:24:40 +01:00
Laurent Cozic
3a57cfea02 Desktop: Simplified and improve command service, and added command palette
- Commands "enabled" state is now expressed using a "when-clause" like in VSCode
- A command palette has been added to the Tools menu
2020-10-18 21:52:10 +01:00
Helmut K. C. Tessarek
71bf0437c1 Desktop: Tray: Exit -> Quit (#3945) 2020-10-18 12:57:04 +01:00
Tomáš Bambas
eca4e24362 All: Translation: Update cs_CZ.po (#3940) 2020-10-17 14:01:32 -04:00
Andros Fenollosa
9a6efb7b37 All: Translation: Update es_ES.po (#3929)
* Update locale es

* Finish translate
2020-10-17 14:00:48 -04:00
jduar
4b666cbbd2 All: Translation: Update pt-PT.po (#3924)
* Updated the Portuguese (pt-PT) translation.

* Updated translator name and email.
2020-10-17 13:58:49 -04:00
Laurent Cozic
f8f46db910 Plugins: Adding support for command boolean expressions 2020-10-17 16:50:07 +01:00
Laurent Cozic
f529adac99 Electron release v1.3.5 2020-10-17 14:05:13 +01:00
Laurent Cozic
3a52b9764b Electron release v1.3.4 2020-10-17 14:03:16 +01:00
Laurent Cozic
7e78d7716b Desktop: Regression: Fixed opening links 2020-10-17 13:56:41 +01:00
Laurent Cozic
0488c5c4cb Android release v1.3.7 2020-10-17 12:07:51 +01:00
Laurent Cozic
921cc3b6c6 Electron release v1.3.3 2020-10-17 11:37:37 +01:00
Laurent Cozic
2a7aa28d4c Desktop, Cli: Fixes #3923 (Regression): Importing ENEX as HTML was importing as Markdown 2020-10-17 11:35:51 +01:00
Laurent Cozic
7b3440ac4c Desktop: Fixes #3915: Editor toolbar was disabled when importing note from MD file 2020-10-17 11:15:43 +01:00
Laurent Cozic
958e5a80b7 Desktop: Fixes #3903: Header links with special characters were no longer working 2020-10-16 22:55:48 +01:00
Laurent Cozic
3179117c62 Mobile: Fixed notebook expand icons 2020-10-16 21:52:27 +01:00
Laurent Cozic
d895463167 All: Removed OneDrive Dev sync target which was not really useful 2020-10-16 21:34:34 +01:00
Laurent Cozic
7e0e513051 Desktop: Regression: Fixed check for update 2020-10-16 21:14:57 +01:00
Laurent Cozic
4309c4f8e2 Desktop: Fixed Toggle Editor button toolip and icon 2020-10-16 18:52:17 +01:00
Laurent Cozic
20b1c90574 Android: Fixed signing config for production 2020-10-16 18:30:58 +01:00
Laurent Cozic
7ff6ceb585 Merge branch 'release-1.3' of https://github.com/laurent22/joplin into release-1.3 2020-10-16 17:45:29 +01:00
Laurent Cozic
3dc3f334ec Tools: Cleaned up ignored files as it was breaking VSCode search 2020-10-16 17:44:50 +01:00
Laurent Cozic
3476211f8b Desktop: Regression: Fixed move to notebook from context menu 2020-10-16 17:44:04 +01:00
Laurent Cozic
48e299916f Desktop: Make sidebar item font weight normal (not bold) 2020-10-16 17:07:43 +01:00
Laurent Cozic
35aebc9f52 Android release v1.3.3 2020-10-16 17:05:22 +01:00
Laurent Cozic
cb3e1cf1e9 Mobile: Upgraded React Native to v0.63
commit 2fb6cee901
Merge: 4e303be85f db509955f6
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 16:24:07 2020 +0100

    Merge branch 'dev' into rn_63

commit 4e303be85f
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 16:14:39 2020 +0100

    Clean up

commit e3a37ec2d6
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 15:57:55 2020 +0100

    Use different script for pre-commit and manual start

commit bd236648fc
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 15:56:45 2020 +0100

    Removed RN eslint config

commit e7feda41c9
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 15:27:08 2020 +0100

    Revert "Disable git hook for now"

    This reverts commit 89263ac742.

commit cfd63fe46f
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 13:02:32 2020 +0100

    Ask permission to use geo-location

commit 66059939a3
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 12:26:20 2020 +0100

    Fixed WebView race condition

commit 1e0d2b7b86
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 11:56:21 2020 +0100

    Fixed webview issues

commit f537d22d7f
Author: Laurent Cozic <laurent@cozic.net>
Date:   Fri Oct 16 11:08:29 2020 +0100

    Improve resource file watching

commit eec32cf70a
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 18:40:13 2020 +0100

    Removed cache package dependency and implemented one more suitable for React Native

commit efa346fea4
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 14:57:21 2020 +0100

    iOS: Added fonts to Info.plist although it was working without it

commit 572b647bc0
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 14:56:49 2020 +0100

    Specify content-type header for OneDrive to prevent network error

commit bcedf6c7f0
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 12:45:01 2020 +0100

    iOS: Disable long press menu since it is already built-in

commit 7359dd61d1
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 12:37:40 2020 +0100

    Removed unused react-native-device-info

commit 2d63ab36d3
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 12:35:54 2020 +0100

    iOS: Fixed taking a picture

commit 8e2875a91c
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 12:11:13 2020 +0100

    iOS: Restored camera roll functionality

commit 75f5edf2ad
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 11:40:13 2020 +0100

    iOS: Fixed build settings

commit b220c98419
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 11:40:03 2020 +0100

    iOS: Got images to work with WebKit

commit c34b43e841
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 10:24:52 2020 +0100

    iOS: Restore more settings

commit 32997611e6
Author: Laurent Cozic <laurent@cozic.net>
Date:   Thu Oct 15 10:15:14 2020 +0100

    iOS: Added back icons and other properties

commit b5811d7f7c
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 23:53:14 2020 +0100

    Got iOS build to work

commit dc6d7c00e0
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 18:40:06 2020 +0100

    Imported old settings in gradle build

commit dff59f5603
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 18:20:00 2020 +0100

    Restored sharing

commit 0bdb449e72
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 17:25:40 2020 +0100

    Updated NoteBodyViewer

commit 0c0d228815
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 16:54:42 2020 +0100

    Fixed networking

commit 6ff45ce485
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 13:11:00 2020 +0100

    Fixed document picker

commit cc889182b6
Author: Laurent Cozic <laurent@cozic.net>
Date:   Wed Oct 14 12:56:27 2020 +0100

    Added back support for alarms

commit 040261abfa
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 22:04:49 2020 +0100

    Fixed Clipboard and remove image-picker package

commit 1077ad8f16
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 21:54:52 2020 +0100

    Fixed Select Alarm dialog and PoorManIntervals class

commit 8296676fd5
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 21:32:52 2020 +0100

    Fixed icons and warnings

commit 3b0e3f6f43
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 17:02:59 2020 +0100

    Got app to build again

commit 89263ac742
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 15:41:17 2020 +0100

    Disable git hook for now

commit d6da162f67
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 15:39:12 2020 +0100

    Restored back all RN packages

commit 7f8ce3732c
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 15:13:12 2020 +0100

    Restored base packages

commit ea59726eb3
Author: Laurent Cozic <laurent@cozic.net>
Date:   Tue Oct 13 15:05:17 2020 +0100

    Started over from scratch
2020-10-16 16:26:19 +01:00
Andros Fenollosa
db509955f6 Cli: Updated installation script with BSD support (#3930) 2020-10-16 15:18:57 +01:00
Caleb John
fb39899f8e Desktop, Cli: Regression: Fix export of pluginAssets when exporting to html/pdf (#3927) 2020-10-16 15:18:19 +01:00
Laurent Cozic
f5d4bedc07 Doc: Fixed plugin API 2020-10-15 16:08:01 +01:00
Laurent Cozic
e710709c15 Fixed special space 2020-10-15 15:54:31 +01:00
Laurent Cozic
d74d6d9539 Update website 2020-10-15 15:35:43 +01:00
Laurent Cozic
435e8dfc3b Trying deployment again 2020-10-15 15:17:18 +01:00
Laurent Cozic
6c68459b34 Update website 2020-10-15 15:07:26 +01:00
Laurent Cozic
2e75a63b26 Updatee website 2020-10-13 13:02:35 +01:00
Laurent Cozic
c328996568 Desktop: Fixed toggleNoteList and toggleSidebar commands 2020-10-13 13:01:02 +01:00
Laurent Cozic
c648f19693 Desktop: Added support for Menu API for plugins 2020-10-13 12:57:03 +01:00
Laurent Cozic
2caaf8e8c1 Desktop: Added support for plugins packaged as JS bundles 2020-10-13 11:16:36 +01:00
Laurent Cozic
ceb7a7303d Desktop: Plugin API - added support for settings.globalValue method 2020-10-13 09:59:53 +01:00
Laurent Cozic
c01f533342 Desktop: Regression: Remove Hide Joplin menu item on Linux too 2020-10-13 09:45:40 +01:00
Laurent Cozic
ff50361e19 Merge branch 'dev' into release-1.3 2020-10-13 09:42:26 +01:00
Laurent Cozic
3539a452a3 Desktop: Remove Hide Joplin menu item on Linux and Windows 2020-10-12 10:45:00 +01:00
Laurent Cozic
9dfe084a02 Destkop: Create template directory on startup 2020-10-12 09:52:36 +01:00
Laurent Cozic
66204401c9 Desktop: Fixes #3899: Regression - Layout Button Sequence menu items were disabled 2020-10-11 22:22:04 +01:00
Laurent Cozic
0644e2897d Security: Updated packages to fix security vulnerabilities 2020-10-11 22:16:53 +01:00
Laurent Cozic
5761451def Merge branch 'dev' into release-1.3 2020-10-11 22:13:06 +01:00
Laurent Cozic
12db3d20ee Electron release v1.3.2 2020-10-11 19:37:57 +01:00
Laurent Cozic
80a70a6649 Desktop: Regression: Context menu in sidebar could point to wrong item 2020-10-11 19:37:12 +01:00
Laurent Cozic
02ed297529 tab 2020-10-11 19:27:33 +01:00
366 changed files with 17577 additions and 9002 deletions

View File

@@ -64,11 +64,13 @@ CliClient/build/
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
CliClient/app/LinkSelector.js
CliClient/app/services/plugins/PluginRunner.js
CliClient/tests/InMemoryCache.js
CliClient/tests/models_Setting.js
CliClient/tests/services_CommandService.js
CliClient/tests/services_InteropService.js
CliClient/tests/services_PluginService.js
CliClient/tests/services_rest_Api.js
CliClient/tests/services/plugins/api/JoplinSetting.js
CliClient/tests/services/plugins/sandboxProxy.js
CliClient/tests/synchronizer_LockHandler.js
CliClient/tests/synchronizer_MigrationHandler.js
@@ -112,7 +114,7 @@ ElectronClient/gui/MainScreen/commands/showNoteProperties.js
ElectronClient/gui/MainScreen/commands/showShareNoteDialog.js
ElectronClient/gui/MainScreen/commands/toggleEditors.js
ElectronClient/gui/MainScreen/commands/toggleNoteList.js
ElectronClient/gui/MainScreen/commands/toggleSidebar.js
ElectronClient/gui/MainScreen/commands/toggleSideBar.js
ElectronClient/gui/MainScreen/commands/toggleVisiblePanes.js
ElectronClient/gui/MainScreen/MainScreen.js
ElectronClient/gui/MenuBar.js
@@ -178,6 +180,7 @@ ElectronClient/gui/SideBar/styles/index.js
ElectronClient/gui/StatusScreen/StatusScreen.js
ElectronClient/gui/style/StyledInput.js
ElectronClient/gui/style/StyledTextInput.js
ElectronClient/gui/TagList.js
ElectronClient/gui/ToggleEditorsButton/styles/index.js
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
ElectronClient/gui/ToolbarBase.js
@@ -185,7 +188,9 @@ ElectronClient/gui/ToolbarButton/styles/index.js
ElectronClient/gui/ToolbarButton/ToolbarButton.js
ElectronClient/gui/utils/NoteListUtils.js
ElectronClient/InteropServiceHelper.js
ElectronClient/plugins/GotoAnything.js
ElectronClient/services/bridge.js
ElectronClient/services/commands/types.js
ElectronClient/services/plugins/hooks/useThemeCss.js
ElectronClient/services/plugins/hooks/useViewIsReady.js
ElectronClient/services/plugins/PlatformImplementation.js
@@ -200,13 +205,21 @@ ReactNativeClient/lib/commands/historyBackward.js
ReactNativeClient/lib/commands/historyForward.js
ReactNativeClient/lib/commands/synchronize.js
ReactNativeClient/lib/components/BackButtonDialogBox.js
ReactNativeClient/lib/components/CameraView.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnMessage.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnResourceLongPress.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useSource.js
ReactNativeClient/lib/components/NoteBodyViewer/NoteBodyViewer.js
ReactNativeClient/lib/components/screens/Note.js
ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
ReactNativeClient/lib/components/SelectDateTimeDialog.js
ReactNativeClient/lib/errorUtils.js
ReactNativeClient/lib/eventManager.js
ReactNativeClient/lib/hooks/useEffectDebugger.js
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
ReactNativeClient/lib/hooks/usePrevious.js
ReactNativeClient/lib/hooks/usePropsDebugger.js
ReactNativeClient/lib/InMemoryCache.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
@@ -218,15 +231,17 @@ ReactNativeClient/lib/markdownUtils.js
ReactNativeClient/lib/models/Alarm.js
ReactNativeClient/lib/models/Setting.js
ReactNativeClient/lib/ntpDate.js
ReactNativeClient/lib/PoorManIntervals.js
ReactNativeClient/lib/reducer.js
ReactNativeClient/lib/services/AlarmService.js
ReactNativeClient/lib/services/AlarmServiceDriver.android.js
ReactNativeClient/lib/services/AlarmServiceDriver.ios.js
ReactNativeClient/lib/services/AlarmServiceDriverNode.js
ReactNativeClient/lib/services/BaseService.js
ReactNativeClient/lib/services/BooleanExpression.js
ReactNativeClient/lib/services/commands/commandsToMarkdownTable.js
ReactNativeClient/lib/services/commands/MenuUtils.js
ReactNativeClient/lib/services/commands/propsHaveChanged.js
ReactNativeClient/lib/services/commands/stateToWhenClauseContext.js
ReactNativeClient/lib/services/commands/ToolbarButtonUtils.js
ReactNativeClient/lib/services/CommandService.js
ReactNativeClient/lib/services/contextkey/contextkey.js
@@ -263,11 +278,13 @@ ReactNativeClient/lib/services/plugins/api/JoplinSettings.js
ReactNativeClient/lib/services/plugins/api/JoplinViews.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsDialogs.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenuItems.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenus.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsPanels.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsToolbarButtons.js
ReactNativeClient/lib/services/plugins/api/JoplinWorkspace.js
ReactNativeClient/lib/services/plugins/api/types.js
ReactNativeClient/lib/services/plugins/BasePluginRunner.js
ReactNativeClient/lib/services/plugins/MenuController.js
ReactNativeClient/lib/services/plugins/MenuItemController.js
ReactNativeClient/lib/services/plugins/Plugin.js
ReactNativeClient/lib/services/plugins/PluginService.js
@@ -296,6 +313,7 @@ ReactNativeClient/lib/services/synchronizer/migrations/1.js
ReactNativeClient/lib/services/synchronizer/migrations/2.js
ReactNativeClient/lib/services/synchronizer/utils/types.js
ReactNativeClient/lib/services/UndoRedoService.js
ReactNativeClient/lib/services/WhenClause.js
ReactNativeClient/lib/ShareExtension.js
ReactNativeClient/lib/shareHandler.js
ReactNativeClient/lib/shim.js

22
.gitignore vendored
View File

@@ -58,11 +58,13 @@ plugin_types/
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
CliClient/app/LinkSelector.js
CliClient/app/services/plugins/PluginRunner.js
CliClient/tests/InMemoryCache.js
CliClient/tests/models_Setting.js
CliClient/tests/services_CommandService.js
CliClient/tests/services_InteropService.js
CliClient/tests/services_PluginService.js
CliClient/tests/services_rest_Api.js
CliClient/tests/services/plugins/api/JoplinSetting.js
CliClient/tests/services/plugins/sandboxProxy.js
CliClient/tests/synchronizer_LockHandler.js
CliClient/tests/synchronizer_MigrationHandler.js
@@ -106,7 +108,7 @@ ElectronClient/gui/MainScreen/commands/showNoteProperties.js
ElectronClient/gui/MainScreen/commands/showShareNoteDialog.js
ElectronClient/gui/MainScreen/commands/toggleEditors.js
ElectronClient/gui/MainScreen/commands/toggleNoteList.js
ElectronClient/gui/MainScreen/commands/toggleSidebar.js
ElectronClient/gui/MainScreen/commands/toggleSideBar.js
ElectronClient/gui/MainScreen/commands/toggleVisiblePanes.js
ElectronClient/gui/MainScreen/MainScreen.js
ElectronClient/gui/MenuBar.js
@@ -172,6 +174,7 @@ ElectronClient/gui/SideBar/styles/index.js
ElectronClient/gui/StatusScreen/StatusScreen.js
ElectronClient/gui/style/StyledInput.js
ElectronClient/gui/style/StyledTextInput.js
ElectronClient/gui/TagList.js
ElectronClient/gui/ToggleEditorsButton/styles/index.js
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
ElectronClient/gui/ToolbarBase.js
@@ -179,7 +182,9 @@ ElectronClient/gui/ToolbarButton/styles/index.js
ElectronClient/gui/ToolbarButton/ToolbarButton.js
ElectronClient/gui/utils/NoteListUtils.js
ElectronClient/InteropServiceHelper.js
ElectronClient/plugins/GotoAnything.js
ElectronClient/services/bridge.js
ElectronClient/services/commands/types.js
ElectronClient/services/plugins/hooks/useThemeCss.js
ElectronClient/services/plugins/hooks/useViewIsReady.js
ElectronClient/services/plugins/PlatformImplementation.js
@@ -194,13 +199,21 @@ ReactNativeClient/lib/commands/historyBackward.js
ReactNativeClient/lib/commands/historyForward.js
ReactNativeClient/lib/commands/synchronize.js
ReactNativeClient/lib/components/BackButtonDialogBox.js
ReactNativeClient/lib/components/CameraView.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnMessage.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnResourceLongPress.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useSource.js
ReactNativeClient/lib/components/NoteBodyViewer/NoteBodyViewer.js
ReactNativeClient/lib/components/screens/Note.js
ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
ReactNativeClient/lib/components/SelectDateTimeDialog.js
ReactNativeClient/lib/errorUtils.js
ReactNativeClient/lib/eventManager.js
ReactNativeClient/lib/hooks/useEffectDebugger.js
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
ReactNativeClient/lib/hooks/usePrevious.js
ReactNativeClient/lib/hooks/usePropsDebugger.js
ReactNativeClient/lib/InMemoryCache.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
@@ -212,15 +225,17 @@ ReactNativeClient/lib/markdownUtils.js
ReactNativeClient/lib/models/Alarm.js
ReactNativeClient/lib/models/Setting.js
ReactNativeClient/lib/ntpDate.js
ReactNativeClient/lib/PoorManIntervals.js
ReactNativeClient/lib/reducer.js
ReactNativeClient/lib/services/AlarmService.js
ReactNativeClient/lib/services/AlarmServiceDriver.android.js
ReactNativeClient/lib/services/AlarmServiceDriver.ios.js
ReactNativeClient/lib/services/AlarmServiceDriverNode.js
ReactNativeClient/lib/services/BaseService.js
ReactNativeClient/lib/services/BooleanExpression.js
ReactNativeClient/lib/services/commands/commandsToMarkdownTable.js
ReactNativeClient/lib/services/commands/MenuUtils.js
ReactNativeClient/lib/services/commands/propsHaveChanged.js
ReactNativeClient/lib/services/commands/stateToWhenClauseContext.js
ReactNativeClient/lib/services/commands/ToolbarButtonUtils.js
ReactNativeClient/lib/services/CommandService.js
ReactNativeClient/lib/services/contextkey/contextkey.js
@@ -257,11 +272,13 @@ ReactNativeClient/lib/services/plugins/api/JoplinSettings.js
ReactNativeClient/lib/services/plugins/api/JoplinViews.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsDialogs.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenuItems.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenus.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsPanels.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsToolbarButtons.js
ReactNativeClient/lib/services/plugins/api/JoplinWorkspace.js
ReactNativeClient/lib/services/plugins/api/types.js
ReactNativeClient/lib/services/plugins/BasePluginRunner.js
ReactNativeClient/lib/services/plugins/MenuController.js
ReactNativeClient/lib/services/plugins/MenuItemController.js
ReactNativeClient/lib/services/plugins/Plugin.js
ReactNativeClient/lib/services/plugins/PluginService.js
@@ -290,6 +307,7 @@ ReactNativeClient/lib/services/synchronizer/migrations/1.js
ReactNativeClient/lib/services/synchronizer/migrations/2.js
ReactNativeClient/lib/services/synchronizer/utils/types.js
ReactNativeClient/lib/services/UndoRedoService.js
ReactNativeClient/lib/services/WhenClause.js
ReactNativeClient/lib/ShareExtension.js
ReactNativeClient/lib/shareHandler.js
ReactNativeClient/lib/shim.js

278
.ignore Normal file
View File

@@ -0,0 +1,278 @@
# This is used by VSCode to ignore patterns during search.
# Before they were in joplin.code-workspace, under the `files.exclude` key
# but it eventually reached the limit with ENAMETOOLONG error.
#
# https://github.com/microsoft/vscode/issues/94718
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
CliClient/app/LinkSelector.js
CliClient/app/services/plugins/PluginRunner.js
CliClient/tests/InMemoryCache.js
CliClient/tests/models_Setting.js
CliClient/tests/services_CommandService.js
CliClient/tests/services_InteropService.js
CliClient/tests/services_PluginService.js
CliClient/tests/services_rest_Api.js
CliClient/tests/services/plugins/api/JoplinSetting.js
CliClient/tests/services/plugins/sandboxProxy.js
CliClient/tests/synchronizer_LockHandler.js
CliClient/tests/synchronizer_MigrationHandler.js
ElectronClient/app.js
ElectronClient/bridge.js
ElectronClient/commands/copyDevCommand.js
ElectronClient/commands/focusElement.js
ElectronClient/commands/startExternalEditing.js
ElectronClient/commands/stopExternalEditing.js
ElectronClient/commands/toggleExternalEditing.js
ElectronClient/ElectronAppWrapper.js
ElectronClient/global.d.js
ElectronClient/gui/Button/Button.js
ElectronClient/gui/ConfigScreen/ButtonBar.js
ElectronClient/gui/ConfigScreen/ConfigScreen.js
ElectronClient/gui/ConfigScreen/SideBar.js
ElectronClient/gui/DropboxLoginScreen.js
ElectronClient/gui/ErrorBoundary.js
ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js
ElectronClient/gui/KeymapConfig/ShortcutRecorder.js
ElectronClient/gui/KeymapConfig/styles/index.js
ElectronClient/gui/KeymapConfig/utils/getLabel.js
ElectronClient/gui/KeymapConfig/utils/useCommandStatus.js
ElectronClient/gui/KeymapConfig/utils/useKeymap.js
ElectronClient/gui/MainScreen/commands/editAlarm.js
ElectronClient/gui/MainScreen/commands/exportPdf.js
ElectronClient/gui/MainScreen/commands/hideModalMessage.js
ElectronClient/gui/MainScreen/commands/moveToFolder.js
ElectronClient/gui/MainScreen/commands/newFolder.js
ElectronClient/gui/MainScreen/commands/newNote.js
ElectronClient/gui/MainScreen/commands/newTodo.js
ElectronClient/gui/MainScreen/commands/print.js
ElectronClient/gui/MainScreen/commands/renameFolder.js
ElectronClient/gui/MainScreen/commands/renameTag.js
ElectronClient/gui/MainScreen/commands/search.js
ElectronClient/gui/MainScreen/commands/selectTemplate.js
ElectronClient/gui/MainScreen/commands/setTags.js
ElectronClient/gui/MainScreen/commands/showModalMessage.js
ElectronClient/gui/MainScreen/commands/showNoteContentProperties.js
ElectronClient/gui/MainScreen/commands/showNoteProperties.js
ElectronClient/gui/MainScreen/commands/showShareNoteDialog.js
ElectronClient/gui/MainScreen/commands/toggleEditors.js
ElectronClient/gui/MainScreen/commands/toggleNoteList.js
ElectronClient/gui/MainScreen/commands/toggleSideBar.js
ElectronClient/gui/MainScreen/commands/toggleVisiblePanes.js
ElectronClient/gui/MainScreen/MainScreen.js
ElectronClient/gui/MenuBar.js
ElectronClient/gui/MultiNoteActions.js
ElectronClient/gui/NoteContentPropertiesDialog.js
ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.js
ElectronClient/gui/NoteEditor/commands/focusElementNoteBody.js
ElectronClient/gui/NoteEditor/commands/focusElementNoteTitle.js
ElectronClient/gui/NoteEditor/commands/showLocalSearch.js
ElectronClient/gui/NoteEditor/commands/showRevisions.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/Editor.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/styles/index.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/Toolbar.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/index.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/types.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useJoplinMode.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useKeymap.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useLineSorting.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useListIdent.js
ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollUtils.js
ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/styles/index.js
ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js
ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.js
ElectronClient/gui/NoteEditor/NoteEditor.js
ElectronClient/gui/NoteEditor/styles/index.js
ElectronClient/gui/NoteEditor/utils/contextMenu.js
ElectronClient/gui/NoteEditor/utils/index.js
ElectronClient/gui/NoteEditor/utils/resourceHandling.js
ElectronClient/gui/NoteEditor/utils/types.js
ElectronClient/gui/NoteEditor/utils/useDropHandler.js
ElectronClient/gui/NoteEditor/utils/useFolder.js
ElectronClient/gui/NoteEditor/utils/useFormNote.js
ElectronClient/gui/NoteEditor/utils/useMarkupToHtml.js
ElectronClient/gui/NoteEditor/utils/useMessageHandler.js
ElectronClient/gui/NoteEditor/utils/useNoteSearchBar.js
ElectronClient/gui/NoteEditor/utils/usePluginServiceRegistration.js
ElectronClient/gui/NoteEditor/utils/useSearchMarkers.js
ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.js
ElectronClient/gui/NoteList/commands/focusElementNoteList.js
ElectronClient/gui/NoteList/NoteList.js
ElectronClient/gui/NoteListControls/commands/focusSearch.js
ElectronClient/gui/NoteListControls/NoteListControls.js
ElectronClient/gui/NoteListItem.js
ElectronClient/gui/NoteTextViewer.js
ElectronClient/gui/NoteToolbar/NoteToolbar.js
ElectronClient/gui/OneDriveLoginScreen.js
ElectronClient/gui/ResizableLayout/hooks/useLayoutItemSizes.js
ElectronClient/gui/ResizableLayout/hooks/useWindowResizeEvent.js
ElectronClient/gui/ResizableLayout/ResizableLayout.js
ElectronClient/gui/ResourceScreen.js
ElectronClient/gui/Root_UpgradeSyncTarget.js
ElectronClient/gui/Root.js
ElectronClient/gui/SearchBar/hooks/useSearch.js
ElectronClient/gui/SearchBar/SearchBar.js
ElectronClient/gui/SearchBar/styles/index.js
ElectronClient/gui/ShareNoteDialog.js
ElectronClient/gui/SideBar/commands/focusElementSideBar.js
ElectronClient/gui/SideBar/SideBar.js
ElectronClient/gui/SideBar/styles/index.js
ElectronClient/gui/StatusScreen/StatusScreen.js
ElectronClient/gui/style/StyledInput.js
ElectronClient/gui/style/StyledTextInput.js
ElectronClient/gui/TagList.js
ElectronClient/gui/ToggleEditorsButton/styles/index.js
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
ElectronClient/gui/ToolbarBase.js
ElectronClient/gui/ToolbarButton/styles/index.js
ElectronClient/gui/ToolbarButton/ToolbarButton.js
ElectronClient/gui/utils/NoteListUtils.js
ElectronClient/InteropServiceHelper.js
ElectronClient/plugins/GotoAnything.js
ElectronClient/services/bridge.js
ElectronClient/services/commands/types.js
ElectronClient/services/plugins/hooks/useThemeCss.js
ElectronClient/services/plugins/hooks/useViewIsReady.js
ElectronClient/services/plugins/PlatformImplementation.js
ElectronClient/services/plugins/PluginRunner.js
ElectronClient/services/plugins/UserWebview.js
ElectronClient/services/plugins/UserWebviewDialog.js
ElectronClient/services/plugins/UserWebviewDialogButtonBar.js
ReactNativeClient/lib/AsyncActionQueue.js
ReactNativeClient/lib/BaseApplication.js
ReactNativeClient/lib/checkPermissions.js
ReactNativeClient/lib/commands/historyBackward.js
ReactNativeClient/lib/commands/historyForward.js
ReactNativeClient/lib/commands/synchronize.js
ReactNativeClient/lib/components/BackButtonDialogBox.js
ReactNativeClient/lib/components/CameraView.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnMessage.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useOnResourceLongPress.js
ReactNativeClient/lib/components/NoteBodyViewer/hooks/useSource.js
ReactNativeClient/lib/components/NoteBodyViewer/NoteBodyViewer.js
ReactNativeClient/lib/components/screens/Note.js
ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
ReactNativeClient/lib/components/SelectDateTimeDialog.js
ReactNativeClient/lib/errorUtils.js
ReactNativeClient/lib/eventManager.js
ReactNativeClient/lib/hooks/useEffectDebugger.js
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
ReactNativeClient/lib/hooks/usePrevious.js
ReactNativeClient/lib/hooks/usePropsDebugger.js
ReactNativeClient/lib/InMemoryCache.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
ReactNativeClient/lib/JoplinServerApi.js
ReactNativeClient/lib/locale.js
ReactNativeClient/lib/Logger.js
ReactNativeClient/lib/markdownUtils.js
ReactNativeClient/lib/models/Alarm.js
ReactNativeClient/lib/models/Setting.js
ReactNativeClient/lib/ntpDate.js
ReactNativeClient/lib/PoorManIntervals.js
ReactNativeClient/lib/reducer.js
ReactNativeClient/lib/services/AlarmService.js
ReactNativeClient/lib/services/AlarmServiceDriver.android.js
ReactNativeClient/lib/services/AlarmServiceDriver.ios.js
ReactNativeClient/lib/services/AlarmServiceDriverNode.js
ReactNativeClient/lib/services/BaseService.js
ReactNativeClient/lib/services/commands/commandsToMarkdownTable.js
ReactNativeClient/lib/services/commands/MenuUtils.js
ReactNativeClient/lib/services/commands/propsHaveChanged.js
ReactNativeClient/lib/services/commands/stateToWhenClauseContext.js
ReactNativeClient/lib/services/commands/ToolbarButtonUtils.js
ReactNativeClient/lib/services/CommandService.js
ReactNativeClient/lib/services/contextkey/contextkey.js
ReactNativeClient/lib/services/debug/populateDatabase.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Base.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Custom.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Html.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Jex.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Md.js
ReactNativeClient/lib/services/interop/InteropService_Exporter_Raw.js
ReactNativeClient/lib/services/interop/InteropService_Importer_Base.js
ReactNativeClient/lib/services/interop/InteropService_Importer_Custom.js
ReactNativeClient/lib/services/interop/InteropService_Importer_EnexToHtml.js
ReactNativeClient/lib/services/interop/InteropService_Importer_EnexToMd.js
ReactNativeClient/lib/services/interop/InteropService_Importer_Jex.js
ReactNativeClient/lib/services/interop/InteropService_Importer_Md.js
ReactNativeClient/lib/services/interop/InteropService_Importer_Raw.js
ReactNativeClient/lib/services/interop/InteropService.js
ReactNativeClient/lib/services/interop/types.js
ReactNativeClient/lib/services/keychain/KeychainService.js
ReactNativeClient/lib/services/keychain/KeychainServiceDriver.dummy.js
ReactNativeClient/lib/services/keychain/KeychainServiceDriver.mobile.js
ReactNativeClient/lib/services/keychain/KeychainServiceDriver.node.js
ReactNativeClient/lib/services/keychain/KeychainServiceDriverBase.js
ReactNativeClient/lib/services/KeymapService.js
ReactNativeClient/lib/services/plugins/api/Global.js
ReactNativeClient/lib/services/plugins/api/Joplin.js
ReactNativeClient/lib/services/plugins/api/JoplinCommands.js
ReactNativeClient/lib/services/plugins/api/JoplinData.js
ReactNativeClient/lib/services/plugins/api/JoplinFilters.js
ReactNativeClient/lib/services/plugins/api/JoplinInterop.js
ReactNativeClient/lib/services/plugins/api/JoplinPlugins.js
ReactNativeClient/lib/services/plugins/api/JoplinSettings.js
ReactNativeClient/lib/services/plugins/api/JoplinViews.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsDialogs.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenuItems.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenus.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsPanels.js
ReactNativeClient/lib/services/plugins/api/JoplinViewsToolbarButtons.js
ReactNativeClient/lib/services/plugins/api/JoplinWorkspace.js
ReactNativeClient/lib/services/plugins/api/types.js
ReactNativeClient/lib/services/plugins/BasePluginRunner.js
ReactNativeClient/lib/services/plugins/MenuController.js
ReactNativeClient/lib/services/plugins/MenuItemController.js
ReactNativeClient/lib/services/plugins/Plugin.js
ReactNativeClient/lib/services/plugins/PluginService.js
ReactNativeClient/lib/services/plugins/reducer.js
ReactNativeClient/lib/services/plugins/sandboxProxy.js
ReactNativeClient/lib/services/plugins/ToolbarButtonController.js
ReactNativeClient/lib/services/plugins/utils/createViewHandle.js
ReactNativeClient/lib/services/plugins/utils/executeSandboxCall.js
ReactNativeClient/lib/services/plugins/utils/manifestFromObject.js
ReactNativeClient/lib/services/plugins/utils/mapEventHandlersToIds.js
ReactNativeClient/lib/services/plugins/utils/types.js
ReactNativeClient/lib/services/plugins/ViewController.js
ReactNativeClient/lib/services/plugins/WebviewController.js
ReactNativeClient/lib/services/ResourceEditWatcher/index.js
ReactNativeClient/lib/services/ResourceEditWatcher/reducer.js
ReactNativeClient/lib/services/rest/actionApi.desktop.js
ReactNativeClient/lib/services/rest/Api.js
ReactNativeClient/lib/services/rest/errors.js
ReactNativeClient/lib/services/searchengine/filterParser.js
ReactNativeClient/lib/services/searchengine/queryBuilder.js
ReactNativeClient/lib/services/SettingUtils.js
ReactNativeClient/lib/services/synchronizer/gui/useSyncTargetUpgrade.js
ReactNativeClient/lib/services/synchronizer/LockHandler.js
ReactNativeClient/lib/services/synchronizer/MigrationHandler.js
ReactNativeClient/lib/services/synchronizer/migrations/1.js
ReactNativeClient/lib/services/synchronizer/migrations/2.js
ReactNativeClient/lib/services/synchronizer/utils/types.js
ReactNativeClient/lib/services/UndoRedoService.js
ReactNativeClient/lib/services/WhenClause.js
ReactNativeClient/lib/ShareExtension.js
ReactNativeClient/lib/shareHandler.js
ReactNativeClient/lib/shim.js
ReactNativeClient/lib/Synchronizer.js
ReactNativeClient/lib/theme.js
ReactNativeClient/lib/themes/aritimDark.js
ReactNativeClient/lib/themes/dark.js
ReactNativeClient/lib/themes/dracula.js
ReactNativeClient/lib/themes/light.js
ReactNativeClient/lib/themes/nord.js
ReactNativeClient/lib/themes/oledDark.js
ReactNativeClient/lib/themes/solarizedDark.js
ReactNativeClient/lib/themes/solarizedLight.js
ReactNativeClient/lib/themes/type.js
ReactNativeClient/lib/uuid.js
ReactNativeClient/lib/versionInfo.js
ReactNativeClient/PluginAssetsLoader.js
ReactNativeClient/setUpQuickActions.js
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD

File diff suppressed because it is too large Load Diff

View File

@@ -2,25 +2,29 @@
# Copyright (C) 2017 Lucas Vieites
# Copyright (C) 2019 Andros Fenollosa
# Copyright (C) 2019 Germán Martín
# Copyright (C) 2020 Andros Fenollosa
# This file is distributed under the same license as the Joplin-CLI package.
# Lucas Vieites <lucas.vieites@gmail.com>, 2017.
# Andros Fenollosa <andros@fenollosa.email>, 2019.
# Germán Martín <gmag11@gmail.com>, 2019.
# Fernando Pindado <fpindado@gmail.com>, 2020.
# Andros Fenollosa <andros@fenollosa.email>, 2020.
#
msgid ""
msgstr ""
"Project-Id-Version: Joplin-CLI 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Fernando Pindado <fpindado@gmail.com>\n"
"Last-Translator: Andros Fenollosa <andros@fenollosa.email>\n"
"Language-Team: Spanish <lucas.vieites@gmail.com>\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Generator: Poedit 2.4.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
#: ElectronClient/services/plugins/UserWebviewDialogButtonBar.js:20
#: ElectronClient/checkForUpdates.js:139
@@ -528,12 +532,14 @@ msgstr "Creando nuevo %s..."
#: ElectronClient/gui/NoteEditor/NoteEditor.js:373
msgid "The following attachments are being watched for changes:"
msgstr ""
"Los siguientes adjuntos están siendo vigilados para ver si hay cambios:"
#: ElectronClient/gui/NoteEditor/NoteEditor.js:376
msgid ""
"The attachments will no longer be watched when you switch to a different "
"note."
msgstr ""
"Los archivos adjuntos ya no se verán cuándo cambies a una nota diferente."
#: ElectronClient/gui/NoteEditor/NoteEditor.js:381
#, javascript-format
@@ -649,12 +655,15 @@ msgid ""
"may take a few minutes to complete and the app needs to be restarted. To "
"proceed please click on the link."
msgstr ""
"El objetivo de sincronización necesita ser actualizado antes de que Joplin "
"pueda sincronizarse. La operación puede tardar unos minutos en completarse y "
"la aplicación necesita ser reiniciada. Para proceder, por favor, haz clic en "
"el enlace."
#: ElectronClient/gui/MainScreen/MainScreen.js:416
#: ElectronClient/gui/MainScreen/MainScreen.min.js:306
#, fuzzy
msgid "Restart and upgrade"
msgstr "Claves maestras que necesitan actualización"
msgstr "Reiniciar y actualizar"
#: ElectronClient/gui/MainScreen/MainScreen.js:420
#: ElectronClient/gui/MainScreen/MainScreen.min.js:313
@@ -814,9 +823,8 @@ msgid "Toggle sidebar"
msgstr "Cambia la barra lateral"
#: ElectronClient/gui/MainScreen/commands/toggleEditors.js:17
#, fuzzy
msgid "Toggle editors"
msgstr "Cambia el diseño del editor"
msgstr "Intercambiar editores"
#: ElectronClient/gui/MainScreen/commands/selectTemplate.js:23
msgid "Template file:"
@@ -1321,9 +1329,8 @@ msgid "Import"
msgstr "Importar"
#: ElectronClient/gui/MenuBar.js:343
#, fuzzy
msgid "Export all"
msgstr "Exportar"
msgstr "Exportar todo"
#: ElectronClient/gui/MenuBar.js:356
#, javascript-format
@@ -1404,38 +1411,36 @@ msgstr "Adjuntos"
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
msgid "Press the shortcut"
msgstr ""
msgstr "Presiona el atajo"
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
msgid ""
"Press the shortcut and then press ENTER. Or, press BACKSPACE to clear the "
"shortcut."
msgstr ""
"Pulse el atajo y luego ENTER. O bien, pulse RETROCESO para borrar el atajo."
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:62
#: ReactNativeClient/lib/services/KeymapService.js:142
#, fuzzy, javascript-format
#, javascript-format
msgid "Error: %s"
msgstr "Error"
msgstr "Error: %s"
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:125
msgid "Command"
msgstr ""
msgstr "Comando"
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:126
#, fuzzy
msgid "Keyboard Shortcut"
msgstr "Modo de teclado"
msgstr "Atajo de teclado"
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:24
#, fuzzy
msgid "Hide Joplin"
msgstr "Acerca de Joplin"
msgstr "Ocultar Joplin"
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:28
#, fuzzy
msgid "Preferences"
msgstr "Preferencias..."
msgstr "Preferencias"
#: ElectronClient/gui/NoteContentPropertiesDialog.js:77
msgid "Words"
@@ -1480,6 +1485,8 @@ msgstr "Estadísticas"
msgid ""
"The app is now going to close. Please relaunch it to complete the process."
msgstr ""
"La aplicación se va a cerrar. Por favor, vuelva a iniciarla para completar "
"el proceso."
#: ElectronClient/app.js:340
#, javascript-format
@@ -1491,9 +1498,8 @@ msgid "Exit"
msgstr "Salir"
#: ElectronClient/commands/copyDevCommand.js:17
#, fuzzy
msgid "Copy dev mode command to clipboard"
msgstr "Copiar la ruta en el portapapeles"
msgstr "Copiar el comando del modo de desarrollo al portapapeles"
#: ElectronClient/commands/startExternalEditing.js:18
msgid "Edit in external editor"
@@ -1505,13 +1511,12 @@ msgid "Error opening note in editor: %s"
msgstr "Error abriendo la nota en el editor: %s"
#: ElectronClient/commands/toggleExternalEditing.js:16
#, fuzzy
msgid "Toggle external editing"
msgstr "Detener la edición externa"
msgstr "Intercambiar la edición externa"
#: ElectronClient/commands/toggleExternalEditing.js:42
msgid "Stop"
msgstr ""
msgstr "Parar"
#: ElectronClient/commands/stopExternalEditing.js:16
msgid "Stop external editing"
@@ -1740,7 +1745,7 @@ msgstr ""
#: CliClient/app/command-sync.js:35
msgid "Upgrade the sync target to the latest version."
msgstr ""
msgstr "Actualiza el objetivo de sincronización a la última versión."
#: CliClient/app/command-sync.js:105
#, javascript-format
@@ -2247,10 +2252,10 @@ msgstr ""
"No se puede cargar el módulo «%s» para el formato «%s» y destino \"%s\""
#: ReactNativeClient/lib/services/interop/InteropService.js:152
#, fuzzy, javascript-format
#, javascript-format
msgid "Cannot load \"%s\" module for format \"%s\" and target \"%s\""
msgstr ""
"No se puede cargar el módulo «%s» para el formato «%s» y destino \"%s\""
"No se puede cargar el módulo %s para el formato %s y el objetivo “%s”"
#: ReactNativeClient/lib/services/interop/InteropService.js:187
#, javascript-format
@@ -2267,23 +2272,23 @@ msgstr "Notas restauradas"
#: ReactNativeClient/lib/services/KeymapService.js:236
msgid "command"
msgstr ""
msgstr "comando"
#: ReactNativeClient/lib/services/KeymapService.js:236
#: ReactNativeClient/lib/services/KeymapService.js:241
#, javascript-format
msgid "\"%s\" is missing the required \"%s\" property."
msgstr ""
msgstr "A “%s” le falta la propiedad requerida de “%s”."
#: ReactNativeClient/lib/services/KeymapService.js:241
#: ReactNativeClient/lib/services/KeymapService.js:248
msgid "accelerator"
msgstr ""
msgstr "acelerador"
#: ReactNativeClient/lib/services/KeymapService.js:248
#, fuzzy, javascript-format
#, javascript-format
msgid "Invalid %s: %s."
msgstr "Respuesta inválida: %s"
msgstr "Inválido %s: %s."
#: ReactNativeClient/lib/services/KeymapService.js:266
#, javascript-format
@@ -2291,11 +2296,13 @@ msgid ""
"Accelerator \"%s\" is used for \"%s\" and \"%s\" commands. This may lead to "
"unexpected behaviour."
msgstr ""
"El acelerador “%s” se usa para los comandos “%s” y “%s”. Esto puede llevar a "
"un comportamiento inesperado."
#: ReactNativeClient/lib/services/KeymapService.js:291
#, javascript-format
msgid "Accelerator \"%s\" is not valid."
msgstr ""
msgstr "El acelerador “%s” no es válido."
#: ReactNativeClient/lib/services/report.js:121
msgid "Items that cannot be synchronised"
@@ -2445,7 +2452,7 @@ msgstr "Versión del perfil: %s"
#: ReactNativeClient/lib/versionInfo.js:23
#, javascript-format
msgid "Keychain Supported: %s"
msgstr ""
msgstr "Llavero soportado: %s"
#: ReactNativeClient/lib/JoplinServerApi.js:71
#, javascript-format
@@ -2849,7 +2856,7 @@ msgstr "Añadir título"
#: ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js:42
msgid "Sync Target Upgrade"
msgstr ""
msgstr "Actualización del objetivo de sincronización"
#: ReactNativeClient/lib/components/screens/encryption-config.js:119
#, javascript-format
@@ -2941,6 +2948,8 @@ msgstr ""
#: ReactNativeClient/lib/components/screen-header.js:453
msgid "The sync target needs to be upgraded. Press this banner to proceed."
msgstr ""
"El objetivo de sincronización necesita ser mejorado. Presiona este banner "
"para proceder."
#: ReactNativeClient/lib/components/side-menu-content.js:126
#, javascript-format
@@ -3137,7 +3146,7 @@ msgstr "sí"
#: ReactNativeClient/lib/models/Setting.js:66
#, javascript-format
msgid "(wysiwyg: %s)"
msgstr ""
msgstr "(wysiwyg: %s)"
#: ReactNativeClient/lib/models/Setting.js:66
msgid "no"
@@ -3180,7 +3189,7 @@ msgstr "Nord"
#: ReactNativeClient/lib/models/Setting.js:80
msgid "Aritim Dark"
msgstr ""
msgstr "Aritim Oscuro"
#: ReactNativeClient/lib/models/Setting.js:81
msgid "OLED Dark"
@@ -3229,15 +3238,15 @@ msgstr "Contraseña de WebDAV"
#: ReactNativeClient/lib/models/Setting.js:214
msgid "AWS S3 bucket"
msgstr ""
msgstr "AWS S3 bucket"
#: ReactNativeClient/lib/models/Setting.js:225
msgid "AWS key"
msgstr ""
msgstr "AWS key"
#: ReactNativeClient/lib/models/Setting.js:235
msgid "AWS secret"
msgstr ""
msgstr "AWS secret"
#: ReactNativeClient/lib/models/Setting.js:247
msgid "Attachment download behaviour"
@@ -3695,9 +3704,8 @@ msgid "Web Clipper"
msgstr "Web Clipper"
#: ReactNativeClient/lib/models/Setting.js:1292
#, fuzzy
msgid "Keyboard Shortcuts"
msgstr "Modo de teclado"
msgstr "Atajos de teclado"
#: ReactNativeClient/lib/models/Setting.js:1299
msgid ""
@@ -3744,7 +3752,7 @@ msgstr "OneDrive"
#: ReactNativeClient/lib/SyncTargetAmazonS3.js:28
msgid "AWS S3"
msgstr ""
msgstr "AWS S3"
#: ReactNativeClient/lib/commands/historyForward.js:16
msgid "Forward"

View File

@@ -7,14 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Joplin-CLI 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Diogo Caveiro \n"
"Last-Translator: João Duarte <jduar@protonmail.com>\n"
"Language-Team: \n"
"Language: pt_PT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2.4\n"
"X-Generator: Poedit 2.4.1\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
#: ElectronClient/services/plugins/UserWebviewDialogButtonBar.js:20
#: ElectronClient/checkForUpdates.js:139
@@ -112,29 +114,28 @@ msgid "Full Release Notes"
msgstr "Notas de Lançamento Completas"
#: ElectronClient/InteropServiceHelper.js:153
#, fuzzy, javascript-format
#, javascript-format
msgid "Exporting to \"%s\" as \"%s\" format. Please wait..."
msgstr "A importar de \"%s\" com o formato \"%s\". Por favor, aguarde..."
msgstr "A exportar para \"%s\" com o formato \"%s\". Por favor, aguarde..."
#: ElectronClient/InteropServiceHelper.js:170
#, fuzzy, javascript-format
#, javascript-format
msgid "Could not export notes: %s"
msgstr "Não foi possível atualizar a chave mestra: %s"
msgstr "Não foi possível exportar as notas: %s"
#: ElectronClient/plugins/GotoAnything.min.js:459
#, fuzzy
msgid ""
"Type a note title or part of its content to jump to it. Or type # followed "
"by a tag name, or @ followed by a notebook name."
msgstr ""
"Digite um título de nota para avançar para o mesmo. Ou digite # seguido do "
"título de uma etiqueta, ou @ seguido do nome de um bloco de notas, ou / "
"seguido do conteúdo da nota."
"Escreva um título de uma nota ou parte do seu conteúdo para saltar para o "
"mesmo. Ou digite # seguido de um nome de etiqueta, ou @ seguido de um nome "
"de um caderno."
#: ElectronClient/plugins/GotoAnything.min.js:499
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:20
msgid "Goto Anything..."
msgstr "Ir até qualquer coisa..."
msgstr "Saltar para..."
#: ElectronClient/gui/NoteListControls/commands/focusSearch.js:15
msgid "Search in all the notes"
@@ -178,9 +179,9 @@ msgid "Delete"
msgstr "Eliminar"
#: ElectronClient/gui/ResourceScreen.js:94
#, fuzzy, javascript-format
#, javascript-format
msgid "Delete attachment \"%s\"?"
msgstr "Eliminar nota \"%s\"?"
msgstr "Eliminar anexo \"%s\"?"
#: ElectronClient/gui/ResourceScreen.js:140
msgid ""
@@ -188,6 +189,9 @@ msgid ""
"notes. Please be careful when deleting one of them as they cannot be "
"restored afterwards."
msgstr ""
"Esta é uma ferramenta avançada para ver os anexos que estão ligados às suas "
"notas. Por favor tenha cuidado ao apagar um deles já que não poderão ser "
"repostos de seguida."
#: ElectronClient/gui/ResourceScreen.js:141
msgid "Please wait..."
@@ -195,13 +199,13 @@ msgstr "Por favor, aguarde..."
#: ElectronClient/gui/ResourceScreen.js:143
msgid "No resources!"
msgstr "Sem fontes!"
msgstr "Sem recursos!"
#: ElectronClient/gui/ResourceScreen.js:145
#, javascript-format
msgid "Warning: not all resources shown for performance reasons (limit: %s)."
msgstr ""
"Aviso: nem todas as fontes apresentadas por razões de desempenho (limite: "
"Aviso: nem todos os recursos apresentadas por razões de desempenho (limite: "
"%s)."
#: ElectronClient/gui/PromptDialog.min.js:249
@@ -427,11 +431,11 @@ msgstr "Anexar ficheiro"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:584
msgid "Code Block"
msgstr ""
msgstr "Bloco de Código"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:593
msgid "Inline Code"
msgstr ""
msgstr "Código em Linha"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:608
#: ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.js:83
@@ -440,13 +444,12 @@ msgstr "Inserir Data e Hora"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
msgid "Drop notes or files here"
msgstr ""
msgstr "Insira notas ou ficheiros aqui"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
#: ElectronClient/gui/MainScreen/MainScreen.min.js:419
#, fuzzy
msgid "Code View"
msgstr "Código"
msgstr "Vista de Código"
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
#, javascript-format
@@ -454,18 +457,18 @@ msgid ""
"Please wait for all attachments to be downloaded and decrypted. You may also "
"switch to %s to edit the note."
msgstr ""
"Por favor espere que todos os anexados sejam transferidos e desencriptados. "
"Também pode mudar para %s para editar a nota."
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/plugins/lists.js:2151
#, fuzzy
msgid "Checkbox list"
msgstr "Campo de seleção"
msgstr "Lista de caixas de seleção"
#: ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.js:165
msgid "strong text"
msgstr "texto destacado"
#: ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.js:166
#, fuzzy
msgid "emphasised text"
msgstr "texto realçado"
@@ -526,13 +529,14 @@ msgstr "A criar novo/a %s..."
#: ElectronClient/gui/NoteEditor/NoteEditor.js:373
msgid "The following attachments are being watched for changes:"
msgstr ""
msgstr "Os anexos seguintes estão a ser monitorizados quanto a alterações:"
#: ElectronClient/gui/NoteEditor/NoteEditor.js:376
msgid ""
"The attachments will no longer be watched when you switch to a different "
"note."
msgstr ""
"Os anexos deixarão de ser monitorizados quando mudar para uma nota diferente."
#: ElectronClient/gui/NoteEditor/NoteEditor.js:381
#, javascript-format
@@ -549,7 +553,7 @@ msgstr "Guardar como..."
#: ElectronClient/gui/NoteEditor/utils/contextMenu.js:65
msgid "Reveal file in folder"
msgstr ""
msgstr "Revelar arquivo na pasta"
#: ElectronClient/gui/NoteEditor/utils/contextMenu.js:73
msgid "Copy path to clipboard"
@@ -649,12 +653,15 @@ msgid ""
"may take a few minutes to complete and the app needs to be restarted. To "
"proceed please click on the link."
msgstr ""
"O alvo de sincronização deve ser atualizado antes que o Joplin possa "
"sincronizar. A operação pode demorar alguns minutos a ser completa e a "
"aplicação precisará de ser reiniciada. Para proceder, por favor clique na "
"ligação."
#: ElectronClient/gui/MainScreen/MainScreen.js:416
#: ElectronClient/gui/MainScreen/MainScreen.min.js:306
#, fuzzy
msgid "Restart and upgrade"
msgstr "Chaves mestras que necessitam de atualização"
msgstr "Reiniciar e atualizar"
#: ElectronClient/gui/MainScreen/MainScreen.js:420
#: ElectronClient/gui/MainScreen/MainScreen.min.js:313
@@ -712,11 +719,11 @@ msgstr "Procurar..."
#: ElectronClient/gui/MainScreen/commands/moveToFolder.js:17
msgid "Move to notebook"
msgstr "Mudar para o bloco de notas"
msgstr "Mudar para o caderno"
#: ElectronClient/gui/MainScreen/commands/moveToFolder.js:36
msgid "Move to notebook:"
msgstr "Mudar para o bloco de notas:"
msgstr "Mudar para o caderno:"
#: ElectronClient/gui/MainScreen/commands/setTags.js:16
#: ElectronClient/gui/SideBar/SideBar.js:426
@@ -814,9 +821,8 @@ msgid "Toggle sidebar"
msgstr "Alternar a barra lateral"
#: ElectronClient/gui/MainScreen/commands/toggleEditors.js:17
#, fuzzy
msgid "Toggle editors"
msgstr "Alternar a estrutura do editor"
msgstr "Alternar editores"
#: ElectronClient/gui/MainScreen/commands/selectTemplate.js:23
msgid "Template file:"
@@ -824,7 +830,7 @@ msgstr "Ficheiro do modelo:"
#: ElectronClient/gui/MainScreen/commands/showNoteContentProperties.js:16
msgid "Statistics..."
msgstr ""
msgstr "Estatísticas..."
#: ElectronClient/gui/EncryptionConfigScreen.min.js:96
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:49
@@ -1148,13 +1154,12 @@ msgstr ""
#: ElectronClient/gui/NoteList/NoteList.min.js:151
#: ElectronClient/gui/NoteList/NoteList.js:160
msgid "Custom order"
msgstr ""
msgstr "Ordem personalizada"
#: ElectronClient/gui/NoteList/NoteList.min.js:151
#: ElectronClient/gui/NoteList/NoteList.js:160
#, fuzzy
msgid "View"
msgstr "&Ver"
msgstr "Ver"
#: ElectronClient/gui/NoteList/NoteList.min.js:151
#: ElectronClient/gui/NoteList/NoteList.js:160
@@ -1169,12 +1174,13 @@ msgid ""
"To manually sort the notes, the sort order must be changed to \"%s\" in the "
"menu \"%s\" > \"%s\""
msgstr ""
"Para ordenar as notas manualmente, a ordem deve ser alterada para \"%s\" no "
"menu \"%s\" > \"%s\""
#: ElectronClient/gui/NoteList/NoteList.min.js:152
#: ElectronClient/gui/NoteList/NoteList.js:161
#, fuzzy
msgid "Do it now"
msgstr "Obter agora:"
msgstr "Fazer agora"
#: ElectronClient/gui/NoteList/NoteList.min.js:423
#: ElectronClient/gui/NoteList/NoteList.js:412
@@ -1287,9 +1293,8 @@ msgid "Options"
msgstr "Opções"
#: ElectronClient/gui/MenuBar.js:266
#, fuzzy
msgid "Note attachments..."
msgstr "Anexos"
msgstr "Anexos das notas..."
#: ElectronClient/gui/MenuBar.js:296 ElectronClient/gui/MenuBar.js:366
#: ElectronClient/gui/MenuBar.js:659
@@ -1320,9 +1325,8 @@ msgid "Import"
msgstr "Importar"
#: ElectronClient/gui/MenuBar.js:343
#, fuzzy
msgid "Export all"
msgstr "Exportar"
msgstr "Exportar todos"
#: ElectronClient/gui/MenuBar.js:356
#, javascript-format
@@ -1360,9 +1364,8 @@ msgid "Zoom Out"
msgstr "Reduzir"
#: ElectronClient/gui/MenuBar.js:516
#, fuzzy
msgid "&Note"
msgstr "Nota"
msgstr "&Nota"
#: ElectronClient/gui/MenuBar.js:525
msgid "&Tools"
@@ -1399,44 +1402,42 @@ msgid "Dropbox Login"
msgstr "Acesso Dropbox"
#: ElectronClient/gui/Root.js:105 ElectronClient/gui/Root.min.js:105
#, fuzzy
msgid "Note attachments"
msgstr "Anexos"
msgstr "Anexos das notas"
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
msgid "Press the shortcut"
msgstr ""
msgstr "Prima o atalho"
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
msgid ""
"Press the shortcut and then press ENTER. Or, press BACKSPACE to clear the "
"shortcut."
msgstr ""
"Prima o atalho e de seguida prima ENTER. Ou então, prima BACKSPACE para "
"apagar o atalho."
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:62
#: ReactNativeClient/lib/services/KeymapService.js:142
#, fuzzy, javascript-format
#, javascript-format
msgid "Error: %s"
msgstr "Erro"
msgstr "Erro: %s"
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:125
msgid "Command"
msgstr ""
msgstr "Comando"
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:126
#, fuzzy
msgid "Keyboard Shortcut"
msgstr "Modo de Teclado"
msgstr "Atalhos de Teclado"
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:24
#, fuzzy
msgid "Hide Joplin"
msgstr "Sobre o Joplin"
msgstr "Esconder o Joplin"
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:28
#, fuzzy
msgid "Preferences"
msgstr "Preferências..."
msgstr "Preferências"
#: ElectronClient/gui/NoteContentPropertiesDialog.js:77
msgid "Words"
@@ -1471,17 +1472,18 @@ msgstr "Visualizador"
#: ElectronClient/gui/NoteContentPropertiesDialog.js:106
#, javascript-format
msgid "Read time: %s min"
msgstr ""
msgstr "Tempo de leitura: %s min"
#: ElectronClient/gui/NoteContentPropertiesDialog.js:109
#, fuzzy
msgid "Statistics"
msgstr "Estado"
msgstr "Estatísticas"
#: ElectronClient/bridge.js:177
msgid ""
"The app is now going to close. Please relaunch it to complete the process."
msgstr ""
"A aplicação vai fechar. Por favor volte a executá-la para completar o "
"processo."
#: ElectronClient/app.js:340
#, javascript-format
@@ -1493,9 +1495,8 @@ msgid "Exit"
msgstr "Sair"
#: ElectronClient/commands/copyDevCommand.js:17
#, fuzzy
msgid "Copy dev mode command to clipboard"
msgstr "Copiar caminho para a área de transferência"
msgstr "Copiar comando de modo dev para a área de transferências"
#: ElectronClient/commands/startExternalEditing.js:18
msgid "Edit in external editor"
@@ -1507,13 +1508,12 @@ msgid "Error opening note in editor: %s"
msgstr "Erro a abrir a nota no editor: %s"
#: ElectronClient/commands/toggleExternalEditing.js:16
#, fuzzy
msgid "Toggle external editing"
msgstr "Parar a edição externa"
msgstr "Alternar edição externa"
#: ElectronClient/commands/toggleExternalEditing.js:42
msgid "Stop"
msgstr ""
msgstr "Parar"
#: ElectronClient/commands/stopExternalEditing.js:16
msgid "Stop external editing"
@@ -1649,8 +1649,8 @@ msgid ""
msgstr ""
"Em qualquer comando, uma nota ou caderno pode ser indicada pelo título ou "
"ID, ou através dos atalhos `$n` ou `$b` para, respetivamente, a nota ou "
"bloco de notas atualmente selecionado. O `$c` pode ser usado para indicar o "
"item atualmente selecionado."
"caderno atualmente selecionado. O `$c` pode ser usado para indicar o item "
"atualmente selecionado."
#: CliClient/app/command-help.js:79
msgid "To move from one pane to another, press Tab or Shift+Tab."
@@ -1743,7 +1743,7 @@ msgstr ""
#: CliClient/app/command-sync.js:35
msgid "Upgrade the sync target to the latest version."
msgstr ""
msgstr "Atualize o alvo de sincronização para a última versão."
#: CliClient/app/command-sync.js:105
#, javascript-format
@@ -1771,9 +1771,8 @@ msgid "Synchronisation target: %s (%s)"
msgstr "Destino de sincronização: %s (%s)"
#: CliClient/app/command-sync.js:177
#, fuzzy
msgid "Cannot initialise synchroniser."
msgstr "Não é possível alterar item encriptado."
msgstr "Não é possível inicializar o sincronizador."
#: CliClient/app/command-sync.js:207
msgid "Starting synchronisation..."
@@ -1916,9 +1915,8 @@ msgstr ""
"desencriptados em segundo plano e estarão disponíveis brevemente."
#: CliClient/app/gui/NoteWidget.js:50
#, fuzzy
msgid "You may also type `status` for more information."
msgstr "Não peça confirmação."
msgstr "Pode também escrever `status` para mais informação."
#: CliClient/app/gui/FolderListWidget.js:31
msgid "Search:"
@@ -1962,14 +1960,16 @@ msgstr ""
"vários minutos, dependendo de quanto há para desencriptar."
#: CliClient/app/command-e2ee.js:53
#, fuzzy, javascript-format
#, javascript-format
msgid "Decrypted items: %d"
msgstr "Itens desencriptados: %s / %s"
msgstr "Itens desencriptados: %d"
#: CliClient/app/command-e2ee.js:54
#, javascript-format
msgid "Skipped items: %d (use --retry-failed-items to retry decrypting them)"
msgstr ""
"Itens ignorados: %d (use --retry-failed-items para tentar desencriptá-los "
"novamente)"
#: CliClient/app/command-e2ee.js:68
msgid "Completed decryption."
@@ -2018,9 +2018,9 @@ msgid "Do not ask for confirmation."
msgstr "Não peça confirmação."
#: CliClient/app/command-import.js:27
#, fuzzy, javascript-format
#, javascript-format
msgid "Output format: %s"
msgstr "Formato da origem: %s"
msgstr "Formato da saída: %s"
#: CliClient/app/command-import.js:65
msgid "Importing notes..."
@@ -2051,6 +2051,8 @@ msgstr "Exibe um resumo sobre as notas e os cadernos."
msgid ""
"To retry decryption of these items. Run `e2ee decrypt --retry-failed-items`"
msgstr ""
"Para tentar desencriptar estes itens novamente. Execute `e2ee decrypt --"
"retry-failed-items`"
#: CliClient/app/command-undone.js:12
msgid "Marks a to-do as non-completed."
@@ -2244,14 +2246,17 @@ msgid "HTML Directory"
msgstr "Diretório HTML"
#: ReactNativeClient/lib/services/interop/InteropService.js:127
#, fuzzy, javascript-format
#, javascript-format
msgid "Cannot load \"%s\" module for format \"%s\" and output \"%s\""
msgstr "Não é possível carregar o módulo \"%s\" para o formato \"%s\"."
msgstr ""
"Não é possível carregar o módulo \"%s\" para o formato \"%s\" e saída \"%s\""
#: ReactNativeClient/lib/services/interop/InteropService.js:152
#, fuzzy, javascript-format
#, javascript-format
msgid "Cannot load \"%s\" module for format \"%s\" and target \"%s\""
msgstr "Não é possível carregar o módulo \"%s\" para o formato \"%s\"."
msgstr ""
"Não é possível carregar o módulo \"%s\" para o formato \"%s\" e o alvo \"%s"
"\"."
#: ReactNativeClient/lib/services/interop/InteropService.js:187
#, javascript-format
@@ -2269,35 +2274,37 @@ msgstr "Notas Recuperadas"
#: ReactNativeClient/lib/services/KeymapService.js:236
msgid "command"
msgstr ""
msgstr "comando"
#: ReactNativeClient/lib/services/KeymapService.js:236
#: ReactNativeClient/lib/services/KeymapService.js:241
#, javascript-format
msgid "\"%s\" is missing the required \"%s\" property."
msgstr ""
msgstr "Está em falta a propriedade \"%s\" de \"%s\"."
#: ReactNativeClient/lib/services/KeymapService.js:241
#: ReactNativeClient/lib/services/KeymapService.js:248
msgid "accelerator"
msgstr ""
msgstr "acelerador"
#: ReactNativeClient/lib/services/KeymapService.js:248
#, fuzzy, javascript-format
msgid "Invalid %s: %s."
msgstr "Resposta inválida: %s"
msgstr "\"%s\" inválida: %s"
#: ReactNativeClient/lib/services/KeymapService.js:266
#, javascript-format
#, fuzzy, javascript-format
msgid ""
"Accelerator \"%s\" is used for \"%s\" and \"%s\" commands. This may lead to "
"unexpected behaviour."
msgstr ""
"O acelerador \"%s\" é usado para comandos \"%s\" e \"%s\". Isto pode levar a "
"comportamentos inesperados."
#: ReactNativeClient/lib/services/KeymapService.js:291
#, javascript-format
#, fuzzy, javascript-format
msgid "Accelerator \"%s\" is not valid."
msgstr ""
msgstr "O acelerador \"%s\" não é válido."
#: ReactNativeClient/lib/services/report.js:121
msgid "Items that cannot be synchronised"
@@ -2309,9 +2316,9 @@ msgid ""
"target. In order to find these items, either search for the title or the ID "
"(which is displayed in brackets above)."
msgstr ""
"Esses itens permanecerão no dispositivo, mas não serão enviados para o "
"destino de sincronização. Para encontrar estes itens, procure o título ou o "
"ID (que é apresentado entre parênteses acima)."
"Esses itens permanecerão no dispositivo, mas não serão enviados para o alvo "
"de sincronização. Para encontrar estes itens, procure o título ou o ID (que "
"é apresentado entre parênteses acima)."
#: ReactNativeClient/lib/services/report.js:130
#, javascript-format
@@ -2447,7 +2454,7 @@ msgstr "Versão do Perfil: %s"
#: ReactNativeClient/lib/versionInfo.js:23
#, javascript-format
msgid "Keychain Supported: %s"
msgstr ""
msgstr "Porta-Chaves Suportado: %s"
#: ReactNativeClient/lib/JoplinServerApi.js:71
#, javascript-format
@@ -2849,7 +2856,7 @@ msgstr "Adicionar título"
#: ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js:42
msgid "Sync Target Upgrade"
msgstr ""
msgstr "Atualização do Alvo de Sincronização"
#: ReactNativeClient/lib/components/screens/encryption-config.js:119
#, javascript-format
@@ -2877,7 +2884,7 @@ msgid ""
"the data! To enable encryption, please enter your password below."
msgstr ""
"Ativar a encriptação significa que *todas* as suas notas e anexos serão "
"ressincronizados e enviados encriptados para o destino de sincronização. Não "
"ressincronizados e enviados encriptados para o alvo de sincronização. Não "
"perca a palavra-passe pois, por razões de segurança, esta será a única forma "
"de desencriptar os dados! Para ativar a encriptação, introduza a sua palavra-"
"passe abaixo."
@@ -2939,8 +2946,11 @@ msgstr ""
"Alguns itens não puderam ser sincronizados. Prima para mais informações."
#: ReactNativeClient/lib/components/screen-header.js:453
#, fuzzy
msgid "The sync target needs to be upgraded. Press this banner to proceed."
msgstr ""
"O alvo de sincronização precisa de ser atualizado. Clique neste banner para "
"proceder."
#: ReactNativeClient/lib/components/side-menu-content.js:126
#, javascript-format
@@ -3021,7 +3031,7 @@ msgid ""
"the sync target is accessible. The reported error was:"
msgstr ""
"Erro. Por favor verifique se o endereço, nome de utilizador, palavra-passe, "
"etc. estão corretos e se o destino de sincronização está acessível. O erro "
"etc. estão corretos e se o alvo de sincronização está acessível. O erro "
"reportado foi:"
#: ReactNativeClient/lib/components/note-list.js:97
@@ -3086,17 +3096,20 @@ msgid "Downloaded"
msgstr "Transferido"
#: ReactNativeClient/lib/models/Resource.js:371
#, fuzzy, javascript-format
#, javascript-format
msgid "Attachment conflict: \"%s\""
msgstr "Anexos"
msgstr "Anexos em conflito: \"%s\""
#: ReactNativeClient/lib/models/Resource.js:372
#, fuzzy, javascript-format
#, javascript-format
msgid ""
"There was a [conflict](%s) on the attachment below.\n"
"\n"
"%s"
msgstr "Ocorreu um erro ao transferir este anexo:"
msgstr ""
"Ocorreu um [conflito](%s) no anexo em baixo.\n"
"\n"
"%s"
#: ReactNativeClient/lib/models/BaseItem.js:721
msgid "Encrypted"
@@ -3104,7 +3117,7 @@ msgstr "Encriptado"
#: ReactNativeClient/lib/models/BaseItem.js:781
msgid "Encrypted items cannot be modified"
msgstr "Não é possível modificar tens encriptados"
msgstr "Não é possível modificar itens encriptados"
#: ReactNativeClient/lib/models/Note.js:27
msgid "created date"
@@ -3112,7 +3125,7 @@ msgstr "data criada"
#: ReactNativeClient/lib/models/Note.js:28
msgid "custom order"
msgstr ""
msgstr "ordem personalizada"
#: ReactNativeClient/lib/models/Note.js:92
msgid "This note does not have geolocation information."
@@ -3129,20 +3142,18 @@ msgid "Cannot move note to \"%s\" notebook"
msgstr "Não é possível mover a nota para o caderno \"%s\""
#: ReactNativeClient/lib/models/Setting.js:65
#, fuzzy
msgid "yes"
msgstr "Sim"
msgstr "sim"
#: ReactNativeClient/lib/models/Setting.js:65
#: ReactNativeClient/lib/models/Setting.js:66
#, javascript-format
msgid "(wysiwyg: %s)"
msgstr ""
msgstr "(wysiwyg: %s)"
#: ReactNativeClient/lib/models/Setting.js:66
#, fuzzy
msgid "no"
msgstr "n"
msgstr "não"
#: ReactNativeClient/lib/models/Setting.js:68
#, javascript-format
@@ -3181,7 +3192,7 @@ msgstr "Nórdico"
#: ReactNativeClient/lib/models/Setting.js:80
msgid "Aritim Dark"
msgstr ""
msgstr "Escuro Aritim"
#: ReactNativeClient/lib/models/Setting.js:81
msgid "OLED Dark"
@@ -3196,8 +3207,8 @@ msgid ""
"The target to synchonise to. Each sync target may have additional parameters "
"which are named as `sync.NUM.NAME` (all documented below)."
msgstr ""
"O destino para a sincronização. Cada destino de sincronização pode ter "
"parâmetros adicionais que são designados como `sync.NUM.NUM.NAME` (todos "
"O destino para a sincronização. Cada alvo de sincronização pode ter "
"parâmetros adicionais que são designados como `sync.NUM.NAME` (todos "
"documentados abaixo)."
#: ReactNativeClient/lib/models/Setting.js:131
@@ -3230,15 +3241,15 @@ msgstr "Palavra-passe WebDAV"
#: ReactNativeClient/lib/models/Setting.js:214
msgid "AWS S3 bucket"
msgstr ""
msgstr "Bucket AWS S3"
#: ReactNativeClient/lib/models/Setting.js:225
msgid "AWS key"
msgstr ""
msgstr "Chave AWS"
#: ReactNativeClient/lib/models/Setting.js:235
msgid "AWS secret"
msgstr ""
msgstr "Segredo AWS"
#: ReactNativeClient/lib/models/Setting.js:247
msgid "Attachment download behaviour"
@@ -3250,10 +3261,9 @@ msgid ""
"In \"Auto\", they are downloaded when you open the note. In \"Always\", all "
"the attachments are downloaded whether you open the note or not."
msgstr ""
"No modo \"Manual\", os anexos são transferidos apenas quando é dado um "
"clique neles. Em \"Automático\", eles são transferidos quando a nota é "
"aberta. Em \"Sempre\", todos os anexos são transferidos, quer a nota seja "
"aberta ou não."
"No modo \"Manual\", os anexos são transferidos apenas quando são clicados. "
"Em \"Automático\", eles são transferidos quando a nota é aberta. Em \"Sempre"
"\", todos os anexos são transferidos, quer a nota seja aberta ou não."
#: ReactNativeClient/lib/models/Setting.js:251
msgid "Always"
@@ -3289,15 +3299,15 @@ msgstr "Tema"
#: ReactNativeClient/lib/models/Setting.js:337
msgid "Automatically switch theme to match system theme"
msgstr ""
msgstr "Mudar automaticamente o tema para combinar com o tema do sistema"
#: ReactNativeClient/lib/models/Setting.js:348
msgid "Preferred light theme"
msgstr ""
msgstr "Tema claro preferido"
#: ReactNativeClient/lib/models/Setting.js:361
msgid "Preferred dark theme"
msgstr ""
msgstr "Tema escuro preferido"
#: ReactNativeClient/lib/models/Setting.js:365
msgid "Show note counts"
@@ -3460,15 +3470,14 @@ msgid "Editor font family"
msgstr "Família da letra do editor"
#: ReactNativeClient/lib/models/Setting.js:556
#, fuzzy
msgid ""
"This should be a *monospace* font or some elements will render incorrectly. "
"If the font is incorrect or empty, it will default to a generic monospace "
"font."
msgstr ""
"Este deverá ser um tipo de letra *mono-espaçado* ou não funcionará "
"corretamente. Se o tipo de letra estiver incorreto ou em branco, será pré-"
"definida para um tipo de letra mono-espaçado genérico."
"corretamente. Se o tipo de letra estiver incorreto ou em branco, reverterá "
"para um tipo de letra mono-espaçado genérico pré-definido."
#: ReactNativeClient/lib/models/Setting.js:595
msgid "Custom stylesheet for Joplin-wide app styles"
@@ -3482,7 +3491,7 @@ msgstr "Atualizar a aplicação automaticamente"
#: ReactNativeClient/lib/models/Setting.js:601
msgid "Get pre-releases when checking for updates"
msgstr "Obtenha versões de pré-lançamento ao verificar atualizações"
msgstr "Obtenha versões de pré-lançamento ao verificar se há atualizações"
#: ReactNativeClient/lib/models/Setting.js:601
#, javascript-format
@@ -3491,7 +3500,7 @@ msgstr "Consulte a página de pré-lançamento para obter mais detalhes: %s"
#: ReactNativeClient/lib/models/Setting.js:609
msgid "Synchronisation interval"
msgstr "Periodicidade de sincronização"
msgstr "Intervalo de sincronização"
#: ReactNativeClient/lib/models/Setting.js:613
#: ReactNativeClient/lib/models/Setting.js:614
@@ -3610,8 +3619,8 @@ msgid ""
"Fail-safe: Do not wipe out local data when sync target is empty (often the "
"result of a misconfiguration or bug)"
msgstr ""
"À prova de falhas: Não elimine os dados locais quando o destino de "
"sincronização está em brancp (muitas vezes o resultado de uma má "
"Segurança contra falhas: Não elimine os dados locais quando o alvo de "
"sincronização está em branco (muitas vezes o resultado de uma má "
"configuração ou erro)"
#: ReactNativeClient/lib/models/Setting.js:695
@@ -3641,7 +3650,7 @@ msgstr "Manter histórico de notas por"
#: ReactNativeClient/lib/models/Setting.js:735
msgid "Notebook list growth factor"
msgstr ""
msgstr "Fator de crescimento do caderno"
#: ReactNativeClient/lib/models/Setting.js:736
#: ReactNativeClient/lib/models/Setting.js:748
@@ -3652,14 +3661,18 @@ msgid ""
"item with a factor of 2 will take twice as much space as an item with a "
"factor of 1.Restart app to see changes."
msgstr ""
"A propriedade fator define como um item aumentará ou diminuirá para ocupar o "
"espaço disponível no seu contentor com respeito aos outros itens. Como tal, "
"um item com um fator de 2 ocupará o dobro do espaço de um item com um fator "
"de 1. Reinicie a aplicação para ver as alterações."
#: ReactNativeClient/lib/models/Setting.js:747
msgid "Note list growth factor"
msgstr ""
msgstr "Fator de crescimento da lista de notas"
#: ReactNativeClient/lib/models/Setting.js:759
msgid "Note area growth factor"
msgstr ""
msgstr "Fator de crescimento da área de notas"
#: ReactNativeClient/lib/models/Setting.js:1272
msgid "General"
@@ -3694,9 +3707,8 @@ msgid "Web Clipper"
msgstr "Recorte Web"
#: ReactNativeClient/lib/models/Setting.js:1292
#, fuzzy
msgid "Keyboard Shortcuts"
msgstr "Modo de Teclado"
msgstr "Atalhos do Teclado"
#: ReactNativeClient/lib/models/Setting.js:1299
msgid ""
@@ -3708,6 +3720,12 @@ msgid ""
"formatting. It is indicated below which plugins are compatible or not with "
"the WYSIWYG editor."
msgstr ""
"Estes plugins modificam o renderizador de Markdown com recursos adicionais. "
"Note que, enquanto estes recursos podem ser úteis, não são Markdown padrão "
"e, como tal, a maioria deles só funcionará no Joplin. Adicionalmente, alguns "
"deles são *incompatíveis* com o editor WYSIWYG. Se abrir uma nota que use um "
"destes plugins nesse editor, perderá a formatação do plugin. Está indicado "
"abaixo quais os plugins que são ou não compatíveis com o editor WYSIWYG."
#: ReactNativeClient/lib/models/Setting.js:1301
#, javascript-format
@@ -3736,11 +3754,11 @@ msgstr "OneDrive"
#: ReactNativeClient/lib/SyncTargetAmazonS3.js:28
msgid "AWS S3"
msgstr ""
msgstr "AWS S3"
#: ReactNativeClient/lib/commands/historyForward.js:16
msgid "Forward"
msgstr ""
msgstr "Avançar"
#: ReactNativeClient/lib/shim-init-node.js:158
#, javascript-format

View File

@@ -4199,11 +4199,6 @@
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
},
"memory-cache": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz",
"integrity": "sha1-eJCwHVLADI68nVM+H46xfjA0hxo="
},
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@@ -5900,11 +5895,6 @@
"is-fullwidth-code-point": "^2.0.0"
}
},
"slug": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/slug/-/slug-3.5.0.tgz",
"integrity": "sha512-+pZLDhMtmAc+ZcojQSMlUKDZBYmvhZiZmK8Ffx/D3Q/MIMHPDBAMbWvWN8vJb9xl2MfbDdRWxFzrdOhBiyVpow=="
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -6767,6 +6757,11 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
"integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc="
},
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"unpack-string": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/unpack-string/-/unpack-string-0.0.2.tgz",
@@ -6869,6 +6864,24 @@
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
},
"uslug": {
"version": "git+https://github.com/laurent22/uslug.git#ba2834d79beb0435318709958b2f5e817d96674d",
"from": "git+https://github.com/laurent22/uslug.git#emoji-support",
"requires": {
"node-emoji": "^1.10.0",
"unorm": ">= 1.0.0"
},
"dependencies": {
"node-emoji": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz",
"integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==",
"requires": {
"lodash.toarray": "^4.4.0"
}
}
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",

View File

@@ -6,7 +6,7 @@
"scripts": {
"test": "gulp buildTests -L && node node_modules/jasmine/bin/jasmine.js --fail-fast=true --config=tests/support/jasmine.json",
"test-ci": "gulp buildTests -L && node node_modules/jasmine/bin/jasmine.js --config=tests/support/jasmine.json",
"postinstall": "npm run build && patch-package --patch-dir ../patches",
"postinstall": "npm run build && patch-package --patch-dir ../patches/shared && patch-package --patch-dir ../patches/node",
"build": "gulp build",
"start": "gulp build -L && node 'build/main.js' --stack-trace-enabled --log-level debug --env dev"
},
@@ -80,7 +80,6 @@
"markdown-it-toc-done-right": "^4.1.0",
"md5": "^2.2.1",
"md5-file": "^4.0.0",
"memory-cache": "^0.2.0",
"mime": "^2.0.3",
"moment": "^2.24.0",
"multiparty": "^4.2.1",
@@ -102,7 +101,6 @@
"sax": "^1.2.4",
"server-destroy": "^1.0.1",
"sharp": "^0.23.2",
"slug": "^3.5.0",
"sprintf-js": "^1.1.1",
"sqlite3": "^4.1.1",
"string-padding": "^1.0.2",
@@ -114,6 +112,7 @@
"terminal-kit": "^1.30.0",
"tkwidgets": "^0.5.26",
"url-parse": "^1.4.7",
"uslug": "git+https://github.com/laurent22/uslug.git#emoji-support",
"uuid": "^3.0.1",
"valid-url": "^1.0.9",
"word-wrap": "^1.2.3",

View File

@@ -0,0 +1,59 @@
import InMemoryCache from 'lib/InMemoryCache';
const { time } = require('lib/time-utils.js');
describe('InMemoryCache', function() {
it('should get and set values', () => {
const cache = new InMemoryCache();
expect(cache.value('test')).toBe(undefined);
expect(cache.value('test', 'default')).toBe('default');
cache.setValue('test', 'something');
expect(cache.value('test')).toBe('something');
// Check we get the exact same object back (cache should not copy)
const someObj = { abcd: '123' };
cache.setValue('someObj', someObj);
expect(cache.value('someObj')).toBe(someObj);
});
it('should expire values', async () => {
const cache = new InMemoryCache();
// Check that the value is udefined once the cache has expired
cache.setValue('test', 'something', 500);
expect(cache.value('test')).toBe('something');
await time.msleep(510);
expect(cache.value('test')).toBe(undefined);
// Check that the TTL is reset every time setValue is called
cache.setValue('test', 'something', 300);
await time.msleep(100);
cache.setValue('test', 'something', 300);
await time.msleep(100);
cache.setValue('test', 'something', 300);
await time.msleep(100);
cache.setValue('test', 'something', 300);
await time.msleep(100);
expect(cache.value('test')).toBe('something');
});
it('should delete old records', async () => {
const cache = new InMemoryCache(5);
cache.setValue('1', '1');
cache.setValue('2', '2');
cache.setValue('3', '3');
cache.setValue('4', '4');
cache.setValue('5', '5');
expect(cache.value('1')).toBe('1');
cache.setValue('6', '6');
expect(cache.value('1')).toBe(undefined);
});
});

View File

@@ -0,0 +1,16 @@
// import Setting from 'lib/models/Setting';
// const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow, expectNotThrow } = require('../test-utils.js');
// describe('plugin_api_JoplinSetting', function() {
// beforeEach(async (done) => {
// await setupDatabaseAndSynchronizer(1);
// await switchClient(1);
// done();
// });
// it('should get and set plugin-specific values', asyncTest(async () => {
// await
// }));
// });

View File

@@ -2,7 +2,7 @@ import MenuUtils from 'lib/services/commands/MenuUtils';
import ToolbarButtonUtils from 'lib/services/commands/ToolbarButtonUtils';
import CommandService, { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
const { asyncTest, setupDatabaseAndSynchronizer, switchClient } = require('test-utils.js');
const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow, expectNotThrow } = require('test-utils.js');
interface TestCommand {
declaration: CommandDeclaration,
@@ -11,7 +11,12 @@ interface TestCommand {
function newService():CommandService {
const service = new CommandService();
service.initialize({});
const mockStore = {
getState: () => {
return {};
},
};
service.initialize(mockStore, true);
return service;
}
@@ -24,8 +29,7 @@ function createCommand(name:string, options:any):TestCommand {
execute: options.execute,
};
if (options.mapStateToProps) runtime.mapStateToProps = options.mapStateToProps;
if (options.isEnabled) runtime.isEnabled = options.isEnabled;
if (options.enabledCondition) runtime.enabledCondition = options.enabledCondition;
return { declaration, runtime };
}
@@ -61,7 +65,7 @@ describe('services_CommandService', function() {
},
}));
const toolbarInfos = toolbarButtonUtils.commandsToToolbarButtons({}, ['test1', 'test2']);
const toolbarInfos = toolbarButtonUtils.commandsToToolbarButtons(['test1', 'test2'], {});
await toolbarInfos[0].onClick();
await toolbarInfos[1].onClick();
@@ -77,98 +81,78 @@ describe('services_CommandService', function() {
registerCommand(service, createCommand('test1', {
execute: () => {},
mapStateToProps: (state:any) => {
return {
selectedNoteId: state.selectedNoteId,
selectedFolderId: state.selectedFolderId,
};
},
isEnabled: (props:any) => {
return props.selectedNoteId === 'abc';
},
enabledCondition: 'oneNoteSelected',
}));
registerCommand(service, createCommand('test2', {
execute: () => {},
mapStateToProps: (state:any) => {
return {
selectedNoteId: state.selectedNoteId,
selectedFolderId: state.selectedFolderId,
};
},
isEnabled: (props:any) => {
return props.selectedNoteId === '123';
},
enabledCondition: 'multipleNotesSelected',
}));
const toolbarInfos = toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: '123',
selectedFolderId: 'aaa',
}, ['test1', 'test2']);
const toolbarInfos = toolbarButtonUtils.commandsToToolbarButtons(['test1', 'test2'], {
oneNoteSelected: false,
multipleNotesSelected: true,
});
expect(toolbarInfos[0].enabled).toBe(false);
expect(toolbarInfos[1].enabled).toBe(true);
}));
it('should enable commands by default', asyncTest(async () => {
const service = newService();
registerCommand(service, createCommand('test1', {
execute: () => {},
}));
expect(service.isEnabled('test1', {})).toBe(true);
}));
it('should return the same toolbarButtons array if nothing has changed', asyncTest(async () => {
const service = newService();
const toolbarButtonUtils = new ToolbarButtonUtils(service);
registerCommand(service, createCommand('test1', {
execute: () => {},
mapStateToProps: (state:any) => {
return {
selectedNoteId: state.selectedNoteId,
};
},
isEnabled: (props:any) => {
return props.selectedNoteId === 'ok';
},
enabledCondition: 'cond1',
}));
registerCommand(service, createCommand('test2', {
execute: () => {},
mapStateToProps: (state:any) => {
return {
selectedFolderId: state.selectedFolderId,
};
},
isEnabled: (props:any) => {
return props.selectedFolderId === 'ok';
},
enabledCondition: 'cond2',
}));
const toolbarInfos1 = toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: 'ok',
selectedFolderId: 'notok',
}, ['test1', 'test2']);
const toolbarInfos1 = toolbarButtonUtils.commandsToToolbarButtons(['test1', 'test2'], {
cond1: true,
cond2: false,
});
const toolbarInfos2 = toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: 'ok',
selectedFolderId: 'notok',
}, ['test1', 'test2']);
const toolbarInfos2 = toolbarButtonUtils.commandsToToolbarButtons(['test1', 'test2'], {
cond1: true,
cond2: false,
});
expect(toolbarInfos1).toBe(toolbarInfos2);
expect(toolbarInfos1[0] === toolbarInfos2[0]).toBe(true);
expect(toolbarInfos1[1] === toolbarInfos2[1]).toBe(true);
const toolbarInfos3 = toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: 'ok',
selectedFolderId: 'ok',
}, ['test1', 'test2']);
const toolbarInfos3 = toolbarButtonUtils.commandsToToolbarButtons(['test1', 'test2'], {
cond1: true,
cond2: true,
});
expect(toolbarInfos2 === toolbarInfos3).toBe(false);
expect(toolbarInfos2[0] === toolbarInfos3[0]).toBe(true);
expect(toolbarInfos2[1] === toolbarInfos3[1]).toBe(false);
{
expect(toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: 'ok',
selectedFolderId: 'notok',
}, ['test1', '-', 'test2'])).toBe(toolbarButtonUtils.commandsToToolbarButtons({
selectedNoteId: 'ok',
selectedFolderId: 'notok',
}, ['test1', '-', 'test2']));
expect(toolbarButtonUtils.commandsToToolbarButtons(['test1', '-', 'test2'], {
cond1: true,
cond2: false,
})).toBe(toolbarButtonUtils.commandsToToolbarButtons(['test1', '-', 'test2'], {
cond1: true,
cond2: false,
}));
}
}));
@@ -206,50 +190,37 @@ describe('services_CommandService', function() {
const utils = new MenuUtils(service);
registerCommand(service, createCommand('test1', {
mapStateToProps: (state:any) => {
return {
isOk: state.test1 === 'ok',
};
},
execute: () => {},
enabledCondition: 'cond1',
}));
registerCommand(service, createCommand('test2', {
mapStateToProps: (state:any) => {
return {
isOk: state.test2 === 'ok',
};
},
execute: () => {},
enabledCondition: 'cond2',
}));
{
const menuItemProps = utils.commandsToMenuItemProps({
test1: 'ok',
test2: 'notok',
}, ['test1', 'test2']);
const menuItemProps = utils.commandsToMenuItemProps(['test1', 'test2'], {
cond1: true,
cond2: false,
});
expect(menuItemProps.test1.isOk).toBe(true);
expect(menuItemProps.test2.isOk).toBe(false);
expect(menuItemProps.test1.enabled).toBe(true);
expect(menuItemProps.test2.enabled).toBe(false);
}
{
const menuItemProps = utils.commandsToMenuItemProps({
test1: 'ok',
test2: 'ok',
}, ['test1', 'test2']);
const menuItemProps = utils.commandsToMenuItemProps(['test1', 'test2'], {
cond1: true,
cond2: true,
});
expect(menuItemProps.test1.isOk).toBe(true);
expect(menuItemProps.test2.isOk).toBe(true);
expect(menuItemProps.test1.enabled).toBe(true);
expect(menuItemProps.test2.enabled).toBe(true);
}
expect(utils.commandsToMenuItemProps({
test1: 'ok',
test2: 'ok',
}, ['test1', 'test2'])).toBe(utils.commandsToMenuItemProps({
test1: 'ok',
test2: 'ok',
}, ['test1', 'test2']));
expect(utils.commandsToMenuItemProps(['test1', 'test2'], { cond1: true, cond2: true }))
.toBe(utils.commandsToMenuItemProps(['test1', 'test2'], { cond1: true, cond2: true }));
}));
it('should create stateful menu items', asyncTest(async () => {
@@ -259,20 +230,30 @@ describe('services_CommandService', function() {
let propValue = null;
registerCommand(service, createCommand('test1', {
mapStateToProps: (state:any) => {
return {
isOk: state.test1 === 'ok',
};
},
execute: (props:any) => {
propValue = props.isOk;
execute: (_context:any, greeting:string) => {
propValue = greeting;
},
}));
const menuItem = utils.commandToStatefulMenuItem('test1', { isOk: 'hello' });
const menuItem = utils.commandToStatefulMenuItem('test1', 'hello');
menuItem.click();
expect(propValue).toBe('hello');
}));
it('should throw an error for invalid when clause keys in dev mode', asyncTest(async () => {
const service = newService();
registerCommand(service, createCommand('test1', {
execute: () => {},
enabledCondition: 'cond1 && cond2',
}));
await expectThrow(async () => service.isEnabled('test1', {}));
await expectThrow(async () => service.isEnabled('test1', { cond1: true }));
await expectNotThrow(async () => service.isEnabled('test1', { cond1: true, cond2: true }));
await expectNotThrow(async () => service.isEnabled('test1', { cond1: true, cond2: false }));
}));
});

View File

@@ -299,7 +299,7 @@ describe('services_KeymapService', () => {
],
[
{ command: 'showLocalSearch', accelerator: 'Option+Cmd+S' },
{ command: 'print', accelerator: 'Cmd+G' /* Default of gotoAnything */ },
{ command: 'print', accelerator: 'Cmd+P' /* Default of gotoAnything */ },
{ command: 'focusElementNoteTitle', accelerator: 'Option+Shift+Cmd+J' },
],
];
@@ -317,7 +317,7 @@ describe('services_KeymapService', () => {
],
[
{ command: 'showLocalSearch', accelerator: 'Ctrl+Alt+S' },
{ command: 'print', accelerator: 'Ctrl+G' /* Default of gotoAnything */ },
{ command: 'print', accelerator: 'Ctrl+P' /* Default of gotoAnything */ },
{ command: 'focusElementNoteTitle', accelerator: 'Ctrl+Alt+Shift+J' },
],
];

View File

@@ -2,7 +2,7 @@ import PluginRunner from '../app/services/plugins/PluginRunner';
import PluginService from 'lib/services/plugins/PluginService';
require('app-module-path').addPath(__dirname);
const { asyncTest, setupDatabaseAndSynchronizer, switchClient } = require('test-utils.js');
const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow } = require('test-utils.js');
const Note = require('lib/models/Note');
const Folder = require('lib/models/Folder');
@@ -40,8 +40,7 @@ describe('services_PluginService', function() {
it('should load and run a simple plugin', asyncTest(async () => {
const service = newPluginService();
const plugin = await service.loadPlugin(`${testPluginDir}/simple`);
await service.runPlugin(plugin);
await service.loadAndRunPlugins([`${testPluginDir}/simple`]);
const allFolders = await Folder.all();
expect(allFolders.length).toBe(1);
@@ -55,9 +54,9 @@ describe('services_PluginService', function() {
it('should load and run a plugin that uses external packages', asyncTest(async () => {
const service = newPluginService();
const plugin = await service.loadPlugin(`${testPluginDir}/withExternalModules`);
await service.loadAndRunPlugins([`${testPluginDir}/withExternalModules`]);
const plugin = service.pluginById('withexternalmodules');
expect(plugin.id).toBe('withexternalmodules');
await service.runPlugin(plugin);
const allFolders = await Folder.all();
expect(allFolders.length).toBe(1);
@@ -78,4 +77,75 @@ describe('services_PluginService', function() {
expect(allFolders.map((f:any) => f.title).sort().join(', ')).toBe('multi - simple1, multi - simple2');
}));
it('should load plugins from JS bundles', asyncTest(async () => {
const service = newPluginService();
const plugin = await service.loadPluginFromString('example', '/tmp', `
/* joplin-manifest:
{
"manifest_version": 1,
"name": "JS Bundle test",
"description": "JS Bundle Test plugin",
"version": "1.0.0",
"author": "Laurent Cozic",
"homepage_url": "https://joplinapp.org"
}
*/
joplin.plugins.register({
onStart: async function() {
await joplin.data.post(['folders'], null, { title: "my plugin folder" });
},
});
`);
await service.runPlugin(plugin);
expect(plugin.manifest.manifest_version).toBe(1);
expect(plugin.manifest.name).toBe('JS Bundle test');
const allFolders = await Folder.all();
expect(allFolders.length).toBe(1);
}));
it('should load plugins from JS bundle files', asyncTest(async () => {
const service = newPluginService();
await service.loadAndRunPlugins(`${testPluginDir}/jsbundles`);
expect(!!service.pluginById('example')).toBe(true);
expect((await Folder.all()).length).toBe(1);
}));
it('should validate JS bundles', asyncTest(async () => {
const invalidJsBundles = [
`
/* joplin-manifest:
{
"not_a_valid_manifest_at_all": 1
}
*/
joplin.plugins.register({
onStart: async function() {},
});
`, `
/* joplin-manifest:
*/
joplin.plugins.register({
onStart: async function() {},
});
`, `
joplin.plugins.register({
onStart: async function() {},
});
`, '',
];
const service = newPluginService();
for (const jsBundle of invalidJsBundles) {
await expectThrow(async () => await service.loadPluginFromString('example', '/tmp', jsBundle));
}
}));
});

View File

@@ -146,7 +146,7 @@ describe('services_rest_Api', function() {
}));
const noteId = response.id;
{
const note = await Note.load(noteId);
expect(note.latitude).toBe('48.73207100');
@@ -154,7 +154,7 @@ describe('services_rest_Api', function() {
expect(note.altitude).toBe('21.0000');
}
await api.route('PUT', 'notes/' + noteId, null, JSON.stringify({
await api.route('PUT', `notes/${noteId}`, null, JSON.stringify({
latitude: '49',
longitude: '-3',
altitude: '22',

View File

@@ -3,6 +3,7 @@
"spec_files": [
"*.js",
"services/plugins/*.js",
"services/plugins/api/*.js",
"!test-utils.js"
],
"stopSpecOnExpectationFailure": false,

View File

@@ -0,0 +1,16 @@
/* joplin-manifest:
{
"manifest_version": 1,
"name": "JS Bundle test",
"description": "JS Bundle Test plugin",
"version": "1.0.0",
"author": "Laurent Cozic",
"homepage_url": "https://joplinapp.org"
}
*/
joplin.plugins.register({
onStart: async function() {
await joplin.data.post(['folders'], null, { title: "my plugin folder" });
},
});

View File

@@ -0,0 +1,2 @@
dist/*
node_modules/

View File

@@ -0,0 +1,14 @@
# Joplin Plugin
This is a template to create a new Joplin plugin.
The main two files you will want to look at are:
- `/src/index.ts`, which contains the entry point for the plugin source code.
- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc.
The plugin is built using webpack, which create the compiled code in `/dist`. The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
## Building the plugin
To build the plugin, simply run `npm run dist`.

View File

@@ -0,0 +1,15 @@
import Plugin from '../Plugin';
import Joplin from './Joplin';
import Logger from 'lib/Logger';
/**
* @ignore
*/
export default class Global {
private joplin_;
private requireWhiteList_;
constructor(logger: Logger, implementation: any, plugin: Plugin, store: any);
get joplin(): Joplin;
private requireWhiteList;
require(filePath: string): any;
get process(): any;
}

View File

@@ -0,0 +1,38 @@
import Plugin from '../Plugin';
import JoplinData from './JoplinData';
import JoplinPlugins from './JoplinPlugins';
import JoplinWorkspace from './JoplinWorkspace';
import JoplinFilters from './JoplinFilters';
import JoplinCommands from './JoplinCommands';
import JoplinViews from './JoplinViews';
import JoplinInterop from './JoplinInterop';
import JoplinSettings from './JoplinSettings';
import Logger from 'lib/Logger';
/**
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
*/
export default class Joplin {
private data_;
private plugins_;
private workspace_;
private filters_;
private commands_;
private views_;
private interop_;
private settings_;
constructor(logger: Logger, implementation: any, plugin: Plugin, store: any);
get data(): JoplinData;
get plugins(): JoplinPlugins;
get workspace(): JoplinWorkspace;
/**
* @ignore
*
* Not sure if it's the best way to hook into the app
* so for now disable filters.
*/
get filters(): JoplinFilters;
get commands(): JoplinCommands;
get views(): JoplinViews;
get interop(): JoplinInterop;
get settings(): JoplinSettings;
}

View File

@@ -0,0 +1,51 @@
import { Command } from './types';
/**
* This class allows executing or registering new Joplin commands. Commands can be executed or associated with
* {@link JoplinViewsToolbarButtons | toolbar buttons} or {@link JoplinViewsMenuItems | menu items}.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
*
* ## Executing Joplin's internal commands
*
* It is also possible to execute internal Joplin's commands which, as of now, are not well documented.
* You can find the list directly on GitHub though at the following locations:
*
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/MainScreen/commands
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/commands
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.ts
*
* To view what arguments are supported, you can open any of these files and look at the `execute()` command.
*/
export default class JoplinCommands {
/**
* <span class="platform-desktop">desktop</span> Executes the given command.
* The `props` are the arguments passed to the command, and they vary based on the command
*
* ```typescript
* // Create a new note in the current notebook:
* await joplin.commands.execute('newNote');
*
* // Create a new sub-notebook under the provided notebook
* // Note: internally, notebooks are called "folders".
* await joplin.commands.execute('newFolder', { parent_id: "SOME_FOLDER_ID" });
* ```
*/
execute(commandName: string, props?: any): Promise<any>;
/**
* <span class="platform-desktop">desktop</span> Registers a new command.
*
* ```typescript
* // Register a new commmand called "testCommand1"
*
* await joplin.commands.register({
* name: 'testCommand1',
* label: 'My Test Command 1',
* iconName: 'fas fa-music',
* execute: () => {
* alert('Testing plugin command 1');
* },
* });
* ```
*/
register(command: Command): Promise<void>;
}

View File

@@ -0,0 +1,47 @@
import { Path } from './types';
/**
* This module provides access to the Joplin data API: https://joplinapp.org/api/references/rest_api/
* This is the main way to retrieve data, such as notes, notebooks, tags, etc.
* or to update them or delete them.
*
* This is also what you would use to search notes, via the `search` endpoint.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/simple)
*
* In general you would use the methods in this class as if you were using a REST API. There are four methods that map to GET, POST, PUT and DELETE calls.
* And each method takes these parameters:
*
* * `path`: This is an array that represents the path to the resource in the form `["resouceName", "resourceId", "resourceLink"]` (eg. ["tags", ":id", "notes"]). The "resources" segment is the name of the resources you want to access (eg. "notes", "folders", etc.). If not followed by anything, it will refer to all the resources in that collection. The optional "resourceId" points to a particular resources within the collection. Finally, an optional "link" can be present, which links the resource to a collection of resources. This can be used in the API for example to retrieve all the notes associated with a tag.
* * `query`: (Optional) The query parameters. In a URL, this is the part after the question mark "?". In this case, it should be an object with key/value pairs.
* * `data`: (Optional) Applies to PUT and POST calls only. The request body contains the data you want to create or modify, for example the content of a note or folder.
* * `files`: (Optional) Used to create new resources and associate them with files.
*
* Please refer to the [Joplin API documentation](https://joplinapp.org/api/references/rest_api/) for complete details about each call. As the plugin runs within the Joplin application **you do not need an authorisation token** to use this API.
*
* For example:
*
* ```typescript
* // Get a note ID, title and body
* const noteId = 'some_note_id';
* const note = await joplin.data.get(['notes', noteId], { fields: ['id', 'title', 'body'] });
*
* // Get all folders
* const folders = await joplin.data.get(['folders']);
*
* // Set the note body
* await joplin.data.put(['notes', noteId], null, { body: "New note body" });
*
* // Create a new note under one of the folders
* await joplin.data.post(['notes'], null, { body: "my new note", title: "some title", parent_id: folders[0].id });
* ```
*/
export default class JoplinData {
private api_;
private pathSegmentRegex_;
private serializeApiBody;
private pathToString;
get(path: Path, query?: any): Promise<any>;
post(path: Path, query?: any, body?: any, files?: any[]): Promise<any>;
put(path: Path, query?: any, body?: any, files?: any[]): Promise<any>;
delete(path: Path, query?: any): Promise<any>;
}

View File

@@ -0,0 +1,10 @@
/**
* @ignore
*
* Not sure if it's the best way to hook into the app
* so for now disable filters.
*/
export default class JoplinFilters {
on(name: string, callback: Function): Promise<void>;
off(name: string, callback: Function): Promise<void>;
}

View File

@@ -0,0 +1,17 @@
import { ExportModule, ImportModule } from './types';
/**
* Provides a way to create modules to import external data into Joplin or to export notes into any arbitrary format.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/json_export)
*
* To implement an import or export module, you would simply define an object with various event handlers that are called
* by the application during the import/export process.
*
* See the documentation of the [[ExportModule]] and [[ImportModule]] for more information.
*
* You may also want to refer to the Joplin API documentation to see the list of properties for each item (note, notebook, etc.) - https://joplinapp.org/api/references/rest_api/
*/
export default class JoplinInterop {
registerExportModule(module: ExportModule): Promise<void>;
registerImportModule(module: ImportModule): Promise<void>;
}

View File

@@ -0,0 +1,24 @@
import Plugin from '../Plugin';
import Logger from 'lib/Logger';
import { Script } from './types';
/**
* This class provides access to plugin-related features.
*/
export default class JoplinPlugins {
private logger;
private plugin;
constructor(logger: Logger, plugin: Plugin);
/**
* Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it.
* That `onStart` method will be executed as soon as the plugin is loaded.
*
* ```typescript
* joplin.plugins.register({
* onStart: async function() {
* // Run your plugin code here
* }
* });
* ```
*/
register(script: Script): Promise<void>;
}

View File

@@ -0,0 +1,43 @@
import Plugin from '../Plugin';
import { SettingItem, SettingSection } from './types';
/**
* This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user.
*
* Settings are essentially key/value pairs.
*
* Note: Currently this API does **not** provide access to Joplin's built-in settings. This is by design as plugins that modify user settings could give unexpected results
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/settings)
*/
export default class JoplinSettings {
private plugin_;
constructor(plugin: Plugin);
private namespacedKey;
/**
* Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts.
* What it means is that you need to register the setting every time the plugin starts (for example in the onStart event).
* The setting value however will be preserved from one launch to the next so there is no risk that it will be lost even if for some
* reason the plugin fails to start at some point.
*/
registerSetting(key: string, settingItem: SettingItem): Promise<void>;
/**
* Registers a new setting section. Like for registerSetting, it is dynamic and needs to be done every time the plugin starts.
*/
registerSection(name: string, section: SettingSection): Promise<void>;
/**
* Gets a setting value (only applies to setting you registered from your plugin)
*/
value(key: string): Promise<any>;
/**
* Sets a setting value (only applies to setting you registered from your plugin)
*/
setValue(key: string, value: any): Promise<void>;
/**
* Gets a global setting value, including app-specific settings and those set by other plugins.
*
* The list of available settings is not documented yet, but can be found by looking at the source code:
*
* https://github.com/laurent22/joplin/blob/3539a452a359162c461d2849829d2d42973eab50/ReactNativeClient/lib/models/Setting.ts#L142
*/
globalValue(key: string): Promise<any>;
}

View File

@@ -0,0 +1,28 @@
import Plugin from '../Plugin';
import JoplinViewsDialogs from './JoplinViewsDialogs';
import JoplinViewsMenuItems from './JoplinViewsMenuItems';
import JoplinViewsMenus from './JoplinViewsMenus';
import JoplinViewsToolbarButtons from './JoplinViewsToolbarButtons';
import JoplinViewsPanels from './JoplinViewsPanels';
/**
* This namespace provides access to view-related services.
*
* All view services provide a `create()` method which you would use to create the view object, whether it's a dialog, a toolbar button or a menu item.
* In some cases, the `create()` method will return a [[ViewHandle]], which you would use to act on the view, for example to set certain properties or call some methods.
*/
export default class JoplinViews {
private store;
private plugin;
private dialogs_;
private panels_;
private menuItems_;
private menus_;
private toolbarButtons_;
private implementation_;
constructor(implementation: any, plugin: Plugin, store: any);
get dialogs(): JoplinViewsDialogs;
get panels(): JoplinViewsPanels;
get menuItems(): JoplinViewsMenuItems;
get menus(): JoplinViewsMenus;
get toolbarButtons(): JoplinViewsToolbarButtons;
}

View File

@@ -0,0 +1,36 @@
import Plugin from '../Plugin';
import { ButtonSpec, ViewHandle, ButtonId } from './types';
/**
* Allows creating and managing dialogs. A dialog is modal window that contains a webview and a row of buttons. You can update the update the webview using the `setHtml` method.
* Dialogs are hidden by default and you need to call `open()` to open them. Once the user clicks on a button, the `open` call will return and provide the button ID that was
* clicked on. There is currently no "close" method since the dialog should be thought as a modal one and thus can only be closed by clicking on one of the buttons.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/dialog)
*/
export default class JoplinViewsDialogs {
private store;
private plugin;
private implementation_;
constructor(implementation: any, plugin: Plugin, store: any);
private controller;
/**
* Creates a new dialog
*/
create(): Promise<ViewHandle>;
/**
* Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel"
*/
showMessageBox(message: string): Promise<number>;
/**
* Sets the dialog HTML content
*/
setHtml(handle: ViewHandle, html: string): Promise<string>;
/**
* Sets the dialog buttons.
*/
setButtons(handle: ViewHandle, buttons: ButtonSpec[]): Promise<ButtonSpec[]>;
/**
* Opens the dialog
*/
open(handle: ViewHandle): Promise<ButtonId>;
}

View File

@@ -0,0 +1,16 @@
import { CreateMenuItemOptions, MenuItemLocation } from './types';
import Plugin from '../Plugin';
/**
* Allows creating and managing menu items.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
*/
export default class JoplinViewsMenuItems {
private store;
private plugin;
constructor(plugin: Plugin, store: any);
/**
* Creates a new menu item and associate it with the given command. You can specify under which menu the item should appear using the `location` parameter.
*/
create(commandName: string, location?: MenuItemLocation, options?: CreateMenuItemOptions): Promise<void>;
}

View File

@@ -0,0 +1,18 @@
import { MenuItem, MenuItemLocation } from './types';
import Plugin from '../Plugin';
/**
* Allows creating menus.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/menu)
*/
export default class JoplinViewsMenus {
private store;
private plugin;
constructor(plugin: Plugin, store: any);
private registerCommandAccelerators;
/**
* Creates a new menu from the provided menu items and place it at the given location. As of now, it is only possible to place the
* menu as a sub-menu of the application build-in menus.
*/
create(label: string, menuItems: MenuItem[], location?: MenuItemLocation): Promise<void>;
}

View File

@@ -0,0 +1,30 @@
import Plugin from '../Plugin';
import { ViewHandle } from './types';
/**
* Allows creating and managing view panels. View panels currently are displayed at the right of the sidebar and allows displaying any HTML content (within a webview) and update it in real-time. For example
* it could be used to display a table of content for the active note, or display various metadata or graph.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/toc)
*/
export default class JoplinViewsPanels {
private store;
private plugin;
constructor(plugin: Plugin, store: any);
private controller;
/**
* Creates a new panel
*/
create(): Promise<ViewHandle>;
/**
* Sets the panel webview HTML
*/
setHtml(handle: ViewHandle, html: string): Promise<string>;
/**
* Adds and loads a new JS or CSS files into the panel.
*/
addScript(handle: ViewHandle, scriptPath: string): Promise<void>;
/**
* Called when a message is sent from the webview (using postMessage).
*/
onMessage(handle: ViewHandle, callback: Function): Promise<void>;
}

View File

@@ -0,0 +1,16 @@
import { ToolbarButtonLocation } from './types';
import Plugin from '../Plugin';
/**
* Allows creating and managing toolbar buttons.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
*/
export default class JoplinViewsToolbarButtons {
private store;
private plugin;
constructor(plugin: Plugin, store: any);
/**
* Creates a new toolbar button and associate it with the given command.
*/
create(commandName: string, location: ToolbarButtonLocation): Promise<void>;
}

View File

@@ -0,0 +1,34 @@
/**
* The workspace service provides access to all the parts of Joplin that are being worked on - i.e. the currently selected notes or notebooks as well
* as various related events, such as when a new note is selected, or when the note content changes.
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins)
*/
export default class JoplinWorkspace {
private store;
constructor(_implementation: any, store: any);
/**
* Called when a new note or notes are selected.
*/
onNoteSelectionChange(callback: Function): Promise<void>;
/**
* Called when the content of a note changes.
*/
onNoteContentChange(callback: Function): Promise<void>;
/**
* Called when an alarm associated with a to-do is triggered.
*/
onNoteAlarmTrigger(callback: Function): Promise<void>;
/**
* Called when the synchronisation process has finished.
*/
onSyncComplete(callback: Function): Promise<void>;
/**
* Gets the currently selected note
*/
selectedNote(): Promise<any>;
/**
* Gets the IDs of the selected notes (can be zero, one, or many). Use the data API to retrieve information about these notes.
*/
selectedNoteIds(): Promise<string[]>;
}

View File

@@ -0,0 +1,5 @@
import type Joplin from './Joplin';
declare const joplin:Joplin;
export default joplin;

View File

@@ -0,0 +1,263 @@
// =================================================================
// Command API types
// =================================================================
export interface Command {
name: string
label: string
iconName?: string,
execute(props:any):Promise<any>
isEnabled?(props:any):boolean
mapStateToProps?(state:any):any
}
// =================================================================
// Interop API types
// =================================================================
export enum FileSystemItem {
File = 'file',
Directory = 'directory',
}
export enum ImportModuleOutputFormat {
Markdown = 'md',
Html = 'html',
}
/**
* Used to implement a module to export data from Joplin. [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/json_export) for an example.
*
* In general, all the event handlers you'll need to implement take a `context` object as a first argument. This object will contain the export or import path as well as various optional properties, such as which notes or notebooks need to be exported.
*
* To get a better sense of what it will contain it can be useful to print it using `console.info(context)`.
*/
export interface ExportModule {
/**
* The format to be exported, eg "enex", "jex", "json", etc.
*/
format: string,
/**
* The description that will appear in the UI, for example in the menu item.
*/
description: string,
/**
* Whether the module will export a single file or multiple files in a directory. It affects the open dialog that will be presented to the user when using your exporter.
*/
target: FileSystemItem,
/**
* Only applies to single file exporters or importers
* It tells whether the format can package multiple notes into one file.
* For example JEX or ENEX can, but HTML cannot.
*/
isNoteArchive: boolean,
/**
* The extensions of the files exported by your module. For example, it is `["htm", "html"]` for the HTML module, and just `["jex"]` for the JEX module.
*/
fileExtensions?: string[],
/**
* Called when the export process starts.
*/
onInit(context:ExportContext): Promise<void>;
/**
* Called when an item needs to be processed. An "item" can be any Joplin object, such as a note, a folder, a notebook, etc.
*/
onProcessItem(context:ExportContext, itemType:number, item:any):Promise<void>;
/**
* Called when a resource file needs to be exported.
*/
onProcessResource(context:ExportContext, resource:any, filePath:string):Promise<void>;
/**
* Called when the export process is done.
*/
onClose(context:ExportContext):Promise<void>;
}
export interface ImportModule {
/**
* The format to be exported, eg "enex", "jex", "json", etc.
*/
format: string,
/**
* The description that will appear in the UI, for example in the menu item.
*/
description: string,
/**
* Only applies to single file exporters or importers
* It tells whether the format can package multiple notes into one file.
* For example JEX or ENEX can, but HTML cannot.
*/
isNoteArchive: boolean,
/**
* The type of sources that are supported by the module. Tells whether the module can import files or directories or both.
*/
sources: FileSystemItem[],
/**
* Tells the file extensions of the exported files.
*/
fileExtensions?: string[],
/**
* Tells the type of notes that will be generated, either HTML or Markdown (default).
*/
outputFormat?: ImportModuleOutputFormat,
/**
* Called when the import process starts. There is only one event handler within which you should import the complete data.
*/
onExec(context:ImportContext): Promise<void>;
}
export interface ExportOptions {
format?: string,
path?:string,
sourceFolderIds?: string[],
sourceNoteIds?: string[],
modulePath?:string,
target?:FileSystemItem,
}
export interface ExportContext {
destPath: string,
options: ExportOptions,
/**
* You can attach your own custom data using this propery - it will then be passed to each event handler, allowing you to keep state from one event to the next.
*/
userData?: any,
}
export interface ImportContext {
sourcePath: string,
options: any,
warnings: string[],
}
// =================================================================
// Misc types
// =================================================================
export interface Script {
onStart?(event:any):Promise<void>,
}
// =================================================================
// Menu types
// =================================================================
export interface CreateMenuItemOptions {
accelerator: string,
}
export enum MenuItemLocation {
File = 'file',
Edit = 'edit',
View = 'view',
Note = 'note',
Tools = 'tools',
Help = 'help',
Context = 'context',
}
export interface MenuItem {
commandName?: string,
accelerator?: string,
submenu?: MenuItem[],
label?: string,
}
// =================================================================
// View API types
// =================================================================
export interface ButtonSpec {
id: ButtonId,
title?: string,
onClick?():void,
}
export type ButtonId = string;
export enum ToolbarButtonLocation {
/**
* This toolbar in the top right corner of the application. It applies to the note as a whole, including its metadata.
*/
NoteToolbar = 'noteToolbar',
/**
* This toolbar is right above the text editor. It applies to the note body only.
*/
EditorToolbar = 'editorToolbar',
}
export type ViewHandle = string;
export interface EditorCommand {
name: string;
value?: any;
}
// =================================================================
// Settings types
// =================================================================
export enum SettingItemType {
Int = 1,
String = 2,
Bool = 3,
Array = 4,
Object = 5,
Button = 6,
}
// Redefine a simplified interface to mask internal details
// and to remove function calls as they would have to be async.
export interface SettingItem {
value: any,
type: SettingItemType,
public: boolean,
label:string,
description?:string,
isEnum?: boolean,
section?: string,
options?:any,
appTypes?:string[],
secure?: boolean,
advanced?: boolean,
minimum?: number,
maximum?: number,
step?: number,
}
export interface SettingSection {
label: string,
iconName?: string,
description?: string,
name?: string,
}
// =================================================================
// Data API types
// =================================================================
/**
* An array of at least one element and at most three elements.
*
* [0]: Resource name (eg. "notes", "folders", "tags", etc.)
* [1]: (Optional) Resource ID.
* [2]: (Optional) Resource link.
*/
export type Path = string[];

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
{
"name": "joplin_plugin",
"version": "1.0.0",
"description": "",
"scripts": {
"dist": "webpack",
"postinstall": "npm run dist"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^14.0.14",
"copy-webpack-plugin": "^6.1.0",
"ts-loader": "^7.0.5",
"typescript": "^3.9.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}

View File

@@ -0,0 +1,25 @@
import joplin from 'api';
joplin.plugins.register({
onStart: async function() {
await joplin.views.menus.create('My Menu', [
{
commandName: "newNote",
},
{
commandName: "newFolder",
},
{
label: 'My sub-menu',
submenu: [
{
commandName: 'print',
},
{
commandName: 'setTags',
},
],
},
]);
},
});

View File

@@ -0,0 +1,8 @@
{
"manifest_version": 1,
"name": "Menu Test",
"description": "",
"version": "1.0.0",
"author": "",
"homepage_url": ""
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"outDir": "./dist/",
"module": "commonjs",
"target": "es2015",
"jsx": "react",
"allowJs": true,
"baseUrl": "."
}
}

View File

@@ -0,0 +1,44 @@
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
entry: './src/index.ts',
target: 'node',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
alias: {
api: path.resolve(__dirname, 'api')
},
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new CopyPlugin({
patterns: [
{
from: "**/*",
context: path.resolve(__dirname, 'src'),
to: path.resolve(__dirname, 'dist'),
globOptions: {
ignore: [
'**/*.ts',
'**/*.tsx',
],
},
},
],
}),
],
};

View File

@@ -45,7 +45,7 @@ joplin.plugins.register({
newLines.push(newCells.join(' | '));
}
await joplin.commands.execute('replaceSelection', { value: newLines.join('\n') });
await joplin.commands.execute('replaceSelection', newLines.join('\n'));
},
});

View File

@@ -2420,6 +2420,11 @@
"path-exists": "^3.0.0"
}
},
"lodash.toarray": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
},
"lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
@@ -2741,6 +2746,14 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node-emoji": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz",
"integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==",
"requires": {
"lodash.toarray": "^4.4.0"
}
},
"node-libs-browser": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz",
@@ -3429,11 +3442,6 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"slug": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/slug/-/slug-3.3.4.tgz",
"integrity": "sha512-VpHbtRCEWmgaZsrZcTsVl/Dhw98lcrOYDO17DNmJCNpppI6s3qJvnNu2Q3D4L84/2bi6vkW40mjNQI9oGQsflg=="
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -3981,6 +3989,11 @@
"imurmurhash": "^0.1.4"
}
},
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"unset-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
@@ -4067,6 +4080,14 @@
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
"dev": true
},
"uslug": {
"version": "git+https://github.com/laurent22/uslug.git#ba2834d79beb0435318709958b2f5e817d96674d",
"from": "git+https://github.com/laurent22/uslug.git#emoji-support",
"requires": {
"node-emoji": "^1.10.0",
"unorm": ">= 1.0.0"
}
},
"util": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",

View File

@@ -20,6 +20,6 @@
"webpack-cli": "^3.3.11"
},
"dependencies": {
"slug": "^3.3.4"
"uslug": "git+https://github.com/laurent22/uslug.git#emoji-support"
}
}

View File

@@ -1,6 +1,6 @@
import joplin from 'api';
const nodeSlug = require('slug');
const uslug = require('uslug');
// From https://stackoverflow.com/a/6234804/561309
function escapeHtml(unsafe:string) {
@@ -29,7 +29,7 @@ function noteHeaders(noteBody:string) {
let slugs:any = {};
function headerSlug(headerText:string) {
const s = nodeSlug(headerText);
const s = uslug(headerText);
let num = slugs[s] ? slugs[s] : 1;
const output = [s];
if (num > 1) output.push(num);
@@ -49,9 +49,7 @@ joplin.plugins.register({
panels.onMessage(view, (message:any) => {
if (message.name === 'scrollToHash') {
joplin.commands.execute('scrollToHash', {
hash: message.hash,
})
joplin.commands.execute('scrollToHash', message.hash)
}
});

View File

@@ -155,7 +155,7 @@ export default class InteropServiceHelper {
if (Array.isArray(path)) path = path[0];
CommandService.instance().execute('showModalMessage', { message: _('Exporting to "%s" as "%s" format. Please wait...', path, module.format) });
CommandService.instance().execute('showModalMessage', _('Exporting to "%s" as "%s" format. Please wait...', path, module.format));
const exportOptions:ExportOptions = {};
exportOptions.path = path;

View File

@@ -58,7 +58,7 @@ const commands = [
require('./gui/MainScreen/commands/showNoteProperties'),
require('./gui/MainScreen/commands/showShareNoteDialog'),
require('./gui/MainScreen/commands/toggleNoteList'),
require('./gui/MainScreen/commands/toggleSidebar'),
require('./gui/MainScreen/commands/toggleSideBar'),
require('./gui/MainScreen/commands/toggleVisiblePanes'),
require('./gui/MainScreen/commands/toggleEditors'),
require('./gui/NoteEditor/commands/focusElementNoteBody'),
@@ -85,7 +85,7 @@ const globalCommands = [
const editorCommandDeclarations = require('./gui/NoteEditor/commands/editorCommandDeclarations').default;
const pluginClasses = [
require('./plugins/GotoAnything.min'),
require('./plugins/GotoAnything').default,
];
interface AppStateRoute {
@@ -425,7 +425,7 @@ class Application extends BaseApplication {
const contextMenu = Menu.buildFromTemplate([
{ label: _('Open %s', app.electronApp().name), click: () => { app.window().show(); } },
{ type: 'separator' },
{ label: _('Exit'), click: () => { app.quit(); } },
{ label: _('Quit'), click: () => { app.quit(); } },
]);
app.createTray(contextMenu);
}
@@ -466,14 +466,14 @@ class Application extends BaseApplication {
async start(argv:string[]):Promise<any> {
const electronIsDev = require('electron-is-dev');
await fs.mkdirp(Setting.value('templateDir'), 0o755);
// If running inside a package, the command line, instead of being "node.exe <path> <flags>" is "joplin.exe <flags>" so
// insert an extra argument so that they can be processed in a consistent way everywhere.
if (!electronIsDev) argv.splice(1, 0, '.');
argv = await super.start(argv);
await fs.mkdirp(Setting.value('templateDir'), 0o755);
await this.applySettingsSideEffects();
if (Setting.value('sync.upgradeState') === Setting.SYNC_UPGRADE_STATE_MUST_DO) {
@@ -513,7 +513,7 @@ class Application extends BaseApplication {
this.initRedux();
CommandService.instance().initialize(this.store());
CommandService.instance().initialize(this.store(), Setting.value('env') == 'dev');
for (const command of commands) {
CommandService.instance().registerDeclaration(command.declaration);

View File

@@ -6,7 +6,7 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async ({ target }:any) => {
execute: async (_context:any, target:string) => {
if (target === 'noteBody') return CommandService.instance().execute('focusElementNoteBody');
if (target === 'noteList') return CommandService.instance().execute('focusElementNoteList');
if (target === 'sideBar') return CommandService.instance().execute('focusElementSideBar');

View File

@@ -1,13 +1,10 @@
import { CommandRuntime, CommandDeclaration } from '../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
const Note = require('lib/models/Note');
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
const bridge = require('electron').remote.require('./bridge').default;
interface Props {
noteId: string
}
export const declaration:CommandDeclaration = {
name: 'startExternalEditing',
label: () => _('Edit in external editor'),
@@ -16,21 +13,16 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async (props:Props) => {
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
try {
const note = await Note.load(props.noteId);
const note = await Note.load(noteId);
ExternalEditWatcher.instance().openAndWatch(note);
} catch (error) {
bridge().showErrorMessageBox(_('Error opening note in editor: %s', error.message));
}
},
isEnabled: (props:any) => {
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return {
noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null,
};
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,11 +1,8 @@
import { CommandRuntime, CommandDeclaration } from '../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
interface Props {
noteId: string
}
export const declaration:CommandDeclaration = {
name: 'stopExternalEditing',
label: () => _('Stop external editing'),
@@ -14,14 +11,10 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async (props:Props) => {
ExternalEditWatcher.instance().stopWatching(props.noteId);
},
isEnabled: (props:any) => {
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return { noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null };
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
ExternalEditWatcher.instance().stopWatching(noteId);
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,12 +1,7 @@
import { CommandRuntime, CommandDeclaration } from '../lib/services/CommandService';
import CommandService, { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { AppState } from '../app';
import CommandService from 'lib/services/CommandService';
interface Props {
noteId: string
noteIsBeingWatched: boolean
}
import { stateUtils } from 'lib/reducer';
import { DesktopCommandContext } from '../services/commands/types';
export const declaration:CommandDeclaration = {
name: 'toggleExternalEditing',
@@ -16,27 +11,21 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async (props:Props) => {
if (!props.noteId) return;
execute: async (context:DesktopCommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
if (props.noteIsBeingWatched) {
CommandService.instance().execute('stopExternalEditing', { noteId: props.noteId });
if (!noteId) return;
if (context.state.watchedNoteFiles.includes(noteId)) {
CommandService.instance().execute('stopExternalEditing', noteId);
} else {
CommandService.instance().execute('startExternalEditing', { noteId: props.noteId });
CommandService.instance().execute('startExternalEditing', noteId);
}
},
isEnabled: (props:Props) => {
return !!props.noteId;
},
mapStateToProps: (state:AppState):Props => {
const noteId = state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null;
return {
noteId: noteId,
noteIsBeingWatched: noteId ? state.watchedNoteFiles.includes(noteId) : false,
};
},
title: (props:Props) => {
return props.noteIsBeingWatched ? _('Stop') : '';
enabledCondition: 'oneNoteSelected',
mapStateToTitle: (state:any) => {
const noteId = stateUtils.selectedNoteId(state);
return state.watchedNoteFiles.includes(noteId) ? _('Stop') : '';
},
};
};

View File

@@ -26,6 +26,8 @@ const getLabel = (commandName: string) => {
return _('Hide Joplin');
case 'closeWindow':
return _('Close Window');
case 'commandPalette':
return _('Command palette');
case 'config':
return shim.isMac() ? _('Preferences') : _('Options');
default:

View File

@@ -61,7 +61,7 @@ const commands = [
require('./commands/showShareNoteDialog'),
require('./commands/toggleEditors'),
require('./commands/toggleNoteList'),
require('./commands/toggleSidebar'),
require('./commands/toggleSideBar'),
require('./commands/toggleVisiblePanes'),
];
@@ -320,7 +320,7 @@ class MainScreenComponent extends React.Component<any, any> {
window.removeEventListener('resize', this.window_resize);
}
toggleSidebar() {
toggleSideBar() {
this.props.dispatch({
type: 'SIDEBAR_VISIBILITY_TOGGLE',
});

View File

@@ -1,8 +1,8 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import eventManager from 'lib/eventManager';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
const Note = require('lib/models/Note');
const BaseModel = require('lib/BaseModel');
const { time } = require('lib/time-utils');
export const declaration:CommandDeclaration = {
@@ -13,7 +13,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteId }:any) => {
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
const note = await Note.load(noteId);
const defaultDate = new Date(Date.now() + 2 * 3600 * 1000);
@@ -51,25 +53,12 @@ export const runtime = (comp:any):CommandRuntime => {
},
});
},
title: (props:any):string => {
if (!props.noteId) return null;
if (!props.noteTodoDue) return null;
return time.formatMsToLocal(props.noteTodoDue);
},
isEnabled: (props:any):boolean => {
if (!props.noteId) return false;
return !!props.noteIsTodo && !props.noteTodoCompleted;
},
mapStateToProps: (state:any):any => {
const noteId = state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null;
const note = noteId ? BaseModel.byId(state.notes, noteId) : null;
return {
noteId: note ? noteId : null,
noteIsTodo: note ? note.is_todo : false,
noteTodoCompleted: note ? note.todo_completed : false,
noteTodoDue: note ? note.todo_due : null,
};
enabledCondition: 'oneNoteSelected && noteIsTodo && !noteTodoCompleted',
mapStateToTitle: (state:any) => {
const note = stateUtils.selectedNote(state);
return note && note.todo_due ? time.formatMsToLocal(note.todo_due) : null;
},
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import shim from 'lib/shim';
import InteropServiceHelper from '../../../InteropServiceHelper';
import { _ } from 'lib/locale';
@@ -12,8 +12,10 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteIds }:any) => {
execute: async (context:CommandContext, noteIds:string[] = null) => {
try {
noteIds = noteIds || context.state.selectedNoteIds;
if (!noteIds.length) throw new Error('No notes selected for pdf export');
let path = null;
@@ -22,7 +24,6 @@ export const runtime = (comp:any):CommandRuntime => {
filters: [{ name: _('PDF File'), extensions: ['pdf'] }],
defaultPath: await InteropServiceHelper.defaultFilename(noteIds[0], 'pdf'),
});
} else {
path = bridge().showOpenDialog({
properties: ['openDirectory', 'createDirectory'],
@@ -50,13 +51,7 @@ export const runtime = (comp:any):CommandRuntime => {
bridge().showErrorMessageBox(error.message);
}
},
isEnabled: (props:any):boolean => {
return !!props.noteIds.length;
},
mapStateToProps: (state:any):any => {
return {
noteIds: state.selectedNoteIds,
};
},
enabledCondition: 'someNotesSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
export const declaration:CommandDeclaration = {
name: 'hideModalMessage',

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Folder = require('lib/models/Folder');
const Note = require('lib/models/Note');
@@ -10,7 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteIds }:any) => {
execute: async (context:CommandContext, noteIds:string[] = null) => {
noteIds = noteIds || context.state.selectedNoteIds;
const folders:any[] = await Folder.sortFolderTree();
const startFolders:any[] = [];
const maxDepth = 15;
@@ -42,13 +44,6 @@ export const runtime = (comp:any):CommandRuntime => {
},
});
},
isEnabled: (props:any):boolean => {
return !!props.noteIds.length;
},
mapStateToProps: (state:any):any => {
return {
noteIds: state.selectedNoteIds,
};
},
enabledCondition: 'someNotesSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandContext, CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Folder = require('lib/models/Folder');
const bridge = require('electron').remote.require('./bridge').default;
@@ -11,7 +11,7 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ parentId }:any) => {
execute: async (_context:CommandContext, parentId:string = null) => {
comp.setState({
promptOptions: {
label: _('Notebook title:'),
@@ -39,8 +39,5 @@ export const runtime = (comp:any):CommandRuntime => {
},
});
},
title: () => {
return _('New notebook');
},
};
};

View File

@@ -1,8 +1,7 @@
import { utils, CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { utils, CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Setting = require('lib/models/Setting').default;
const Note = require('lib/models/Note');
const Folder = require('lib/models/Folder');
const TemplateUtils = require('lib/TemplateUtils');
export const declaration:CommandDeclaration = {
@@ -13,7 +12,7 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async ({ template, isTodo }:any) => {
execute: async (_context:CommandContext, template:string = null, isTodo:boolean = false) => {
const folderId = Setting.value('activeFolderId');
if (!folderId) return;
@@ -34,12 +33,6 @@ export const runtime = ():CommandRuntime => {
id: newNote.id,
});
},
isEnabled: () => {
const { folders, selectedFolderId } = utils.store.getState();
return !!folders.length && selectedFolderId !== Folder.conflictFolderId();
},
title: () => {
return _('New note');
},
enabledCondition: 'oneFolderSelected && !inConflictFolder',
};
};

View File

@@ -1,4 +1,4 @@
import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import CommandService, { CommandContext, CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -9,14 +9,9 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async ({ template }:any) => {
return CommandService.instance().execute('newNote', { template: template, isTodo: true });
},
isEnabled: () => {
return CommandService.instance().isEnabled('newNote', {});
},
title: () => {
return _('New to-do');
execute: async (_context:CommandContext, template:string = null) => {
return CommandService.instance().execute('newNote', template, true);
},
enabledCondition: 'oneFolderSelected && !inConflictFolder',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const bridge = require('electron').remote.require('./bridge').default;
@@ -10,8 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteIds }:any) => {
// TODO: test
execute: async (context:CommandContext, noteIds:string[] = null) => {
noteIds = noteIds || context.state.selectedNoteIds;
try {
if (noteIds.length !== 1) throw new Error(_('Only one note can be printed at a time.'));
await comp.printTo_('printer', { noteId: noteIds[0] });
@@ -19,13 +20,6 @@ export const runtime = (comp:any):CommandRuntime => {
bridge().showErrorMessageBox(error.message);
}
},
isEnabled: (props:any):boolean => {
return !!props.noteIds.length;
},
mapStateToProps: (state:any):any => {
return {
noteIds: state.selectedNoteIds,
};
},
enabledCondition: 'someNotesSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Folder = require('lib/models/Folder');
const bridge = require('electron').remote.require('./bridge').default;
@@ -10,7 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ folderId }:any) => {
execute: async (context:CommandContext, folderId:string = null) => {
folderId = folderId || context.state.selectedFolderId;
const folder = await Folder.load(folderId);
if (folder) {

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Tag = require('lib/models/Tag');
const bridge = require('electron').remote.require('./bridge').default;
@@ -10,7 +10,10 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ tagId }:any) => {
execute: async (context:CommandContext, tagId:string = null) => {
tagId = tagId || context.state.selectedTagId;
if (!tagId) return;
const tag = await Tag.load(tagId);
if (tag) {
comp.setState({

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
const BaseModel = require('lib/BaseModel');
const uuid = require('lib/uuid').default;
@@ -9,7 +9,7 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ query }:any) => {
execute: async (_context:CommandContext, query:string) => {
if (!comp.searchId_) comp.searchId_ = uuid.create();
comp.props.dispatch({

View File

@@ -1,4 +1,4 @@
import CommandService, { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import CommandService, { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const TemplateUtils = require('lib/TemplateUtils');
@@ -8,7 +8,7 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteType }:any) => {
execute: async (_context:CommandContext, noteType:string) => {
comp.setState({
promptOptions: {
label: _('Template file:'),
@@ -18,9 +18,9 @@ export const runtime = (comp:any):CommandRuntime => {
onClose: async (answer:any) => {
if (answer) {
if (noteType === 'note' || noteType === 'todo') {
CommandService.instance().execute('newNote', { template: answer.value, isTodo: noteType === 'todo' });
CommandService.instance().execute('newNote', answer.value, noteType === 'todo');
} else {
CommandService.instance().execute('insertText', { value: TemplateUtils.render(answer.value) });
CommandService.instance().execute('insertText', TemplateUtils.render(answer.value));
}
}

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
const Tag = require('lib/models/Tag');
@@ -10,7 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteIds }:any) => {
execute: async (context:CommandContext, noteIds:string[] = null) => {
noteIds = noteIds || context.state.selectedNoteIds;
const tags = await Tag.commonTagsByNoteIds(noteIds);
const startTags = tags
.map((a:any) => {
@@ -64,11 +66,6 @@ export const runtime = (comp:any):CommandRuntime => {
},
});
},
isEnabled: (props:any) => {
return !!props.noteIds.length;
},
mapStateToProps: (state:any) => {
return { noteIds: state.selectedNoteIds };
},
enabledCondition: 'someNotesSelected',
};
};

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime, CommandContext } from 'lib/services/CommandService';
export const declaration:CommandDeclaration = {
name: 'showModalMessage',
@@ -7,7 +7,7 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ message }:any) => {
execute: async (_context:CommandContext, message:string) => {
comp.setState({
modalLayer: {
visible: true,

View File

@@ -1,5 +1,6 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
const Note = require('lib/models/Note');
export const declaration:CommandDeclaration = {
@@ -9,7 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteId }:any) => {
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
const note = await Note.load(noteId);
if (note) {
comp.setState({
@@ -21,11 +24,7 @@ export const runtime = (comp:any):CommandRuntime => {
});
}
},
isEnabled: (props:any) => {
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return { noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null };
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,5 +1,6 @@
import CommandService, { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import CommandService, { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
export const declaration:CommandDeclaration = {
name: 'showNoteProperties',
@@ -9,7 +10,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteId }:any) => {
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
comp.setState({
notePropertiesDialogOptions: {
noteId: noteId,
@@ -20,11 +23,6 @@ export const runtime = (comp:any):CommandRuntime => {
},
});
},
isEnabled: (props:any) => {
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return { noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null };
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -8,7 +8,9 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteIds }:any) => {
execute: async (context:CommandContext, noteIds:string[] = null) => {
noteIds = noteIds || context.state.selectedNoteIds;
comp.setState({
shareNoteDialogOptions: {
noteIds: noteIds,

View File

@@ -1,4 +1,4 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime, CommandContext } from 'lib/services/CommandService';
import Setting from 'lib/models/Setting';
import { stateUtils } from 'lib/reducer';
import { _ } from 'lib/locale';
@@ -11,22 +11,14 @@ export const declaration:CommandDeclaration = {
export const runtime = ():CommandRuntime => {
return {
execute: async (props:any) => {
execute: async (context:CommandContext) => {
// A bit of a hack, but for now don't allow changing code view
// while a note is being saved as it will cause a problem with
// TinyMCE because it won't have time to send its content before
// being switch to Ace Editor.
if (props.hasNotesBeingSaved) return;
if (stateUtils.hasNotesBeingSaved(context.state)) return;
Setting.toggle('editor.codeView');
},
isEnabled: (props:any):boolean => {
return !props.hasNotesBeingSaved && props.hasOneSelectedNote;
},
mapStateToProps: (state:any):any => {
return {
hasNotesBeingSaved: stateUtils.hasNotesBeingSaved(state),
hasOneSelectedNote: state.selectedNoteIds.length === 1,
};
},
enabledCondition: '!notesAreBeingSaved && oneNoteSelected',
};
};

View File

@@ -1,10 +1,10 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
name: 'toggleNoteList',
label: () => _('Toggle note list'),
iconName: 'fa-align-justify',
iconName: 'fas fa-align-justify',
};
export const runtime = (comp:any):CommandRuntime => {
@@ -14,8 +14,5 @@ export const runtime = (comp:any):CommandRuntime => {
type: 'NOTELIST_VISIBILITY_TOGGLE',
});
},
title: () => {
return _('Toggle note list');
},
};
};

View File

@@ -1,10 +1,10 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
name: 'toggleSidebar',
name: 'toggleSideBar',
label: () => _('Toggle sidebar'),
iconName: 'fa-bars',
iconName: 'fas fa-bars',
};
export const runtime = (comp:any):CommandRuntime => {
@@ -14,8 +14,5 @@ export const runtime = (comp:any):CommandRuntime => {
type: 'SIDEBAR_VISIBILITY_TOGGLE',
});
},
title: () => {
return _('Toggle sidebar');
},
};
};

View File

@@ -1,4 +1,4 @@
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -14,14 +14,7 @@ export const runtime = (comp:any):CommandRuntime => {
type: 'NOTE_VISIBLE_PANES_TOGGLE',
});
},
isEnabled: (props:any):boolean => {
return props.settingEditorCodeView && props.selectedNoteIds.length === 1;
},
mapStateToProps: (state:any):any => {
return {
selectedNoteIds: state.selectedNoteIds,
settingEditorCodeView: state.settings['editor.codeView'],
};
},
enabledCondition: 'markdownEditorVisible && oneNoteSelected',
};
};

View File

@@ -5,14 +5,15 @@ import { stateUtils } from 'lib/reducer';
import CommandService from 'lib/services/CommandService';
import MenuUtils from 'lib/services/commands/MenuUtils';
import KeymapService from 'lib/services/KeymapService';
import { utils as pluginUtils, ViewInfo } from 'lib/services/plugins/reducer';
import { PluginStates, utils as pluginUtils } from 'lib/services/plugins/reducer';
import shim from 'lib/shim';
import Setting from 'lib/models/Setting';
import versionInfo from 'lib/versionInfo';
import { Module } from 'lib/services/interop/types';
import InteropServiceHelper from '../InteropServiceHelper';
import { _ } from 'lib/locale';
import { MenuItemLocation } from 'lib/services/plugins/api/types';
import { MenuItem, MenuItemLocation } from 'lib/services/plugins/api/types';
import stateToWhenClauseContext from 'lib/services/commands/stateToWhenClauseContext';
const { connect } = require('react-redux');
const { reg } = require('lib/registry.js');
@@ -23,6 +24,51 @@ const Menu = bridge().Menu;
const PluginManager = require('lib/services/PluginManager');
const TemplateUtils = require('lib/TemplateUtils');
const menuUtils = new MenuUtils(CommandService.instance());
function pluginMenuItemsCommandNames(menuItems:MenuItem[]):string[] {
let output:string[] = [];
for (const menuItem of menuItems) {
if (menuItem.submenu) {
output = output.concat(pluginMenuItemsCommandNames(menuItem.submenu));
} else {
if (menuItem.commandName) output.push(menuItem.commandName);
}
}
return output;
}
function pluginCommandNames(plugins:PluginStates):string[] {
let output:string[] = [];
for (const view of pluginUtils.viewsByType(plugins, 'menu')) {
output = output.concat(pluginMenuItemsCommandNames(view.menuItems));
}
for (const view of pluginUtils.viewsByType(plugins, 'menuItem')) {
if (view.commandName) output.push(view.commandName);
}
return output;
}
function createPluginMenuTree(label:string, menuItems:MenuItem[], onMenuItemClick:Function) {
const output:any = {
label: label,
submenu: [],
};
for (const menuItem of menuItems) {
if (menuItem.submenu) {
output.submenu.push(createPluginMenuTree(menuItem.label, menuItem.submenu, onMenuItemClick));
} else {
output.submenu.push(menuUtils.commandToMenuItem(menuItem.commandName, onMenuItemClick));
}
}
return output;
}
interface Props {
dispatch: Function,
menuItemProps: any,
@@ -36,7 +82,8 @@ interface Props {
showNoteCounts: boolean,
uncompletedTodosOnTop: boolean,
showCompletedTodos: boolean,
pluginMenuItemInfos: ViewInfo[],
pluginMenuItems: any[],
pluginMenus: any[],
}
const commandNames:string[] = [
@@ -62,7 +109,7 @@ const commandNames:string[] = [
'attachFile',
'focusSearch',
'showLocalSearch',
'toggleSidebar',
'toggleSideBar',
'toggleNoteList',
'toggleVisiblePanes',
'toggleExternalEditing',
@@ -85,8 +132,6 @@ function menuItemSetEnabled(id:string, enabled:boolean) {
menuItem.enabled = enabled;
}
const menuUtils = new MenuUtils(CommandService.instance());
function useMenu(props:Props) {
const [menu, setMenu] = useState(null);
const [keymapLastChangeTime, setKeymapLastChangeTime] = useState(Date.now());
@@ -113,12 +158,12 @@ function useMenu(props:Props) {
if (Array.isArray(path)) path = path[0];
CommandService.instance().execute('showModalMessage', { message: _('Importing from "%s" as "%s" format. Please wait...', path, module.format) });
CommandService.instance().execute('showModalMessage', _('Importing from "%s" as "%s" format. Please wait...', path, module.format));
const importOptions = {
path,
format: module.format,
modulePath: module.path,
outputFormat: module.outputFormat,
onError: console.warn,
destinationFolderId: !module.isNoteArchive && moduleSource === 'file' ? props.selectedFolderId : null,
};
@@ -143,7 +188,7 @@ function useMenu(props:Props) {
useEffect(() => {
const keymapService = KeymapService.instance();
const pluginCommandNames = props.pluginMenuItemInfos.map((viewInfo:ViewInfo) => viewInfo.view.commandName);
const pluginCommandNames = props.pluginMenuItems.map((view:any) => view.commandName);
const menuItemDic = menuUtils.commandsToMenuItems(commandNames.concat(pluginCommandNames), (commandName:string) => onMenuItemClickRef.current(commandName));
const quitMenuItem = {
@@ -207,7 +252,7 @@ function useMenu(props:Props) {
exportItems.push({
label: module.fullLabel(),
click: async () => {
await InteropServiceHelper.export(props.dispatch.bind(this), module);
await InteropServiceHelper.export((action:any) => props.dispatch(action), module);
},
});
}
@@ -255,12 +300,12 @@ function useMenu(props:Props) {
templateItems.push({
label: _('Create note from template'),
click: () => {
CommandService.instance().execute('selectTemplate', { noteType: 'note' });
CommandService.instance().execute('selectTemplate', 'note');
},
}, {
label: _('Create to-do from template'),
click: () => {
CommandService.instance().execute('selectTemplate', { noteType: 'todo' });
CommandService.instance().execute('selectTemplate', 'todo');
},
}, {
label: _('Insert template'),
@@ -278,7 +323,7 @@ function useMenu(props:Props) {
click: async () => {
const templates = await TemplateUtils.loadTemplates(Setting.value('templateDir'));
this.store().dispatch({
props.dispatch({
type: 'TEMPLATE_UPDATE_ALL',
templates: templates,
});
@@ -314,8 +359,8 @@ function useMenu(props:Props) {
}
toolsItems = toolsItems.concat(toolsItemsAll);
function _checkForUpdates(ctx:any) {
bridge().checkForUpdates(false, bridge().window(), ctx.checkForUpdateLoggerPath(), { includePreReleases: Setting.value('autoUpdate.includePreReleases') });
function _checkForUpdates() {
bridge().checkForUpdates(false, bridge().window(), `${Setting.value('profileDir')}/log-autoupdater.txt`, { includePreReleases: Setting.value('autoUpdate.includePreReleases') });
}
function _showAbout() {
@@ -361,7 +406,7 @@ function useMenu(props:Props) {
}, {
label: _('Check for updates...'),
visible: shim.isMac() ? true : false,
click: () => _checkForUpdates(this),
click: () => _checkForUpdates(),
}, {
type: 'separator',
visible: shim.isMac() ? true : false,
@@ -397,12 +442,16 @@ function useMenu(props:Props) {
}, shim.isMac() ? noItem : printItem, {
type: 'separator',
platforms: ['darwin'],
}, {
},
shim.isMac() ? {
label: _('Hide %s', 'Joplin'),
platforms: ['darwin'],
accelerator: shim.isMac() && keymapService.getAccelerator('hideApp'),
click: () => { bridge().electronApp().hide(); },
}, {
} : noItem,
{
type: 'separator',
},
quitMenuItem],
@@ -484,7 +533,7 @@ function useMenu(props:Props) {
view: {
label: _('&View'),
submenu: [
menuItemDic.toggleSidebar,
menuItemDic.toggleSideBar,
menuItemDic.toggleNoteList,
menuItemDic.toggleVisiblePanes,
{
@@ -502,7 +551,6 @@ function useMenu(props:Props) {
id: 'showNoteCounts',
label: Setting.settingMetadata('showNoteCounts').label(),
type: 'checkbox',
// checked: Setting.value('showNoteCounts'),
click: () => {
Setting.setValue('showNoteCounts', !Setting.value('showNoteCounts'));
},
@@ -510,7 +558,6 @@ function useMenu(props:Props) {
id: 'uncompletedTodosOnTop',
label: Setting.settingMetadata('uncompletedTodosOnTop').label(),
type: 'checkbox',
// checked: Setting.value('uncompletedTodosOnTop'),
click: () => {
Setting.setValue('uncompletedTodosOnTop', !Setting.value('uncompletedTodosOnTop'));
},
@@ -518,7 +565,6 @@ function useMenu(props:Props) {
id: 'showCompletedTodos',
label: Setting.settingMetadata('showCompletedTodos').label(),
type: 'checkbox',
// checked: Setting.value('showCompletedTodos'),
click: () => {
Setting.setValue('showCompletedTodos', !Setting.value('showCompletedTodos'));
},
@@ -590,7 +636,7 @@ function useMenu(props:Props) {
}, {
label: _('Check for updates...'),
visible: shim.isMac() ? false : true,
click: () => _checkForUpdates(this),
click: () => _checkForUpdates(),
},
separator(),
{
@@ -641,26 +687,36 @@ function useMenu(props:Props) {
rootMenus[key].submenu = cleanUpSeparators(rootMenus[key].submenu);
}
const pluginMenuItems = PluginManager.instance().menuItems();
for (const item of pluginMenuItems) {
const itemParent = rootMenus[item.parent] ? rootMenus[item.parent] : 'tools';
itemParent.submenu.push(item);
{
// This is for GotoAnything only - should be refactored since this plugin manager is not used otherwise
const pluginMenuItems = PluginManager.instance().menuItems();
for (const item of pluginMenuItems) {
const itemParent = rootMenus[item.parent] ? rootMenus[item.parent] : 'tools';
itemParent.submenu.push(item);
}
}
// TODO: test
const pluginViewInfos = props.pluginMenuItemInfos;
for (const info of pluginViewInfos) {
const location:MenuItemLocation = info.view.location;
for (const view of props.pluginMenuItems) {
const location:MenuItemLocation = view.location;
if (location === MenuItemLocation.Context) continue;
const itemParent = rootMenus[location];
if (!itemParent) {
reg.logger().error('Menu item location does not exist: ', location, info);
reg.logger().error('Menu item location does not exist: ', location, view);
} else {
itemParent.submenu.push(menuItemDic[info.view.commandName]);
itemParent.submenu.push(menuItemDic[view.commandName]);
}
}
for (const view of props.pluginMenus) {
if (view.location === MenuItemLocation.Context) continue;
const itemParent = rootMenus[view.location];
if (!itemParent) {
reg.logger().error('Menu location does not exist: ', location, view);
} else {
itemParent.submenu.push(createPluginMenuTree(view.label, view.menuItems, (commandName:string) => onMenuItemClickRef.current(commandName)));
}
}
@@ -725,17 +781,21 @@ function useMenu(props:Props) {
} else {
setMenu(Menu.buildFromTemplate(template));
}
}, [props.routeName, props.pluginMenuItemInfos, keymapLastChangeTime, modulesLastChangeTime]);
}, [props.routeName, props.pluginMenuItems, props.pluginMenus, keymapLastChangeTime, modulesLastChangeTime]);
useEffect(() => {
const whenClauseContext = CommandService.instance().currentWhenClauseContext();
for (const commandName in props.menuItemProps) {
if (!props.menuItemProps[commandName]) continue;
menuItemSetEnabled(commandName, CommandService.instance().isEnabled(commandName, props.menuItemProps[commandName]));
const p = props.menuItemProps[commandName];
if (!p) continue;
const enabled = 'enabled' in p ? p.enabled : CommandService.instance().isEnabled(commandName, whenClauseContext);
menuItemSetEnabled(commandName, enabled);
}
const layoutButtonSequenceOptions = Setting.enumOptions('layoutButtonSequence');
for (const value in layoutButtonSequenceOptions) {
menuItemSetEnabled(`layoutButtonSequence_${value}`, props.layoutButtonSequence === Number(value));
menuItemSetChecked(`layoutButtonSequence_${value}`, props.layoutButtonSequence === Number(value));
}
function applySortItemCheckState(type:string) {
@@ -800,8 +860,10 @@ function MenuBar(props:Props):JSX.Element {
}
const mapStateToProps = (state:AppState) => {
const whenClauseContext = stateToWhenClauseContext(state);
return {
menuItemProps: menuUtils.commandsToMenuItemProps(state, commandNames),
menuItemProps: menuUtils.commandsToMenuItemProps(commandNames.concat(pluginCommandNames(state.pluginService.plugins)), whenClauseContext),
routeName: state.route.routeName,
selectedFolderId: state.selectedFolderId,
layoutButtonSequence: state.settings.layoutButtonSequence,
@@ -812,7 +874,8 @@ const mapStateToProps = (state:AppState) => {
showNoteCounts: state.settings.showNoteCounts,
uncompletedTodosOnTop: state.settings.uncompletedTodosOnTop,
showCompletedTodos: state.settings.showCompletedTodos,
pluginMenuItemInfos: stateUtils.selectArrayShallow({ array: pluginUtils.viewInfosByType(state.pluginService.plugins, 'menuItem') }, 'menuBar.pluginMenuItemInfos'),
pluginMenuItems: stateUtils.selectArrayShallow({ array: pluginUtils.viewsByType(state.pluginService.plugins, 'menuItem') }, 'menuBar.pluginMenuItems'),
pluginMenus: stateUtils.selectArrayShallow({ array: pluginUtils.viewsByType(state.pluginService.plugins, 'menu') }, 'menuBar.pluginMenus'),
};
};

View File

@@ -46,8 +46,6 @@ function formatReadTime(readTimeMinutes: number) {
}
export default function NoteContentPropertiesDialog(props:NoteContentPropertiesDialogProps) {
console.info('MMMMMMMMMMMM', props.markupLanguage);
const theme = themeStyle(props.themeId);
const tableBodyComps: JSX.Element[] = [];
// For the source Markdown

View File

@@ -5,6 +5,7 @@ import { utils as pluginUtils } from 'lib/services/plugins/reducer';
import { connect } from 'react-redux';
import { AppState } from '../../../../app';
import ToolbarButtonUtils, { ToolbarButtonInfo } from 'lib/services/commands/ToolbarButtonUtils';
import stateToWhenClauseContext from 'lib/services/commands/stateToWhenClauseContext';
const { buildStyle } = require('lib/theme');
interface ToolbarProps {
@@ -31,6 +32,8 @@ function Toolbar(props:ToolbarProps) {
}
const mapStateToProps = (state: AppState) => {
const whenClauseContext = stateToWhenClauseContext(state);
const commandNames = [
'historyBackward',
'historyForward',
@@ -53,7 +56,7 @@ const mapStateToProps = (state: AppState) => {
].concat(pluginUtils.commandNamesFromViews(state.pluginService.plugins, 'editorToolbar'));
return {
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons(state, commandNames),
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons(commandNames, whenClauseContext),
};
};

View File

@@ -25,6 +25,8 @@ import eventManager from 'lib/eventManager';
import { AppState } from '../../app';
import ToolbarButtonUtils from 'lib/services/commands/ToolbarButtonUtils';
import { _ } from 'lib/locale';
import stateToWhenClauseContext from 'lib/services/commands/stateToWhenClauseContext';
import TagList from '../TagList';
const { themeStyle } = require('lib/theme');
const { substrWithEllipsis } = require('lib/string-utils');
@@ -38,7 +40,6 @@ const Note = require('lib/models/Note.js');
const bridge = require('electron').remote.require('./bridge').default;
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
const NoteRevisionViewer = require('../NoteRevisionViewer.min');
const TagList = require('../TagList.min.js');
const commands = [
require('./commands/showRevisions'),
@@ -247,9 +248,9 @@ function NoteEditor(props: NoteEditorProps) {
event.preventDefault();
if (event.shiftKey) {
CommandService.instance().execute('focusElement', { target: 'noteList' });
CommandService.instance().execute('focusElement', 'noteList');
} else {
CommandService.instance().execute('focusElement', { target: 'noteBody' });
CommandService.instance().execute('focusElement', 'noteBody');
}
}
}, [props.dispatch]);
@@ -364,7 +365,7 @@ function NoteEditor(props: NoteEditorProps) {
function renderTagBar() {
const theme = themeStyle(props.themeId);
const noteIds = [formNote.id];
const instructions = <span onClick={() => { CommandService.instance().execute('setTags', { noteIds }); }} style={{ ...theme.clickableTextStyle, whiteSpace: 'nowrap' }}>Click to add tags...</span>;
const instructions = <span onClick={() => { CommandService.instance().execute('setTags', noteIds); }} style={{ ...theme.clickableTextStyle, whiteSpace: 'nowrap' }}>Click to add tags...</span>;
const tagList = props.selectedNoteTags.length ? <TagList items={props.selectedNoteTags} /> : null;
return (
@@ -435,7 +436,7 @@ function NoteEditor(props: NoteEditorProps) {
const wysiwygBanner = props.bodyEditor !== 'TinyMCE' ? null : (
<div style={{ ...styles.warningBanner }}>
This is an experimental WYSIWYG editor for evaluation only. Please do not use with important notes as you may lose some data! See the <a style={styles.urlColor} onClick={introductionPostLinkClick} href="#">introduction post</a> for more information. TO SWITCH TO THE MARKDOWN EDITOR PLEASE PRESS "Code View".
This is an experimental Rich Text editor for evaluation only. Please do not use with important notes as you may lose some data! See the <a style={styles.urlColor} onClick={introductionPostLinkClick} href="#">introduction post</a> for more information. To switch to the Markdown Editor please press the "Toggle editors" in the top right-hand corner.
</div>
);
@@ -565,6 +566,7 @@ export {
const mapStateToProps = (state: AppState) => {
const noteId = state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null;
const whenClauseContext = stateToWhenClauseContext(state);
return {
noteId: noteId,
@@ -587,15 +589,15 @@ const mapStateToProps = (state: AppState) => {
watchedResources: state.watchedResources,
highlightedWords: state.highlightedWords,
plugins: state.pluginService.plugins,
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons(state, [
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons([
'historyBackward',
'historyForward',
'toggleEditors',
'toggleExternalEditing',
]),
setTagsToolbarButtonInfo: toolbarButtonUtils.commandsToToolbarButtons(state, [
], whenClauseContext),
setTagsToolbarButtonInfo: toolbarButtonUtils.commandsToToolbarButtons([
'setTags',
])[0],
], whenClauseContext)[0],
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -12,13 +12,6 @@ export const runtime = (comp:any):CommandRuntime => {
execute: async () => {
comp.editorRef.current.execCommand({ name: 'focus' });
},
isEnabled: (props:any):boolean => {
return props.hasOneNoteSelected;
},
mapStateToProps: (state:any):any => {
return {
hasOneNoteSelected: state.selectedNoteIds.length === 1,
};
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -13,14 +13,6 @@ export const runtime = (comp:any):CommandRuntime => {
if (!comp.titleInputRef.current) return;
comp.titleInputRef.current.focus();
},
isEnabled: (props:any):boolean => {
return props.hasOneNoteSelected;
},
mapStateToProps: (state:any):any => {
return {
hasOneNoteSelected: state.selectedNoteIds.length === 1,
};
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
@@ -16,11 +16,6 @@ export const runtime = (comp:any):CommandRuntime => {
if (comp.noteSearchBarRef.current) comp.noteSearchBarRef.current.wrappedInstance.focus();
}
},
isEnabled: (props:any) => {
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return { noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null };
},
enabledCondition: 'oneNoteSelected',
};
};

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
export const declaration:CommandDeclaration = {
name: 'showRevisions',

View File

@@ -1,11 +1,9 @@
import { useEffect } from 'react';
import { FormNote, ScrollOptionTypes } from './types';
import editorCommandDeclarations from '../commands/editorCommandDeclarations';
import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import CommandService, { CommandDeclaration, CommandRuntime, CommandContext } from 'lib/services/CommandService';
const { time } = require('lib/time-utils.js');
const BaseModel = require('lib/BaseModel');
const { reg } = require('lib/registry.js');
const { MarkupToHtml } = require('lib/joplin-renderer');
const commandsWithDependencies = [
require('../commands/showLocalSearch'),
@@ -25,49 +23,30 @@ interface HookDependencies {
function editorCommandRuntime(declaration:CommandDeclaration, editorRef:any):CommandRuntime {
return {
execute: async (props:any) => {
// console.info('Running editor command:', declaration.name, props);
execute: async (_context:CommandContext, ...args:any[]) => {
if (!editorRef.current.execCommand) {
reg.logger().warn('Received command, but editor cannot execute commands', declaration.name);
return;
}
if (declaration.name === 'insertDateTime') {
return editorRef.current.execCommand({
name: 'insertText',
value: time.formatMsToLocal(new Date().getTime()),
});
} else if (declaration.name === 'scrollToHash') {
return editorRef.current.scrollTo({
type: ScrollOptionTypes.Hash,
value: args[0],
});
} else {
if (declaration.name === 'insertDateTime') {
return editorRef.current.execCommand({
name: 'insertText',
value: time.formatMsToLocal(new Date().getTime()),
});
} else if (declaration.name === 'scrollToHash') {
return editorRef.current.scrollTo({
type: ScrollOptionTypes.Hash,
value: props.hash,
});
} else {
return editorRef.current.execCommand({
name: declaration.name,
value: props.value,
});
}
return editorRef.current.execCommand({
name: declaration.name,
value: args[0],
});
}
},
isEnabled: (props:any) => {
if (props.isDialogVisible) return false;
if (props.markdownEditorViewerOnly) return false;
if (!props.hasSelectedNote) return false;
return props.isMarkdownNote;
},
mapStateToProps: (state:any) => {
const noteId = state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null;
const note = noteId ? BaseModel.byId(state.notes, noteId) : null;
const isMarkdownNote = note ? note.markup_language === MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN : false;
return {
// True when the Markdown editor is active, and only the viewer pane is visible
// In this case, all editor-related shortcuts are disabled.
markdownEditorViewerOnly: state.settings['editor.codeView'] && state.noteVisiblePanes.length === 1 && state.noteVisiblePanes[0] === 'viewer',
hasSelectedNote: !!note,
isDialogVisible: !!Object.keys(state.visibleDialogs).length,
isMarkdownNote: isMarkdownNote,
};
},
enabledCondition: '!modalDialogVisible && markdownEditorPaneVisible && oneNoteSelected && noteIsMarkdown',
};
}

View File

@@ -24,7 +24,7 @@ const StyledRoot = styled.div`
width: 100%;
height: 100%;
background-color: ${(props:any) => props.theme.backgroundColor3};
border-right: 1px solid ${(props:any) => props.theme.dividerColor},
border-right: 1px solid ${(props:any) => props.theme.dividerColor};
`;
class NoteListComponent extends React.Component {
@@ -386,9 +386,9 @@ class NoteListComponent extends React.Component {
event.preventDefault();
if (event.shiftKey) {
CommandService.instance().execute('focusElement', { target: 'sideBar' });
CommandService.instance().execute('focusElement', 'sideBar');
} else {
CommandService.instance().execute('focusElement', { target: 'noteTitle' });
CommandService.instance().execute('focusElement', 'noteTitle');
}
}

View File

@@ -1,5 +1,6 @@
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { CommandRuntime, CommandDeclaration, CommandContext } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { stateUtils } from 'lib/reducer';
export const declaration:CommandDeclaration = {
name: 'focusElementNoteList',
@@ -9,19 +10,14 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ noteId }:any) => {
execute: async (context:CommandContext, noteId:string = null) => {
noteId = noteId || stateUtils.selectedNoteId(context.state);
if (noteId) {
const ref = comp.itemAnchorRef(noteId);
if (ref) ref.focus();
}
},
isEnabled: (props:any):boolean => {
return !!props.noteId;
},
mapStateToProps: (state:any):any => {
return {
noteId: state.selectedNoteIds.length ? state.selectedNoteIds[0] : null,
};
},
enabledCondition: 'noteListHasNotes',
};
};

View File

@@ -52,13 +52,13 @@ export default function NoteListControls(props:Props) {
return (
<ButtonContainer>
<StyledButton
tooltip={CommandService.instance().title('newTodo', {})}
tooltip={CommandService.instance().label('newTodo')}
iconName="far fa-check-square"
level={ButtonLevel.Primary}
onClick={onNewTodoButtonClick}
/>
<StyledButton
tooltip={CommandService.instance().title('newNote', {})}
tooltip={CommandService.instance().label('newNote')}
iconName="icon-note"
level={ButtonLevel.Primary}
onClick={onNewNoteButtonClick}

View File

@@ -1,4 +1,4 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {

View File

@@ -3,6 +3,7 @@ import CommandService from 'lib/services/CommandService';
import ToolbarBase from '../ToolbarBase';
import { utils as pluginUtils } from 'lib/services/plugins/reducer';
import ToolbarButtonUtils, { ToolbarButtonInfo } from 'lib/services/commands/ToolbarButtonUtils';
import stateToWhenClauseContext from 'lib/services/commands/stateToWhenClauseContext';
const { connect } = require('react-redux');
const { buildStyle } = require('lib/theme');
@@ -32,12 +33,14 @@ function NoteToolbar(props:NoteToolbarProps) {
const toolbarButtonUtils = new ToolbarButtonUtils(CommandService.instance());
const mapStateToProps = (state:any) => {
const whenClauseContext = stateToWhenClauseContext(state);
return {
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons(state, [
toolbarButtonInfos: toolbarButtonUtils.commandsToToolbarButtons([
'editAlarm',
'toggleVisiblePanes',
'showNoteProperties',
].concat(pluginUtils.commandNamesFromViews(state.pluginService.plugins, 'noteToolbar'))),
].concat(pluginUtils.commandNamesFromViews(state.pluginService.plugins, 'noteToolbar')), whenClauseContext),
};
};

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import app from '../app';
import MainScreen from './MainScreen/MainScreen';
import ConfigScreen from './ConfigScreen/ConfigScreen';
@@ -10,6 +9,7 @@ import { themeStyle } from 'lib/theme';
import { Size } from './ResizableLayout/ResizableLayout';
import MenuBar from './MenuBar';
import { _ } from 'lib/locale';
const React = require('react');
const { render } = require('react-dom');
const { connect, Provider } = require('react-redux');

View File

@@ -5,7 +5,7 @@ const debounce = require('debounce');
export default function useSearch(query:string) {
useEffect(() => {
const search = debounce((query:string) => {
CommandService.instance().execute('search', { query });
CommandService.instance().execute('search', query);
}, 500);
search(query);

View File

@@ -230,7 +230,7 @@ class SideBarComponent extends React.Component<Props, State> {
if (itemType === BaseModel.TYPE_FOLDER && !item.encryption_applied) {
menu.append(
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder', { parentId: itemId }))
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder', itemId))
);
}
@@ -259,7 +259,7 @@ class SideBarComponent extends React.Component<Props, State> {
);
if (itemType === BaseModel.TYPE_FOLDER && !item.encryption_applied) {
menu.append(new MenuItem(menuUtils.commandToStatefulMenuItem('renameFolder', { folderId: itemId })));
menu.append(new MenuItem(menuUtils.commandToStatefulMenuItem('renameFolder', itemId)));
menu.append(new MenuItem({ type: 'separator' }));
@@ -290,7 +290,7 @@ class SideBarComponent extends React.Component<Props, State> {
if (itemType === BaseModel.TYPE_TAG) {
menu.append(new MenuItem(
menuUtils.commandToStatefulMenuItem('renameTag', { tagId: itemId })
menuUtils.commandToStatefulMenuItem('renameTag', itemId)
));
}
@@ -510,9 +510,9 @@ class SideBarComponent extends React.Component<Props, State> {
event.preventDefault();
if (event.shiftKey) {
CommandService.instance().execute('focusElement', { target: 'noteBody' });
CommandService.instance().execute('focusElement', 'noteBody');
} else {
CommandService.instance().execute('focusElement', { target: 'noteList' });
CommandService.instance().execute('focusElement', 'noteList');
}
}
@@ -559,7 +559,7 @@ class SideBarComponent extends React.Component<Props, State> {
iconAnimation={iconAnimation}
title={label}
onClick={() => {
CommandService.instance().execute('synchronize', { syncStarted: type !== 'sync' });
CommandService.instance().execute('synchronize', type !== 'sync');
}}
/>
);
@@ -569,6 +569,20 @@ class SideBarComponent extends React.Component<Props, State> {
CommandService.instance().execute('newFolder');
}
// componentDidUpdate(prevProps:any, prevState:any) {
// for (const n in prevProps) {
// if (prevProps[n] !== (this.props as any)[n]) {
// console.info('CHANGED PROPS', n);
// }
// }
// for (const n in prevState) {
// if (prevState[n] !== (this.state as any)[n]) {
// console.info('CHANGED STATE', n);
// }
// }
// }
render() {
const theme = themeStyle(this.props.themeId);

View File

@@ -1,5 +1,6 @@
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
import { CommandRuntime, CommandDeclaration } from 'lib/services/CommandService';
import { _ } from 'lib/locale';
import { DesktopCommandContext } from 'ElectronClient/services/commands/types';
export const declaration:CommandDeclaration = {
name: 'focusElementSideBar',
@@ -9,8 +10,10 @@ export const declaration:CommandDeclaration = {
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async ({ sidebarVisibility }:any) => {
if (sidebarVisibility) {
execute: async (context:DesktopCommandContext) => {
const sideBarVisible = !!context.state.sidebarVisibility;
if (sideBarVisible) {
const item = comp.selectedItem();
if (item) {
const anchorRef = comp.anchorItemRefs[item.type][item.id];
@@ -21,13 +24,7 @@ export const runtime = (comp:any):CommandRuntime => {
}
}
},
isEnabled: (props:any):boolean => {
return props.sidebarVisibility;
},
mapStateToProps: (state:any):any => {
return {
sidebarVisibility: state.sidebarVisibility,
};
},
enabledCondition: 'sideBarVisible',
};
};

View File

@@ -68,7 +68,7 @@ function listItemTextColor(props:any) {
export const StyledListItemAnchor = styled.a`
font-size: ${(props:any) => Math.round(props.theme.fontSize * 1.0833333)}px;
font-weight: 500;
// font-weight: 500;
text-decoration: none;
color: ${(props:any) => listItemTextColor(props)};
cursor: default;

View File

@@ -1,52 +0,0 @@
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('lib/theme');
const TagItem = require('./TagItem.min.js');
class TagListComponent extends React.Component {
render() {
const style = Object.assign({}, this.props.style);
const theme = themeStyle(this.props.themeId);
const tags = this.props.items;
style.display = 'flex';
style.flexDirection = 'row';
// style.borderBottom = `1px solid ${theme.dividerColor}`;
style.boxSizing = 'border-box';
style.fontSize = theme.fontSize;
style.whiteSpace = 'nowrap';
// style.height = 40;
style.paddingTop = 8;
style.paddingBottom = 8;
const tagItems = [];
if (tags && tags.length > 0) {
tags.sort((a, b) => {
return a.title < b.title ? -1 : +1;
});
for (let i = 0; i < tags.length; i++) {
const props = {
title: tags[i].title,
key: tags[i].id,
};
tagItems.push(<TagItem {...props} />);
}
}
return (
<div className="tag-list" style={style}>
{tagItems}
</div>
);
}
}
const mapStateToProps = state => {
return { themeId: state.settings.theme };
};
const TagList = connect(mapStateToProps)(TagListComponent);
module.exports = TagList;

View File

@@ -0,0 +1,63 @@
import * as React from 'react';
import { useMemo } from 'react';
import { AppState } from '../app';
const { connect } = require('react-redux');
const { themeStyle } = require('lib/theme');
const TagItem = require('./TagItem.min.js');
interface Props {
themeId: number,
style: any,
items: any[],
}
function TagList(props:Props) {
const style = useMemo(() => {
const theme = themeStyle(props.themeId);
const output = { ...props.style };
output.display = 'flex';
output.flexDirection = 'row';
output.boxSizing = 'border-box';
output.fontSize = theme.fontSize;
output.whiteSpace = 'nowrap';
output.paddingTop = 8;
output.paddingBottom = 8;
return output;
}, [props.style, props.themeId]);
const tags = useMemo(() => {
const output = props.items.slice();
output.sort((a:any, b:any) => {
return a.title < b.title ? -1 : +1;
});
return output;
}, [props.items]);
const tagItems = useMemo(() => {
const output = [];
for (let i = 0; i < tags.length; i++) {
const props = {
title: tags[i].title,
key: tags[i].id,
};
output.push(<TagItem {...props} />);
}
return output;
}, [tags]);
return (
<div className="tag-list" style={style}>
{tagItems}
</div>
);
}
const mapStateToProps = (state:AppState) => {
return { themeId: state.settings.theme };
};
export default connect(mapStateToProps)(TagList);

View File

@@ -17,7 +17,7 @@ export default function ToggleEditorsButton(props:Props) {
const style = styles_(props);
return (
<button style={style.button} disabled={!props.toolbarButtonInfo.enabled} aria-label={props.toolbarButtonInfo.title} title={props.toolbarButtonInfo.title} type="button" className="tox-tbtn" aria-pressed="false" onClick={props.toolbarButtonInfo.onClick}>
<button style={style.button} disabled={!props.toolbarButtonInfo.enabled} aria-label={props.toolbarButtonInfo.tooltip} title={props.toolbarButtonInfo.tooltip} type="button" className="tox-tbtn" aria-pressed="false" onClick={props.toolbarButtonInfo.onClick}>
<div style={style.leftInnerButton}>
<i style={style.leftIcon} className="fab fa-markdown"></i>
</div>

View File

@@ -5,7 +5,7 @@ export default function styles(props:Props) {
return buildStyle(['ToggleEditorsButton', props.value], props.themeId, (theme: any) => {
const iconSize = 15;
const mdIconWidth = iconSize * 1.25;
const buttonHeight = theme.toolbarHeight - 8;
const buttonHeight = theme.toolbarHeight - 7;
const mdIconPadding = Math.round((buttonHeight - iconSize) / 2) + 3;
const innerButton:any = {
@@ -41,14 +41,14 @@ export default function styles(props:Props) {
leftIcon: {
fontSize: iconSize,
position: 'relative',
top: 1,
top: 2,
color: theme.color3,
},
rightIcon: {
fontSize: iconSize - 1,
borderLeft: 'none',
position: 'relative',
top: 1,
top: 2,
color: theme.color3,
},
};

View File

@@ -40,11 +40,11 @@ export default class NoteListUtils {
if (!hasEncrypted) {
menu.append(
new MenuItem(menuUtils.commandToStatefulMenuItem('setTags', { noteIds }))
new MenuItem(menuUtils.commandToStatefulMenuItem('setTags', noteIds))
);
menu.append(
new MenuItem(menuUtils.commandToStatefulMenuItem('moveToFolder'))
new MenuItem(menuUtils.commandToStatefulMenuItem('moveToFolder', noteIds))
);
menu.append(
@@ -63,7 +63,7 @@ export default class NoteListUtils {
if (singleNoteId) {
const cmd = props.watchedNoteFiles.includes(singleNoteId) ? 'stopExternalEditing' : 'startExternalEditing';
menu.append(new MenuItem(menuUtils.commandToStatefulMenuItem(cmd, { noteId: singleNoteId })));
menu.append(new MenuItem(menuUtils.commandToStatefulMenuItem(cmd, singleNoteId)));
}
if (noteIds.length <= 1) {
@@ -132,7 +132,7 @@ export default class NoteListUtils {
menu.append(
new MenuItem(
menuUtils.commandToStatefulMenuItem('showShareNoteDialog', { noteIds: noteIds.slice() })
menuUtils.commandToStatefulMenuItem('showShareNoteDialog', noteIds.slice())
)
);
@@ -157,7 +157,7 @@ export default class NoteListUtils {
exportMenu.append(
new MenuItem(
menuUtils.commandToStatefulMenuItem('exportPdf', { noteIds: noteIds })
menuUtils.commandToStatefulMenuItem('exportPdf', noteIds)
)
);

View File

@@ -1,6 +1,6 @@
{
"name": "Joplin",
"version": "1.3.1",
"version": "1.3.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -5924,9 +5924,7 @@
"minimist": {
"version": "0.0.8",
"resolved": false,
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true,
"optional": true
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"minipass": {
"version": "2.9.0",
@@ -5950,13 +5948,22 @@
}
},
"mkdirp": {
"version": "0.5.1",
"resolved": false,
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
"minimist": "^1.2.5"
},
"dependencies": {
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true,
"optional": true
}
}
},
"ms": {
@@ -7773,6 +7780,11 @@
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
},
"lodash.toarray": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
},
"log-symbols": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
@@ -8072,11 +8084,6 @@
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.0.4.tgz",
"integrity": "sha512-P0z5IeAH6qHHGkJIXWw0xC2HNEgkx/9uWWBQw64FJj3/ol14VYdfVGWWr0fXfjhhv3TKVIqUq65os6O4GUNksA=="
},
"memory-cache": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz",
"integrity": "sha1-eJCwHVLADI68nVM+H46xfjA0hxo="
},
"mermaid": {
"version": "8.8.1",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.8.1.tgz",
@@ -8506,6 +8513,14 @@
"semver": "^5.4.1"
}
},
"node-emoji": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz",
"integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==",
"requires": {
"lodash.toarray": "^4.4.0"
}
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
@@ -10684,11 +10699,6 @@
}
}
},
"slug": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/slug/-/slug-3.5.0.tgz",
"integrity": "sha512-+pZLDhMtmAc+ZcojQSMlUKDZBYmvhZiZmK8Ffx/D3Q/MIMHPDBAMbWvWN8vJb9xl2MfbDdRWxFzrdOhBiyVpow=="
},
"smalltalk": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/smalltalk/-/smalltalk-2.5.1.tgz",
@@ -11751,6 +11761,11 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
"integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc="
},
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"unset-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
@@ -11942,6 +11957,14 @@
"integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=",
"dev": true
},
"uslug": {
"version": "git+https://github.com/laurent22/uslug.git#ba2834d79beb0435318709958b2f5e817d96674d",
"from": "git+https://github.com/laurent22/uslug.git#emoji-support",
"requires": {
"node-emoji": "^1.10.0",
"unorm": ">= 1.0.0"
}
},
"utf8-byte-length": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",

View File

@@ -1,11 +1,11 @@
{
"name": "Joplin",
"version": "1.3.1",
"version": "1.3.7",
"description": "Joplin for Desktop",
"main": "main.js",
"scripts": {
"dist": "node_modules/.bin/electron-builder",
"build": "patch-package --patch-dir ../patches && gulp build",
"build": "patch-package --patch-dir ../patches/shared && patch-package --patch-dir ../patches/node && gulp build",
"postinstall": "npm run build && gulp electronRebuild",
"start": "gulp build && electron . --env dev --log-level debug --no-welcome --open-dev-tools"
},
@@ -169,7 +169,6 @@
"markdown-it-toc-done-right": "^4.1.0",
"md5": "^2.2.1",
"md5-file": "^4.0.0",
"memory-cache": "^0.2.0",
"mermaid": "^8.8.1",
"moment": "^2.22.2",
"multiparty": "^4.2.1",
@@ -196,7 +195,6 @@
"roboto-fontface": "^0.10.0",
"sax": "^1.2.4",
"server-destroy": "^1.0.1",
"slug": "^3.5.0",
"smalltalk": "^2.5.1",
"sprintf-js": "^1.1.1",
"sqlite3": "^4.1.1",
@@ -212,6 +210,7 @@
"tinymce": "^5.2.0",
"uglifycss": "0.0.29",
"url-parse": "^1.4.3",
"uslug": "git+https://github.com/laurent22/uslug.git#emoji-support",
"uuid": "^3.2.1",
"valid-url": "^1.0.9",
"xml2js": "^0.4.19"

Some files were not shown because too many files have changed in this diff Show More