Help talk:Gadget-ImageAnnotator
This is the talk page for the experimental ImageAnnotator feature. If you experience any bugs or other problems while trying it out, or if you have suggestion improvements, please leave a note here. Lupo 11:10, 8 March 2010 (UTC)
"Add a note" button not present
Hello, I followed the install guide on [1]Gadget-ImageAnnotator/Installation but the "Add a note" button is not present. Anyone can help? I have also added $wgUseAjax = true; in LocalSettings.php Poymode (talk) 11:14, 22 March 2010 (UTC)
- That question belongs here. ManishEarthTalk • Stalk 11:26, 22 March 2010 (UTC)
- Yes, but since he's asked and I've seen it, I'll answer it here: do you have the read API enabled on your wiki? Does your wiki serve the normal wikibits.js? Did you adapt the configuration to the setup of your wiki? Did you change the
LAPI_file_store
variable in MediaWiki:LAPI.js on your wiki as appropriate? Can you post a URL to your wiki (if it's public, of course)? Lupo 12:44, 22 March 2010 (UTC)- What do you mean by the read API? Yes, I have wikibits.js. This is from the source of my main page:
<script type="text/javascript" src="/wiki/skins/common/wikibits.js?207"></script>
. Actually, I haven't made my wiki live yet. Still testing it on my local. This is my LAPI_file_store:var LAPI_file_store = "http://10.48.30.154/wiki/images/";
. btw, sorry for posting in unappropriate section.Poymode (talk) 03:26, 23 March 2010 (UTC)- Does your wiki really generate image urls containing an IP? The read API is enabled by setting $wgEnableAPI to
true
in LocalSettings.php. Lupo 08:58, 23 March 2010 (UTC)- Well, yes. For example if I entered http://10.48.30.154/wiki/images/logo.png then the logo would show up. I just enabled my $wgEnableAPI and set it to true. Any core pages that should be customized? Is the LAPI_file_store very important? I was thinking that all images in the variable's Path will the only ones be considered by the ImageAnnotator, Am I right on this? Poymode (talk) 10:00, 23 March 2010 (UTC)
- No, you shouldn't need to customize any core php pages. But you should have ParserFunctions installed; otherwise the templates won't work. Lupo 11:14, 23 March 2010 (UTC)
- Go to a file description page. What's the value of the src attribute of the preview image you see there? That's what
LAPI_file_store
should match. It's used to make sure that things taken to be images are really some image coming from your wiki. It's necessary because MediaWiki installations can also be configured to allow direct off-site image display. Lupo 11:14, 23 March 2010 (UTC) - Question for Lupo: shouldn't the write API be enabled, too? I'm not too good in MW variables, but I can see that ImgAnnotater uses AJAX to save the annotations. ManishEarthTalk • Stalk 10:05, 23 March 2010 (UTC)
- No, the write API is not necessary. That was a conscious design decision, because while it is activated on the WMF servers, it might not be for other installations. Lupo 11:15, 23 March 2010 (UTC)
- Well, yes. For example if I entered http://10.48.30.154/wiki/images/logo.png then the logo would show up. I just enabled my $wgEnableAPI and set it to true. Any core pages that should be customized? Is the LAPI_file_store very important? I was thinking that all images in the variable's Path will the only ones be considered by the ImageAnnotator, Am I right on this? Poymode (talk) 10:00, 23 March 2010 (UTC)
- Does your wiki really generate image urls containing an IP? The read API is enabled by setting $wgEnableAPI to
- What do you mean by the read API? Yes, I have wikibits.js. This is from the source of my main page:
- Yes, but since he's asked and I've seen it, I'll answer it here: do you have the read API enabled on your wiki? Does your wiki serve the normal wikibits.js? Did you adapt the configuration to the setup of your wiki? Did you change the
So its not required for AJAX editing? Surprising... ManishEarthTalk • Stalk 11:43, 23 March 2010 (UTC)
- To Lupo: Hello Lupo, I have uploaded my sample wiki. Please check link WIKI. The "Add a note" button still isn't showing.Poymode (talk) 10:23, 24 March 2010 (UTC)
- I cannot connect to your wiki. DNS doesn't know "boinky.me". Lupo 11:22, 24 March 2010 (UTC)
- I can connect... ManishEarthTalk • Stalk 12:21, 24 March 2010 (UTC)
- Add
var wgMainpage = "Main Page";
to Common.js (It should be predefined...)- Don't you mean
wgMainPageTitle
? But yes, that variable should be served and set automatically. If it isn't on boinky.me, something is fundamentally wrong with that setup. Poymode, what MediaWiki-Version is your wiki running? Lupo 12:47, 24 March 2010 (UTC)- Allright, I see that this variable was added only on Aug 4, 2009 and is thus available only as of MediaWiki 1.16, but not in earlier versions. I'll add a guard in commons:MediaWiki:ImageAnnotatorConfig.js, where it is used. Lupo 12:55, 24 March 2010 (UTC)
- Don't you mean
- Add
- I can connect... ManishEarthTalk • Stalk 12:21, 24 March 2010 (UTC)
- I cannot connect to your wiki. DNS doesn't know "boinky.me". Lupo 11:22, 24 March 2010 (UTC)
- To Lupo: Hello Lupo, I have uploaded my sample wiki. Please check link WIKI. The "Add a note" button still isn't showing.Poymode (talk) 10:23, 24 March 2010 (UTC)
I am currently using 1.15.2. How important is the said variable? I already set it in Common.js but still no avail of an add button 13:41, 24 March 2010 (UTC)
- The variable is used in one of the scripts (MediaWiki:ImageAnnotatorConfig.js), which isn't loading because its broken. You'll get an error code:
http://boinky.me/wiki/index.php?title=MediaWiki:ImageAnnotatorConfig.js&action=raw&ctype=text/javascript&dummy=88155 (line 35): Uncaught ReferenceError: wgMainPageTitle is not defined
. You'll need to upgrade your MW software. ManishEarthTalk • Stalk 13:52, 24 March 2010 (UTC)- Or he could grab the fixed commons:MediaWiki:ImageAnnotatorConfig.js, which just ignores the variable if it doesn't exist. Lupo 14:27, 24 March 2010 (UTC)
- It's still not working as, as Lupo said, the variable is
wgMainPageTitle
(CaSe SenSItiVe). ManishEarthTalk • Stalk 14:05, 24 March 2010 (UTC)- I uploaded File:IUPAC_naming_example_without_carbons.png there, and manually copied the annotations... It's not working, even in the file namespace... First see if its working in the File: namespace and then try out the mainspace. ManishEarthTalk • Stalk 14:22, 24 March 2010 (UTC)
- So you mean I have to update to the beta 1.16? I have put $wgMainPageTitle = "Main Page"; in MediaWiki:Common.js but I guess it makes no sense since this variable isn't available prior to 1.16. This are the contents of my Common.js
var wgMainPageTitle = "Main Page"; /**** ImageAnnotator ****** * Globally enabled per * http://commons.wikimedia.org/w/index.php?title=Commons:Village_pump&oldid=26818359#New_interface_feature * * Maintainer: [[User:Lupo]] ****/ if (wgNamespaceNumber != -1 && wgAction && (wgAction == 'view' || wgAction == 'purge')) { // Not on Special pages, and only if viewing the page if (typeof (ImageAnnotator_disable) == 'undefined' || !ImageAnnotator_disable) { // Don't even import it if it's disabled. importScript ('MediaWiki:Gadget-ImageAnnotator.js'); } }
I also updated ImageAnnotatorConfig.js. One question, the variable $wgUseAjax = true; doesn't seem to be shown in the page source. Is this really needed? In the guide It says AJAX needs to be turned on to see the "Add a note" button Poymode (talk) 15:12, 24 March 2010 (UTC)
- No,
$wgUseAjax
should not needed for ImageAnnotator. It enables an older interface from the times before we had the API. I think it's still used for the license preview on the upload form, and possibly for the "watch this page" tab, but that's about it. See Manual:Ajax. Unfortunately, I still can't connect to your wiki. I'll try over the weekend from another network. Lupo 08:08, 25 March 2010 (UTC)- Lupo, try http://www.deathwink.com/wiki/ http://www.deathwink.com/wiki/. I have transferred it there.Poymode (talk) 14:16, 25 March 2010 (UTC)
- Why not give him Sysop permissions there? I think he's User:Test there, judging by Special:ListUsers. Just go to Special:MakeSysop and make him an admin so that he can edit the scripts in the Mediawiki: namespace. ManishEarthTalk • Stalk 15:27, 25 March 2010 (UTC)
- Lupo, try http://www.deathwink.com/wiki/ http://www.deathwink.com/wiki/. I have transferred it there.Poymode (talk) 14:16, 25 March 2010 (UTC)
- There I can indeed connect. (And yes, I was editing as User:Test.) Your wiki setup is indeed a bit special, as it has
wgScriptPath
a prefix ofwgArticlePath
. Since I'm so used to the WMF setup, where these two are different, I never occurred to me that this might not always be the case. Get the corrrected commons:MediaWiki:LAPI.js and copy it to your wiki. Set theLAPI_file_store
variable as follows:
- There I can indeed connect. (And yes, I was editing as User:Test.) Your wiki setup is indeed a bit special, as it has
var LAPI_file_store = "(https?://www\\.deathwink\\.com)?/wiki/(images|index\\.php)/";
- I hope it'll work then. If not, tell me and I'll take another look. Lupo 15:51, 25 March 2010 (UTC)
- It works now Lupo. What fixed it? I wanted to know. Did you update the LAPI.js again? or was it my LAPI_file_store. Although I tried it only in the File namespace but it doesn't work here. PAGE. Is this included in the Main Page? Because I think the main page is disabled by the config. I saw it work through your sandbox though. I've added you as a sysop incase something happens. I will be further testing this tomorrow. THanks men. Manis and LUPO. Poymode (talk) 16:17, 25 March 2010 (UTC)
- I hope it'll work then. If not, tell me and I'll take another look. Lupo 15:51, 25 March 2010 (UTC)
Or can I only add annotations on the File namespace? I can only add a note if its in the File namespace Poymode (talk) 16:22, 25 March 2010 (UTC)
- Both. Part of the fix was setting
LAPI_file_store
properly, the other part was my fix for overlappingwgScript
andwgArticlePath
in LAPI.js. - You can add notes only on the file description pages. On other pages, you can only add local notes using the Template ImageWithNotes. See commons:Help:Gadget-ImageAnnotator#Local annotations. That's what I did on User:Test/sandbox. Notice that my "Test" note doesn't show up anywhere else. But with your current configuration you can see the notes defined on the file description page on any page that includes the image (except if overridden by such a {{ImageWithNotes}}). Cheers Lupo 16:27, 25 March 2010 (UTC)
- Yo, thanks dude. I kinda get it now. Cheers Poymode (talk) 16:42, 25 March 2010 (UTC)
MediaWiki 1.17
If you get an error message after adding or deleting a note saying the was a "version inconsistency" or "revision ID not found", please refresh your browser's cache. Lupo 13:31, 16 February 2011 (UTC)
If you're using ImageAnnotator on your own wiki with MediaWiki 1.17, you must use ImageAnnotator version 2.2b. See commons:Help:Gadget-ImageAnnotator/Installation#MediaWiki_V1.17. Lupo 13:31, 16 February 2011 (UTC)
Is this still working?
@Lupo: Hi, I was wondering if the local version is still working? I can't see any annotations at File:Spelterini Blüemlisalp.jpg or File:WEF on the Middle East Arab and foreign Ministers.jpg, after enabling the gadget and clearing my cache.
FYI, I'm compiling a list of "interactive elements" at mw:Talk:Wikimedia Foundation Design/Patterns and components that mentions the ImageAnnotator as an example. Thanks. –Quiddity (talk) 20:13, 10 August 2013 (UTC)
- Hmmm, now I'm confused. I see that the second to last picture, at Wikipedia:Wikipedia_Signpost/2013-08-14/News_and_notes, has working annotations. But I can only see those annotations in that page, not at File:Wikimania 2013 Group Photograph.JPG or at Wikimania 2013.
- I still can't see annotations (either at the :File: page or within articles) for the 2 examples given in my first comment. Any idea what the discrepancy is? –Quiddity (talk) 20:01, 16 August 2013 (UTC)
- Yeah, it needed an update. The version I once installed here for evaluation purposes was way behind the latest version at the Commons. If you go to File:Spelterini Blüemlisalp.jpg and then refresh your browser's cache, it should work again. Lupo 08:12, 19 August 2013 (UTC)
- @Lupo: Thank you! That definitely works on the :File: pages. Nifty!
- I'm still not sure what is going on with the in-page examples though. The second to last picture, at Wikipedia:Wikipedia_Signpost/2013-08-14/News_and_notes, has annotations - but the same image/code (and other variants) at User:Quiddity/sandbox5 are not working. I guess this is a namespace limitation, because it is just in testing-mode at the moment? Thanks. –Quiddity (talk) 21:34, 19 August 2013 (UTC)
- Yeah, it needed an update. The version I once installed here for evaluation purposes was way behind the latest version at the Commons. If you go to File:Spelterini Blüemlisalp.jpg and then refresh your browser's cache, it should work again. Lupo 08:12, 19 August 2013 (UTC)