MediaWiki talk:Gadget-CommentsInLocalTime.js

Import for changes
Similar to other scripts like Friendly at MediaWiki:Gadget-Friendly.js, please replace this script's page with the following code:

Sometimes, minor tweaks need to be made and so this allows me to make them immediately when responding to queries. Right now, I use the Gadget version of the script so I am immediately aware of any problems that come up with the script, and if I can update the script and see the script update immediately, then it helps immensely with debugging the script. Gary King ( talk ) 20:35, 25 January 2009 (UTC)
 * ✅ Oren0 (talk) 21:00, 25 January 2009 (UTC)

Please change the script's name from  to. I have already moved the actual script, and redirected the old page to the new one. Gary King ( talk ) 20:04, 26 January 2009 (UTC)


 * [[Image:Yes check.svg|20px]] Done — { { Nihiltres | talk | log } } 00:24, 27 January 2009 (UTC)

User Gary was renamed
Please change the  call to , for the same reason currently being discussed at WP:Village pump (technical). --SoledadKabocha (talk) 02:30, 21 February 2014 (UTC)
 * Yes check.svg Done — Mr. Stradivarius  ♪ talk ♪ 04:17, 21 February 2014 (UTC)

Interface-protected edit request on 23 January 2020 - copy the code from User:Gary/comments_in_local_time.js and paste it here
I don't understand why it is being loaded from User:Gary/comments_in_local_time.js. This gadget is widely used by local and crosswiki users. If Gary wants to modify their script, he should submit an edit request instead. We have enough interface admins here to take care of edit requests. I am also worried about its users security, Gary can change the script at any time and and move it to somewhere else. Also if his account is renamed the hotlinking would break because their user subpages will be automatically moved by a global renamer. It already happened in the past as you can see. Also ResourceLoader modules are automatically minifed along with other features to provide better performance. Masum Reza 📞 07:32, 23 January 2020 (UTC)

Same rationale applies for MediaWiki:Gadget-wikEdDiff.js. The main reason I am asking is for performance improvements and less data costs. As I said ResourceLoader minifies the code. Masum Reza 📞 07:45, 23 January 2020 (UTC)

are you ok with this? You don't seem to be updating the gadget very often. Masum Reza 📞 07:52, 23 January 2020 (UTC)
 * Some discussion at Interface_administrators%27_noticeboard/Archive_1. I've regretted not re-starting that, been busy. ~  Amory  (u • t • c) 11:06, 23 January 2020 (UTC)


 * Sure, the original code can be copied to this page. The code won't be changed much. Gary  ( talk  ·  scripts )  20:55, 23 January 2020 (UTC)
 * I don't think this edit request is actionable as such. User:Gary/comments_in_local_time.js contains some ES6 code such as arrow functions and backquote strings, which cannot not be parsed by the ResourceLoader. See T75714. SD0001 (talk) 23:30, 23 January 2020 (UTC)


 * Damn, that sucks. I don't want to go through the code and revert the changes I made to bring it into the modern JavaScript era. So I'll just wait for this issue to be fixed globally, to ResourceLoader, or someone else can update this script, if they want. Gary  ( talk  ·  scripts )  01:10, 24 January 2020 (UTC)
 * You can always choose to use something like babel to automatically bring it down to ES5. SD0001 (talk) 09:36, 24 January 2020 (UTC)


 * I don't want to transpile the code. I originally wrote it in CoffeeScript, then transpiled to JavaScript. But admins edited the code when something broke. So then the transpiled JS code was out of sync with the original CS code. The same would happen if I transpiled with Babel. So I only want one version of the code to exist. Gary  ( talk  ·  scripts )  18:48, 24 January 2020 (UTC)
 * ❌ (not yet) I agree we should not be loading userspace code to the gadget, however it doesn't appear that a final solution is yet ready to deploy - reactivate the edit request when it is. —  xaosflux  Talk 14:30, 31 January 2020 (UTC)
 * Only just returning to this, sorry, but what about loading a specific oldid of the userpage?  That way, if something happens to Gary, a malicious editor wouldn't be able to change the code.  It would still mean filing an edit request whenever you update the code, Gary, but you've said you wouldn't mind.  It does mean an intadmin should review the code changes, but then again we should anyway...  If there's no opposition I'll do it today or tomorrow. ~  Amory  (u • t • c) 11:46, 3 February 2020 (UTC)
 * I much prefer the "promote to production" process of just "copy the code to the gadget page", gadgets are meant to be community-maintained after all. — xaosflux  Talk 12:24, 3 February 2020 (UTC)
 * Mais oui, but in the absence of a full-measure, half a loaf is better than none. ~ Amory  (u • t • c) 14:28, 3 February 2020 (UTC)

Fix for incompatibility with DiscussionTools
Pinging author @Gary.

Please sync with User:SD0001/comments in local time.js (compare). This fixes a major issue with this gadget that was reported on VPT (Village pump (technical)) – all comments go back to being in UTC time whenever the new DiscussionTools beta feature is used to reply to a comment (because discussionTools uses an AJAX reload).

Also reported on User talk:Gary/comments in local time.js by @Jack who built the house. – SD0001  (talk) 11:00, 1 April 2021 (UTC)
 * I'd much prefer to just import this to the primary gadget, instead of it being an import of your personal script (nothing would stop you from using your own script) - any concerns here? — xaosflux  Talk 13:13, 1 April 2021 (UTC)
 * Directly putting the code in the gadget page will not work because this is written in ES6 which the ResourceLoader doesn't support. – SD0001  (talk) 13:49, 1 April 2021 (UTC)


 * I've got no problems with any of the suggested changes, from both this thread and the linked thread, from being made. I just don't have the time to fix all bugs that might arise, etc. I'm not familiar with the new JavaScript hooks that now exist. So I'll let the community make any necessary changes to the script as needed. Gary  ( talk  ·  scripts )  14:52, 1 April 2021 (UTC)
 * ✅ { I've synced this in to close the ER; would still prefer someone converts this in to an actual gadget though if anyone is up for it. — xaosflux  Talk 14:43, 6 April 2021 (UTC)
 * this seems to have had some breaking impact - see Village_pump_(technical). — xaosflux  Talk 15:33, 6 April 2021 (UTC)
 * Further fixes to this gadget should likely be by a rewrite that will allow this to be a native gadget. — xaosflux  Talk 15:37, 6 April 2021 (UTC)
 * Huh what? This is a gadget that merely changes the way timestamps are displayed, and has nothing whatsoever to do with editing of pages. It's extremely unlikely the changes here had anything to do with the VPT thread. FWIW the modified version has been in my common.js for the past 5 days and I didn't face any issues. – SD0001  (talk) 17:03, 6 April 2021 (UTC)
 * possible collision with something else? If Gary wants to do whatever with this it is up to him since it is a personal page, but only if we de-list it from the gadgets page and make him directly responsible I suppose? — xaosflux  Talk 22:43, 6 April 2021 (UTC)
 * , I think the problem might have been  When I was running into the problem I noticed there was a   tag with a class "localcomments". Or at least, I think that's the case, since the code was reverted, I get a tag as expected. Ritchie333 (talk)  (cont)  11:04, 7 April 2021 (UTC)

Integration into MediaWiki
It looks like T240360 is the task for making CommentsInLocalTime part of mediawiki (as part of DiscussionTools extension). – SD0001  (talk) 16:29, 3 April 2021 (UTC)