Wiki source code of Attachment Picker WebJar

Last modified by Eleni Cojocariu on 2026/10/01 09:49

Show last authors
1 The Attachment Picker WebJar holds the JavaScript of the [[attachmentGalleryPicker macro>>doc:documentation.xs.dev.attachments.attachmentgallerypicker-macro.WebHome]]: one RequireJS module that turns markup into a working picker, and one that searches the wiki for attachments. Every XWiki instance already carries it, through the flavor.
2
3 == Modules ==
4
5 |=Module|=What ##define()## returns|=Requires
6 |##xwiki-attachment-picker##|Nothing. Loading it registers the jQuery plugin and the automatic initialisation.|##jquery##, ##xwiki-attachments-icon##, ##xwiki-l10n!##, ##xwiki-attachment-picker-solr-search##
7 |##xwiki-attachment-picker-solr-search##|The ##SolrSearch## class.|##jquery##
8 |##xwiki-attachment-picker-translation-keys##|The descriptor ##xwiki-l10n!## reads to fetch the four messages. Internal: defined in the same file as the picker, with no RequireJS name of its own outside the WebJar.|Nothing
9
10 Load [[the picker module>>doc:documentation.xs.dev.attachments.attachment-picker-webjar.picker-module.WebHome]] to build a picker the macro cannot render, or [[the search module>>doc:documentation.xs.dev.attachments.attachment-picker-webjar.search-module.WebHome]] to reuse its search without a picker at all.
11
12 ##xwiki-attachments-icon## comes from the XWiki web application rather than from this WebJar, ##xwiki-l10n!##, the RequireJS loader plugin, from the [[Front-end Localization WebJar>>doc:documentation.xs.dev.front-end.localization.webjar.WebHome]], and the search reaches the wiki's Solr index through a wiki page of the instance. The modules therefore run inside an XWiki page and nowhere else.

Get Connected