User talk:Timotheus Canens/displaymessage.js#Missing dependency
Edit Request October 1, 2013 by Technical 13
{{Edit protected|User:Timotheus_Canens/displaymessage.js|ans=y}}
I'm requesting {{Pinggroup|someone|Timotheus Canans|Legoktm}} to update this page that is used by the WP:AFCH per [https://github.com/WPAFC/afch/issues/159 the ticket on GitHub] requesting that all text input lines have spellcheck on by default. To do this, please replace:
$messageDiv = $( '
' );with the code that has been tested on testwiki:User:Timotheus Canens/displaymessage.js of:
$messageDiv = $( '
' );Thank you. Technical 13 (talk) 18:24, 1 October 2013 (UTC)
: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)
:: 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)
:::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)
Missing license information
{{Ping|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, [http://wiki.creativecommons.org/4.0/Compatibility 2] e [http://wiki.creativecommons.org/GPL_compatibility_use_cases#Sharing_computer_code_between_GPL_software_and_CC-BY-SA_communities 3]). I think a header like mw:Copyright headers#GPL would be enough.
BTW: maybe this [https://github.com/wikimedia/mediawiki-core/blob/9023aa2d830029da5745e92212f03ddbc71da4c2/resources/mediawiki/mediawiki.util.js#L424-L467 link to the source] is more convenient for those wanting to check the original code? Helder 00:49, 4 August 2014 (UTC)
:But isn't that still problematic, since everything on Wikipedia needs to be CC-BY-SA? I think {{ping|Krinkle}} [https://github.com/wikimedia/mediawiki-core/commit/841623c3fcc487d624e273060b6490d7ae039435 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)
Missing dependency
{{U|Timotheus Canens}}: this script tries to use mw.util.$content
, whose value [https://github.com/wikimedia/mediawiki-core/blob/9023aa2d830029da5745e92212f03ddbc71da4c2/resources/mediawiki/mediawiki.util.js#L65-L84 is set by the function mw.util.init
] which is only [https://github.com/wikimedia/mediawiki-core/blob/9023aa2d830029da5745e92212f03ddbc71da4c2/resources/mediawiki.page/mediawiki.page.startup.js#L11-L16 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)
: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)
::See Wikipedia:Village pump (technical)#User:Mr.Z-man/closeAFD.js (2 cont.). Helder 01:33, 4 August 2014 (UTC)
:::That appears to be an unrelated issue. T. Canens (talk) 02:08, 4 August 2014 (UTC)
Dark mode
{{edit interface-protected|User:Timotheus Canens/displaymessage.js|answered=yes}}
@Timotheus Canens: Now that Wikipedia supports dark mode, I propose the following change:
{{textdiff|1=$messageDiv = $( '
' );|2=$messageDiv = $( '' );}}To be compatible with it. 0xDeadbeef→∞ (talk to me) 12:38, 20 August 2024 (UTC)
- The author hasn't edited in 2 months. Going to put an edit request to get more visibility. PS: this fixes the dark mode display for spihelper. 0xDeadbeef→∞ (talk to me) 01:34, 23 August 2024 (UTC)
- Added fallback for skins that don't have these varaibles. 0xDeadbeef→∞ (talk to me) 01:38, 23 August 2024 (UTC)