MediaWiki talk:Gadget-ImageAnnotator.js

Installing ImageAnnotator on another Wiki
Image notes are only visible when the ImageAnnotator gadget is installed and activated (either by default for all users, or the viewing user has the gadget enabled). This means that notes added here at the Commons are not visible at other Wikis unless the gadget is installed there, too.

To install the gadget on another Wiki, follow these steps:
 * 1) Copy the following files from the Commons onto your own Wiki:
 * 2) *MediaWiki:Gadget-ImageAnnotator.js
 * 3) *MediaWiki:LAPI.js
 * 4) *MediaWiki:TextCleaner.js
 * 5) *MediaWiki:Tooltips.js
 * 6) *MediaWiki:UIElements.js
 * 7) *MediaWiki:AjaxSubmit.js
 * 8) *MediaWiki:Gadget-DisableImageAnnotator.js
 * 9) Set up MediaWiki:Gadget-DisableImageAnnotator.js as a gadget on your Wiki: copy MediaWiki:Gadget-DisableImageAnnotator to your Wiki and add the line "DisableImageAnnotator|DisableImageAnnotator.js" to MediaWiki:Gadgets-definition on your Wiki.
 * 10) To set it up ImageAnnotator as a gadget, write a description of it at MediaWiki:Gadget-ImageAnnotator on your Wiki, and add the line "ImageAnnotator|ImageAnnotator.js" to MediaWiki:Gadgets-definition (also on your Wiki).
 * 11) To enable the gadget for everyone, you may skip step 3 and instead add the line "if (wgNamespaceNumber != -1) importScript ('MediaWiki:Gadget-ImageAnnotator.js');" to MediaWiki:Common.js on your Wiki. (Or take a look at our MediaWiki:Common.js to see how we do this and copy that code over to your Wiki.)
 * 12) Copy the templates Template:ImageNote, Template:ImageNoteEnd, and Template:ImageWithNotes to your Wiki and protect them.
 * 13) Copy the templates MediaWiki:ImageAnnotatorTexts and MediaWiki:ImageAnnotatorUITexts to your Wiki.
 * 14) Modify MediaWiki:ImageAnnotatorTexts to adapt it to your Wiki's default language. Replace the string lang="en" (one occurrence) as appropriate; e.g. at the Arabic Wikipedia, use lang="ar".
 * 15) If you want, also create user interface texts in your language in the MediaWiki-messages noted above. The messages in the default language of the Wiki always go into the pages without suffix. For other languages, use suffixes. On the Arabic Wikipedia, for instance, you'd put Arabic text at MediaWiki:ImageAnnotatorEditorLabel and the English text at MediaWiki:ImageAnnotatorEditorLabel/en.

The gadget will work for files uploaded locally on your Wiki exactly as it does for files here at the Commons. For non-local files (files hosted here at the Commons, but viewed on your Wiki), the script will enable viewing of the notes (if there are any), but will not allow modifying them. Modification of notes is possible only if the user views the file at the Wiki where the file actually resides.

Note: the above instructions assume that you want to install the gadget on another WMF project. If you are using a MediaWiki installation that does not serve wikibits.js, you are on your own. You will have to modify the scripts to use whatever environment your Wiki provides (in particular script loading and getElementsByClassName).