Star Wars: The Old Republic Wiki

Forum index > Template creation and testing

Hi everyone, I need your advices on the following: I'm still looking to create this Coord tooltip template but I need to do some tests and it will be much easier to do them directly on this wiki. Have you any policy or specific Namespace where you put "dev templates" or can i just create it or them directly in the template Namespace? Zophar 10:42, 7 March 2012 (UTC)

Directly in the template namespace is fine. Be sure to update the template documentation once you get it working. Good luck! -- Alianin T C 12:02, 7 March 2012 (UTC)
Well $wgAllowUserJs is not enable. I've created http://www.wikiswtor.com/User:Zophar/test.js with a simple alert("Hello World") which is supposed to display a simple box at each page load but nothing happen. Is it possible to enable it? Zophar 12:53, 7 March 2012 (UTC)
As for the template itself, I began adding a placeholder to many articles just in case someone should add functionality like this in the future. If you add it to Template:Loc the tooltips should be added to several mission articles immediately. Additionally many of the NPC and Mob articles I've written include this template within the infobox. The parameter currently produces no output, but it would be a simple matter to flip a switch and turn it on.
Perhaps you can answer a question about java tooltips that I asked a while ago with no answer: is it possible for a user to selectively turn Javascript tooltips of? The tooltips are a fairly controversial addition and not everyone appreciates them. If there was some way for a user to turn them off, though, or selectively disable the display of those he or she doesn't use, then their addition to the project would be much more palatable. -- Heaven's Agent 14:25, 7 March 2012 (UTC)
That's a nice idea indeed. Well I'm not expert on those mediawiki JS features BUT the answer is perhaps in Gadgets Extension (https://www.mediawiki.org/wiki/Extension:Gadgets). It permits to enable/disable those Gadgets through each user preferences. I already experience it on MediaWiki main site (https://www.mediawiki.org/wiki/Special:Preference) and I'm able to enable/disable some new features (Code editing, new tools, etc...). So I think it's quiet easy to implement. Zophar 15:48, 7 March 2012 (UTC)
If I'm following the process correctly (and I admit I may be entirely wrong) you're using your personal namespace settings to test and polish the functionality of the map tooltips. Once the tooltips are pushed project-wide would it be possible for users to make changes to their personal javascript in a similar way that, in essence, breaks aspects of the tooltip functionality? Some way to overwrite the code so that it doesn't function when they're logged into their user account? -- Heaven's Agent 20:19, 7 March 2012 (UTC)
Well the Gadgets Extension permits users to enable/disable only the portion of tools (JavaScript or CSS based "gadgets") they want (as long as the gadget is defined in the gadget-definition). Now concerning user code "overriding" I'm far not enough experienced with mediawiki to speak about this subject, cannot answer that question yet ;) Zophar 20:36, 7 March 2012 (UTC)
No worries; I'm attempting to think of a way to allow the functionality without the addition of a new extension; we've not had much luck getting extensions added to the project in the past. -- Heaven's Agent 20:49, 7 March 2012 (UTC)
Have a look at this page : http://lotro-wiki.com/index.php/User:Eleazaros/tooltip.js Well it's seems possible to do exactly what you want. Zophar 20:56, 7 March 2012 (UTC)
That does seem to be what I'm looking for. Now I've just got to figure out how it works, and how to adapt it so that it functions here. If it even needs adapting; I can't tell. :P
Thanks for the link. -- Heaven's Agent 21:21, 7 March 2012 (UTC)
Well it's easy to implement a small PortletLink (see mw.util.addPortletLink) to add a link to the toolbox menu and enable/disable the needed flag. I'll give a shot soon on this one once i've finished the tooltip coords. Zophar 22:15, 7 March 2012 (UTC)