MediaWiki talk:Gadget-ImageBoxes.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

JavaScript-based image annotation boxes

Version 0.1 alpha

(c) 2007 by Magnus Manske

Released under GPL

Comments

[edit]

I've just started a fork at User:Dschwen/ImageBoxes.js to implement some ideas for easier editing. --Dschwen 12:13, 4 July 2007 (UTC)[reply]

an exception in it

[edit]

There is a problem with this gadget: MediaWiki talk:Gadget-HotCat.js#shows up not on all pages. I discovered it because I noticed that another gadget was not in effect on all pages.--Imz (talk) 14:06, 13 October 2008 (UTC)[reply]

The error is
[Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "http://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-ImageBoxes.js&action=raw&ctype=text/javascript Line: 252"]
Line 252 is:
file.insertBefore ( controls , linkinfile.nextSibling ) ;
This means linkinfile.nextSibling is either not in the document at all (we can rule this possibility out because linkinfile clearly is) or linkinfile.nextSibling is not a direct child of file. The first link under file (linkinfile) should be a direct child. Indeed it should be the first child. But clearly that's not happening for some reason.
The current error could be fixed by using:
linkinfile.parentNode.insertBefore ( controls , linkinfile.nextSibling ) ;
but that would likely just move the problem elsewhere. I recommend you determine whether this problem occurs when you run only this gadget. If not, the root problem is elsewhere. Also note that this gadget is not actively maintained. Superm401 - Talk 09:08, 14 October 2008 (UTC)[reply]
No, this exception doesn't occur if I disable all other gadgets. Just checked.--Imz (talk) 09:26, 14 October 2008 (UTC)[reply]
It occurs if the enabled gadgets are it and "Choose Resolution".--Imz (talk) 09:31, 14 October 2008 (UTC)[reply]
Ok, that explains it. MediaWiki:Gadget-ChooseResolution.js mangles the XHTML of the page in a way that breaks the assumptions this script makes. I've fixed this script. Could you please retry it, with only these two gadgets enabled? Go to an image page where it doesn't work, then force a reload (shift-reload in Firefox, ctrl-reload in IE). If either of the two still doesn't work, report here any errors you got in the error console. Lupo 11:46, 14 October 2008 (UTC)[reply]
No errors anymore from these two gadgets. Thanks!--Imz (talk) 11:55, 14 October 2008 (UTC)[reply]
But I've discovered an error in another gadget this way: MediaWiki talk:Gadget-WhatIsThat.js#error in generated code.--Imz (talk) 12:03, 14 October 2008 (UTC)[reply]

Another error

[edit]

Hi, I am giving {{Imagebox}}es another try. I added 2 boxes to File:Bundesarchiv Bild 183-2008-0415-508, Warschau, Luftaufnahme, Zerstörungen.jpg. The top one worked just fine but the bottom one created "Bad Request" by producing link to Category:Marsza%u0142kowska Street in Warsaw [1] instead of Category:Marszałkowska Street in Warsaw. Could someone fix it? --Jarekt (talk) 13:19, 19 May 2009 (UTC)[reply]

In addition boxes in File:Heinrich Berann NPS Yellowstone.jpg do not show up and attempt to add a new box produced the following line: {{Imagebox|1|NaN|0|NaN|Grand Teton}}. --Jarekt (talk) 13:33, 19 May 2009 (UTC)[reply]