change: zotero-types v0.1.0
This commit is contained in:
parent
e1e0ff769e
commit
9eda46d9ac
|
|
@ -60,6 +60,6 @@
|
|||
"esbuild": "^0.14.34",
|
||||
"compressing": "^1.5.1",
|
||||
"release-it": "^14.14.0",
|
||||
"zotero-types": "^0.0.8"
|
||||
"zotero-types": "^0.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class EditorController extends AddonBase {
|
|||
instance: Zotero.EditorInstance;
|
||||
time: number;
|
||||
}>;
|
||||
editorPromise: _ZoteroPromise;
|
||||
editorPromise: _ZoteroPromiseObject;
|
||||
activeEditor: Zotero.EditorInstance;
|
||||
|
||||
constructor(parent: Knowledge4Zotero) {
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ class EditorViews extends AddonBase {
|
|||
);
|
||||
newLines.push(templateText);
|
||||
const newLineString = newLines.join("\n");
|
||||
const notifyFlag: _ZoteroPromise = Zotero.Promise.defer();
|
||||
const notifyFlag: _ZoteroPromiseObject = Zotero.Promise.defer();
|
||||
const notifierName = "insertLinkWait";
|
||||
this._Addon.ZoteroEvents.addNotifyListener(
|
||||
notifierName,
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ class NoteExport extends AddonBase {
|
|||
note: Zotero.Item;
|
||||
filename: string;
|
||||
}>;
|
||||
_pdfPrintPromise: _ZoteroPromise;
|
||||
_docxPromise: _ZoteroPromise;
|
||||
_pdfPrintPromise: _ZoteroPromiseObject;
|
||||
_docxPromise: _ZoteroPromiseObject;
|
||||
_docxBlob: Blob;
|
||||
|
||||
constructor(parent: Knowledge4Zotero) {
|
||||
|
|
|
|||
|
|
@ -45,8 +45,9 @@ class SyncListWindow extends AddonBase {
|
|||
}
|
||||
for (const note of notes) {
|
||||
const syncInfo = this._Addon.SyncUtils.getSyncStatus(note);
|
||||
const listitem: XUL.ListItem =
|
||||
this._window.document.createElement("listitem");
|
||||
const listitem = this._window.document.createElement(
|
||||
"listitem"
|
||||
) as XUL.ListItem;
|
||||
listitem.setAttribute("id", note.id);
|
||||
|
||||
const icon = this._window.document.createElement("listcell");
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@ class TemplateWindow extends AddonBase {
|
|||
}
|
||||
|
||||
getSelectedTemplateName(): string {
|
||||
const listbox: XUL.ListItem =
|
||||
this._window.document.getElementById("template-list");
|
||||
const listbox = this._window.document.getElementById(
|
||||
"template-list"
|
||||
) as XUL.ListItem;
|
||||
const selectedItem = listbox.selectedItem;
|
||||
if (selectedItem) {
|
||||
const name = selectedItem.getAttribute("id");
|
||||
|
|
@ -73,10 +74,12 @@ class TemplateWindow extends AddonBase {
|
|||
const name = this.getSelectedTemplateName();
|
||||
const templateText = this._Addon.TemplateController.getTemplateText(name);
|
||||
|
||||
const header: XUL.Textbox =
|
||||
this._window.document.getElementById("editor-name");
|
||||
const text: XUL.Textbox =
|
||||
this._window.document.getElementById("editor-textbox");
|
||||
const header = this._window.document.getElementById(
|
||||
"editor-name"
|
||||
) as XUL.Textbox;
|
||||
const text = this._window.document.getElementById(
|
||||
"editor-textbox"
|
||||
) as XUL.Textbox;
|
||||
const saveTemplate = this._window.document.getElementById("save-template");
|
||||
const deleteTemplate =
|
||||
this._window.document.getElementById("delete-template");
|
||||
|
|
@ -155,10 +158,12 @@ class TemplateWindow extends AddonBase {
|
|||
|
||||
saveSelectedTemplate() {
|
||||
const name = this.getSelectedTemplateName();
|
||||
const header: XUL.Textbox =
|
||||
this._window.document.getElementById("editor-name");
|
||||
const text: XUL.Textbox =
|
||||
this._window.document.getElementById("editor-textbox");
|
||||
const header = this._window.document.getElementById(
|
||||
"editor-name"
|
||||
) as XUL.Textbox;
|
||||
const text = this._window.document.getElementById(
|
||||
"editor-textbox"
|
||||
) as XUL.Textbox;
|
||||
|
||||
if (
|
||||
this._Addon.TemplateController._systemTemplateNames.includes(name) &&
|
||||
|
|
@ -202,8 +207,9 @@ class TemplateWindow extends AddonBase {
|
|||
resetSelectedTemplate() {
|
||||
const name = this.getSelectedTemplateName();
|
||||
if (this._Addon.TemplateController._systemTemplateNames.includes(name)) {
|
||||
const text: XUL.Textbox =
|
||||
this._window.document.getElementById("editor-textbox");
|
||||
const text = this._window.document.getElementById(
|
||||
"editor-textbox"
|
||||
) as XUL.Textbox;
|
||||
text.value = this._Addon.TemplateController._defaultTemplates.find(
|
||||
(t) => t.name === name
|
||||
).text;
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ import { EditorMessage, OutlineType, pick } from "../utils";
|
|||
import AddonBase from "../module";
|
||||
|
||||
class WorkspaceWindow extends AddonBase {
|
||||
private _initIframe: _ZoteroPromise;
|
||||
private _initIframe: _ZoteroPromiseObject;
|
||||
public workspaceWindow: Window;
|
||||
public workspaceTabId: string;
|
||||
public workspaceNoteEditor: Zotero.EditorInstance | undefined;
|
||||
public previewItemID: number;
|
||||
private _firstInit: boolean;
|
||||
public _workspacePromise: _ZoteroPromise;
|
||||
public _workspacePromise: _ZoteroPromiseObject;
|
||||
private _DOMParser: any;
|
||||
|
||||
constructor(parent: Knowledge4Zotero) {
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ class ZoteroEvents extends AddonBase {
|
|||
null,
|
||||
0
|
||||
);
|
||||
this._Addon.NoteUtils.addLineToNote(noteItem, cite.html, -1);
|
||||
await this._Addon.NoteUtils.addLineToNote(noteItem, cite.html, -1);
|
||||
this._Addon.ZoteroViews.showProgressWindow(
|
||||
"Better Notes",
|
||||
`${
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class ZoteroViews extends AddonBase {
|
|||
.forEach((el) => ((el as HTMLElement).hidden = hidden));
|
||||
|
||||
// Disable Zotero pdf export
|
||||
(document.getElementById("menu_export_files") as XUL.Element).disabled =
|
||||
(document.getElementById("menu_export_files") as XUL.Menuitem).disabled =
|
||||
!hidden;
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ class ZoteroViews extends AddonBase {
|
|||
id: style.styleID,
|
||||
locale: "",
|
||||
});
|
||||
const itemNode: XUL.Element = document.createElement("menuitem");
|
||||
const itemNode = document.createElement("menuitem") as XUL.Menuitem;
|
||||
itemNode.setAttribute("value", val);
|
||||
itemNode.setAttribute("label", style.title);
|
||||
itemNode.setAttribute("type", "checkbox");
|
||||
|
|
@ -340,9 +340,9 @@ class ZoteroViews extends AddonBase {
|
|||
Zotero.Prefs.set("Knowledge4Zotero.autoAnnotation", autoAnnotation);
|
||||
}
|
||||
|
||||
const menuitem: XUL.Element = _window.document.getElementById(
|
||||
const menuitem = _window.document.getElementById(
|
||||
"menu_autoannotation_betternotes"
|
||||
);
|
||||
) as XUL.Menuitem;
|
||||
if (autoAnnotation) {
|
||||
menuitem.setAttribute("checked", true);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue