Skip to content

Commit fc3b13a

Browse files
committed
Release 1.0.0-21
1 parent e74b2bf commit fc3b13a

File tree

8 files changed

+32
-29
lines changed

8 files changed

+32
-29
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zotero-actions-tags",
3-
"version": "1.0.0-20",
3+
"version": "1.0.0-21",
44
"description": "Action it, tag it, sorted.",
55
"config": {
66
"addonName": "Actions and Tags for Zotero",

src/addon.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { ProgressWindowHelper } from "zotero-plugin-toolkit/dist/helpers/progressWindow";
2-
import { ColumnOptions, VirtualizedTableHelper } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
2+
import {
3+
ColumnOptions,
4+
VirtualizedTableHelper,
5+
} from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
36
import { createZToolkit } from "./utils/ztoolkit";
47
import { ActionMap } from "./utils/actions";
58
import { KeyModifier } from "./utils/shorcut";

src/hooks.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function onStartup() {
3232

3333
await addon.api.actionManager.dispatchActionByEvent(
3434
ActionEventTypes.programStartup,
35-
{}
35+
{},
3636
);
3737

3838
initReaderShortcuts();
@@ -47,7 +47,7 @@ async function onMainWindowLoad(win: Window): Promise<void> {
4747
ActionEventTypes.mainWindowLoad,
4848
{
4949
window: win,
50-
}
50+
},
5151
);
5252
}
5353

@@ -57,7 +57,7 @@ async function onMainWindowUnload(win: Window): Promise<void> {
5757
ActionEventTypes.mainWindowUnload,
5858
{
5959
window: win,
60-
}
60+
},
6161
);
6262
}
6363

src/modules/menu.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function initMenu(win: Window) {
3636
},
3737
],
3838
},
39-
win.document.querySelector("popupset")!
39+
win.document.querySelector("popupset")!,
4040
);
4141
const image =
4242
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAA40lEQVRYCWP8//8/AyFwJL/hjsbXJ8oEFSKBG9wyd20mNqgQUsdESMGCypkppFoOAiA924s711PsAOmfb2NItRwGWP7/FaTYAbQGow4YdcCoA0YdMOqAUQcMuANYCCm4yS394AWboD05hn9k5XrgSqkDjgloPiDHcih4kENAwWgaGHXAqAModcBFKB4QB4AsdoBish1BrgPAli8rNvsAwpQ4ghwHLIRZDhNAcsRCUg0jWBSjW76s2CwBmwTUEQlRvadA3HhiDSQlBHBajuYQkBqiQ4JYBxQSYzmaIwoJKmRgYAAAgCNBYXH3oBUAAAAASUVORK5CYII=";
@@ -85,23 +85,23 @@ function initMenu(win: Window) {
8585
classList: ["button-background"],
8686
},
8787
],
88-
})
88+
}),
8989
);
9090
append(
9191
ztoolkit.UI.createElement(doc, "style", {
9292
id: `${config.addonRef}-reader-button`,
9393
properties: {
9494
textContent: readerButtonCSS,
9595
},
96-
})
96+
}),
9797
);
9898
});
9999
}
100100

101101
function buildItemMenu(win: Window, target: "item" | "reader") {
102102
const doc = win.document;
103103
const popup = doc.querySelector(
104-
`#${config.addonRef}-${target}-popup`
104+
`#${config.addonRef}-${target}-popup`,
105105
) as XUL.MenuPopup;
106106
// Remove all children in popup
107107
while (popup.firstChild) {
@@ -140,7 +140,7 @@ function buildItemMenu(win: Window, target: "item" | "reader") {
140140
};
141141
}),
142142
},
143-
popup
143+
popup,
144144
);
145145
}
146146
}
@@ -162,7 +162,7 @@ function getActionsByMenu() {
162162
}
163163
return ((x[sortBy] as string) || "").localeCompare(
164164
(y[sortBy] || "") as string,
165-
Zotero.locale
165+
Zotero.locale,
166166
);
167167
});
168168
}

