-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ItemBoxAPI2 #3255
base: main
Are you sure you want to change the base?
ItemBoxAPI2 #3255
Conversation
Can you rebase this on current main? |
abad6a2
to
2e9937e
Compare
rebased |
/** | ||
* Registers custom row(s) for the item box element. | ||
* Note that the `dataKey` you use here may be different from the one returned by the function. | ||
* This is because the `dataKey` is prefixed with the `pluginID` to avoid conflicts after the column is registered. | ||
* @param {ItemBoxCustomRowOptions | ItemBoxCustomRowOptions[]} options - Options for the custom row. | ||
* @example | ||
* Register an uneditable single row. The row will be appended to the end of the item box. | ||
* ```js | ||
* const registeredDataKey = await Zotero.ItemBoxManager.registerRows({ | ||
* dataKey: 'rtitle', | ||
* label: 'Reversed Title', | ||
* pluginID: 'make-it-red@zotero.org', | ||
* dataProvider: (item, dataKey) => item.getField('title').split('').reverse().join(''), | ||
* dataSetter: (item, dataKey, value) => Zotero.debug(`Item ${item.getField("title")}'s reversed title is ${value} now.`), | ||
* }); | ||
* ``` | ||
* @example | ||
* Register an editable multiline row | ||
* ```js | ||
* const registeredDataKey = await Zotero.ItemBoxManager.registerRows({ | ||
* dataKey: 'rabstract', | ||
* label: 'Reversed Abstract', | ||
* pluginID: 'make-it-red@zotero.org', // plugin ID, which will be used to unregister the row when the plugin is unloaded | ||
* editable: true, | ||
* multiline: true, | ||
* index: 1, | ||
* dataProvider: (item, dataKey) => item.getField('abstractNote').split('').reverse().join(''), | ||
* dataSetter: (item, dataKey, value) => Zotero.debug(`Item ${item.getField("title")}'s reversed abstract is ${value} now.`), | ||
* expandStateGetter: (item, dataKey) => Zotero.Prefs.get("extensions.make-it-red.reversedAbstractExpanded", true), | ||
* expandStateSetter: (item, dataKey, expanded) => Zotero.Prefs.set("extensions.make-it-red.reversedAbstractExpanded", expanded, true) | ||
* }); | ||
* ``` | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples are here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples are updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, mostly nitpicky! This looks quite good to me in general.
For reference: I believe this is the PR hinted at in the zotero-dev group which removes the final remaining blocker for better bibtex Zotero 7 support (retorquere/zotero-better-bibtex#2522). |
No description provided.