User talk:Lupin/recent2.js

Please go to User talk:Lupin/Anti-vandal tool to discuss this script.

Editing this
Lupin, do you mind if I edit this to add some more keywords/change the code a little? I can test it on my own user account first so as not to mess everyone else up, but do you mind? - Mys  e  kurity ( have you seen this? ) 09:50, 11 December 2005 (UTC)


 * I don't have any huge objection, although my preference would be for you to explain the changes you want to make and show me the version you want to change to. Lupin|talk|popups 16:53, 11 December 2005 (UTC)

Warn
linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' + '&autoedit=s#$#\' + bundle.articleTitle + '%20~#&autosummary=Your%20recent%20edits','warn')

Lupin, What do you think about replacing the code-piece above with the one below

linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' +           '&autoedit=s#$#\n==%20Regarding%20your%20edits%20on%20' + bundle.articleTitle + '\n\n' + bundle.articleTitle + '%20~#&autosummary=Your%20recent%20edits%20on%20' + bundle.articleTitle,'warn')

I feel this would make a better talk entry. --kkailas 12:24, 18 May 2006 (UTC)

New vandalism templates
This code should add 3 new links to the test, vandalism and delete templates defined in WP:UTM. That would be nice if you could support these, since they are real nice :) -- lucasbfr talk 21:46, 22 January 2007 (UTC)  linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' + '&autoedit=s#$#\%20#&autosummary=Your%20recent%20edits', 'test')    + ' | ' +  linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' + '&autoedit=s#$#\%20#&autosummary=Your%20recent%20edits', 'vand')    + ' | ' +  linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' + '&autoedit=s#$#\%20#&autosummary=Your%20recent%20edits', 'del')    + ' | ' +

Recent IP edits etc.
Shouldn't 'Recent IP edits' be implemented by adding an '&hideliu=1' to the 'feed' string, rather than by requesting all edits and then filtering out those whose editors match a RegExp? The same applies to hiding one's own edits ('&hidemyself=1'). Or doesn't the RSS feed work that way? Philip Trueman 10:35, 14 May 2007 (UTC)

Edit
editprotected Please replace with For consistency with the edit summary of the admin rollback tool (see e.g. ).  Melsaran  (talk) 16:22, 2 October 2007 (UTC)

I assume Lupin can do this, so admin help isn't required. &mdash; Carl (CBM · talk) 17:25, 2 October 2007 (UTC)

Small fixes
Hi!

