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 , but not  . 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)
 * Clarification:I'm only referring to code changes (auto-generation of the regex). Support for multiple systems isn't needed on hi-wp as of now.--Siddhartha Ghai (talk) 19:54, 27 December 2012 (UTC)
 * ✅, . Krinkle (talk) 23:55, 30 December 2012 (UTC)
 * Thanks for the script. I have implemented it in Telugu wikipedia for telugu numerals. If someone can make the icon for Telugu that will be great. --వైజాసత్య (talk) 06:40, 13 April 2013 (UTC)

Documentation, standardization and cookie
So we now have usage of the gadget on te-wp.

For the use on this wiki, maybe add the relevant UI to this gadget itself, i.e reference to the doc page, te numerals, teUI when using the te interface lang etc and then show only two numeral sets, the arabic (international) one, and the one from the user's interface language?

Also, te-wp is using the cookie value 1 for te numerals, while here and on hi-wp that's for deva numerals. IMHO that's bad. Maybe the te version should be changed to use 2 (or something else)?

Regards--Siddhartha Ghai (talk) 05:42, 4 October 2013 (UTC)

Also, the telugu wikipedia is using the December 2012 version. Once these issues and the ones at Mediawiki talk:Gadget-Numerakri.css are fixed, it should probably be updated (along with the version on the hindi wikipedia).--Siddhartha Ghai (talk) 05:49, 4 October 2013 (UTC)
 * Hi,
 * The cookie problem has been solved by using the new cookie  which contains a codename instead of a number.
 * The bug in Cologne Blue you reported at Mediawiki talk:Gadget-Numerakri.css has been fixed.
 * I don't have time to work on the UI, doc page or te-wp interface. Perhaps you or someone else could work on that? (e.g. copy this version, apply the te-wp changes, and then I'll copy your new version back here).
 * Krinkle (talk) 14:17, 4 October 2013 (UTC)
 * Thanks for the cookie thing. I'll ask the maintainer at te-wp to update. Problem in cologneblue bugfix at Mediawiki talk:Gadget-Numerakri.css. I'll make a copy of this, do the requisite UI changes and notify here when done.
 * One more thing: This is not a pressing concern, just food for thought. The gadget works for both the interface and the content, and it was originally targeted to (but not limited to) content.
 * However, since the cookie doesn't incorporate the name of the website, it means numeral preferences get transferred to other websites too. This may not be always desirable. Example: A user may wish to see devanagari numerals with devanagari content on the hindi wikipedia, but read docs here in english, and wish for international numerals since devanagari numerals would seem out of place.--Siddhartha Ghai (talk) 10:59, 5 October 2013 (UTC)

Incomplete list of dependencies
, this script is still using  from jquery.mwExtension, so this edit is not quite right. Helder.wiki 01:43, 12 March 2014 (UTC)

Projects
The following is a list of wikiprojects where this gadget is availaible in some form:
 * 1) Here
 * 2) Hindi Wikipedia (enabled by default)
 * 3) Telugu Wikipedia (has an older version modified for use with telugu numerals)
 * 4) Punjabi(pa) Wikipedia (as of writing, a user requested me for adding this on punjabi wikipedia, and I've given him this gadget modified for use with gurmukhi numerals)
 * 5) Sanskrit Wikipedia

The version on telugu wikipedia uses the older cookie format, others use the current format.

Cookie

 * 1) The cookie used here and on hindi wikipedia is the same.
 * 2) Telugu wikipedia uses the older cookie.
 * 3) Code I've given for punjabi wikipedia uses cookie '3' for gurmukhi (Since 1 is for devanagari, I've left 2 for telugu and added 3 to the code for gurmukhi)

--Siddhartha Ghai (talk) 13:16, 20 March 2014 (UTC)

The gadget is now available on sanskrit wikipedia (and may be enabled there by default too).--Siddhartha Ghai (talk) 06:36, 13 April 2014 (UTC)

Punjabi Wikipedia
Hello, Is there any way with which we can make this Gadget default for all users? Instead of Default, Arabic and Gurmukhi, Is there any option to make Arabic numerals by default for all users and only Gurmukhi as the second option ? Thanks a lot. --Satdeep gill (talk) 03:42, 1 December 2014 (UTC)

Requesting this gadget for Kannada Wikipedia
Hi, I would love to see this gadget on kn:wiki. Let me know if there is any specific procedure for this. Thanks Omshivaprakash (talk) 05:25, 25 April 2015 (UTC)