User:Jimmy Xu/common.js
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
importScript('User:Bencmq/Mass_rollback.js');
importScript('User:Jimmy_Xu/scripts/SummaryByteCounter.js');
importScript('User:Jimmy_Xu/scripts/cactions.js');
importScript('User:Jimmy_Xu/scripts/sig.js');
importScript('User:Kegns/prevent.js');
importScript('User:Liangent/Scripts/UndoRange.js');
(function() {
let replaceText = function(selector, text) {
document.querySelectorAll(selector).forEach(e => e.textContent = text);
}
if (/\/Wikipedia:(?:CV|%E9%A0%81%E9%9D%A2%E5%AD%98%E5%BB%A2%E8%A8%8E%E8%AB%96\/%E7%96%91%E4%BC%BC%E4%BE%B5%E6%AC%8A)$/.test(document.referrer)) {
let elem = document.querySelector('#ca-delete a');
elem.setAttribute('href', elem.getAttribute('href') + encodeURI('&wpReason=侵犯版权'));
}
mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'User:Jimmy_Xu/common.js'), 'common.js', 'n-commonjs', 'common.js');
mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'm:User:Jimmy_Xu/global.js'), 'global.js', 'n-globaljs', 'global.js');
mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'User:Jimmy_Xu/common.css'), 'common.css', 'n-commoncss', 'common.css');
mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'm:User:Jimmy_Xu/global.css'), 'global.css', 'n-globalcss', 'global.css');
mw.util.addPortletLink('p-tb', mw.config.get('wgArticlePath').replace('$1', 'Special:PrefixIndex/' + encodeURIComponent(mw.config.get('wgPageName'))), '前缀索引', 't-prefixindex', '所有具有此前缀的页面', 'i', document.getElementById('t-upload'));
replaceText('abbr.newpage', 'n');
replaceText('abbr.minoredit', 'm');
replaceText('abbr.botedit', 'b');
replaceText('abbr.wikibase-edit', 'd');
replaceText('li#ca-wikilove a', '友爱');
replaceText('li#ca-varlang-0 a', '不');
replaceText('li#ca-varlang-1 a', '简');
replaceText('li#ca-varlang-2 a', '繁');
replaceText('li#ca-varlang-3 a', '陆');
replaceText('li#ca-varlang-4 a', '港');
replaceText('li#ca-varlang-5 a', '澳');
replaceText('li#ca-varlang-6 a', '马');
replaceText('li#ca-varlang-7 a', '新');
replaceText('li#ca-varlang-8 a', '台');
document.querySelector('div#p-logo a').style.setProperty('background-image', 'url(//upload.wikimedia.org/wikipedia/commons/archive/6/62/20210913002946%21Wiki_zh-hans.png)', 'important');
})();