Could someone please replace the current code by [//en.wikipedia.org/wiki/User:Lupin/recent2.js?oldid=479653746&diff=578294331&diffonly=1 this fixed version from my common.js]? Here is what I changed: Helder 17:04, 20 October 2013 (UTC)
 * Fixed the watchlist monitoring, which was broken since 84718 was merged into MediaWiki (see also User talk:Lupin/Anti-vandal tool/Archive 4, and the related [//en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&diff=next&oldid=151132615 fix from 2007]);
 * Fixed the error handling of the two requests (broken in [//en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&diff=prev&oldid=55329741 this edit]), by replacing one occurrence of " " by " ", and " " by " "
 * Replaced the " " from [//en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&diff=249129507 this edit] by " "
 * Used  to access the MediaWiki variables (they are not global if , as in Translatewiki.net, and in the future on Wikipedia)
 * Removed deprecated " " code
 * Used jQuery instead of the old
 * Added the configuration to make it possible to validate the code using the tool recommended by MediaWiki developers (jsHint)
 * Fixed a few comparisons and declared a few variables suggested by the validator
 * Can you confirm if you have been able to fully test the requested code? &mdash; Martin (MSGJ · talk) 08:22, 22 October 2013 (UTC)
 * , I tested, and now I noticed also an old bug which will be fixed by [//en.wikipedia.org/w/index.php?action=edit&oldid=578294331 this new version] of the script. Helder 18:40, 22 October 2013 (UTC)
 * Okay, ✅ &mdash; Martin (MSGJ · talk) 09:41, 23 October 2013 (UTC)

A few simplifications
Hi!

I simplified the script a little and made [//en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&oldid=578382619&diff=578435047 a few other updates]: Could someone merge these changes? Helder 16:21, 23 October 2013 (UTC)
 * Use  to get the value of the href attributes
 * Use protocol relative URLs
 * Escape strings with  before using them as part of a regex
 * Fixed another regex
 * Use  instead of the deprecated   element
 * Do not duplicate values which are already available through
 * Remove unused global function ;
 * Use  to check if 'sysop' is in the array
 * Use the standard  instead of a custom
 * Use the standard  instead of a custom
 * Use (a shortcut for) the standard instead of a custom recent2.runOnLoad
 * Compare page names with  instead of calling a function to build a regex which detects variations in the usage of spaces and underscores
 * Rename a two variables to make it clear they contain a page name (not an URL)
 * Add missing semicolons;
 * Add FIXME comments to highlight parts of the code which still needs improvements
 * Fix trailing comments
 * Use dot notation for objects instead of strings
 * Make sure all dependencies are loaded before using them
 * Also load the module "mediawiki.action.history.diff" to improve the formatting of the diffs (related to 34798 / 34800)
 * Update jsHint config to match this improved version
 * Okay I'll take it for granted that everything is tested :) ✅ &mdash; Martin (MSGJ · talk) 19:24, 23 October 2013 (UTC)

IPv6 compatibility (and minor fixes)
Hello again!

I improved the script a little more: Could someone merge the new code? Helder 16:29, 24 October 2013 (UTC)
 * Added IPv6 compatibility
 * Added missing  operators and curly braces around blocks
 * Converted some expressions to more understandable if statements
 * Converted some RegExp constructors to literals
 * Used $.escapeRE to escape regular expressions characters
 * Removed unused global recent2.testPage
 * Indicated the license of the script
 * Formatted some multiline comments
 * Updated jsHint configuration, to better match the config used on MediaWiki
 * ✅ &mdash; Martin (MSGJ · talk) 11:25, 25 October 2013 (UTC)

Separation of logic and interface
I would like someone to make this update to the code: Helder 18:30, 25 October 2013 (UTC)
 * Move the interface messages into an object and use  to access them (this makes it easier to adapt the script to wikis in other languages)
 * Fix a bug I introduced in a previous update: the spellchecker links were not automatically fixing the text. This was because  considered the character "#" as part of the parameters while   doesn't. I've replaced "#" by another character ("♫").
 * Yes check.svg Done — Mr. Stradivarius  ♪ talk ♪ 03:51, 27 October 2013 (UTC)

Replace "wikiGetlink" by "getUrl"
Hello!

Please replace the 5 occurrences of "wikiGetlink" by "getUrl" (as I did [//pt.wikipedia.org/w/index.php?diff=prev&oldid=37344759 on Portuguese Wikipedia]), per 55764 / 94270). Helder 21:37, 11 November 2013 (UTC)
 * done —Th e DJ (talk • contribs) 14:10, 13 November 2013 (UTC)

window.AVTAutoEdit
, are you sure the old  and   can be merged into a single  ? Helder.wiki 13:26, 2 April 2014 (UTC)
 * Good point. fixed now. I needed to get this split off, it was clashing with the globals from navpopups. my god our old gadgets are a mess. —Th e DJ (talk • contribs) 14:13, 2 April 2014 (UTC)

Change to non-admin rollback edit summary
Please change the line  to   in order to provide a link to the talk page of the user whose edits are being reverted and ensure consistency between edit summaries generated by the various rollback tools on Wikipedia. — Preceding unsigned comment added by My Chemistry romantic (talk • contribs)
 * Yes check.svg Done seems uncontroversial &mdash; Martin (MSGJ · talk) 10:04, 21 December 2016 (UTC)

jquery.mwExtension
Hi! Could you do a change like this to migrate from the deprecated module to "mediawiki.RegExp"? Helder 03:31, 18 August 2017 (UTC)
 * Yes check.svg Done by &mdash; Martin (MSGJ · talk) 19:39, 30 August 2017 (UTC)

Needed mw.loader change
I propose to change line 1223 from " " to " " -- the location of the diff CSS styles having recently changed. I'm posting this first in case anyone has an objection (if not, go ahead and do it!). --R'n'B (call me Russ) 18:08, 23 January 2018 (UTC)
 * +1. See WP:Village pump (technical)#mediawiki.action.history.diff. Helder 20:13, 23 January 2018 (UTC)

✅ --R'n'B (call me Russ) 20:58, 23 January 2018 (UTC)
 * Ah - that would explain why my version of Lupin's spellchecker with my own tweaked .js file has stopped working.  The change at line 1223 got it back functioning again. Thanks for posting this.  Regards from the UK, Nick Moyes (talk) 22:36, 12 February 2018 (UTC)