User:Gifted9/common.js: Difference between revisions
Content deleted Content added
Replaced content with "//jwb mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');" Tags: Replaced Manual revert |
tinkering w mw:Special:WhatLinksHere_action_links |
||
Line 1: | Line 1: | ||
//jwb |
//jwb |
||
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); |
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); |
||
/** |
|||
* Special:WhatLinksHere edit, history and delete links |
|||
* |
|||
* Adds "edit", "hist" and "delete" link 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( ' | ' ) |
|||
.after( $( '<a>' ).attr( 'href', url + 'edit' ).text( 'edit' ) ).after( ' | ' ); |
|||
}); |
Revision as of 18:44, 22 March 2023
//jwb
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');
/**
* Special:WhatLinksHere edit, history and delete links
*
* Adds "edit", "hist" and "delete" link 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( ' | ' )
.after( $( '<a>' ).attr( 'href', url + 'edit' ).text( 'edit' ) ).after( ' | ' );
});