Giter Site home page Giter Site logo

windingwind / zotero-plugin-toolkit Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 13.0 600 KB

Toolkit for Zotero Plugin Developers.

Home Page: https://www.npmjs.com/package/zotero-plugin-toolkit

License: MIT License

TypeScript 99.98% Shell 0.02%
npm-package zotero zotero-addon zotero-api zotero-plugin

zotero-plugin-toolkit's People

Contributors

dominic-dallosto avatar jiaojiaodubai avatar muisedestiny avatar northword avatar raykr avatar retorquere avatar volatile-static avatar windingwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zotero-plugin-toolkit's Issues

Is it possible to obtain the precise coordinates of the selected text in a PDF document through the plugin?

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~

registering prefpane fails

I'm using the toolkit to load this prefpane: https://gist.github.com/988368e73613c8f3a44240afa7854ecf

but that gets me

error log
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

[WARN] Bug with the `Guide` tool on v2.3.34 - v2.3.36

Affected Plugins

As far as I know, only some previous versions of the Better Notes plugin.

  1. If you are not using the Guide tool, you are not affected;
  2. If you are not on v2.3.34, v2.3.35, or v2.3.36, you are not affected.

Description

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.

TypeError: tabbox is null

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:

image

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

Can't pass a directory to FilePicker

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:

  • passing a directory and a filename to the suggestion parameter - the directory is stripped and only the filename is used
  • passing only a directory - the name of the last folder is used as the suggested filename

Let me know if I'm missing something!

Platform: Windows 10
Zotero Version: 7
Zotero Toolkit Version: 2.3.35

Redundant logs in Zotero console

你好,

首先,十分感谢对该toolkit的开发,极大地缩短了插件的开发周期!

不知道是不是我设置的不对,不管我把 process.env.NODE_ENV 设置为development 还是 production,我都会在Zotero的Console中看到以下log:

bug

请问如何屏蔽到这些?

另外打包时,无论有没有用到,都会将该toolkit中全部的代码都打包在内吗?

谢谢!

guide: do not recognize window out-of-focus as the next step

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?

How can I access the metadata/file paths of all a users's saved files?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.