User:Irukaza/common.js
跳到导航
跳到搜索
注意:这类代码页面在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- 按住
CTRL+SHIFT+DEL 或 ⌘-Shift-R
来清除缓存! - 或尝试在地址栏的地址最后添加代码
?_=1
来访问最新页面。 - 你还可以在设置中勾选小工具在页面右上角添加清除缓存按钮!
//Explanations for this javaScript code in http://zh.moegirl.org/User:AnnAngela/js
(function(mw) {
mw.loader.implement('AnnToolsPersonalLabel', function($, jQuery) {
$('#pt-watchlist').after('<li id="pt-backlog"><a href="//www.hmoegirl.com/分类:积压工作">积压工作</a></li><li id="pt-sandbox"><a href="//www.hmoegirl.com/User:=海豚=/沙盒">我的沙盒</a></li>');
});
})(mediaWiki);
$('#mw-content-text a').each(function() {
try {
var link = new mw.Uri(this.href);
if (link.host !== 'commons.moegirl.org') return;
if (/^\/api\.php/i.test(link.path)) return;
if (!link.query.title && /\.php$/i.test(link.path)) return;
if (link.query && (link.query.action || link.query.diff)) return;
var href = ((link.query.title || decodeURI(link.path.substring(1))).match(/^user:[^\/]+|^user[ _]talk:[^\/]+/i) || [null])[0];
if (href) $(this).after('<sub>[<a target="_blank" title="主站上的用户 ' + href.replace(/user(_talk)?\:/i, '') + '" href="https://zh.moegirl.org/' + href + '">主</a>]</sub>');
} catch (e) {
return;
}
});