用户:Salt lovely/common.js
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
/*使用wikiplus*/
mw.loader.load('https://wikiplus-app.com/Main.js');
/* var new_element1 = document.createElement("link");
new_element1.setAttribute("rel", "stylesheet");
new_element1.setAttribute(
"href",
"http://cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css"
);
document.head.appendChild(new_element1);
var new_element2 = document.createElement("script");
new_element2.setAttribute("type", "text/javascript");
new_element2.setAttribute(
"src",
"http://cdn.bootcss.com/highlight.js/8.0/highlight.min.js"
);
document.head.appendChild(new_element2);
var new_element3 = document.createElement("script");
new_element3.innerHTML="hljs.initHighlightingOnLoad();";
document.head.appendChild(new_element3);
*/
$('head').append('<link href="https://cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css" rel="stylesheet"><script src="https://cdn.bootcss.com/highlight.js/8.0/highlight.min.js"></script><script >hljs.initHighlightingOnLoad();</script>');
$(document).ready(function(){
function countLog(obj) {
$(obj).each(function(){
var count=$(this).children('li').length;
$(this).prepend('<span>共计'+count+'条记录</span>');
});
}
/*清理缓存*/
$('#pt-logout').before('<li id="pt-purge"><a title="刷新页面并清理缓存" href="?action=purge">清理缓存</a><li>');
/*日志统计*/
countLog("#mw-log-deleterevision-submit>ul");
});