利用者:Tietew/log.js
表示
お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。
多くの Windows や Linux のブラウザ
- Ctrl を押しながら F5 を押す。
Mac における Safari
Mac における Chrome や Firefox
- ⌘ Cmd と ⇧ Shift を押しながら R を押す。
詳細についてはWikipedia:キャッシュを消すをご覧ください。
// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY.
// You can use/modify/redistribute without any permission.
$.when(
mw.loader.using('mediawiki.util'),
$.ready
).then(function() {
var pagetitle = mw.config.get('wgPageName');
var ns = mw.config.get('wgNamespaceNumber');
// insertion point of toolbox
var lit = document.getElementById('t-recentchangeslinked');
if (!lit) lit = document.getElementById('t-whatlinkshere');
if (!lit) return; // if not found, we're on a special page
var nextnode = lit.nextElementSibling;
if (!nextnode) return;
// purge cache
var portlet = mw.util.addPortletLink(
'p-tb',
mw.util.getUrl(pagetitle, {action: 'purge'}),
'Purge cache',
't-purgecache',
undefined,
undefined,
nextnode
);
if (portlet) nextnode = portlet;
// User: or User_talk:
var user;
if ((ns === 2 || ns === 3) && (user = mw.config.get('wgRelevantUserName'))) {
portlet = mw.util.addPortletLink(
'p-tb',
mw.util.getUrl('Special:Log', {user: user, wpFormIdentifier: 'logeventslist'}),
'User log',
't-userlog',
undefined,
undefined,
nextnode
);
if (portlet) nextnode = portlet;
// IP address
if (mw.util.isIPAddress(user)) {
mw.util.addPortletLink(
'p-cactions',
'//wq.apnic.net/apnic-bin/whois.pl?searchtext=' + user,
'whois',
'ca-whois'
);
}
}
// Page log
portlet = mw.util.addPortletLink(
'p-tb',
mw.util.getUrl('Special:Log', {page: pagetitle}),
'Page log',
't-pagelog',
undefined,
undefined,
nextnode
);
// File: or File_talk:
if ((ns === 6 || ns === 7) && location.host !== 'commons.wikimedia.org') {
mw.util.addPortletLink(
'p-cactions',
'//commons.wikimedia.org/wiki/' + (ns === 6 ? 'File:' : 'File_talk:') + mw.config.get('wgTitle'),
'commons',
'ca-commons'
);
}
});