The Wayback Machine - https://web.archive.org/web/20151018180502/https://phabricator.wikimedia.org/T44357

Show number of items on Whatlinkshere if less than limit value
OpenPublic

Description

It would be to useful to show the number of items displayed on Special:WhatLinksHere if it is less than the limit value (in other words, all appearing on a single page).

E.g. when limit=50, if 35 results are returned, display "Showing 35 results."

Note: this isn't quite the same as #4394.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=4394
https://bugzilla.wikimedia.org/show_bug.cgi?id=6424

bzimport set Reference to bz42357.
Scott created this task.Via Legacy · Nov 22 2012, 12:39 PM
Scott added a comment.Via Conduit · Nov 22 2012, 12:41 PM
Comment Actions

Bug 4394, even.

MrBlueSky added a comment.Via Conduit · Dec 7 2012, 9:38 PM
Comment Actions

The actual limit on the number of results which are shown is something of a moving target because of bug [[bug 42357]], at least when redirects are shown.

MrBlueSky added a comment.Via Conduit · Dec 7 2012, 9:39 PM
Comment Actions

Bug 6424, actually ;)

Technical13 added a comment.Via Conduit · Feb 24 2014, 12:30 AM
Comment Actions

Adding:

$('div#mw-content-text').html($('div#mw-content-text').html().replace(/previous [\d,]* \| next [\d,]*/, 'showing all ' + $('ul#mw-whatlinkshere-list li').length + ' results'));

to my [[Special:MyPage/common.js]] works for me. Of course, you could add some formatting in there if you were so inclined...

Technical13 added a comment.Edited · Via Conduit · Feb 24 2014, 1:15 AM
Comment Actions
/* show result count if all results are shown on one page */
if ( $( 'div#mw-content-text' ).html().search( /previous [\d,]* \|  next [\d,]*/ ) !== -1 ) {
   var allPagesReplace = 'showing ';
    if ( $( 'ul#mw-whatlinkshere-list li' ).length === 1 ) {
        allPagesReplace += 'the only ';
    } else if ( $( 'ul#mw-whatlinkshere-list li' ).length > 1 ) {
        allPagesReplace += 'all ' + $( 'ul#mw-whatlinkshere-list li' ).length;
    }
    allPagesReplace += ' result';
    if( $( 'ul#mw-whatlinkshere-list li' ).length > 1 ) {
        allPagesReplace += 's';
    }
   $( 'div#mw-content-text' ).html( $( 'div#mw-content-text' ).html().replace( /previous [\d,]* \|  next [\d,]*/g, allPagesReplace ) );
}

Is the anal retentive version...
Can be loaded locally on enwp with:
importScript( 'User:Technical 13/Scripts/Gadget-pageCount.js' );// [[User:Technical 13/Scripts/Gadget-pageCount]]

or globally on any other mw site with:
mw.loader.load( 'en.wikipedia.org/w/index.php?title=User:Technical 13/Scripts/Gadget-pageCount.js&action=raw&ctype=text/javascript' );[[User:Technical 13/enwpScripts]]

Since this can be done very easily with JavaScript, closing as WORKSFORME

Legoktm added a comment.Via Conduit · Feb 24 2014, 1:17 AM
Comment Actions

Userscripts aren't a valid solution.

gerritbot added a comment.Via Conduit · Apr 22 2014, 4:10 AM
Comment Actions

Change 127866 had a related patch set uploaded by Gerrit Patch Uploader:
Show number of displayed pages on WhatLinksHere

https://gerrit.wikimedia.org/r/127866

Nikerabbit added a comment.Via Conduit · Apr 22 2014, 7:33 AM
Comment Actions

Why not just change ul to ol?

Nemo_bis added a comment.Via Conduit · Apr 22 2014, 7:40 AM
Comment Actions

(In reply to Niklas Laxström from comment #9)

Why not just change ul to ol?

No opinion, but ol would be more noisy.

PiRSquared17 added a comment.Via Conduit · Apr 22 2014, 11:57 AM
Comment Actions

(In reply to Nemo from comment #10)

(In reply to Niklas Laxström from comment #9)
> Why not just change ul to ol?

No opinion, but ol would be more noisy.

Maybe the person who requested this could comment on that. If not, would it be better to display the count above the list?

Scott added a comment.Via Conduit · Apr 28 2014, 5:51 PM
Comment Actions

(In reply to PiRSquared17 from comment #8)

Demo: http://pirsquared-dev.wmflabs.org/wiki/Special:WhatLinksHere/Cake

I may be missing something here but this demo doesn't appear to be a demo of my request. If it were, it would say "showing 5 results"....

(In reply to Nemo from comment #10)

(In reply to Niklas Laxström from comment #9)
> Why not just change ul to ol?

No opinion, but ol would be more noisy.

I've just tried switching WhatLinksHere's standard output to an ol on a 50-item result list and it is very noisy - plus kind of confusing if you don't know that the results are displayed in order of creation. I don't think it would be much of an inprovement.

Reguyla moved this task to What links here on the MediaWiki-Special-pages workboard.Via Web · May 26 2015, 2:59 AM
Technical13 removed a subscriber: Technical13.Via Web · May 26 2015, 3:12 AM
Ainali added a subscriber: Ainali.Via Web · May 26 2015, 6:06 AM

Add Comment

Morty Proxy This is a proxified and sanitized view of the page, visit original site.