User talk:Timotheus Canens/displaymessage.js

Latest comment: 9 years ago by Timotheus Canens in topic Missing dependency

Edit Request October 1, 2013 by Technical 13 edit

I'm requesting someone (Timotheus CanansLegoktm) to update this page that is used by the WP:AFCH per the ticket on GitHub requesting that all text input lines have spellcheck on by default. To do this, please replace:

			$messageDiv = $( '<div id="display-message" style="margin:1em;padding:0.5em 2.5%;border:solid 1px #ddd;background-color:#fcfcfc;font-size: 0.8em"></div>' );

with the code that has been tested on testwiki:User:Timotheus Canens/displaymessage.js of:

			$messageDiv = $( '<div id="display-message" spellcheck="true" style="margin: 1em; padding: 0.5em 2.5%; border: solid 1px #DDD; background-color: #FCFCFC; font-size: 0.8em;"></div>' );

Thank you. Technical 13 (talk) 18:24, 1 October 2013 (UTC)Reply

I'm hesitant to do this since this library is used by other scripts. Is $('#display-message').attr('spellcheck', 'true'); not good enough? Legoktm (talk) 19:44, 1 October 2013 (UTC)Reply
I'll look into doing that, especially since this is used by other projects and AFCH is considering ditching this and using MediaWiki:Gadget-morebits.js instead... I'll switch it ans=y for now until I've tried it. Although, the style could still be cleaned up to be easier to read, which of course is a cosmetic thing. Technical 13 (talk) 20:23, 1 October 2013 (UTC)Reply
similar to Legoktm, I don't like that idea. Not every textfield should have the spellchecker turned on by default. mabdul 20:25, 1 October 2013 (UTC)Reply

Missing license information edit

@Timotheus Canens: Isn't this code under GPL2, which is the license adopted by MediaWiki developers? This needs to be indicated, as CC-BY-SA (the Wikipedia license) is not compatible with it (see 1, 2 e 3). I think a header like mw:Copyright headers#GPL would be enough.

BTW: maybe this link to the source is more convenient for those wanting to check the original code? Helder 00:49, 4 August 2014 (UTC)Reply

But isn't that still problematic, since everything on Wikipedia needs to be CC-BY-SA? I think @Krinkle: wrote this code, so maybe it's better to see if he can license them under CC-BY-SA as well? T. Canens (talk) 01:27, 4 August 2014 (UTC)Reply

Missing dependency edit

Timotheus Canens: this script tries to use mw.util.$content, whose value is set by the function mw.util.init which is only executed when on module "mediawiki.page.startup" is ready. Therefore the script should load the module with mw.loader.using to avoid race conditions (in which case the message would not to be added to the content). Helder 01:07, 4 August 2014 (UTC)Reply

I don't really care much about that race condition; this is a hack for things like User:Mr.Z-man/closeAFD - the intended use case is to display a form or message at user request well after the page has finished loading. If someone tries to use it before the page has even finished loading and it breaks, that's a feature in my book - you shouldn't be close AFD's when the page load isn't even complete. T. Canens (talk) 01:20, 4 August 2014 (UTC)Reply
See Wikipedia:Village pump (technical)#User:Mr.Z-man/closeAFD.js (2 cont.). Helder 01:33, 4 August 2014 (UTC)Reply
That appears to be an unrelated issue. T. Canens (talk) 02:08, 4 August 2014 (UTC)Reply