User:Gifted9/common.js: Difference between revisions
Content deleted Content added
wikia:dev:CodeLinksDropdown, maybe |
+ miscellany to user dropdown |
||
Line 14: | Line 14: | ||
}); |
}); |
||
// add a bunch of stuff to my user tools dropdown. documentation at [[mw:ResourceLoader/Core modules]] and https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util-method-addPortletLink |
|||
// import |
|||
// First wait for mediawiki.util to load, and the page to be ready. |
|||
importArticles({ |
|||
mw.loader.using('mediawiki.util', function() { |
|||
type: 'script', |
|||
articles: [ |
|||
// General usage pattern: mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ ); |
|||
'u:dev:MediaWiki:CodeLinksDropdown.js', |
|||
⚫ | |||
// personal common.js |
|||
}); |
|||
mw.util.addPortletLink( |
|||
'p-personal', |
|||
mw.util.getUrl('Special:MyPage/' + "common.js"), |
|||
'Logs'); |
|||
⚫ |
Revision as of 15:11, 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( ' | ' )
});
// add a bunch of stuff to my user tools dropdown. documentation at [[mw:ResourceLoader/Core modules]] and https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util-method-addPortletLink
// First wait for mediawiki.util to load, and the page to be ready.
mw.loader.using('mediawiki.util', function() {
// General usage pattern: mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ );
// personal common.js
mw.util.addPortletLink(
'p-personal',
mw.util.getUrl('Special:MyPage/' + "common.js"),
'Logs');
});