r70270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70269‎ | r70270 | r70271 >
Date:09:20, 1 August 2010
Author:ialex
Status:reverted (Comments)
Tags:
Comment:
* (bug 24563) Entries on Special:WhatLinksHere now have a link to their history
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -262,11 +262,13 @@
263263 }
264264
265265 protected function listItem( $row, $nt, $notClose = false ) {
 266+ global $wgLang;
 267+
266268 # local message cache
267269 static $msgcache = null;
268270 if ( $msgcache === null ) {
269271 static $msgs = array( 'isredirect', 'istemplate', 'semicolon-separator',
270 - 'whatlinkshere-links', 'isimage' );
 272+ 'whatlinkshere-links', 'isimage', 'hist' );
271273 $msgcache = array();
272274 foreach ( $msgs as $msg ) {
273275 $msgcache[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
@@ -301,8 +303,10 @@
302304 }
303305
304306 # Space for utilities links, with a what-links-here link provided
305 - $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
306 - $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' );
 307+ $tools = array();
 308+ $tools[] = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
 309+ $tools[] = $this->skin->linkKnown( $nt, $msgcache['hist'], array(), array( 'action' => 'history' ) );
 310+ $wlh = Xml::wrapClass( '(' . $wgLang->pipeList( $tools ) . ')', 'mw-whatlinkshere-tools' );
307311
308312 return $notClose ?
309313 Xml::openElement( 'li' ) . "$link $propsText $wlh\n" :
Index: trunk/phase3/RELEASE-NOTES
@@ -120,6 +120,7 @@
121121 easily replicated by custom user scripts for those who really want it.
122122 * Non-file pages can no longer be moved to the file namespace, nor vice versa.
123123 * (bug 671) The <dfn> element has been whitelisted in user input.
 124+* (bug 24563) Entries on Special:WhatLinksHere now have a link to their history
124125
125126 === Bug fixes in 1.17 ===
126127 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r81496Revert r70270; per CR comments.happy-melon00:20, 4 February 2011

Comments

#Comment by TheDJ (talk | contribs)   12:04, 21 November 2010

I'm confused. Why should be able to do this ? What makes history so special in the context of "linking to pages", that it warrents inclusion ? It might also be handy to directly go to the edit page and a delete link might be handy as well sometimes.

#Comment by Hashar (talk | contribs)   12:06, 21 November 2010

(remarking new).

#Comment by Happy-melon (talk | contribs)   17:47, 17 December 2010

Also not convinced that this is beneficial. The one existing action link is to view WhatLinksHere for that page, which is clearly link-related. Don't think history is particularly relevant here.

#Comment by Happy-melon (talk | contribs)   17:48, 17 December 2010

Mark fixme to attract some more commenters... :D

#Comment by MZMcBride (talk | contribs)   18:03, 17 December 2010

I don't think this should be in core, but instructions/tools to implement this functionality in JavaScript (jQuery now, I guess) should be much more readily available.

#Comment by Happy-melon (talk | contribs)   18:32, 17 December 2010

It's about three lines in jQuery:

$('#mw-whatlinkshere-list li').each(function(){	
    $('.mw-whatlinkshere-tools a:last',this).after(
        $('<a href="'+$('a:first',this).attr('href')+'?action=history">hist</a>')
    ).after('|');
});

Works for wikis with short urls, only needs a little tweaking for other formats.

#Comment by Krinkle (talk | contribs)   18:40, 17 December 2010

Works on any mediawiki:

$( '#mw-whatlinkshere-list li' ).each( function(){	
    $( '.mw-whatlinkshere-tools a:last', this ).after(
        $( '<a>' ).attr( 'href', wgScript +'?title=' + encodeURIComponent( $( 'a:first', this ).text() ) + '&action=history').text( 'hist' )
    ).after(' | ');
});
#Comment by MZMcBride (talk | contribs)   23:03, 17 December 2010

Thank you both for the snippets. I posted Krinkle's version at jQuery snippets. I think that's (slightly) less obscure than code comments on a random revision.

#Comment by Nikerabbit (talk | contribs)   10:48, 18 December 2010

/me is still waiting for the universal JS-based page tool links to remove visual clutter in all listings.

#Comment by Catrope (talk | contribs)   16:16, 31 December 2010

Why was this tagged revert1.17? I see no reason to revert this in 1.17 but not trunk, so I won't revert it in 1.17 unless and until it's been reverted on trunk.

#Comment by Catrope (talk | contribs)   12:37, 3 February 2011

Untagging revert1.17. It seems harmless and has not been reverted in trunk. If someone really wants this to die, they can revert it in trunk and tag that revision for 1.17.

#Comment by Platonides (talk | contribs)   22:42, 3 February 2011

I don't see the need for history either. Why history and not edit, for example? If any, I would modify whatlinkshere-links so that those links can be created in MediaWiki namespace.

#Comment by Happy-melon (talk | contribs)   00:20, 4 February 2011

Reverted in r81496.

Status & tagging log