You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-29 23:48:19 +02:00
Compare commits
65 Commits
plugin_sys
...
testing
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea878fb614 | ||
|
|
5fd0408365 | ||
|
|
2d099b2bed | ||
|
|
3c0b9ee522 | ||
|
|
987890ba98 | ||
|
|
3358c46122 | ||
|
|
d819e6ee0c | ||
|
|
b66be79351 | ||
|
|
433fa21069 | ||
|
|
30543104be | ||
|
|
b6a004086c | ||
|
|
4265b3afb0 | ||
|
|
ccd7ba28d7 | ||
|
|
871f8b3a72 | ||
|
|
f276d2b2d4 | ||
|
|
2bb5acdfb1 | ||
|
|
dda0d8ca08 | ||
|
|
15f22c0507 | ||
|
|
fa7bd2cfab | ||
|
|
dc51781976 | ||
|
|
c874aee774 | ||
|
|
6c84fdc51d | ||
|
|
8ff0f7c529 | ||
|
|
b326ffc41c | ||
|
|
a0de8582e6 | ||
|
|
5eb0417b1a | ||
|
|
c42d9cf069 | ||
|
|
d965a7b6db | ||
|
|
c1919c2908 | ||
|
|
3fd7470104 | ||
|
|
0bf74142ac | ||
|
|
b3bf7144ac | ||
|
|
5738a4f92b | ||
|
|
784851b217 | ||
|
|
0e0803e050 | ||
|
|
3d3abfe259 | ||
|
|
3f38b518fe | ||
|
|
e673ee97de | ||
|
|
7cb55ffdc4 | ||
|
|
b706217d41 | ||
|
|
6f680081f4 | ||
|
|
fe41d37f8f | ||
|
|
833fb1264f | ||
|
|
f007735936 | ||
|
|
73a39d36ea | ||
|
|
a43ab26a46 | ||
|
|
f5f117cb72 | ||
|
|
fc6da04081 | ||
|
|
12ff654986 | ||
|
|
e852ad846f | ||
|
|
28e00fdf2e | ||
|
|
3bd0656eab | ||
|
|
e9af71dd76 | ||
|
|
73b33e8e32 | ||
|
|
c2c7efee91 | ||
|
|
c9c44d5643 | ||
|
|
0836fca822 | ||
|
|
566df5039c | ||
|
|
559655bf33 | ||
|
|
0eab23fbcf | ||
|
|
f334f4f487 | ||
|
|
49bfa49489 | ||
|
|
5f81944a3e | ||
|
|
00057da17d | ||
|
|
0a05464013 |
@@ -68,29 +68,8 @@ CliClient/tests/models_Setting.js
|
||||
CliClient/tests/services_CommandService.js
|
||||
CliClient/tests/services_InteropService.js
|
||||
CliClient/tests/services_PluginService.js
|
||||
CliClient/tests/services_rest_Api.js
|
||||
CliClient/tests/services/plugins/sandboxProxy.js
|
||||
CliClient/tests/support/plugins/codemirror_test/global.d.js
|
||||
CliClient/tests/support/plugins/codemirror_test/src/index.js
|
||||
CliClient/tests/support/plugins/dialog/global.d.js
|
||||
CliClient/tests/support/plugins/dialog/src/index.js
|
||||
CliClient/tests/support/plugins/events/global.d.js
|
||||
CliClient/tests/support/plugins/events/src/index.js
|
||||
CliClient/tests/support/plugins/json_export/global.d.js
|
||||
CliClient/tests/support/plugins/json_export/src/index.js
|
||||
CliClient/tests/support/plugins/markdown_plugin/global.d.js
|
||||
CliClient/tests/support/plugins/markdown_plugin/src/index.js
|
||||
CliClient/tests/support/plugins/multi_selection/global.d.js
|
||||
CliClient/tests/support/plugins/multi_selection/src/index.js
|
||||
CliClient/tests/support/plugins/register_command/global.d.js
|
||||
CliClient/tests/support/plugins/register_command/src/index.js
|
||||
CliClient/tests/support/plugins/selected_text/global.d.js
|
||||
CliClient/tests/support/plugins/selected_text/src/index.js
|
||||
CliClient/tests/support/plugins/settings/global.d.js
|
||||
CliClient/tests/support/plugins/settings/src/index.js
|
||||
CliClient/tests/support/plugins/toc/global.d.js
|
||||
CliClient/tests/support/plugins/toc/src/index.js
|
||||
CliClient/tests/support/plugins/withExternalModules/global.d.js
|
||||
CliClient/tests/support/plugins/withExternalModules/src/index.js
|
||||
CliClient/tests/synchronizer_LockHandler.js
|
||||
CliClient/tests/synchronizer_MigrationHandler.js
|
||||
ElectronClient/app.js
|
||||
@@ -99,6 +78,7 @@ ElectronClient/commands/copyDevCommand.js
|
||||
ElectronClient/commands/focusElement.js
|
||||
ElectronClient/commands/startExternalEditing.js
|
||||
ElectronClient/commands/stopExternalEditing.js
|
||||
ElectronClient/commands/toggleExternalEditing.js
|
||||
ElectronClient/ElectronAppWrapper.js
|
||||
ElectronClient/global.d.js
|
||||
ElectronClient/gui/Button/Button.js
|
||||
@@ -219,7 +199,9 @@ ReactNativeClient/lib/checkPermissions.js
|
||||
ReactNativeClient/lib/commands/historyBackward.js
|
||||
ReactNativeClient/lib/commands/historyForward.js
|
||||
ReactNativeClient/lib/commands/synchronize.js
|
||||
ReactNativeClient/lib/components/BackButtonDialogBox.js
|
||||
ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
|
||||
ReactNativeClient/lib/errorUtils.js
|
||||
ReactNativeClient/lib/eventManager.js
|
||||
ReactNativeClient/lib/hooks/useEffectDebugger.js
|
||||
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
|
||||
@@ -232,6 +214,7 @@ ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
|
||||
ReactNativeClient/lib/JoplinServerApi.js
|
||||
ReactNativeClient/lib/locale.js
|
||||
ReactNativeClient/lib/Logger.js
|
||||
ReactNativeClient/lib/markdownUtils.js
|
||||
ReactNativeClient/lib/models/Alarm.js
|
||||
ReactNativeClient/lib/models/Setting.js
|
||||
ReactNativeClient/lib/ntpDate.js
|
||||
@@ -277,13 +260,13 @@ ReactNativeClient/lib/services/plugins/api/JoplinFilters.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinInterop.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinPlugins.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinSettings.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinUtils.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViews.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsDialogs.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenuItems.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsPanels.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsToolbarButtons.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinWorkspace.js
|
||||
ReactNativeClient/lib/services/plugins/api/types.js
|
||||
ReactNativeClient/lib/services/plugins/BasePluginRunner.js
|
||||
ReactNativeClient/lib/services/plugins/MenuItemController.js
|
||||
ReactNativeClient/lib/services/plugins/Plugin.js
|
||||
@@ -301,6 +284,7 @@ ReactNativeClient/lib/services/plugins/WebviewController.js
|
||||
ReactNativeClient/lib/services/ResourceEditWatcher/index.js
|
||||
ReactNativeClient/lib/services/ResourceEditWatcher/reducer.js
|
||||
ReactNativeClient/lib/services/rest/actionApi.desktop.js
|
||||
ReactNativeClient/lib/services/rest/Api.js
|
||||
ReactNativeClient/lib/services/rest/errors.js
|
||||
ReactNativeClient/lib/services/searchengine/filterParser.js
|
||||
ReactNativeClient/lib/services/searchengine/queryBuilder.js
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE
vendored
2
.github/PULL_REQUEST_TEMPLATE
vendored
@@ -20,6 +20,6 @@ If it's not related to any platform (such as a translation, change to the docume
|
||||
|
||||
Then please append the issue that you've addressed or fixed. Use "Resolves #123" for new features or improvements and "Fixes #123" for bug fixes.
|
||||
|
||||
AND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/master/CONTRIBUTING.md
|
||||
AND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/dev/CONTRIBUTING.md
|
||||
|
||||
-->
|
||||
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
@@ -53,6 +53,7 @@ Tools/commit_hook.txt
|
||||
ReactNativeClient/lib/sql-extensions/spellfix.so
|
||||
ReactNativeClient/lib/sql-extensions/spellfix.dylib
|
||||
CliClient/build/
|
||||
plugin_types/
|
||||
|
||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||
CliClient/app/LinkSelector.js
|
||||
@@ -61,29 +62,8 @@ CliClient/tests/models_Setting.js
|
||||
CliClient/tests/services_CommandService.js
|
||||
CliClient/tests/services_InteropService.js
|
||||
CliClient/tests/services_PluginService.js
|
||||
CliClient/tests/services_rest_Api.js
|
||||
CliClient/tests/services/plugins/sandboxProxy.js
|
||||
CliClient/tests/support/plugins/codemirror_test/global.d.js
|
||||
CliClient/tests/support/plugins/codemirror_test/src/index.js
|
||||
CliClient/tests/support/plugins/dialog/global.d.js
|
||||
CliClient/tests/support/plugins/dialog/src/index.js
|
||||
CliClient/tests/support/plugins/events/global.d.js
|
||||
CliClient/tests/support/plugins/events/src/index.js
|
||||
CliClient/tests/support/plugins/json_export/global.d.js
|
||||
CliClient/tests/support/plugins/json_export/src/index.js
|
||||
CliClient/tests/support/plugins/markdown_plugin/global.d.js
|
||||
CliClient/tests/support/plugins/markdown_plugin/src/index.js
|
||||
CliClient/tests/support/plugins/multi_selection/global.d.js
|
||||
CliClient/tests/support/plugins/multi_selection/src/index.js
|
||||
CliClient/tests/support/plugins/register_command/global.d.js
|
||||
CliClient/tests/support/plugins/register_command/src/index.js
|
||||
CliClient/tests/support/plugins/selected_text/global.d.js
|
||||
CliClient/tests/support/plugins/selected_text/src/index.js
|
||||
CliClient/tests/support/plugins/settings/global.d.js
|
||||
CliClient/tests/support/plugins/settings/src/index.js
|
||||
CliClient/tests/support/plugins/toc/global.d.js
|
||||
CliClient/tests/support/plugins/toc/src/index.js
|
||||
CliClient/tests/support/plugins/withExternalModules/global.d.js
|
||||
CliClient/tests/support/plugins/withExternalModules/src/index.js
|
||||
CliClient/tests/synchronizer_LockHandler.js
|
||||
CliClient/tests/synchronizer_MigrationHandler.js
|
||||
ElectronClient/app.js
|
||||
@@ -92,6 +72,7 @@ ElectronClient/commands/copyDevCommand.js
|
||||
ElectronClient/commands/focusElement.js
|
||||
ElectronClient/commands/startExternalEditing.js
|
||||
ElectronClient/commands/stopExternalEditing.js
|
||||
ElectronClient/commands/toggleExternalEditing.js
|
||||
ElectronClient/ElectronAppWrapper.js
|
||||
ElectronClient/global.d.js
|
||||
ElectronClient/gui/Button/Button.js
|
||||
@@ -212,7 +193,9 @@ ReactNativeClient/lib/checkPermissions.js
|
||||
ReactNativeClient/lib/commands/historyBackward.js
|
||||
ReactNativeClient/lib/commands/historyForward.js
|
||||
ReactNativeClient/lib/commands/synchronize.js
|
||||
ReactNativeClient/lib/components/BackButtonDialogBox.js
|
||||
ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
|
||||
ReactNativeClient/lib/errorUtils.js
|
||||
ReactNativeClient/lib/eventManager.js
|
||||
ReactNativeClient/lib/hooks/useEffectDebugger.js
|
||||
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
|
||||
@@ -225,6 +208,7 @@ ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
|
||||
ReactNativeClient/lib/JoplinServerApi.js
|
||||
ReactNativeClient/lib/locale.js
|
||||
ReactNativeClient/lib/Logger.js
|
||||
ReactNativeClient/lib/markdownUtils.js
|
||||
ReactNativeClient/lib/models/Alarm.js
|
||||
ReactNativeClient/lib/models/Setting.js
|
||||
ReactNativeClient/lib/ntpDate.js
|
||||
@@ -270,13 +254,13 @@ ReactNativeClient/lib/services/plugins/api/JoplinFilters.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinInterop.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinPlugins.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinSettings.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinUtils.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViews.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsDialogs.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsMenuItems.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsPanels.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinViewsToolbarButtons.js
|
||||
ReactNativeClient/lib/services/plugins/api/JoplinWorkspace.js
|
||||
ReactNativeClient/lib/services/plugins/api/types.js
|
||||
ReactNativeClient/lib/services/plugins/BasePluginRunner.js
|
||||
ReactNativeClient/lib/services/plugins/MenuItemController.js
|
||||
ReactNativeClient/lib/services/plugins/Plugin.js
|
||||
@@ -294,6 +278,7 @@ ReactNativeClient/lib/services/plugins/WebviewController.js
|
||||
ReactNativeClient/lib/services/ResourceEditWatcher/index.js
|
||||
ReactNativeClient/lib/services/ResourceEditWatcher/reducer.js
|
||||
ReactNativeClient/lib/services/rest/actionApi.desktop.js
|
||||
ReactNativeClient/lib/services/rest/Api.js
|
||||
ReactNativeClient/lib/services/rest/errors.js
|
||||
ReactNativeClient/lib/services/searchengine/filterParser.js
|
||||
ReactNativeClient/lib/services/searchengine/queryBuilder.js
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
2
BUILD.md
2
BUILD.md
@@ -96,4 +96,4 @@ The Markdown renderer is located under ReactNativeClient/lib/joplin-renderer. Wh
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
Please read for the [Build Troubleshooting Document](https://github.com/laurent22/joplin/blob/master/readme/build_troubleshooting.md) for various tips on how to get the build working.
|
||||
Please read for the [Build Troubleshooting Document](https://github.com/laurent22/joplin/blob/dev/readme/build_troubleshooting.md) for various tips on how to get the build working.
|
||||
@@ -38,7 +38,7 @@ If you want to start contributing to the project's code, please follow these gui
|
||||
- All the applications share the same backend (database, synchronisation, settings, models, business logic, etc.) so if you change something in the backend in one app, makes sure it still work in the other apps. Usually it does, but keep this in mind.
|
||||
- Pull requests that make many changes using an automated tool, like for spell fixing, styling, etc. will not be accepted. An exception would be if the changes have been discussed in the forum and someone has agreed to review **and test** the pull request.
|
||||
|
||||
Building the apps is relatively easy - please [see the build instructions](https://github.com/laurent22/joplin/blob/master/BUILD.md) for more details.
|
||||
Building the apps is relatively easy - please [see the build instructions](https://github.com/laurent22/joplin/blob/dev/BUILD.md) for more details.
|
||||
|
||||
## Coding style
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const BaseItem = require('lib/models/BaseItem');
|
||||
const BaseModel = require('lib/BaseModel');
|
||||
const { toTitleCase } = require('lib/string-utils.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
const markdownUtils = require('lib/markdownUtils');
|
||||
const markdownUtils = require('lib/markdownUtils').default;
|
||||
const { Database } = require('lib/database.js');
|
||||
|
||||
class Command extends BaseCommand {
|
||||
@@ -53,9 +53,9 @@ class Command extends BaseCommand {
|
||||
|
||||
const lines = [];
|
||||
|
||||
lines.push('# Joplin API');
|
||||
lines.push('# Joplin Data API');
|
||||
lines.push('');
|
||||
|
||||
lines.push('This API is available when the clipper server is running. It provides access to the notes, notebooks, tags and other Joplin object via a REST API. Plugins can also access this API even when the clipper server is not running.');
|
||||
lines.push('');
|
||||
lines.push('In order to use it, you\'ll first need to find on which port the service is running. To do so, open the Web Clipper Options in Joplin and if the service is running it should tell you on which port. Normally it runs on port **41184**. If you want to find it programmatically, you may follow this kind of algorithm:');
|
||||
lines.push('');
|
||||
|
||||
@@ -124,7 +124,6 @@ class Command extends BaseCommand {
|
||||
|
||||
if (args.name == 'locale') {
|
||||
setLocale(Setting.value('locale'));
|
||||
app().onLocaleChanged();
|
||||
}
|
||||
|
||||
await Setting.saveAll();
|
||||
|
||||
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
@@ -42,38 +42,38 @@ stats['ar'] = {"percentDone":80};
|
||||
stats['eu'] = {"percentDone":34};
|
||||
stats['bs_BA'] = {"percentDone":83};
|
||||
stats['bg_BG'] = {"percentDone":66};
|
||||
stats['ca'] = {"percentDone":53};
|
||||
stats['hr_HR'] = {"percentDone":28};
|
||||
stats['ca'] = {"percentDone":96};
|
||||
stats['hr_HR'] = {"percentDone":27};
|
||||
stats['cs_CZ'] = {"percentDone":82};
|
||||
stats['da_DK'] = {"percentDone":74};
|
||||
stats['de_DE'] = {"percentDone":95};
|
||||
stats['de_DE'] = {"percentDone":98};
|
||||
stats['et_EE'] = {"percentDone":66};
|
||||
stats['en_GB'] = {"percentDone":100};
|
||||
stats['en_US'] = {"percentDone":100};
|
||||
stats['es_ES'] = {"percentDone":95};
|
||||
stats['eo'] = {"percentDone":38};
|
||||
stats['fr_FR'] = {"percentDone":94};
|
||||
stats['fr_FR'] = {"percentDone":99};
|
||||
stats['gl_ES'] = {"percentDone":43};
|
||||
stats['id_ID'] = {"percentDone":93};
|
||||
stats['it_IT'] = {"percentDone":91};
|
||||
stats['nl_NL'] = {"percentDone":96};
|
||||
stats['it_IT'] = {"percentDone":90};
|
||||
stats['nl_BE'] = {"percentDone":34};
|
||||
stats['nl_NL'] = {"percentDone":95};
|
||||
stats['nb_NO'] = {"percentDone":88};
|
||||
stats['fa'] = {"percentDone":80};
|
||||
stats['pl_PL'] = {"percentDone":96};
|
||||
stats['pt_PT'] = {"percentDone":89};
|
||||
stats['fa'] = {"percentDone":83};
|
||||
stats['pl_PL'] = {"percentDone":98};
|
||||
stats['pt_PT'] = {"percentDone":88};
|
||||
stats['pt_BR'] = {"percentDone":96};
|
||||
stats['ro'] = {"percentDone":78};
|
||||
stats['ro'] = {"percentDone":77};
|
||||
stats['sl_SI'] = {"percentDone":42};
|
||||
stats['sv'] = {"percentDone":71};
|
||||
stats['sv'] = {"percentDone":70};
|
||||
stats['th_TH'] = {"percentDone":52};
|
||||
stats['vi'] = {"percentDone":85};
|
||||
stats['tr_TR'] = {"percentDone":96};
|
||||
stats['tr_TR'] = {"percentDone":98};
|
||||
stats['el_GR'] = {"percentDone":96};
|
||||
stats['ru_RU'] = {"percentDone":95};
|
||||
stats['sr_RS'] = {"percentDone":72};
|
||||
stats['sr_RS'] = {"percentDone":71};
|
||||
stats['zh_CN'] = {"percentDone":96};
|
||||
stats['zh_TW'] = {"percentDone":95};
|
||||
stats['ja_JP'] = {"percentDone":96};
|
||||
stats['ko'] = {"percentDone":86};
|
||||
stats['ja_JP'] = {"percentDone":98};
|
||||
stats['ko'] = {"percentDone":98};
|
||||
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
8
CliClient/package-lock.json
generated
8
CliClient/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "joplin",
|
||||
"version": "1.2.2",
|
||||
"version": "1.3.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -5901,9 +5901,9 @@
|
||||
}
|
||||
},
|
||||
"slug": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/slug/-/slug-3.3.4.tgz",
|
||||
"integrity": "sha512-VpHbtRCEWmgaZsrZcTsVl/Dhw98lcrOYDO17DNmJCNpppI6s3qJvnNu2Q3D4L84/2bi6vkW40mjNQI9oGQsflg=="
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/slug/-/slug-3.5.0.tgz",
|
||||
"integrity": "sha512-+pZLDhMtmAc+ZcojQSMlUKDZBYmvhZiZmK8Ffx/D3Q/MIMHPDBAMbWvWN8vJb9xl2MfbDdRWxFzrdOhBiyVpow=="
|
||||
},
|
||||
"snapdragon": {
|
||||
"version": "0.8.2",
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
"sax": "^1.2.4",
|
||||
"server-destroy": "^1.0.1",
|
||||
"sharp": "^0.23.2",
|
||||
"slug": "^3.3.4",
|
||||
"slug": "^3.5.0",
|
||||
"sprintf-js": "^1.1.1",
|
||||
"sqlite3": "^4.1.1",
|
||||
"string-padding": "^1.0.2",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const { asyncTest } = require('test-utils.js');
|
||||
const markdownUtils = require('lib/markdownUtils.js');
|
||||
const markdownUtils = require('lib/markdownUtils').default;
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
||||
|
||||
@@ -78,16 +78,4 @@ describe('services_PluginService', function() {
|
||||
expect(allFolders.map((f:any) => f.title).sort().join(', ')).toBe('multi - simple1, multi - simple2');
|
||||
}));
|
||||
|
||||
// it('should translate calls from plugin process to sandbox', asyncTest(async () => {
|
||||
// const service = newPluginService();
|
||||
// const plugin = await service.loadPlugin(`${testPluginDir}/simple`);
|
||||
// await service.runPlugin(plugin);
|
||||
|
||||
// const folder = await Folder.save({ title: 'folder' });
|
||||
|
||||
// const folderFromApi = await service.executeSandboxCall(plugin.id, 'joplin.data.get', ['folders/' + folder.id]);
|
||||
// expect(folder.id).toBe(folderFromApi.id);
|
||||
// expect(folder.title).toBe(folderFromApi.title);
|
||||
// }));
|
||||
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, asyncTest, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const { fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, asyncTest, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync, mockDate, restoreDate } = require('test-utils.js');
|
||||
const SearchEngine = require('lib/services/searchengine/SearchEngine');
|
||||
const Note = require('lib/models/Note');
|
||||
const ItemChange = require('lib/models/ItemChange');
|
||||
@@ -33,16 +33,32 @@ const calculateScore = (searchString, notes) => {
|
||||
const numTokens = notes.map(note => note.title.split(' ').length);
|
||||
const avgTokens = Math.round(numTokens.reduce((a, b) => a + b, 0) / notes.length);
|
||||
|
||||
let titleBM25 = new Array(notes.length).fill(-1);
|
||||
const msSinceEpoch = Math.round(new Date().getTime());
|
||||
const msPerDay = 86400000;
|
||||
const weightForDaysSinceLastUpdate = (row) => {
|
||||
// BM25 weights typically range 0-10, and last updated date should weight similarly, though prioritizing recency logarithmically.
|
||||
// An alpha of 200 ensures matches in the last week will show up front (11.59) and often so for matches within 2 weeks (5.99),
|
||||
// but is much less of a factor at 30 days (2.84) or very little after 90 days (0.95), focusing mostly on content at that point.
|
||||
if (!row.user_updated_time) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const alpha = 200;
|
||||
const daysSinceLastUpdate = (msSinceEpoch - row.user_updated_time) / msPerDay;
|
||||
return alpha * Math.log(1 + 1 / Math.max(daysSinceLastUpdate, 0.5));
|
||||
};
|
||||
|
||||
let titleBM25WeightedByLastUpdate = new Array(notes.length).fill(-1);
|
||||
if (avgTokens != 0) {
|
||||
for (let i = 0; i < notes.length; i++) {
|
||||
titleBM25[i] = IDF(notes.length, notesWithWord) * ((freqTitle[i] * (K1 + 1)) / (freqTitle[i] + K1 * (1 - B + B * (numTokens[i] / avgTokens))));
|
||||
titleBM25WeightedByLastUpdate[i] = IDF(notes.length, notesWithWord) * ((freqTitle[i] * (K1 + 1)) / (freqTitle[i] + K1 * (1 - B + B * (numTokens[i] / avgTokens))));
|
||||
titleBM25WeightedByLastUpdate[i] += weightForDaysSinceLastUpdate(notes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
const scores = [];
|
||||
for (let i = 0; i < notes.length; i++) {
|
||||
if (freqTitle[i]) scores.push(titleBM25[i]);
|
||||
if (freqTitle[i]) scores.push(titleBM25WeightedByLastUpdate[i]);
|
||||
}
|
||||
|
||||
scores.sort().reverse();
|
||||
@@ -142,33 +158,54 @@ describe('services_SearchEngine', function() {
|
||||
expect(rows[1].id).toBe(n2.id);
|
||||
}));
|
||||
|
||||
it('should correctly weigh notes using BM25', asyncTest(async () => {
|
||||
|
||||
it('should correctly weigh notes using BM25 and user_updated_time', asyncTest(async () => {
|
||||
await mockDate(2020, 9, 30, 50);
|
||||
const noteData = [
|
||||
{
|
||||
title: 'abc test2 test2',
|
||||
updated_time: 1601425064756,
|
||||
user_updated_time: 1601425064756,
|
||||
created_time: 1601425064756,
|
||||
user_created_time: 1601425064756,
|
||||
},
|
||||
{
|
||||
title: 'foo foo',
|
||||
updated_time: 1601425064758,
|
||||
user_updated_time: 1601425064758,
|
||||
created_time: 1601425064758,
|
||||
user_created_time: 1601425064758,
|
||||
},
|
||||
{
|
||||
title: 'dead beef',
|
||||
updated_time: 1601425064760,
|
||||
user_updated_time: 1601425064760,
|
||||
created_time: 1601425064760,
|
||||
user_created_time: 1601425064760,
|
||||
},
|
||||
{
|
||||
title: 'test2 bar',
|
||||
updated_time: 1601425064761,
|
||||
user_updated_time: 1601425064761,
|
||||
created_time: 1601425064761,
|
||||
user_created_time: 1601425064761,
|
||||
},
|
||||
{
|
||||
title: 'blah blah abc',
|
||||
updated_time: 1601425064763,
|
||||
user_updated_time: 1601425064763,
|
||||
created_time: 1601425064763,
|
||||
user_created_time: 1601425064763,
|
||||
},
|
||||
];
|
||||
|
||||
const n0 = await Note.save(noteData[0]);
|
||||
const n1 = await Note.save(noteData[1]);
|
||||
const n2 = await Note.save(noteData[2]);
|
||||
const n3 = await Note.save(noteData[3]);
|
||||
const n4 = await Note.save(noteData[4]);
|
||||
|
||||
const n0 = await Note.save(noteData[0], { autoTimestamp: false });
|
||||
const n1 = await Note.save(noteData[1], { autoTimestamp: false });
|
||||
const n2 = await Note.save(noteData[2], { autoTimestamp: false });
|
||||
const n3 = await Note.save(noteData[3], { autoTimestamp: false });
|
||||
const n4 = await Note.save(noteData[4], { autoTimestamp: false });
|
||||
restoreDate();
|
||||
await engine.syncTables();
|
||||
await mockDate(2020, 9, 30, 50);
|
||||
|
||||
let searchString = 'abc';
|
||||
let scores = calculateScore(searchString, noteData);
|
||||
@@ -198,6 +235,7 @@ describe('services_SearchEngine', function() {
|
||||
// console.log(scores);
|
||||
|
||||
expect(rows[0].weight).toEqual(scores[0]);
|
||||
await restoreDate();
|
||||
}));
|
||||
|
||||
it('should tell where the results are found', asyncTest(async () => {
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
require('app-module-path').addPath(__dirname);
|
||||
import Api from 'lib/services/rest/Api';
|
||||
import shim from 'lib/shim';
|
||||
|
||||
const { asyncTest, setupDatabaseAndSynchronizer, switchClient, checkThrowAsync } = require('test-utils.js');
|
||||
const Api = require('lib/services/rest/Api');
|
||||
const Folder = require('lib/models/Folder');
|
||||
const Resource = require('lib/models/Resource');
|
||||
const Note = require('lib/models/Note');
|
||||
const Tag = require('lib/models/Tag');
|
||||
const NoteTag = require('lib/models/NoteTag');
|
||||
const shim = require('lib/shim').default;
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
||||
});
|
||||
|
||||
let api = null;
|
||||
let api:Api = null;
|
||||
|
||||
describe('services_rest_Api', function() {
|
||||
|
||||
@@ -28,21 +25,23 @@ describe('services_rest_Api', function() {
|
||||
|
||||
it('should ping', asyncTest(async () => {
|
||||
const response = await api.route('GET', 'ping');
|
||||
expect(response).toBe('JoplinClipperServer');
|
||||
}));
|
||||
|
||||
it('should handle Not Found errors', asyncTest(async () => {
|
||||
const hasThrown = await checkThrowAsync(async () => await api.route('GET', 'pong'));
|
||||
expect(hasThrown).toBe(true);
|
||||
}));
|
||||
|
||||
it('should get folders', asyncTest(async () => {
|
||||
const f1 = await Folder.save({ title: 'mon carnet' });
|
||||
await Folder.save({ title: 'mon carnet' });
|
||||
const response = await api.route('GET', 'folders');
|
||||
expect(response.length).toBe(1);
|
||||
}));
|
||||
|
||||
it('should update folders', asyncTest(async () => {
|
||||
const f1 = await Folder.save({ title: 'mon carnet' });
|
||||
const response = await api.route('PUT', `folders/${f1.id}`, null, JSON.stringify({
|
||||
await api.route('PUT', `folders/${f1.id}`, null, JSON.stringify({
|
||||
title: 'modifié',
|
||||
}));
|
||||
|
||||
@@ -84,8 +83,8 @@ describe('services_rest_Api', function() {
|
||||
const response2 = await api.route('GET', `folders/${f1.id}/notes`);
|
||||
expect(response2.length).toBe(0);
|
||||
|
||||
const n1 = await Note.save({ title: 'un', parent_id: f1.id });
|
||||
const n2 = await Note.save({ title: 'deux', parent_id: f1.id });
|
||||
await Note.save({ title: 'un', parent_id: f1.id });
|
||||
await Note.save({ title: 'deux', parent_id: f1.id });
|
||||
const response = await api.route('GET', `folders/${f1.id}/notes`);
|
||||
expect(response.length).toBe(2);
|
||||
}));
|
||||
@@ -100,7 +99,7 @@ describe('services_rest_Api', function() {
|
||||
const f1 = await Folder.save({ title: 'mon carnet' });
|
||||
const f2 = await Folder.save({ title: 'mon deuxième carnet' });
|
||||
const n1 = await Note.save({ title: 'un', parent_id: f1.id });
|
||||
const n2 = await Note.save({ title: 'deux', parent_id: f1.id });
|
||||
await Note.save({ title: 'deux', parent_id: f1.id });
|
||||
const n3 = await Note.save({ title: 'trois', parent_id: f2.id });
|
||||
|
||||
response = await api.route('GET', 'notes');
|
||||
@@ -134,6 +133,41 @@ describe('services_rest_Api', function() {
|
||||
expect(!!response.id).toBe(true);
|
||||
}));
|
||||
|
||||
it('should allow setting note properties', asyncTest(async () => {
|
||||
let response:any = null;
|
||||
const f = await Folder.save({ title: 'mon carnet' });
|
||||
|
||||
response = await api.route('POST', 'notes', null, JSON.stringify({
|
||||
title: 'testing',
|
||||
parent_id: f.id,
|
||||
latitude: '48.732071',
|
||||
longitude: '-3.458700',
|
||||
altitude: '21',
|
||||
}));
|
||||
|
||||
const noteId = response.id;
|
||||
|
||||
{
|
||||
const note = await Note.load(noteId);
|
||||
expect(note.latitude).toBe('48.73207100');
|
||||
expect(note.longitude).toBe('-3.45870000');
|
||||
expect(note.altitude).toBe('21.0000');
|
||||
}
|
||||
|
||||
await api.route('PUT', 'notes/' + noteId, null, JSON.stringify({
|
||||
latitude: '49',
|
||||
longitude: '-3',
|
||||
altitude: '22',
|
||||
}));
|
||||
|
||||
{
|
||||
const note = await Note.load(noteId);
|
||||
expect(note.latitude).toBe('49.00000000');
|
||||
expect(note.longitude).toBe('-3.00000000');
|
||||
expect(note.altitude).toBe('22.0000');
|
||||
}
|
||||
}));
|
||||
|
||||
it('should preserve user timestamps when creating notes', asyncTest(async () => {
|
||||
let response = null;
|
||||
const f = await Folder.save({ title: 'mon carnet' });
|
||||
@@ -221,10 +255,9 @@ describe('services_rest_Api', function() {
|
||||
}));
|
||||
|
||||
it('should delete resources', asyncTest(async () => {
|
||||
let response = null;
|
||||
const f = await Folder.save({ title: 'mon carnet' });
|
||||
|
||||
response = await api.route('POST', 'notes', null, JSON.stringify({
|
||||
await api.route('POST', 'notes', null, JSON.stringify({
|
||||
title: 'testing image',
|
||||
parent_id: f.id,
|
||||
image_data_url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUeNoAyAA3/wFwtO3K6gUB/vz2+Prw9fj/+/r+/wBZKAAExOgF4/MC9ff+MRH6Ui4E+/0Bqc/zutj6AgT+/Pz7+vv7++nu82c4DlMqCvLs8goA/gL8/fz09fb59vXa6vzZ6vjT5fbn6voD/fwC8vX4UiT9Zi//APHyAP8ACgUBAPv5APz7BPj2+DIaC2o3E+3o6ywaC5fT6gD6/QD9/QEVf9kD+/dcLQgJA/7v8vqfwOf18wA1IAIEVycAyt//v9XvAPv7APz8LhoIAPz9Ri4OAgwARgx4W/6fVeEAAAAASUVORK5CYII=',
|
||||
@@ -286,7 +319,7 @@ describe('services_rest_Api', function() {
|
||||
const tag = await Tag.save({ title: 'mon étiquette' });
|
||||
const note = await Note.save({ title: 'ma note' });
|
||||
|
||||
const response = await api.route('POST', `tags/${tag.id}/notes`, null, JSON.stringify({
|
||||
await api.route('POST', `tags/${tag.id}/notes`, null, JSON.stringify({
|
||||
id: note.id,
|
||||
}));
|
||||
|
||||
@@ -299,7 +332,7 @@ describe('services_rest_Api', function() {
|
||||
const note = await Note.save({ title: 'ma note' });
|
||||
await Tag.addNote(tag.id, note.id);
|
||||
|
||||
const response = await api.route('DELETE', `tags/${tag.id}/notes/${note.id}`);
|
||||
await api.route('DELETE', `tags/${tag.id}/notes/${note.id}`);
|
||||
|
||||
const noteIds = await Tag.noteIds(tag.id);
|
||||
expect(noteIds.length).toBe(0);
|
||||
1
CliClient/tests/support/plugins/.gitignore
vendored
Normal file
1
CliClient/tests/support/plugins/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_temp
|
||||
@@ -1 +0,0 @@
|
||||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function l(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,l)}a((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};joplin.plugins.register({run:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return joplin.filters.on("codeMirrorOptions",(function(t){return n(n({},t),{lineNumbers:!0})})),[2]}))}))}})}]);
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "To test setting preferences on CodeMirror editor",
|
||||
"version": "1.0.0",
|
||||
"homepage_url": "https://joplinapp.org",
|
||||
"permissions": [
|
||||
"model"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
declare var joplin:any;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "codemirror_test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"ts-loader": "^7.0.5",
|
||||
"typescript": "^3.9.3",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
joplin.filters.on('codeMirrorOptions', (options:any) => {
|
||||
return { ...options, lineNumbers: true };
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"noImplicitAny": true,
|
||||
"module": "es6",
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.ts',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ '.tsx', '.ts', '.js' ],
|
||||
},
|
||||
output: {
|
||||
filename: 'index.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user