MediaWiki talk:Gadget-Numerakri.js

Needed Features

 * Easily visible dropdown box to select numeral system, availaible for both logged-in and logged-out users
 * Remembering user preference for numeral system and changing numerals on document.ready for all pages automatically once the preference is set
 * Changing all numerals in the page (including list numbering) without changing any anchor urls, image src properties, hyperlink urls etc.
 * Changing title text and alt text properties for images, anchors etc.
 * Not changing the numerals in the editbox in the editpage or the previewpage, not changing any input numerals
 * Providing an html class, numerals inside which would not be changed. This is to be for places where the numerals are to be specifically differentiated, and possibly will be used for ContentSub (Redirected from blah) which may contain numerals.
 * Not change numerals in the mailto link for emailing users
 * Not changing the numerals in the source for anchors for the book sources (such as ISBN) (The visible ISBN may be changed, but the link should not be changed)--Siddhartha Ghai (talk) 03:35, 5 July 2012 (UTC)

Icon
When implementing the dropdown, you'll probably want to implement that as a portlet link via mw.util.addPortletLink, and use a click event handler to show/hide the dropdown menu, and use CSS to show an icon (just like the user page link with icon). Krinkle (talk) 20:32, 8 July 2012 (UTC)

Revision 2012-12-19
Krinkle (talk) 03:18, 19 December 2012 (UTC)
 * Merged in changes by Siddhartha Ghai from hi:MediaWiki:Gadget-Numeral converter.js and hi:MediaWiki:Gadget-Numeral converter.css
 * Fallback was broken (ReferenceError: walkTextNodes is not defined)
 * Use CSS instead of inline styles.
 * Use variable references instead of using string selectors in  constantly (it is much faster to reference the nodes directly then querying the document to find the element). This phased out a lot of unneeded IDs from the document.
 * Build the interface inside out, this is faster because now there is only 1 insertion into the document and thus only 1 "paint" action in the browser.
 * Add basic messaging system.
 * Minor redesign for "Modern" skin: Icon was 50px, which equals the height of the toolbar (leaving no padding, edge of icon touched edge of toolbar). Reduced to 40px and also made white.
 * Refactored skip-class code
 * Using  instead of   so that it also works on elements that have more classes.
 * Moved check from  to TreeWalker's   callback so that it can be used on a container element (not just on the direct parent of the text node). In this case it is used on the SELECT element that contains the OPTION elements.
 * Fixed bug in options. Use  (or   or  . Attributes control initial state from HTML. Once in the DOM, the property controls live state, the attributes can be stale.
 * Factored any MediaWiki-specific code out into a new  method. This way one can extend the
 * Optimised initialisation by defining and instantiating the constructor outside "document-ready" and only calling "setupInterface" inside of the domready handler.
 * Various clean up and coding styles (more comments and spacing, delivery from ResourceLoader trims all this).
 * Passes JSHint!
 * Uh, firstly, thanks for the update; and, I'd tried to improve the code myself at w:hi:सदस्य:Siddhartha_Ghai/Numeral_converter.js. That supports multiple numeral systems. Maybe you should have a look and incorporate improvements? Thanks--Siddhartha Ghai (talk) 19:48, 25 December 2012 (UTC)