User:Irukaza/common.js

H萌娘,万物皆可H的百科全书!
< User:Irukaza
imported>=海豚=2020年4月8日 (三) 16:29的版本
跳到导航 跳到搜索

注意:这类代码页面在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • 按住CTRL+SHIFT+DEL 或 ⌘-Shift-R来清除缓存!
  • 或尝试在地址栏的地址最后添加代码?_=1来访问最新页面。
    添加代码后的本页地址如下:-{R|https://hmoegirl.com/User:Irukaza/common.js?_=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 !== 'www.hmoegirl.com') 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;
            }
        });