1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-06 23:56:13 +02:00

Desktop: Resolves #8080: Add support for plugin user data (#8312)

This commit is contained in:
Laurent Cozic
2023-06-13 18:06:16 +01:00
committed by GitHub
parent 6424832984
commit 92c68882e2
67 changed files with 13357 additions and 232 deletions

View File

@ -14,6 +14,7 @@ import { toFileProtocolPath, toForwardSlashes } from '../path-utils';
const { pregQuote, substrWithEllipsis } = require('../string-utils.js');
const { _ } = require('../locale');
import { pull, unique } from '../ArrayUtils';
import { LoadOptions } from './utils/types';
const urlUtils = require('../urlUtils.js');
const { isImageMimeType } = require('../resourceUtils');
const { MarkupToHtml } = require('@joplin/renderer');
@ -662,6 +663,10 @@ export default class Note extends BaseItem {
return n.updated_time < date;
}
public static load(id: string, options: LoadOptions = null): Promise<NoteEntity> {
return super.load(id, options);
}
public static async save(o: NoteEntity, options: any = null): Promise<NoteEntity> {
const isNew = this.isNew(o, options);
@ -705,7 +710,7 @@ export default class Note extends BaseItem {
if (oldNote) {
for (const field in o) {
if (!o.hasOwnProperty(field)) continue;
if ((o as any)[field] !== oldNote[field]) {
if ((o as any)[field] !== (oldNote as any)[field]) {
changedFields.push(field);
}
}