wshanks / Zutilo

Zotero plugin providing some additional editing features
Other
1.51k stars 72 forks source link

Shortcut not work (all software are latest version) #187

Closed ydprtm closed 3 years ago

ydprtm commented 3 years ago

Hi there,

I'm new to Zotero. Just installed it and this great addon, trying to replace Endnote.

My concern is any possible difference in the output style in this new software. So I frequently preview the Style Editor to check and find this addon to define a shortcut to open the Style Editor. But, none of the shortcuts I defined worked...

FYI, two shortcuts I defined:

My environment info as below:

[JavaScript Error: "ReferenceError: window is not defined" {file: "chrome://zotero/content/preferences/preferences.js" line: 144}] openInViewer@chrome://zotero/content/preferences/preferences.js:144:9 keys.shortcuts.openStyleEditor@chrome://zutilo/content/keys.js:338:5 createKey/<@chrome://zutilo/content/zoteroOverlay.js:1229:17

PS., Zotero is wired. The Error console has the "Copy" option for each message item after right-click, but never works!

qqobb commented 3 years ago

I could reproduce your issue with the Open Style Editor shortcut. While I don't understand why it's broken, I found a simple fix.

The Open Style Editor shortcut has been added with PR https://github.com/wshanks/Zutilo/pull/44. The relevant Zutilo code is here. It's using the code from https://github.com/wshanks/Zutilo/issues/41#issuecomment-136248872, which still works in Zotero's JavaScript API. However, when the openInViewer command is executed in Zutilo, it seems that these lines throw a "window undefined" error. I don't understand much about this, but I suspect that some of the Fx60 changes (see, e.g., here) might be at the root of this issue.

Luckily, there's a simple fix that doesn't require calling the openInViewer command. We can now call the openStyleEditor() function (here) from the Tools -> Developer menu (here).

I'll create a pull request for this fix. In the meantime, you can use Alt+T+D+S as a shortcut.

Items pane next tab: F6

This will most likely not work, see https://github.com/wshanks/Zutilo/issues/122.

The Error console has the "Copy" option for each message item after right-click, but never works!

Yes, this seems to be a Zotero bug. You can select the message and use Ctrl+C instead. Zotero's desktop client is currently based on Firefox. The Zotero developers are planning to update the Firefox base later this year, see here. Maybe this bug will be resolved when that update happens.