Progress Window

29 views
Skip to first unread message

Brenton Wiernik

unread,
Nov 29, 2017, 5:51:18 PM11/29/17
to zotero-dev
Is it possible for a plugin to call the Zotero progress window? And if so, how would I do that? I have a plugin that can be made to perform a lookup query on a large number of items, and I'd like to be able to give the user an indicator of progress on the operation if it is a very large number of items.

Adomas Venčkauskas

unread,
Nov 30, 2017, 10:08:52 AM11/30/17
to zotero-dev
See, e.g. this piece of code that invokes the progress window. The progressWindow.js file should make sense for figuring out the API.

Brenton Wiernik

unread,
Nov 30, 2017, 2:30:41 PM11/30/17
to zotero-dev
Thanks!

Another question, I'm having a hard time adding menu items to the zotero-doi-menu popup in itembox.xml. Just calling <popup id="zotero-doi-menu"> or <menupopup id="zotero-doi-menu"> from my overlay.xul to add items to the menu doesn't work the way that it does for zotero-itemmenu, zotero-collectionmenu, etc. Is there another method I need to use to modify that popup?

Brenton Wiernik

unread,
Dec 3, 2017, 4:21:45 PM12/3/17
to zotero-dev
Adomas,

Is there a function to replace the progress window text, rather than append it? I'd like to replace the description with "Item X of Y", etc. as it iterates over the list of selected items, but don't need to display item titles or other data—I'd rather not show 200 lines in the window if the user selects a large number of items.

Adomas Venčkauskas

unread,
Dec 3, 2017, 4:25:37 PM12/3/17
to zoter...@googlegroups.com
Another question, I'm having a hard time adding menu items to the zotero-doi-menu popup in itembox.xml. Just calling <popup id="zotero-doi-menu"> or <menupopup id="zotero-doi-menu"> from my overlay.xul to add items to the menu doesn't work the way that it does for zotero-itemmenu, zotero-collectionmenu, etc. Is there another method I need to use to modify that popup?
 
Regarding the itembox, I'm very shallowly familiar with the xbl stuff, so maybe Dan can offer advice. Otherwise you'd have to go mine MDN for information.

Is there a function to replace the progress window text, rather than append it? I'd like to replace the description with "Item X of Y", etc. as it iterates over the list of selected items, but don't need to display item titles or other data—I'd rather not show 200 lines in the window if the user selects a large number of items.

I don't think there are, but you can always add one.

Dan Stillman

unread,
Dec 3, 2017, 7:01:01 PM12/3/17
to zoter...@googlegroups.com
On 11/30/17 2:30 PM, Brenton Wiernik wrote:
> Another question, I'm having a hard time adding menu items to the
> zotero-doi-menu popup in itembox.xml. Just calling <popup
> id="zotero-doi-menu"> or <menupopup id="zotero-doi-menu"> from my
> overlay.xul to add items to the menu doesn't work the way that it does
> for zotero-itemmenu, zotero-collectionmenu, etc. Is there another
> method I need to use to modify that popup?

I don't think a normal XUL overlay will work for an XBL binding, so
you'd probably need to do it in code, possibly using
._id('zotero-doi-menu') on the item box to get that element. Not sure if
that content is torn down between views, but if so you might need to
alter it whenever it's reinitialized.

> Is there a function to replace the progress window text, rather than
> append it? I'd like to replace the description with "Item X of Y",
> etc. as it iterates over the list of selected items, but don't need to
> display item titles or other data—I'd rather not show 200 lines in the
> window if the user selects a large number of items.

Have you looked at the object-oriented version of that API?

https://github.com/zotero/zotero/blob/816fb52b76cff576f7eedc7bae568d66c4464d2b/chrome/content/zotero/fileInterface.js#L345

Brenton Wiernik

unread,
Dec 5, 2017, 10:02:21 AM12/5/17
to zotero-dev
Thanks, Dan. Those are really helpful.
Reply all
Reply to author
Forward
0 new messages