refator: add module description
This commit is contained in:
parent
27c9553048
commit
9d3b7c38ff
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file defines the plugin's structure.
|
||||
*/
|
||||
|
||||
import AddonEvents from "./zotero/events";
|
||||
import ZoteroViews from "./zotero/views";
|
||||
import ReaderViews from "./reader/annotationButton";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains note editor UI code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { CopyHelper, EditorMessage } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file realizes note export.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { pick } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
@ -341,9 +345,11 @@ class NoteExport extends AddonBase {
|
|||
|
||||
private _getFileName(noteItem: Zotero.Item) {
|
||||
return (
|
||||
this._Addon.TemplateController.renderTemplate("[ExportMDFileName]", "noteItem", [
|
||||
noteItem,
|
||||
]) as string
|
||||
this._Addon.TemplateController.renderTemplate(
|
||||
"[ExportMDFileName]",
|
||||
"noteItem",
|
||||
[noteItem]
|
||||
) as string
|
||||
).replace(/\\/g, "-");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains note export window code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file realizes note parse (md, html, rich-text).
|
||||
*/
|
||||
|
||||
import AddonBase from "../module";
|
||||
import { HTML2Markdown, Markdown2HTML } from "./convertMD";
|
||||
import TurndownService = require("turndown");
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file realizes note tools.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file is the esbuild entrance.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "./addon";
|
||||
|
||||
Zotero.Knowledge4Zotero = new Knowledge4Zotero();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* This file defines the modules' base class.
|
||||
*/
|
||||
|
||||
|
||||
import Knowledge4Zotero from "./addon";
|
||||
|
||||
class AddonBase {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains reader annotation pane code.
|
||||
*/
|
||||
|
||||
const CryptoJS = require("crypto-js");
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file realizes the sycn feature.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains sync info window related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains sync list window related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import AddonBase from "../module";
|
||||
|
||||
|
|
@ -154,9 +158,10 @@ class SyncListWindow extends AddonBase {
|
|||
return;
|
||||
}
|
||||
if (this.useRelated()) {
|
||||
let noteIds: number[] = await this._Addon.SyncController.getRelatedNoteIdsFromNotes(
|
||||
selectedItems
|
||||
);
|
||||
let noteIds: number[] =
|
||||
await this._Addon.SyncController.getRelatedNoteIdsFromNotes(
|
||||
selectedItems
|
||||
);
|
||||
selectedItems = Zotero.Items.get(noteIds) as Zotero.Item[];
|
||||
}
|
||||
for (const note of selectedItems) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file realizes the template feature.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { NoteTemplate } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains template window related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { NoteTemplate } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains definitions of commonly used structures.
|
||||
*/
|
||||
|
||||
class EditorMessage {
|
||||
public type: string;
|
||||
public content: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file contains the first-run wizard window code
|
||||
* This file contains the first-run wizard window code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "./addon";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains workspace menu related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { OutlineType } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains workspace ontline related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { OutlineType } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains workspace window related code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { EditorMessage, OutlineType } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains the life-time and UI events.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { CopyHelper, EditorMessage } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file contains the Zotero UI code.
|
||||
*/
|
||||
|
||||
import Knowledge4Zotero from "../addon";
|
||||
import { EditorMessage } from "../utils";
|
||||
import AddonBase from "../module";
|
||||
|
|
|
|||
Loading…
Reference in New Issue