<googlemap version="0.9" lat="42.711618" lon="-73.205112"> </googlemap>
<sgallery height="600" width="800" showinfopane="false"> Image:IMG_0350.JPG Image:IMG_0351.JPG </sgallery>
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.
Installing from scratch
- Note: if you want to upgrade an existing installation to the latest version, do not follow these steps. Follow the steps in the section "Upgrading an installation" below.
To install the gadget on another Wiki, follow these steps:
- Copy the following files from the Commons onto your own Wiki:
- 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.
- 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).
- 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.)
- Copy the templates Template:ImageNote, Template:ImageNoteEnd, and Template:ImageWithNotes to your Wiki and protect them. Don't forget to adapt the category and the namespace selector (replace "File" as appropriate) in Template:ImageNote.
- Copy the templates Template:ImageAnnotations, Template:InlineImageAnnotations, and Template:ImageNoteColors to your Wiki.
- Copy the templates MediaWiki:ImageAnnotatorTexts, MediaWiki:ImageAnnotatorUITexts, and MediaWiki:ImageAnnotatorEditSummaries to your Wiki.
- 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".
- Translate the texts in the edit summaries into the content language of your wiki.
- 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).