From cb22bfa300677e6e2943db954ead849d59975dbb Mon Sep 17 00:00:00 2001 From: Wil Thomason Date: Tue, 16 May 2023 17:42:09 -0500 Subject: [PATCH] Add template keys for Zotero PDF opening URI and library location for custom Zotero URIs --- README.md | 4 +++- content/zotodo.ts | 6 +++++- locale/en-US/zotodo.dtd | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 70cba60..fc3c98a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Scaffolded with the wonderful - Customizable project, section, and due date settings - Customizable labels for tasks - Generate Zotero select links +- Generate Zotero PDF opening links ## Installation 1. Download the [latest version](https://github.com/wbthomason/zotodo/releases/latest) of the `.xpi`. @@ -32,4 +33,5 @@ Scaffolded with the wonderful - [x] Create project/labels if nonexistent - [ ] OAuth flow for getting authorization key - [ ] Set project by Zotero collection -- [ ] Add more template tokens +- [x] Add more template tokens +- [ ] Switch to official Todoist API client diff --git a/content/zotodo.ts b/content/zotodo.ts index 2129b7f..faef8e2 100644 --- a/content/zotodo.ts +++ b/content/zotodo.ts @@ -115,7 +115,7 @@ class TodoistAPI { public async createTask(task_data: TaskData) { const icon = `chrome://zotero/skin/spinner-16px${Zotero.hiDPI ? '@2x' : '' - }.png` + }.png` const progWin = show(icon, 'Creating task', 'Making Todoist task for item') if (this.token == null || this.token === '') { this.token = getPref('todoist_token') @@ -622,6 +622,8 @@ class Zotodo { // tslint:disable-line:variable-name } const select_uri = `zotero://select/${library_path}/items/${item_id}` + let open_uri = '' + if (pdf_id != -1) { open_uri = `zotero://open-pdf/${library_path}/items/${item_id}` } let citekey = '' if ( typeof Zotero.BetterBibTeX === 'object' && @@ -641,8 +643,10 @@ class Zotodo { // tslint:disable-line:variable-name pdf_id, et_al, authors, + library_path, item_id, select_uri, + open_uri, citekey, } diff --git a/locale/en-US/zotodo.dtd b/locale/en-US/zotodo.dtd index 57ac475..a3b339f 100644 --- a/locale/en-US/zotodo.dtd +++ b/locale/en-US/zotodo.dtd @@ -14,7 +14,7 @@ - +