src/modules/preferenceWindow.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function initUI() {
2222
const renderLock = Zotero.Promise.defer();
2323
if (!isWindowAlive(addon.data.prefs.window)) return;
2424
addon.data.prefs.tableHelper = new ztoolkit.VirtualizedTable(
25-
addon.data.prefs.window!
25+
addon.data.prefs.window!,
2626
)
2727
.setContainerId(`${config.addonRef}-table-container`)
2828
.setProp({
@@ -99,7 +99,7 @@ function initEvents() {
9999
.querySelector(`#${config.addonRef}-rule-add`)
100100
?.addEventListener("command", (e) => {
101101
const key = addon.api.actionManager.updateAction(
102-
Object.assign({}, emptyAction)
102+
Object.assign({}, emptyAction),
103103
);
104104
updateUI();
105105
editAction(key);
@@ -134,7 +134,7 @@ function getRowData(index: number) {
134134
return {
135135
event: getString(`prefs-rule-event-${ActionEventTypes[action.event]}`),
136136
operation: getString(
137-
`prefs-rule-operation-${ActionOperationTypes[action.operation]}`
137+
`prefs-rule-operation-${ActionOperationTypes[action.operation]}`,
138138
),
139139
data: action.data,
140140
shortcut: action.shortcut,
@@ -274,7 +274,7 @@ async function editAction(currentKey?: string) {
274274
const content = await openEditorWindow(dialogData.data);
275275
(
276276
dialog.window.document.querySelector(
277-
"#data-input"
277+
"#data-input",
278278
) as HTMLTextAreaElement
279279
).value = content;
280280
dialogData.data = content;
@@ -308,7 +308,7 @@ async function editAction(currentKey?: string) {
308308
const key = ev.target as HTMLElement;
309309
const win = dialog.window;
310310
key.textContent = `[${getString(
311-
"prefs-rule-edit-shortcut-placeholder"
311+
"prefs-rule-edit-shortcut-placeholder",
312312
)}]`;
313313
dialogData.shortcut = "";
314314
const keyDownListener = (e: KeyboardEvent) => {
@@ -414,7 +414,7 @@ async function editAction(currentKey?: string) {
414414
menu: dialogData.menu,
415415
name: dialogData.name,
416416
},
417-
currentKey
417+
currentKey,
418418
);
419419
updateUI();
420420
}
@@ -436,7 +436,7 @@ async function openEditorWindow(content: string) {
436436
const editorWin = addon.data.prefs.window?.openDialog(
437437
"chrome://scaffold/content/monaco/monaco.html",
438438
"monaco",
439-
"chrome,centerscreen,dialog=no,resizable,scrollbars=yes,width=800,height=600"
439+
"chrome,centerscreen,dialog=no,resizable,scrollbars=yes,width=800,height=600",
440440
) as
441441
| (Window & {
442442
loadMonaco: (options: Record<string, any>) => Promise<{ editor: any }>;

src/modules/shortcuts.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ function initReaderShortcuts() {
2020
() => (reader._internalReader?._primaryView as any)?._iframeWindow,
2121
() =>
2222
_initShortcuts(
23-
(reader._internalReader._primaryView as any)?._iframeWindow
24-
)
23+
(reader._internalReader._primaryView as any)?._iframeWindow,
24+
),
2525
);
2626
});
2727
}

src/utils/actions.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function initActions() {
101101
addon.data.actions.map = new ztoolkit.LargePref(
102102
`${config.prefsPrefix}.rules`,
103103
`${config.prefsPrefix}.rules.`,
104-
"parser"
104+
"parser",
105105
).asMapLike() as ActionMap;
106106
if (!getPref("rulesInit")) {
107107
for (const key of defaultActions.keys()) {
@@ -149,7 +149,7 @@ function initActions() {
149149

150150
function updateCachedActionKeys() {
151151
addon.data.actions.cachedKeys = Array.from(
152-
addon.data.actions.map.keys()
152+
addon.data.actions.map.keys(),
153153
).sort((a, b) => {
154154
const actionA = addon.data.actions.map.get(a);
155155
const actionB = addon.data.actions.map.get(b);
@@ -160,13 +160,13 @@ function updateCachedActionKeys() {
160160
actionA[
161161
addon.data.prefs.columns[addon.data.prefs.columnIndex]
162162
.dataKey as keyof ActionData
163-
] || ""
163+
] || "",
164164
);
165165
const valueB = String(
166166
actionB[
167167
addon.data.prefs.columns[addon.data.prefs.columnIndex]
168168
.dataKey as keyof ActionData
169-
] || ""
169+
] || "",
170170
);
171171

172172
return addon.data.prefs.columnAscending
@@ -222,7 +222,7 @@ async function applyAction(rule: ActionData, args: ActionArgs) {
222222
}
223223
}
224224
message = `Toggle tag ${tags.join(",")} to item ${item?.getField(
225-
"title"
225+
"title",
226226
)}`;
227227
break;
228228
}
@@ -269,7 +269,7 @@ async function applyAction(rule: ActionData, args: ActionArgs) {
269269
const actions = getActions();
270270
// Find the action by name
271271
const action = Object.values(actions).find(
272-
(action) => action.name === rule.data
272+
(action) => action.name === rule.data,
273273
);
274274
if (action) {
275275
await applyAction(action, args);
@@ -290,7 +290,7 @@ async function applyAction(rule: ActionData, args: ActionArgs) {
290290
function getActions(): Record<string, ActionData>;
291291
function getActions(key: string): ActionData | undefined;
292292
function getActions(
293-
key?: string
293+
key?: string,
294294
): Record<string, ActionData> | ActionData | undefined {
295295
if (!key) {
296296
const map = addon.data.actions.map;

update-beta.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
"updates": [
55
{
6-
"version": "1.0.0-20",
7-
"update_link": "https://github.com/windingwind/zotero-actions-tags/releases/download/v1.0.0-20/zotero-actions-tags.xpi",
6+
"version": "1.0.0-21",
7+
"update_link": "https://github.com/windingwind/zotero-actions-tags/releases/download/v1.0.0-21/zotero-actions-tags.xpi",
88
"applications": {
99
"zotero": {
1010
"strict_min_version": "6.999"

0 commit comments

Comments
 (0)