You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Desktop: Add ability to share a note publicly using Nextcloud (#2173)
* Moved button row to separate component file and started Sharing dialog * Adding Sharing dialog * Applied "npx react-codemod rename-unsafe-lifecycles" * More UI * Tools: Improved TypeScript integration * Improved share dialog * Tools Added support for translation validation in CI, and added support for plural translations * Improved UI and sharing workflow * Share workflow * Cleaned up and improved sharing config error handling * Fixed build scripts and doc for TypeScript * Run linter
This commit is contained in:
@@ -6,8 +6,10 @@ const { _ } = require('lib/locale.js');
|
||||
const Setting = require('lib/models/Setting.js');
|
||||
const { Synchronizer } = require('lib/synchronizer.js');
|
||||
const SyncTargetWebDAV = require('lib/SyncTargetWebDAV');
|
||||
const JoplinServerApi = require('lib/JoplinServerApi.js').default;
|
||||
|
||||
class SyncTargetNextcloud extends BaseSyncTarget {
|
||||
|
||||
static id() {
|
||||
return 5;
|
||||
}
|
||||
@@ -47,6 +49,21 @@ class SyncTargetNextcloud extends BaseSyncTarget {
|
||||
async initSynchronizer() {
|
||||
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
|
||||
}
|
||||
|
||||
async appApi() {
|
||||
if (!this.appApi_) {
|
||||
this.appApi_ = new JoplinServerApi({
|
||||
baseUrl: () => JoplinServerApi.baseUrlFromNextcloudWebDavUrl(Setting.value('sync.5.path')),
|
||||
username: () => Setting.value('sync.5.username'),
|
||||
password: () => Setting.value('sync.5.password'),
|
||||
});
|
||||
|
||||
this.appApi_.setLogger(this.logger());
|
||||
}
|
||||
|
||||
return this.appApi_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = SyncTargetNextcloud;
|
||||
|
||||
Reference in New Issue
Block a user