Jump to content

Help talk:Gadget-ImageAnnotator

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Poymode (talk | contribs) at 16:12, 25 March 2010. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

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.