windingwind / zotero-plugin-toolkit Goto Github PK
View Code? Open in Web Editor NEWToolkit for Zotero Plugin Developers.
Home Page: https://www.npmjs.com/package/zotero-plugin-toolkit
License: MIT License
Toolkit for Zotero Plugin Developers.
Home Page: https://www.npmjs.com/package/zotero-plugin-toolkit
License: MIT License
I am learning how to develop a zotero plugin.
Specifically, the purpose is to retrieve the coordinates of the selected text in relation to the PDF page, and subsequently display relevant hints proximal to the text. However, such an outcome has yet to be achieved.
I have attempted to obtain the 'selection', then get the range
by selection.getRangeAt(0)
. Unfortunately, this approach has been hindered by the persistent outcome whereby Selection.isCollapsed
is always set to true
.
Consequently, coordinates for the selected text are consistently registering as 0.
Several methods have been employed in an attempt to obtain the 'selection', including:
readerinstance._iframeWindow?.getSelection()
readerinstance._iframeWindow?.document.getSelection()
window.getSelection()
which listens to the selectionchange
event.These efforts have proved futile. As such, I am seeking further guidance or recommendations to resolve this issue.
Thank you in advance for your enthusiasm~
Passing a URI to Zotero.File.getContentsAsync() is deprecated -- use Zotero.HTTP.request() instead
I'm using the toolkit to load this prefpane: https://gist.github.com/988368e73613c8f3a44240afa7854ecf
but that gets me
console.trace:
chrome://zotero-better-bibtex/content/better-bibtex.js 2907 log
chrome://zotero-better-bibtex/content/better-bibtex.js 3187 parseXHTMLToFragment
chrome://zotero-better-bibtex/content/better-bibtex.js 3660 node_modules/zotero-plugin-toolkit/dist/managers/preferencePane.js/register/onOpenWindow/<
console.groupEnd:
zotero(3)(+0000005): {"location":null}
console.groupCollapsed: ({})
console.trace:
chrome://zotero-better-bibtex/content/better-bibtex.js 2907 log
chrome://zotero-better-bibtex/content/better-bibtex.js 3661 node_modules/zotero-plugin-toolkit/dist/managers/preferencePane.js/register/onOpenWindow/<
console.groupEnd:
zotero(3)(+0000002): {}
JavaScript error: chrome://global/content/bindings/tabbox.xml, line 250: TypeError: children[i].getAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
JavaScript error: chrome://global/content/bindings/menulist.xml, line 236: TypeError: val.setAttribute is not a function
..... lots more
In preferencepanemanager.register, where does ZoteroCompat
come from?
The use of Zotero.File.getContentsAsync() in the following file seems to cause the deprecation warning as mentioned in the title.
As far as I know, only some previous versions of the Better Notes plugin.
Guide
tool, you are not affected;It is known that quitting the app while the panel of the Guide
tool is activated might cause the popup autohide flag to be changed and can cause various kinds of popups not to be hidden on unfocus.
This bug is fixed in the latest release of the plugin-toolkit.
This is really nice library. I noticed a display issue related to the prompt window under Ubuntu dark mode:
I believe it is related to the border-radius setting for the input:
zotero-plugin-toolkit/src/managers/prompt.ts
Line 638 in e896eaa
More broadly, how can I customize this prompt UI element, such as its style and keyboard shortcut?
Thanks!
It seems that in Zotero 6 compat code, the url is still hard-coded
zotero-plugin-toolkit/src/managers/preferencePane.ts
Lines 217 to 220 in 1299bf6
I'm trying to set up the template to create a new Zotero plugin, so I followed the quick start guide from the README.
When running npm run start
, Zotero is launched with the example add-on trying to load itself, but an error occurs:
Specifically, this line is the one that errors out.
If I comment it out, everything else works as expected, but unfortunately, I need to interact with a tab panel in my plugin.
Zotero version: Zotero-7.0.0-beta.68+c31a40c74_win-x64
I'm only able to pass a suggested filename to the file picker, not a suggested directory. It would be nice to have this funtionality as well and the underlying Zotero FilePicker supports it.
I tried:
suggestion
parameter - the directory is stripped and only the filename is usedLet me know if I'm missing something!
Platform: Windows 10
Zotero Version: 7
Zotero Toolkit Version: 2.3.35
zotero-plugin-toolkit/src/tools/ui.ts
Line 29 in ca24c81
In the current guide module, the guide goes to the next step when clicking next, when clicking at the mask, or when the window is out of focus, which doesn't make sense to me. The window being out of focus could mean that the user has gone on to something else without finishing reading the content of the step, and the guide should remain as it is instead of going to the next step.
Also, would it make more sense to bind esc to exit the entire guide process instead of the next step?
New user of the library here. I was looking through the docs and couldn't find anything on this. How can I access a user's saved items? I'm building a tool that backs up data in a private cloud so I want to get a list of all the metadata of the users items and push them to my DB.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.