Skip to content

Commit

Permalink
Release 1.0.0-6
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Sep 14, 2023
1 parent 17d1765 commit bb20b53
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zotero-actions-tags",
"version": "1.0.0-5",
"version": "1.0.0-6",
"description": "Action it, tag it, sorted.",
"config": {
"addonName": "Actions and Tags for Zotero",
Expand Down
4 changes: 2 additions & 2 deletions src/modules/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function dispatchRuleEvents(eventType: TagEventTypes, data: TagRuleData) {

function getRulesByEvent(event: TagEventTypes) {
return Array.from(addon.data.rules.data.values()).filter(
(rule) => rule.event === event && rule.enabled
(rule) => rule.event === event && rule.enabled,
);
}

Expand All @@ -28,7 +28,7 @@ function getRulesByShortcuts(shortcut: KeyModifier) {
(rule) =>
rule.enabled &&
rule.shortcut &&
new KeyModifier(rule.shortcut).equals(shortcut)
new KeyModifier(rule.shortcut).equals(shortcut),
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function initMenu() {
function buildItemMenu(win: Window) {
const doc = win.document;
const popup = doc.querySelector(
`#${config.addonRef}-itemPopup`
`#${config.addonRef}-itemPopup`,
) as XUL.MenuPopup;
// Remove all children in popup
while (popup.firstChild) {
Expand Down Expand Up @@ -62,7 +62,7 @@ function buildItemMenu(win: Window) {
};
}),
},
popup
popup,
);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/modules/preferenceWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function initUI() {
if (!isWindowAlive(addon.data.prefs.window)) return;
updateCachedRuleKeys();
addon.data.prefs.tableHelper = new ztoolkit.VirtualizedTable(
addon.data.prefs.window!
addon.data.prefs.window!,
)
.setContainerId(`${config.addonRef}-table-container`)
.setProp({
Expand Down Expand Up @@ -165,7 +165,7 @@ function getRowData(index: number) {
return {
event: getString(`prefs-rule-event-${TagEventTypes[rule.event]}`),
operation: getString(
`prefs-rule-operation-${TagOperationTypes[rule.operation]}`
`prefs-rule-operation-${TagOperationTypes[rule.operation]}`,
),
data: rule.data,
shortcut: rule.shortcut,
Expand Down Expand Up @@ -285,7 +285,7 @@ async function editRule(currentKey?: string) {
const content = await openEditorWindow(dialogData.data);
(
dialog.window.document.querySelector(
"#data-input"
"#data-input",
) as HTMLTextAreaElement
).value = content;
dialogData.data = content;
Expand Down Expand Up @@ -319,7 +319,7 @@ async function editRule(currentKey?: string) {
const key = ev.target as HTMLElement;
const win = dialog.window;
key.textContent = `[${getString(
"prefs-rule-edit-shortcut-placeholder"
"prefs-rule-edit-shortcut-placeholder",
)}]`;
dialogData.shortcut = "";
const keyDownListener = (e: KeyboardEvent) => {
Expand Down Expand Up @@ -430,7 +430,7 @@ async function openEditorWindow(content: string) {
const editorWin = addon.data.prefs.window?.openDialog(
"chrome://scaffold/content/monaco/monaco.html",
"monaco",
"chrome,centerscreen,dialog=no,resizable,scrollbars=yes,width=800,height=600"
"chrome,centerscreen,dialog=no,resizable,scrollbars=yes,width=800,height=600",
);
await waitUtilAsync(() => editorWin?.loadMonaco);
const { monaco, editor } = await editorWin.loadMonaco({
Expand Down
8 changes: 4 additions & 4 deletions src/utils/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function initRules() {
addon.data.rules.data = new ztoolkit.LargePref(
`${config.prefsPrefix}.rules`,
`${config.prefsPrefix}.rules.`,
"parser"
"parser",
).asMapLike() as TagRuleMap;
if (!getPref("rulesInit")) {
for (const key of defaultRules.keys()) {
Expand Down Expand Up @@ -128,7 +128,7 @@ async function applyRule(rule: TagRule, data: TagRuleData) {
item.removeTag(tag);
}
message = `Remove tag ${tags.join(",")} from item ${item.getField(
"title"
"title",
)}`;
break;
}
Expand All @@ -141,7 +141,7 @@ async function applyRule(rule: TagRule, data: TagRuleData) {
}
}
message = `Toggle tag ${tags.join(",")} to item ${item.getField(
"title"
"title",
)}`;
break;
}
Expand All @@ -150,7 +150,7 @@ async function applyRule(rule: TagRule, data: TagRuleData) {
try {
const func = new AsyncFunction("item, data, require", script);
message = await func(item, data, (module: string) =>
ztoolkit.getGlobal(module)
ztoolkit.getGlobal(module),
);
} catch (e) {
ztoolkit.log("Script Error", e);
Expand Down

0 comments on commit bb20b53

Please sign in to comment.