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

Compare commits

...

99 Commits

Author SHA1 Message Date
Laurent Cozic
9c057071b5 Electron release v1.0.226 2020-07-04 10:47:04 +01:00
Laurent Cozic
ee3f4beeaf Desktop: Dev fix: Better handling of command props 2020-07-04 10:46:22 +01:00
Laurent Cozic
7035b1f9f6 Desktop: Dev fix: Added back title on header buttons 2020-07-04 10:46:22 +01:00
Deep Majumder
3aea55ee63 Tools: Generates SHA-256 sum of AppImage for Linux (#3410) 2020-07-03 22:46:20 +01:00
Laurent Cozic
28acb4eca6 Electron release v1.0.225 2020-07-03 22:43:19 +01:00
Laurent Cozic
c63c6370b5 Desktop: Refactored command system
The goal is to make the command system more modular, so each command can
be defined as a single object that includes a declaration (name, label,
etc.) and a runtime (to execute the command, test if it should be
enabled, etc.)

Utility methods are provided to convert a command to a menu item or a
toolbar button, thus reducing duplicated and boiler plate code across the
codebase (often the menu item logic was duplicated in the toolbar
button logic and vice versa).

The goal is to make it easier to add new commands (and associated menu
item and toolbar buttons) and to call them from
anywhere. This is also useful for plugins, which can also easily define
new commands.

Could also allow creating a command palette.
2020-07-03 22:32:39 +01:00
Laurent Cozic
6046f40e45 Tools: Fixed tests following highlight.js upgrade (changed in HTML escape mode) 2020-07-03 22:30:33 +01:00
Caleb John
262159cf73 Desktop: Codemirror: Remove cancelled keys in favour of explicit keymaps (#3417) 2020-07-02 23:00:56 +01:00
Caleb John
8eb94bc8ab Desktop: Manually refresh codemirror whenever the window size changes (#3388)
* Manually refresh codemirror whenever the parent div size changes

* Set editor width through style rather than adding an extra property

* use Memo for editorStyle
2020-07-02 22:45:43 +01:00
WhiredPlanck
a9390affaa All: Translation: Update zh_CN.po (#3430)
* Update zh_CN.po

* Correct typo

* Correct typo: NextCloud --> Nextcloud; Improved translation

* Improved translation (2)
2020-06-30 10:30:09 -04:00
Arda Kılıçdağı
66392b4e8a Yandex disk removed from supported WEBDAV clients (#3432)
Yandex.disk recently removed file upload support from WebDAV

https://ru.stackoverflow.com/questions/1043523/После-загрузки-файла-на-Яндекс-Диск-по-webdav-происходят-паузы-по-60-секунд-на-к
https://qna.habr.com/q/677787

So this makes Yandex.disk unusable at the moment.

Here's a similar issue, please see recent comments: https://github.com/PhilippC/keepass2android/issues/506

I've personally tried, and cannot even access to Yandex.disk at the moment through WebDAV.

This PR simply removes yandex.disk line from the ReadMe.

Thanks,
2020-06-30 10:26:30 -04:00
Laurent Cozic
3283f34c79 ios-v10.0.50 2020-06-28 20:17:13 +01:00
Laurent Cozic
fd4e5d7d30 Android release v1.0.333 2020-06-28 19:57:33 +01:00
Laurent Cozic
5bbf9d87c2 Desktop: Fixes #3412: Fixed custom order when note title is changed 2020-06-28 19:10:35 +01:00
Laurent Cozic
acf1ff6d1d Desktop, Cli: Fixes #3402: Fixed import of checkboxes in ENEX files 2020-06-28 18:55:47 +01:00
Laurent Cozic
05acc51054 Desktop, Mobile: Fixes #3281: Prevent code highlighting from freezing the app in some cases 2020-06-28 18:31:43 +01:00
Laurent Cozic
eb8841379c Desktop, Cli: Fixes #2331: Only de-duplicate imported notebook titles when needed 2020-06-28 18:00:51 +01:00
Laurent Cozic
d601575549 Doc: Updated sponsors 2020-06-27 10:05:19 +01:00
Arda Kılıçdağı
0d2f253218 All: Translation: Update tr_TR.po (#3415) 2020-06-25 22:29:35 -04:00
rnbastos
349d020da2 All: Translation: Update pt_BR.po (#3408) 2020-06-25 22:28:28 -04:00
Laurent Cozic
87ccb86f54 All: Reducer should not mutate state 2020-06-25 20:27:14 +01:00
Anjula Karunarathne
20482b2f14 Update README.md (#3414)
Fixed typo: Xfcxe -> Xfce
2020-06-24 23:54:16 +01:00
Laurent Cozic
47a05fb4ba Tools: Fixed build 2020-06-24 23:13:32 +01:00
Laurent Cozic
ac0a89625a Tools: Fixed build issues 2020-06-24 23:11:42 +01:00
Caleb John
a07638239b Tools: Use ensureDir instead of mkdir in utils (#3409)
* Use ensureDir instead of mkdir in utils

* switch to mkdirp
2020-06-23 21:38:52 +01:00
Laurent Cozic
5143870d3b Tools: Improve building and testing app on Windows 2020-06-22 23:06:47 +01:00
Gen Neko
f61c4c1374 All: Translation: Update ja_JP.po (#3394) 2020-06-21 12:14:59 -04:00
Laurent Cozic
254735fcae Desktop: WYSIWYG: Fix undo issue 2020-06-21 14:37:04 +01:00
Laurent Cozic
44024371ff Merge branch 'master' of github.com:laurent22/joplin 2020-06-21 14:01:53 +01:00
Laurent Cozic
be232fa34b Tools: Add no-array-constructor eslint rule 2020-06-21 13:58:54 +01:00
Helmut K. C. Tessarek
1a90165255 Desktop, Mobile: Fix link color for dark theme (#3391) 2020-06-21 00:47:19 +01:00
Helmut K. C. Tessarek
13417d15b7 Update en_US.po 2020-06-20 18:22:01 -04:00
Helmut K. C. Tessarek
9fe1f6acfc Update translations 2020-06-20 18:21:11 -04:00
Laurent Cozic
1899d86641 Electron release v1.0.224 2020-06-20 23:12:06 +01:00
Laurent Cozic
6ca63ca56b Merge branch 'master' of github.com:laurent22/joplin 2020-06-20 23:11:38 +01:00
Derviš T
e796968ec0 All: Translation: Update bs_BA.po (#3390)
Finished translating new strings. Corrected the old ones that have changed since the last translation update.
2020-06-20 18:11:25 -04:00
Laurent Cozic
7b64c8dbe3 Desktop: Fixed API issue 2020-06-20 23:11:18 +01:00
Laurent Cozic
2377f7bc07 Desktop: Make sure search engine can keep working when index is corrupted 2020-06-20 19:21:35 +01:00
Laurent Cozic
47fdcef182 Electron release v1.0.223 2020-06-20 12:34:49 +01:00
Laurent Cozic
d27b658392 Desktop: API: Improved error handling on service end-point 2020-06-20 12:34:05 +01:00
Laurent Cozic
07720ed6f8 Electron release v1.0.222 2020-06-20 12:21:31 +01:00
rnbastos
a9cdecf599 Update pt_BR.po (#3382) 2020-06-20 12:21:05 +01:00
yaozeye
c6b5a5c328 Update zh_CN.po (#3387) 2020-06-20 12:20:40 +01:00
Laurent Cozic
e7f3aa3764 Updated British spelling 2020-06-20 12:18:41 +01:00
Laurent Cozic
89ca8e08d6 Desktop: API: Fixed externalEditWatcher/noteIsWatched call, fixed tests 2020-06-20 12:03:22 +01:00
Laurent Cozic
6350506ce7 Mobile: Fixes OneDribe login screen 2020-06-20 11:14:01 +01:00
Laurent Cozic
d5ed611920 Update website 2020-06-20 02:57:32 +01:00
Laurent Cozic
acc10ccac4 Electron release v1.0.221 2020-06-20 02:31:12 +01:00
Laurent Cozic
45160a2e73 Desktop: API: Add support for external editing from API 2020-06-20 02:30:09 +01:00
Laurent Cozic
e38794171a Tools: Fix desktop build issue on Windows 2020-06-20 01:18:46 +01:00
Laurent Cozic
c2d6da83c0 All: Fixes #3381: Prevent desktop.ini file from breaking sync lock 2020-06-20 01:15:56 +01:00
Caleb John
77005fc495 Tools: Try to add codemirror types again (#3380)
* Try add codemirror type again

* Add global typedef for codemirror

* Add comment
2020-06-18 18:58:11 +01:00
Deep Majumder
0273e58783 Doc: Corrected info on supported Linux dsitros. (#3378)
Added list of supported desktop environments
2020-06-18 18:55:41 +01:00
Laurent Cozic
3e88a24753 Desktop: Reduce database logging statements 2020-06-17 23:46:47 +01:00
Laurent Cozic
1205908233 Revert "Desktop: Change codemirror to user import syntax (#3375)"
This reverts commit 3a7a068196.
2020-06-17 23:45:36 +01:00
Caleb John
3a7a068196 Desktop: Change codemirror to user import syntax (#3375) 2020-06-17 18:47:11 +01:00
Caleb John
845ecfe742 Desktop: Add default filename for jex export (#3034)
* Add default filename for jex export

* Restructure date as default filename
2020-06-17 18:35:13 +01:00
Laurent Cozic
53355aaad3 Clipper: Do not export invisible elements 2020-06-17 00:03:40 +01:00
Laurent Cozic
7cd0e25538 Merge branch 'master' of github.com:laurent22/joplin 2020-06-16 18:10:04 +01:00
Caleb John
2f15178ff6 Desktop: Remove auto-indent for in note html/xml for Code Mirror (#3374)
html/xml inside of a codeblock will still benefit from auto-indent
2020-06-16 13:00:58 +01:00
Caleb John
a4b13be0d1 Desktop: Fix getLineSpan logic and list token regex logic (#3365)
- previously getLineSpan was included line text as a token (dumb
oversight)
- the regex was updated to include a space after a OL element (was
missing for some reason)
2020-06-16 13:00:17 +01:00
Caleb John
23ae4fb790 Desktop: Add swapLineUp and swapLineDown keys to Code Mirror editor (#3363) 2020-06-16 12:59:33 +01:00
Laurent Cozic
cff036d08b Desktop: Do not expand the leaft notebook when following a link to a note 2020-06-15 22:59:42 +00:00
Laurent Cozic
7826cc0b03 Doc: Added sponsor 2020-06-15 23:03:09 +01:00
Alexander van der Berg
2bfa28a311 Doc: Fix sponsors table layout in the GitHub README.md (#3362)
The table was displayed correctly only on https://joplinapp.org/
2020-06-15 23:00:50 +01:00
Laurent Cozic
780c5c80ae Revert "Desktop: Fixes #3302: Prevent drag and dropping of text in editor as it can lead to data loss"
This reverts commit a75db94da5.

It turns out people often drag and drop text, so restoring the functionality.

See https://discourse.joplinapp.org/t/9406
2020-06-15 19:16:22 +01:00
Laurent Cozic
fcd00b3212 Desktop, Cli: Fixed various bugs related to the import of ENEX files as HTML 2020-06-15 17:10:51 +01:00
Laurent Cozic
6a41d6e85a Cli: Allow importing ENEX files as HTML 2020-06-14 16:45:17 +00:00
Laurent Cozic
3733858145 Desktop, Cli: Fixed issue with importing resources from ENEX files 2020-06-14 16:26:35 +00:00
Laurent Cozic
95d8ee65a5 ios-v10.0.49 2020-06-14 17:04:10 +01:00
Laurent Cozic
8e57697b71 Android release v1.0.332 2020-06-14 16:28:11 +01:00
Helmut K. C. Tessarek
c9c371b297 Update translations 2020-06-13 18:18:30 -04:00
Helmut K. C. Tessarek
d4f794920e update de_DE.po 2020-06-13 18:17:07 -04:00
Helmut K. C. Tessarek
13b5ef36d7 Update translations 2020-06-13 17:47:15 -04:00
Laurent Cozic
83e0bac52a Electron release v1.0.220 2020-06-13 17:43:07 +01:00
Laurent Cozic
9943ae0fa5 Electron release v1.0.219 2020-06-13 17:41:20 +01:00
Laurent Cozic
4c95872826 Tools: Fixed build-translation tool on macOS 2020-06-13 17:41:02 +01:00
Laurent Cozic
4aef72572d Desktop: Added debug info to detect empty note issue 2020-06-13 17:17:32 +01:00
Laurent Cozic
126918be54 Mobile: Do not restore selection on undo/redo (unreliable) 2020-06-13 16:46:43 +01:00
Laurent Cozic
1dc4516efc Revert "Mobile: Refactored and made dialog boxes more reliable"
This reverts commit f432734338.

This new package has its own glitches and doesn't look good
when button labels are too large. So reverting to the less
glitchy package.
2020-06-13 16:20:59 +01:00
Laurent Cozic
9a9cfbd130 Mobile: Resolves #2595: Add undo/redo support 2020-06-13 16:20:18 +01:00
Rodgco
341c9ba64b All: Translation: Update pt_BR.po (#3358) 2020-06-10 22:08:07 -04:00
Laurent Cozic
f432734338 Mobile: Refactored and made dialog boxes more reliable 2020-06-10 22:12:18 +01:00
Laurent Cozic
b7f5f848f2 All: Refactored themes to allow using the same ones in both desktop and mobile version
Will also allow using them when exporting HTML or PDF from CLI.
2020-06-10 22:08:59 +01:00
Laurent Cozic
d80cf6bf37 Mobile: Made saving notes more reliable 2020-06-09 23:30:32 +00:00
Laurent Cozic
31bce2e644 Mobile: Fixed issue with resources not being downloaded after metadata has been decrypted 2020-06-09 19:56:48 +00:00
Laurent Cozic
faabd17fc6 Desktop: Fixed issue with setting filename for edited attachments 2020-06-09 19:15:43 +00:00
Laurent Cozic
4c4ed60cfb Merge branch 'master' of github.com:laurent22/joplin 2020-06-08 18:49:16 +01:00
Laurent Cozic
be1895a080 Clipper: Fixes #3241: Handle certain special cases of ordered lists 2020-06-08 18:44:13 +01:00
Laurent Cozic
b81b6135f6 Clean up unused optional parameter 2020-06-08 09:05:03 +01:00
Laurent Cozic
583ac7960b Mobile: Dev fix: Add missing key 2020-06-08 09:02:14 +01:00
Laurent Cozic
b749bb60fc Merge branch 'master' of github.com:laurent22/joplin 2020-06-08 09:02:04 +01:00
Roman Musin
2c6a298758 Android: Fixes #3010: Request permissions if needed when exporting profile (#3202) 2020-06-08 09:01:11 +01:00
Laurent Cozic
42544cc63b Mobile: Reduce side menu edge hit width
Due to this bug:

https://github.com/react-native-community/react-native-side-menu/issues/153

After rotating the device, the edge hit area is too large, more than 50%
of the note in some cases, which makes it difficult to scroll the note
or zoom.
2020-06-08 08:49:24 +01:00
Roman Musin
d2b81d221b Mobile: Fixes #3343: Fixed issue when creating note then switching notebook (#3347) 2020-06-08 08:40:52 +01:00
Laurent Cozic
618d8723d1 Android release v1.0.331 2020-06-08 07:53:49 +01:00
Laurent Cozic
8058d3f728 Removed debug code 2020-06-08 07:43:09 +01:00
Laurent Cozic
0bc10acf02 Mobile: Fixes #3344: Fixed regression that would cause links in notes to open within app itself 2020-06-08 07:41:04 +01:00
Laurent Cozic
e5866e8aa6 ios-v10.0.48 2020-06-07 14:54:34 +01:00
362 changed files with 113083 additions and 106891 deletions

View File

@@ -61,8 +61,39 @@ Modules/TinyMCE/IconPack/postinstall.js
Modules/TinyMCE/langs/
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
ElectronClient/commands/focusElement.js
ElectronClient/commands/startExternalEditing.js
ElectronClient/commands/stopExternalEditing.js
ElectronClient/global.d.js
ElectronClient/gui/ErrorBoundary.js
ElectronClient/gui/Header/commands/focusSearch.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/newNote.js
ElectronClient/gui/MainScreen/commands/newNotebook.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/toggleNoteList.js
ElectronClient/gui/MainScreen/commands/toggleSidebar.js
ElectronClient/gui/MainScreen/commands/toggleVisiblePanes.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/AceEditor/AceEditor.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/styles/index.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/Toolbar.js
@@ -94,12 +125,18 @@ ElectronClient/gui/NoteEditor/utils/useMessageHandler.js
ElectronClient/gui/NoteEditor/utils/useNoteSearchBar.js
ElectronClient/gui/NoteEditor/utils/useSearchMarkers.js
ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.js
ElectronClient/gui/NoteList/commands/focusElementNoteList.js
ElectronClient/gui/NoteListItem.js
ElectronClient/gui/NoteToolbar/NoteToolbar.js
ElectronClient/gui/ResourceScreen.js
ElectronClient/gui/ShareNoteDialog.js
ElectronClient/gui/SideBar/commands/focusElementSideBar.js
ReactNativeClient/lib/AsyncActionQueue.js
ReactNativeClient/lib/checkPermissions.js
ReactNativeClient/lib/commands/historyBackward.js
ReactNativeClient/lib/commands/historyForward.js
ReactNativeClient/lib/commands/synchronize.js
ReactNativeClient/lib/hooks/useEffectDebugger.js
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
ReactNativeClient/lib/hooks/usePrevious.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
@@ -107,13 +144,17 @@ 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/services/CommandService.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/ResourceEditWatcher.js
ReactNativeClient/lib/services/rest/actionApi.desktop.js
ReactNativeClient/lib/services/rest/errors.js
ReactNativeClient/lib/services/SettingUtils.js
ReactNativeClient/lib/services/UndoRedoService.js
ReactNativeClient/lib/ShareExtension.js
ReactNativeClient/lib/shareHandler.js
ReactNativeClient/PluginAssetsLoader.js

View File

@@ -60,6 +60,7 @@ module.exports = {
"no-new-func": ["error"],
"import/prefer-default-export": ["error"],
"import/first": ["error"],
"no-array-constructor": ["error"],
// Checks rules of Hooks
"react-hooks/rules-of-hooks": "error",

41
.gitignore vendored
View File

@@ -51,8 +51,39 @@ Tools/commit_hook.txt
*.map
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
ElectronClient/commands/focusElement.js
ElectronClient/commands/startExternalEditing.js
ElectronClient/commands/stopExternalEditing.js
ElectronClient/global.d.js
ElectronClient/gui/ErrorBoundary.js
ElectronClient/gui/Header/commands/focusSearch.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/newNote.js
ElectronClient/gui/MainScreen/commands/newNotebook.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/toggleNoteList.js
ElectronClient/gui/MainScreen/commands/toggleSidebar.js
ElectronClient/gui/MainScreen/commands/toggleVisiblePanes.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/AceEditor/AceEditor.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/styles/index.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/Toolbar.js
@@ -84,12 +115,18 @@ ElectronClient/gui/NoteEditor/utils/useMessageHandler.js
ElectronClient/gui/NoteEditor/utils/useNoteSearchBar.js
ElectronClient/gui/NoteEditor/utils/useSearchMarkers.js
ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.js
ElectronClient/gui/NoteList/commands/focusElementNoteList.js
ElectronClient/gui/NoteListItem.js
ElectronClient/gui/NoteToolbar/NoteToolbar.js
ElectronClient/gui/ResourceScreen.js
ElectronClient/gui/ShareNoteDialog.js
ElectronClient/gui/SideBar/commands/focusElementSideBar.js
ReactNativeClient/lib/AsyncActionQueue.js
ReactNativeClient/lib/checkPermissions.js
ReactNativeClient/lib/commands/historyBackward.js
ReactNativeClient/lib/commands/historyForward.js
ReactNativeClient/lib/commands/synchronize.js
ReactNativeClient/lib/hooks/useEffectDebugger.js
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
ReactNativeClient/lib/hooks/usePrevious.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
@@ -97,13 +134,17 @@ 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/services/CommandService.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/ResourceEditWatcher.js
ReactNativeClient/lib/services/rest/actionApi.desktop.js
ReactNativeClient/lib/services/rest/errors.js
ReactNativeClient/lib/services/SettingUtils.js
ReactNativeClient/lib/services/UndoRedoService.js
ReactNativeClient/lib/ShareExtension.js
ReactNativeClient/lib/shareHandler.js
ReactNativeClient/PluginAssetsLoader.js

View File

@@ -70,6 +70,8 @@ You can specify additional parameters when running the desktop or CLI applicatio
Most of the application is written in JavaScript, however new classes and files should generally be written in [TypeScript](https://www.typescriptlang.org/). All TypeScript files are generated next to the .ts or .tsx file. So for example, if there's a file "lib/MyClass.ts", there will be a generated "lib/MyClass.js" next to it. It is implemented that way as it requires minimal changes to integrate TypeScript in the existing JavaScript code base.
In the current setup, `tsc` is executed from the root of the project, and will compile everything in CliClient, ElectronClient, etc. This is more convenient to have just one place to compile everything, and it also means there's only one watch command to run. However, one drawback is that TypeScript doesn't find types defined in node_modules folders in sub-directories. For example, if you install `immer` in ElectronClient, then try to use the package, TypeScript will report that it cannot find this module. In theory using `typeRoots`, it should be possible to make it find the right modules but it doesn't seem to work in this case. Currently the workaround is to install any such package at the root of the project. By doing so, TypeScript will find the type definitions and compilation will work. It's not ideal since the module is installed at the root even though it's not used, but for now that will work.
## Hot reload
If you'd like to auto-reload the desktop app on changes rather than having to quit and restart it manually each time, you can use [watchman-make](https://facebook.github.io/watchman/docs/watchman-make.html):

View File

@@ -21,7 +21,11 @@ class Command extends BaseCommand {
.filter(m => m.type === 'importer')
.map(m => m.format);
return [['--format <format>', _('Source format: %s', ['auto'].concat(formats).join(', '))], ['-f, --force', _('Do not ask for confirmation.')]];
return [
['--format <format>', _('Source format: %s', ['auto'].concat(formats).join(', '))],
['-f, --force', _('Do not ask for confirmation.')],
['--output-format <output-format>', _('Output format: %s', 'md, html')],
];
}
async action(args) {
@@ -55,9 +59,9 @@ class Command extends BaseCommand {
this.stdout(s);
};
app()
.gui()
.showConsole();
if (args.options.outputFormat) importOptions.outputFormat = args.options.outputFormat;
app().gui().showConsole();
this.stdout(_('Importing notes...'));
const service = new InteropService();
const result = await service.import(importOptions);

View File

@@ -174,7 +174,7 @@ class Command extends BaseCommand {
this.stdout(_('Synchronisation target: %s (%s)', Setting.enumOptionLabel('sync.target', this.syncTargetId_), this.syncTargetId_));
if (!sync) throw new Error(_('Cannot initialize synchroniser.'));
if (!sync) throw new Error(_('Cannot initialise synchroniser.'));
this.stdout(_('Starting synchronisation...'));

View File

@@ -52,8 +52,6 @@ BaseItem.loadClass('Revision', Revision);
Setting.setConstant('appId', `net.cozic.joplin${env === 'dev' ? 'dev' : ''}-cli`);
Setting.setConstant('appType', 'cli');
console.info(Setting.value('appId'));
shimInit();
const application = app();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -38,42 +38,42 @@ locales['tr_TR'] = require('./tr_TR.json');
locales['vi'] = require('./vi.json');
locales['zh_CN'] = require('./zh_CN.json');
locales['zh_TW'] = require('./zh_TW.json');
stats['ar'] = {"percentDone":85};
stats['eu'] = {"percentDone":36};
stats['bs_BA'] = {"percentDone":79};
stats['bg_BG'] = {"percentDone":71};
stats['ca'] = {"percentDone":56};
stats['hr_HR'] = {"percentDone":30};
stats['cs_CZ'] = {"percentDone":88};
stats['da_DK'] = {"percentDone":79};
stats['de_DE'] = {"percentDone":96};
stats['et_EE'] = {"percentDone":70};
stats['ar'] = {"percentDone":83};
stats['eu'] = {"percentDone":35};
stats['bs_BA'] = {"percentDone":87};
stats['bg_BG'] = {"percentDone":69};
stats['ca'] = {"percentDone":55};
stats['hr_HR'] = {"percentDone":29};
stats['cs_CZ'] = {"percentDone":86};
stats['da_DK'] = {"percentDone":77};
stats['de_DE'] = {"percentDone":97};
stats['et_EE'] = {"percentDone":69};
stats['en_GB'] = {"percentDone":100};
stats['en_US'] = {"percentDone":100};
stats['es_ES'] = {"percentDone":95};
stats['es_ES'] = {"percentDone":93};
stats['eo'] = {"percentDone":40};
stats['fr_FR'] = {"percentDone":100};
stats['gl_ES'] = {"percentDone":46};
stats['id_ID'] = {"percentDone":98};
stats['it_IT'] = {"percentDone":95};
stats['nl_BE'] = {"percentDone":36};
stats['nl_NL'] = {"percentDone":90};
stats['nb_NO'] = {"percentDone":93};
stats['fr_FR'] = {"percentDone":98};
stats['gl_ES'] = {"percentDone":45};
stats['id_ID'] = {"percentDone":97};
stats['it_IT'] = {"percentDone":94};
stats['nl_NL'] = {"percentDone":88};
stats['nl_BE'] = {"percentDone":35};
stats['nb_NO'] = {"percentDone":92};
stats['fa'] = {"percentDone":35};
stats['pl_PL'] = {"percentDone":89};
stats['pt_PT'] = {"percentDone":94};
stats['pt_BR'] = {"percentDone":95};
stats['ro'] = {"percentDone":36};
stats['sl_SI'] = {"percentDone":45};
stats['sv'] = {"percentDone":75};
stats['th_TH'] = {"percentDone":56};
stats['vi'] = {"percentDone":91};
stats['tr_TR'] = {"percentDone":95};
stats['el_GR'] = {"percentDone":95};
stats['ru_RU'] = {"percentDone":93};
stats['sr_RS'] = {"percentDone":76};
stats['zh_CN'] = {"percentDone":93};
stats['zh_TW'] = {"percentDone":94};
stats['ja_JP'] = {"percentDone":98};
stats['ko'] = {"percentDone":92};
stats['pl_PL'] = {"percentDone":88};
stats['pt_PT'] = {"percentDone":92};
stats['pt_BR'] = {"percentDone":99};
stats['ro'] = {"percentDone":35};
stats['sl_SI'] = {"percentDone":44};
stats['sv'] = {"percentDone":74};
stats['th_TH'] = {"percentDone":55};
stats['vi'] = {"percentDone":89};
stats['tr_TR'] = {"percentDone":98};
stats['el_GR'] = {"percentDone":94};
stats['ru_RU'] = {"percentDone":92};
stats['sr_RS'] = {"percentDone":75};
stats['zh_CN'] = {"percentDone":97};
stats['zh_TW'] = {"percentDone":93};
stats['ja_JP'] = {"percentDone":97};
stats['ko'] = {"percentDone":90};
module.exports = { locales: locales, stats: stats };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -33,9 +33,9 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"acorn": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz",
"integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg=="
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz",
"integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ=="
},
"acorn-globals": {
"version": "4.3.4",
@@ -1161,9 +1161,9 @@
"integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw=="
},
"cssstyle": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.2.0.tgz",
"integrity": "sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz",
"integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",
"requires": {
"cssom": "~0.3.6"
},
@@ -1594,9 +1594,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"escodegen": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz",
"integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==",
"version": "1.14.2",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.2.tgz",
"integrity": "sha512-InuOIiKk8wwuOFg6x9BQXbzjrQhtyXh46K9bqVTPzSo2FnyMBaYGBMC6PhQy7yxxil9vIedFBweQBMK74/7o8A==",
"requires": {
"esprima": "^4.0.1",
"estraverse": "^4.2.0",
@@ -2111,7 +2111,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -2132,12 +2133,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -2152,17 +2155,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -2279,7 +2285,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -2291,6 +2298,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -2305,6 +2313,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -2312,12 +2321,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -2336,6 +2347,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -2425,7 +2437,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -2437,6 +2450,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -2522,7 +2536,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -2558,6 +2573,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -2577,6 +2593,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -2620,12 +2637,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3020,9 +3039,9 @@
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0="
},
"highlight.js": {
"version": "9.18.1",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.1.tgz",
"integrity": "sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg=="
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.1.tgz",
"integrity": "sha512-b4L09127uVa+9vkMgPpdUQP78ickGbHEQTWeBrQFTJZ4/n2aihWOGS0ZoUqAwjVmfjhq/C76HRzkqwZhK4sBbg=="
},
"homedir-polyfill": {
"version": "1.0.3",
@@ -3730,9 +3749,9 @@
"dev": true
},
"joplin-turndown": {
"version": "4.0.27",
"resolved": "https://registry.npmjs.org/joplin-turndown/-/joplin-turndown-4.0.27.tgz",
"integrity": "sha512-qwJEzpbsyXnfjYgCVXWbuf3BdbDAaP7edm5ubeVAaQ3RnaiSEB2xZLg3lubmuFOIxXnkMDMkGJC4G+qAbCW95w==",
"version": "4.0.28",
"resolved": "https://registry.npmjs.org/joplin-turndown/-/joplin-turndown-4.0.28.tgz",
"integrity": "sha512-wQP9OUBAkWq/VPPCJcY1EI6tSXWlGs/BJ7Ce8BZYRF/1vEk/TRHOdKmCObQrXz/0nRoLiP5xeqNvHE1nK4XbRQ==",
"requires": {
"css": "^2.2.4",
"html-entities": "^1.2.1",
@@ -6611,7 +6630,7 @@
"requires": {
"chalk": "^2.1.0",
"emphasize": "^1.5.0",
"node-emoji": "git+https://github.com/laurent22/node-emoji.git#9fa01eac463e94dde1316ef8c53089eeef4973b5",
"node-emoji": "git+https://github.com/laurent22/node-emoji.git",
"slice-ansi": "^1.0.0",
"string-width": "^2.1.1",
"terminal-kit": "^1.13.11",
@@ -7283,9 +7302,9 @@
}
},
"ws": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz",
"integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ=="
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
},
"xdg-basedir": {
"version": "3.0.0",

View File

@@ -49,13 +49,13 @@
"font-awesome-filetypes": "^2.1.0",
"form-data": "^2.1.4",
"fs-extra": "^5.0.0",
"highlight.js": "^9.17.1",
"highlight.js": "10.1.1",
"html-entities": "^1.2.1",
"html-minifier": "^3.5.15",
"htmlparser2": "^4.1.0",
"image-data-uri": "^2.0.0",
"image-type": "^3.0.0",
"joplin-turndown": "^4.0.27",
"joplin-turndown": "^4.0.28",
"joplin-turndown-plugin-gfm": "^1.0.12",
"json-stringify-safe": "^5.0.1",
"jssha": "^2.3.0",

View File

@@ -89,20 +89,20 @@ describe('EnexToHtml', function() {
}],
});
it('fails when not given a matching resource', asyncTest(async () => {
// To test the promise-unexpectedly-resolved case, add `audioResource` to the array.
const resources = [];
const inputFile = fileWithPath('en-media--image.enex');
const enexInput = await shim.fsDriver().readFile(inputFile);
const promisedOutput = enexXmlToHtml(enexInput, resources);
// it('fails when not given a matching resource', asyncTest(async () => {
// // To test the promise-unexpectedly-resolved case, add `audioResource` to the array.
// const resources = [];
// const inputFile = fileWithPath('en-media--image.enex');
// const enexInput = await shim.fsDriver().readFile(inputFile);
// const promisedOutput = enexXmlToHtml(enexInput, resources);
promisedOutput.then(() => {
// Promise should not be resolved
expect(false).toEqual(true);
}, (reason) => {
expect(reason)
.toBe('Hash with no associated resource: 89ce7da62c6b2832929a6964237e98e9');
});
}));
// promisedOutput.then(() => {
// // Promise should not be resolved
// expect(false).toEqual(true);
// }, (reason) => {
// expect(reason)
// .toBe('Hash with no associated resource: 89ce7da62c6b2832929a6964237e98e9');
// });
// }));
});

View File

@@ -12,7 +12,7 @@ const BaseModel = require('lib/BaseModel.js');
const { shim } = require('lib/shim');
const MdToHtml = require('lib/joplin-renderer/MdToHtml');
const { enexXmlToMd } = require('lib/import-enex-md-gen.js');
const { themeStyle } = require('../../ElectronClient/theme.js');
const { themeStyle } = require('lib/theme');
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60 * 60 * 1000; // Can run for a while since everything is in the same test unit

View File

@@ -2,6 +2,5 @@
<div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
<div>
<br>
<br>
</div>
</en-note>

View File

@@ -3,7 +3,7 @@
<p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
<ul>
<li>
<div><input type="checkbox" onclick="return false;">Foo</div>
<div><input checked="checked" type="checkbox" onclick="return false;">Foo</div>
</li>
<li>
<div><input type="checkbox" onclick="return false;"><b>Bar</b></div>

View File

@@ -8,6 +8,5 @@
</div>
<div>
<br>
<br>
</div>
</en-note>

View File

@@ -4,11 +4,9 @@
<div>
<input type="checkbox" onclick="return false;">A test for <i>italic</i>
<br>
<br>
</div>
<div>
<br>
<br>
</div>
<div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>
</en-note>

View File

@@ -0,0 +1,5 @@
<ul style="list-style-type:decimal;">
<li>Item A</li>
<li>Item B</li>
<li>Item C</li>
</ul>

View File

@@ -0,0 +1,3 @@
1. Item A
2. Item B
3. Item C

View File

@@ -1,5 +1,5 @@
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="javascript" data-joplin-source-open="```javascript&#10;" data-joplin-source-close="&#10;```">function() {
console.info('bonjour');
}</pre><pre class="hljs"><code><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-built_in">console</span>.info(<span class="hljs-string">'bonjour'</span>);
<span class="hljs-built_in">console</span>.info(<span class="hljs-string">&#x27;bonjour&#x27;</span>);
}</code></pre></div>

View File

@@ -1 +1 @@
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="html" data-joplin-source-open="```html&#10;" data-joplin-source-close="&#10;```">&lt;a href=&quot;#&quot; onclick=&quot;leavethisalone&quot;&gt;testing fence&lt;/a&gt;</pre><pre class="hljs"><code><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"leavethisalone"</span>&gt;</span>testing fence<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span></code></pre></div>
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="html" data-joplin-source-open="```html&#10;" data-joplin-source-close="&#10;```">&lt;a href=&quot;#&quot; onclick=&quot;leavethisalone&quot;&gt;testing fence&lt;/a&gt;</pre><pre class="hljs"><code><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;#&quot;</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">&quot;leavethisalone&quot;</span>&gt;</span>testing fence<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span></code></pre></div>

View File

@@ -0,0 +1,33 @@
/* eslint-disable no-unused-vars */
require('app-module-path').addPath(__dirname);
const { time } = require('lib/time-utils.js');
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
const mimeUtils = require('lib/mime-utils.js').mime;
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
});
describe('mimeUils', function() {
beforeEach(async (done) => {
done();
});
it('should get the file extension from the mime type', asyncTest(async () => {
expect(mimeUtils.toFileExtension('image/jpeg')).toBe('jpg');
expect(mimeUtils.toFileExtension('image/jpg')).toBe('jpg');
expect(mimeUtils.toFileExtension('IMAGE/JPG')).toBe('jpg');
expect(mimeUtils.toFileExtension('')).toBe(null);
}));
it('should get the mime type from the filename', asyncTest(async () => {
expect(mimeUtils.fromFilename('test.jpg')).toBe('image/jpeg');
expect(mimeUtils.fromFilename('test.JPG')).toBe('image/jpeg');
expect(mimeUtils.fromFilename('test.doesntexist')).toBe(null);
expect(mimeUtils.fromFilename('test')).toBe(null);
}));
});

View File

@@ -79,6 +79,45 @@ describe('services_InteropService', function() {
fieldsEqual(folder3, folder1, fieldNames);
}));
it('should import folders and de-duplicate titles when needed', asyncTest(async () => {
const service = new InteropService();
const folder1 = await Folder.save({ title: 'folder' });
const folder2 = await Folder.save({ title: 'folder' });
const filePath = `${exportDir()}/test.jex`;
await service.export({ path: filePath });
await Folder.delete(folder1.id);
await Folder.delete(folder2.id);
await service.import({ path: filePath });
const allFolders = await Folder.all();
expect(allFolders.map(f => f.title).sort().join(' - ')).toBe('folder - folder (1)');
}));
it('should import folders, and only de-duplicate titles when needed', asyncTest(async () => {
const service = new InteropService();
const folder1 = await Folder.save({ title: 'folder1' });
const folder2 = await Folder.save({ title: 'folder2' });
const sub1 = await Folder.save({ title: 'Sub', parent_id: folder1.id });
const sub2 = await Folder.save({ title: 'Sub', parent_id: folder2.id });
const filePath = `${exportDir()}/test.jex`;
await service.export({ path: filePath });
await Folder.delete(folder1.id);
await Folder.delete(folder2.id);
await service.import({ path: filePath });
const importedFolder1 = await Folder.loadByTitle('folder1');
const importedFolder2 = await Folder.loadByTitle('folder2');
const importedSub1 = await Folder.load((await Folder.childrenIds(importedFolder1.id))[0]);
const importedSub2 = await Folder.load((await Folder.childrenIds(importedFolder2.id))[0]);
expect(importedSub1.title).toBe('Sub');
expect(importedSub2.title).toBe('Sub');
}));
it('should export and import folders and notes', asyncTest(async () => {
const service = new InteropService();
const folder1 = await Folder.save({ title: 'folder1' });

View File

@@ -0,0 +1,86 @@
// /* eslint-disable no-unused-vars */
// require('app-module-path').addPath(__dirname);
// const { asyncTest, fileContentEqual, setupDatabase, checkThrow, revisionService, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
// const KvStore = require('lib/services/KvStore.js');
// const UndoRedoService = require('lib/services/UndoRedoService.js').default;
// process.on('unhandledRejection', (reason, p) => {
// console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
// });
// jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
// describe('services_UndoRedoService', function() {
// beforeEach(async (done) => {
// await setupDatabaseAndSynchronizer(1);
// await switchClient(1);
// done();
// });
// it('should undo and redo', asyncTest(async () => {
// const service = new UndoRedoService();
// expect(service.canUndo).toBe(false);
// expect(service.canRedo).toBe(false);
// service.push('test');
// expect(service.canUndo).toBe(true);
// expect(service.canRedo).toBe(false);
// service.push('test 2');
// service.push('test 3');
// expect(service.undo()).toBe('test 3');
// expect(service.canRedo).toBe(true);
// expect(service.undo()).toBe('test 2');
// expect(service.undo()).toBe('test');
// expect(checkThrow(() => service.undo())).toBe(true);
// expect(service.canUndo).toBe(false);
// expect(service.canRedo).toBe(true);
// expect(service.redo()).toBe('test');
// expect(service.canUndo).toBe(true);
// expect(service.redo()).toBe('test 2');
// expect(service.redo()).toBe('test 3');
// expect(service.canRedo).toBe(false);
// expect(checkThrow(() => service.redo())).toBe(true);
// }));
// it('should clear the redo stack when undoing', asyncTest(async () => {
// const service = new UndoRedoService();
// service.push('test');
// service.push('test 2');
// service.push('test 3');
// service.undo();
// expect(service.canRedo).toBe(true);
// service.push('test 4');
// expect(service.canRedo).toBe(false);
// expect(service.undo()).toBe('test 4');
// expect(service.undo()).toBe('test 2');
// }));
// it('should limit the size of the undo stack', asyncTest(async () => {
// const service = new UndoRedoService();
// for (let i = 0; i < 30; i++) {
// service.push(`test${i}`);
// }
// for (let i = 0; i < 20; i++) {
// service.undo();
// }
// expect(service.canUndo).toBe(false);
// }));
// });

View File

@@ -378,6 +378,16 @@ async function checkThrowAsync(asyncFn) {
return hasThrown;
}
function checkThrow(fn) {
let hasThrown = false;
try {
fn();
} catch (error) {
hasThrown = true;
}
return hasThrown;
}
function fileContentEqual(path1, path2) {
const fs = require('fs-extra');
const content1 = fs.readFileSync(path1, 'base64');
@@ -563,4 +573,4 @@ class TestApp extends BaseApplication {
}
}
module.exports = { kvStore, resourceService, resourceFetcher, tempFilePath, allSyncTargetItemsEncrypted, setupDatabase, revisionService, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync, encryptionService, loadEncryptionMasterKey, fileContentEqual, decryptionWorker, asyncTest, currentClientId, id, ids, sortedIds, at, createNTestNotes, createNTestFolders, createNTestTags, TestApp };
module.exports = { kvStore, resourceService, resourceFetcher, tempFilePath, allSyncTargetItemsEncrypted, setupDatabase, revisionService, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync, checkThrow, encryptionService, loadEncryptionMasterKey, fileContentEqual, decryptionWorker, asyncTest, currentClientId, id, ids, sortedIds, at, createNTestNotes, createNTestFolders, createNTestTags, TestApp };

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