You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-30 20:39:46 +02:00
Compare commits
99 Commits
android-v1
...
v1.0.226
Author | SHA1 | Date | |
---|---|---|---|
|
9c057071b5 | ||
|
ee3f4beeaf | ||
|
7035b1f9f6 | ||
|
3aea55ee63 | ||
|
28acb4eca6 | ||
|
c63c6370b5 | ||
|
6046f40e45 | ||
|
262159cf73 | ||
|
8eb94bc8ab | ||
|
a9390affaa | ||
|
66392b4e8a | ||
|
3283f34c79 | ||
|
fd4e5d7d30 | ||
|
5bbf9d87c2 | ||
|
acf1ff6d1d | ||
|
05acc51054 | ||
|
eb8841379c | ||
|
d601575549 | ||
|
0d2f253218 | ||
|
349d020da2 | ||
|
87ccb86f54 | ||
|
20482b2f14 | ||
|
47a05fb4ba | ||
|
ac0a89625a | ||
|
a07638239b | ||
|
5143870d3b | ||
|
f61c4c1374 | ||
|
254735fcae | ||
|
44024371ff | ||
|
be232fa34b | ||
|
1a90165255 | ||
|
13417d15b7 | ||
|
9fe1f6acfc | ||
|
1899d86641 | ||
|
6ca63ca56b | ||
|
e796968ec0 | ||
|
7b64c8dbe3 | ||
|
2377f7bc07 | ||
|
47fdcef182 | ||
|
d27b658392 | ||
|
07720ed6f8 | ||
|
a9cdecf599 | ||
|
c6b5a5c328 | ||
|
e7f3aa3764 | ||
|
89ca8e08d6 | ||
|
6350506ce7 | ||
|
d5ed611920 | ||
|
acc10ccac4 | ||
|
45160a2e73 | ||
|
e38794171a | ||
|
c2d6da83c0 | ||
|
77005fc495 | ||
|
0273e58783 | ||
|
3e88a24753 | ||
|
1205908233 | ||
|
3a7a068196 | ||
|
845ecfe742 | ||
|
53355aaad3 | ||
|
7cd0e25538 | ||
|
2f15178ff6 | ||
|
a4b13be0d1 | ||
|
23ae4fb790 | ||
|
cff036d08b | ||
|
7826cc0b03 | ||
|
2bfa28a311 | ||
|
780c5c80ae | ||
|
fcd00b3212 | ||
|
6a41d6e85a | ||
|
3733858145 | ||
|
95d8ee65a5 | ||
|
8e57697b71 | ||
|
c9c371b297 | ||
|
d4f794920e | ||
|
13b5ef36d7 | ||
|
83e0bac52a | ||
|
9943ae0fa5 | ||
|
4c95872826 | ||
|
4aef72572d | ||
|
126918be54 | ||
|
1dc4516efc | ||
|
9a9cfbd130 | ||
|
341c9ba64b | ||
|
f432734338 | ||
|
b7f5f848f2 | ||
|
d80cf6bf37 | ||
|
31bce2e644 | ||
|
faabd17fc6 | ||
|
4c4ed60cfb | ||
|
be1895a080 | ||
|
b81b6135f6 | ||
|
583ac7960b | ||
|
b749bb60fc | ||
|
2c6a298758 | ||
|
42544cc63b | ||
|
d2b81d221b | ||
|
618d8723d1 | ||
|
8058d3f728 | ||
|
0bc10acf02 | ||
|
e5866e8aa6 |
@@ -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
|
||||
|
@@ -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
41
.gitignore
vendored
@@ -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
|
||||
|
2
BUILD.md
2
BUILD.md
@@ -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):
|
||||
|
@@ -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);
|
||||
|
@@ -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...'));
|
||||
|
||||
|
@@ -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
@@ -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
79
CliClient/package-lock.json
generated
79
CliClient/package-lock.json
generated
@@ -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",
|
||||
|
@@ -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",
|
||||
|
@@ -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');
|
||||
// });
|
||||
// }));
|
||||
|
||||
});
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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>
|
@@ -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>
|
||||
|
@@ -8,6 +8,5 @@
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</en-note>
|
@@ -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>
|
5
CliClient/tests/html_to_md/list_with_style_type.html
Normal file
5
CliClient/tests/html_to_md/list_with_style_type.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<ul style="list-style-type:decimal;">
|
||||
<li>Item A</li>
|
||||
<li>Item B</li>
|
||||
<li>Item C</li>
|
||||
</ul>
|
3
CliClient/tests/html_to_md/list_with_style_type.md
Normal file
3
CliClient/tests/html_to_md/list_with_style_type.md
Normal file
@@ -0,0 +1,3 @@
|
||||
1. Item A
|
||||
2. Item B
|
||||
3. Item C
|
@@ -1,5 +1,5 @@
|
||||
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="javascript" data-joplin-source-open="```javascript " data-joplin-source-close=" ```">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">'bonjour'</span>);
|
||||
}</code></pre></div>
|
||||
|
@@ -1 +1 @@
|
||||
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="html" data-joplin-source-open="```html " data-joplin-source-close=" ```"><a href="#" onclick="leavethisalone">testing fence</a></pre><pre class="hljs"><code><span class="hljs-tag"><<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>></span>testing fence<span class="hljs-tag"></<span class="hljs-name">a</span>></span></code></pre></div>
|
||||
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="html" data-joplin-source-open="```html " data-joplin-source-close=" ```"><a href="#" onclick="leavethisalone">testing fence</a></pre><pre class="hljs"><code><span class="hljs-tag"><<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>></span>testing fence<span class="hljs-tag"></<span class="hljs-name">a</span>></span></code></pre></div>
|
||||
|
33
CliClient/tests/mimeUtils.js
Normal file
33
CliClient/tests/mimeUtils.js
Normal 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);
|
||||
}));
|
||||
|
||||
});
|
@@ -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' });
|
||||
|
86
CliClient/tests/services_UndoRedoService.js
Normal file
86
CliClient/tests/services_UndoRedoService.js
Normal 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);
|
||||
// }));
|
||||
|
||||
// });
|
@@ -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
Reference in New Issue
Block a user