Help talk:Gadget-ImageAnnotator

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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)[reply]

"Add a note" button not present[edit]

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)[reply]

That question belongs here. ManishEarthTalkStalk 11:26, 22 March 2010 (UTC)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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. ManishEarthTalkStalk 10:05, 23 March 2010 (UTC)[reply]
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)[reply]

So its not required for AJAX editing? Surprising... ManishEarthTalkStalk 11:43, 23 March 2010 (UTC)[reply]

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)[reply]
I cannot connect to your wiki. DNS doesn't know "boinky.me". Lupo 11:22, 24 March 2010 (UTC)[reply]
I can connect... ManishEarthTalkStalk 12:21, 24 March 2010 (UTC)[reply]
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)[reply]
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)[reply]

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. ManishEarthTalkStalk 13:52, 24 March 2010 (UTC)[reply]
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)[reply]
It's still not working as, as Lupo said, the variable is wgMainPageTitle (CaSe SenSItiVe). ManishEarthTalkStalk 14:05, 24 March 2010 (UTC)[reply]
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. ManishEarthTalkStalk 14:22, 24 March 2010 (UTC)[reply]
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)[reply]

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)[reply]
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)[reply]
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. ManishEarthTalkStalk 15:27, 25 March 2010 (UTC)[reply]
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 of wgArticlePath. 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 the LAPI_file_store variable as follows:
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)[reply]
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)[reply]

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)[reply]

Both. Part of the fix was setting LAPI_file_store properly, the other part was my fix for overlapping wgScript and wgArticlePath 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)[reply]
Yo, thanks dude. I kinda get it now. Cheers Poymode (talk) 16:42, 25 March 2010 (UTC)[reply]

MediaWiki 1.17[edit]

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)[reply]

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)[reply]

Is this still working?[edit]

@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)[reply]

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)[reply]
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)[reply]
@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)[reply]
Yes. When I did the update yesterday, I noticed that it was enabled only in the File: and Wikipedia: namespaces. I left it like that, but I could quite easily also enable it on user subpages (like it actually says on Help:Gadget-ImageAnnotator). In fact, I'm not sure why it does show the annotations on the image on the signpost article; I thought that feature (annotations on inline images) was switched off, too. Lupo 06:50, 20 August 2013 (UTC)[reply]
Namespace: I'd suggest enabling it for all namespaces except mainspace, to allow testing everywhere, unless there are concerns that I haven't thought of?
Inline: I really like the commons:Help:Gadget-ImageAnnotator#Inline_display_of_annotations feature. It's difficult to discover which image have annotations, otherwise, in a place like Wikipedia where most views are just of thumbnails. I'd suggest leaving that on.
Relatedly to inline, are you familiar with the "Media viewer" work being done at mw:Multimedia (specifically mw:Multimedia/Feature ideas#Media viewer)? They might appreciate your input, on that or the other features they're working on. :) –Quiddity (talk) 18:43, 20 August 2013 (UTC)[reply]
For evaluation purposes, a few namespaces should be sufficient. It's unlikely this will be enabled globally anyway. This thing was written before we had jQuery and even before the ResourceLoader component became really useable. The code, as-is, would be considered hacky beyond belief by the jQuery-Jockeys. Display of annotation on inline images causes quite a few Ajax requests in the background; if this were enabled globally, I'm not sure it didn't overload the servers. This whole annotation thing should actually be rewritten as a MediaWiki extension, so that most of the heavy action could be done on the server directly, without costly requests going back and forth. And the JavaScript parts of that extension should be rewritten in jQuery, and make use of the ResourceLoader and the edit API. Also, since the WMF sites switched to HTML5, some new possibilities have arisen. For instance, one could now basically do non-rectangular annotations, I think. The new WikiData project also has added new possibilities; perhaps image annotations should be stored there?
In any case: I don't have any time to develop this further. And before I have analyzed why these inline annotations are shown (maybe a bug in the code, or maybe a change in the way thumbnails appear in the HTML now, or maybe I just misremember the feature being basically disabled) I'm wary of enabling it in more namespaces. I don't want it to break anything. Lupo 20:59, 20 August 2013 (UTC)[reply]
Much thanks for the added details. I'd mentioned the gadget a while ago, to a staff dev at mw:Design_audit#To_Do, and I've pointed him here to learn these updates. TTFN, –Quiddity (talk) 23:06, 20 August 2013 (UTC)[reply]