User:Gifted9/common.js: Difference between revisions

The most up-to-date image and information guide on Webkinz Classic items, events, and more!
Content deleted Content added
Line 3: Line 3:


/**
/**
* Special:WhatLinksHere edit, history and delete links
* adds history and delete links to Special:WhatLinksHere
*
* Adds "edit", "hist" and "delete" link to [[Special:WhatLinksHere]]
*
* @source: https://www.mediawiki.org/wiki/Snippets/Special:WhatLinksHere_history_link
* @source: https://www.mediawiki.org/wiki/Snippets/Special:WhatLinksHere_history_link
* @rev: 2
* @rev: 2
Line 15: Line 12:
.after( $( '<a>' ).attr( 'href', url + 'delete' ).text( 'delete' ) ).after( ' | ' )
.after( $( '<a>' ).attr( 'href', url + 'delete' ).text( 'delete' ) ).after( ' | ' )
.after( $( '<a>' ).attr( 'href', url + 'history' ).text( 'hist' ) ).after( ' | ' )
.after( $( '<a>' ).attr( 'href', url + 'history' ).text( 'hist' ) ).after( ' | ' )
});
.after( $( '<a>' ).attr( 'href', url + 'edit' ).text( 'edit' ) ).after( ' | ' );

// import

importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:CodeLinksDropdown.js',
]
});
});

Revision as of 15:00, 23 March 2023

//jwb
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');

/**
 * adds history and delete links to Special:WhatLinksHere 
 * @source: https://www.mediawiki.org/wiki/Snippets/Special:WhatLinksHere_history_link
 * @rev: 2
 */
$( '#mw-whatlinkshere-list li' ).each( function() {
	var url = mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( $( 'a:first', this ).text() ) + '&action=';
	$( '.mw-whatlinkshere-tools a:last', this )
		.after( $( '<a>' ).attr( 'href', url + 'delete' ).text( 'delete' ) ).after( ' | ' )
		.after( $( '<a>' ).attr( 'href', url + 'history' ).text( 'hist' ) ).after( ' | ' )
});

// import 

importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:CodeLinksDropdown.js',
    ]
});