User:Lantx/ArticleInfo-wikimirror.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
//Released under GPL v3 license
(function() {
var dom = document.getElementById('contentSub');
if (dom && mw.config.get('wgAction') === 'view' && mw.config.get('wgIsArticle') && mw.config.get('wgCurRevisionId') === mw.config.get('wgRevisionId') && !mw.config.get('wgServerName').match(/wikimirror\.org$/)) {
dom.insertAdjacentHTML('beforebegin', '<div id=\"xtools\" style=\"font-size:84%;line-height:1.2em;width:auto\"><span id=\"xtools_result\"></span></div>');
$.get('//xtools.wmflabs.org' + '/api/page/articleinfo/' + mw.config.get('wgDBname') + '/' + mw.config.get('wgPageName').replace(/["?%&+]/g, escape) + '?format=html' + '&uselang=' + mw.config.get('wgUserLanguage')).done(function(info) {
document.getElementById('xtools_result').insertAdjacentHTML('afterbegin', info)
})
}
})();