You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-12 22:57:38 +02:00
All: Removed sync target info out of setting class
This commit is contained in:
@ -9,11 +9,31 @@ class SyncTargetRegistry {
|
||||
static addClass(SyncTargetClass) {
|
||||
this.reg_[SyncTargetClass.id()] = {
|
||||
id: SyncTargetClass.id(),
|
||||
name: SyncTargetClass.targetName(),
|
||||
label: SyncTargetClass.label(),
|
||||
classRef: SyncTargetClass,
|
||||
};
|
||||
}
|
||||
|
||||
static nameToId(name) {
|
||||
console.info(this.reg_);
|
||||
|
||||
for (let n in this.reg_) {
|
||||
if (!this.reg_.hasOwnProperty(n)) continue;
|
||||
if (this.reg_[n].name === name) return this.reg_[n].id;
|
||||
}
|
||||
throw new Error('Name not found: ' + name);
|
||||
}
|
||||
|
||||
static idAndLabelPlainObject() {
|
||||
let output = {};
|
||||
for (let n in this.reg_) {
|
||||
if (!this.reg_.hasOwnProperty(n)) continue;
|
||||
output[n] = this.reg_[n].label;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SyncTargetRegistry.reg_ = {};
|
||||
|
Reference in New Issue
Block a user