jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/359498 )
Change subject: Follow-up 6b83e12aee71: reenable fromrc handling, but without
breaking visited links
......................................................................
Follow-up 6b83e12aee71: reenable fromrc handling, but without breaking visited
links
Per Krinkle's recommendation on the task, use replaceState to remove fromrc=1
from the URL, so that visited links don't break.
Bug: T158458
Change-Id: I8711083c3d9add0cb09374bd2f3b8e96d740ca34
---
M modules/ext.wikimediaEvents.recentChangesClicks.js
1 file changed, 7 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Mooeypoo: Looks good to me, approved
diff --git a/modules/ext.wikimediaEvents.recentChangesClicks.js
b/modules/ext.wikimediaEvents.recentChangesClicks.js
index 5779188..9e35caf 100644
--- a/modules/ext.wikimediaEvents.recentChangesClicks.js
+++ b/modules/ext.wikimediaEvents.recentChangesClicks.js
@@ -44,7 +44,7 @@
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) ===
'Recentchanges' ) {
$( '.mw-changeslist' ).on( 'click', 'a[href]', function
( e ) {
- var selector,
+ var selector, target,
type = 'unknown',
$link = $( this );
if ( e.which === 3 ) {
@@ -52,10 +52,9 @@
}
// Add fromrc=1 to the URL
- // DISABLED for now because it messes with link
visited colors (T158458#3161869)
- /*target = new mw.Uri( $link.attr( 'href' ) );
+ target = new mw.Uri( $link.attr( 'href' ) );
target.extend( { fromrc: 1 } );
- $link.attr( 'href', target.toString() );*/
+ $link.attr( 'href', target.toString() );
// Figure out the link type
for ( selector in linkTypes ) {
@@ -109,6 +108,10 @@
// Log an event
trackClick( type, getPageType() );
} );
+
+ // Remove fromrc=1 from the URL
+ delete uri.query.fromrc;
+ history.replaceState( null, document.title, uri );
}
} );
--
To view, visit https://gerrit.wikimedia.org/r/359498
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8711083c3d9add0cb09374bd2f3b8e96d740ca34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits