User:Tribe of Tiger/script experiments
Tribe of Tiger Let's Purrfect! 07:19, 6 February 2018 (UTC)
Tribeof Tiger 07:08, 6 February 2018 (UTC)
Tribe of Tiger Let's Purrfect!
if ( mw.config.values.wgCanonicalSpecialPageName === 'Whatlinkshere' ) {
$( function() {
'use strict';
var ul = $( '#mw-whatlinkshere-list' );
ul.before( '<button id="whatlinksheresort">Sort</button>' );
$( '#whatlinksheresort' ).click( function() {
var li = ul.children( 'li' );
li.detach().sort( function( a, b ) {
return $( a ).find( 'a' ).first().text().localeCompare( $( b ).find( 'a' ).first().text() );
} );
ul.append( li );
} );
} );
}
Stumped
Hi, GR - I'm trying out a couple of your scripts, but I'm stumped over how to use the generate diffs script. I've added it to common.js and I get the checkbox, copy to clipboard and input bar. What I'm not understanding is what to do with diff once it's generated. I tried putting it in the search bar but get nothing. I've attached an image of how it looks in Safari on my user contributions page - I'm assuming that's the only page it works on? It doesn't show-up on any other pages that I can tell.
As you can see by the image, the little box shows-up beside the diff with a checkmark, the copy diffs to clipboard is above the timeline, and when I click on copy diffs it automatically adds the diff in the input bar. I can check several diffs and it adds them all. I just don't know what to do with them after that. Atsme📞📧 12:22, 28 February 2018 (UTC)
- {{re|Atsme The purpose of this is to generate a list of diffs that can be pasted as wikitext into another page. So when I'm commenting on something at AE or ANI or something, it's very tedious to copy the link for each diff that I want to refer to. The script means I can select some diffs, click the 'Copy diffs to clipboard' button, then paste them into a project or talk page. The result should look like [[Special:Diff/1234567]], [[Special:Diff/12345678]]. It should work on user contribution pages and page history pages. It's particularly useful with Writ Keeper's commonHistory script which lets you inspect diffs within a user contribs or page history list. GoldenRing (talk) 14:34, 28 February 2018 (UTC)