MediaWiki talk:Gadget-ImageAnnotator-v3.js

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Namespace-mediawiki.svg MediaWiki:Gadget-ImageAnnotator-v3.js forms part of the MediaWiki interface and can only be edited by administrators.
To request a change to MediaWiki:Gadget-ImageAnnotator-v3.js, add {{Edit request}} to this talk page, followed by a description of your request.
This gadget is enabled globally for everyone through an inclusion in MediaWiki:Common.js. You need not (and in fact, cannot) enable it in any way; it is already enabled. In case of an insurmountable problem, there's an emergency switch-off that logged-in users can use: just enable at Special:Preferences→Gadgets the gadget for "disabling image annotations". If you feel the need to do that, please also report your problem here.

To see all annotated images, visit Category:Images with annotations.
Page paste.png Documentation on this script is at Help:Gadget-ImageAnnotator.
Translations: English
Crystal Clear app file-manager.png Archives
Conversations older than 7 days will be archived automatically.
Gnome-dialog-information.svg
ImageAnnotator's Documentation.
Gnome-help-faq.svg
ImageAnnotator's Frequently Asked Questions.
Gnome-system-run.svg
ImageAnnotator's technical Forum.
Gnome-system-help.svg
ImageAnnotator's non-technical Forum.
Gnome-emblem-default.svg
Image note guideline.


Disable annotations inside a node[edit]

Could you please provide a mechanism to disable annotations inside a node, like infoboxes, location maps? Or is there already one? --84.3.90.28 11:19, 17 November 2013 (UTC)

h(eight) is undefined or NaN[edit]

Hi, since today, it happened to me that when adding annotations to images, the h(eight) parameter is set to undefined or NaN. Which shrinks the box to a minimal height. You can edit the images description and fix the problem manually as a workaround. But this is new erroneous behaviour and should be fixed. [1], [2], regards --Herzi Pinki (talk) 16:32, 2 July 2014 (UTC)

@Krinkle: that one's for you. Lupo 17:09, 2 July 2014 (UTC)
This version is really broken. It doesn't display notes on thumbnails either. That's what happens if you don't test your changes. Hint: DOM Element.getElementsByClassName() is not the same as the legacy wrapper getElementByClassName you removed. I suppose the problems are due to that. Lupo 18:20, 2 July 2014 (UTC)
I don't think it has anything to do with getElementsByClassName. I tested it locally and via the console and worked. I think there might be a race condition or silly typo somewhere. I'll iterate a bit further.
@Lupo: Note that I'm just trying to improve the library by 1) migrating away from deprecated interfaces that will soon be removed, 2) making use of more centrally developed interfaces in general.
This should greatly reduce the amount of code, improve its performance and stability and make it easier to install and manage by requiring less of other MediaWiki-namespace scripts to be loaded first (and promoting it to a gadget so that it can be minified and cached much more effectively). When this gadget was first written a lot of the base level infrastructure didn't exist, but nowadays it does. You and others have done a tremendous job implementing utility methods such as those in LAPI, but I think it's fair to say the developer community around jQuery at large (which should include us) is better equipped to develop, improve performance of and maintain continuous browser compatible with these utilities. I don't expect to encounter any bugs in jQuery during this. If anything it'll by my own stupidity in doing it wrong. It would mean a lot to me if you're interested to join me in this endeavour. –Krinkletalk 19:22, 3 July 2014 (UTC)
Krinkle, I don't have the time to do any serious development here these days. If you clean up things now, and stuff breaks, you'll have to fix it yourself. And yes, the "sh" typo was the immediate reason for the bug reported here. About getElementsByClassName: previous code selected only certain node kinds with a certain class. It's been so long that I'm really not sure if that is necessary, but I think it'd be safer to use the jQuery-replacement of jQuery(scope).find(((!tag || tag === '*') ? "" : tag) + '.' + className);. Using the built-in function, it's now effectively jQuery(scope).find('.' + className);, i.e., the tag is now ignored. As I said, I'm not sure if that may not have unintended side-effects. Lupo 19:58, 3 July 2014 (UTC)

Annotation box changes after adding Gallery section to "other versions"[edit]

in files File:Core Banks - Osprey - 01.JPG and File:Core Banks - Osprey - 02.JPG I added an annotation and than a <gallery>File:Core Banks - Osprey - 02.JPG</gallery> section to "other versions" field. After adding the gallery annotation box stopped displaying properly. Can someone look into it? --Jarekt (talk) 17:17, 7 July 2014 (UTC)

See the section above this one. Krinkle has done something to the gadget that now makes it insert the annotation height value as "undefined". Users must now edit the image description pages and put a value there manually. I did it for one of your two images. I'm leaving the other to you. It has nothing to do with the gallery. As you're an administrator, you can try to replace "sh" with "h" in line 645 of MediaWiki:Gadget-ImageAnnotator.js and see if it fixes the problem. Users have been complaining about it and they will thank you for doing something about it. -- Asclepias (talk) 18:51, 7 July 2014 (UTC)