|
|
| (未显示同一用户的32个中间版本) |
| 第1行: |
第1行: |
| /*使用wikiplus*/
| | mw.loader.load("//mcbbs.wiki/index.php?title=用户:Salt_lovely/user.js&action=raw&ctype=text/javascript", "text/javascript"); |
| mw.loader.load('https://wikiplus-app.com/Main.js'); | | // 受不了MW的**(粗口)JS压缩器了,是不是“ES2015”你们只支持了“ES”和“5”???????????? |
| /*引入高亮*/
| |
| $('head').append('<script src="https://cdn.bootcdn.net/ajax/libs/prettify/188.0.0/prettify.min.js"></script><link href="https://cdn.bootcdn.net/ajax/libs/prettify/r298/prettify.min.css" rel="stylesheet">')
| |
| /*文档准备完毕后执行*/
| |
| $(document).ready(function(){
| |
| function countLog(obj) {
| |
| $(obj).each(function(){
| |
| var count=$(this).children('li').length;
| |
| $(this).prepend('<span>共计'+count+'条记录</span>');
| |
| });
| |
| }
| |
| /*代码高亮*/
| |
| function colorizedPre(){
| |
| var preList = document.querySelectorAll("pre");
| |
| var i;
| |
| for (i = 0; i < preList.length; i++) {
| |
| preList[i].classList.add('prettyprint');
| |
| }
| |
| prettyPrint();
| |
| for (i = 0; i < preList.length; i++) {
| |
| preList[i].classList.remove('prettyprint');
| |
| }
| |
| }
| |
| setTimeout(() => {colorizedPre();}, 2000);
| |
| /*清理缓存*/
| |
| $('#pt-logout').before('<li id="pt-purge"><a title="刷新页面并清理缓存" href="?action=purge">清理缓存</a><li>');
| |
| | |
| /*日志统计*/
| |
| countLog("#mw-log-deleterevision-submit>ul");
| |
| | |
| });
| |
| | |
| //弃用代码
| |
| /* 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);
| |
| */
| |
| /*
| |
| var advanceFrame = function( parentElem, parentSelector ) {
| |
| var curFrame = parentElem.querySelector( parentSelector + ' > .animated-active' );
| |
| $( curFrame ).removeClass( 'animated-active' );
| |
| var $nextFrame = $( curFrame && curFrame.nextElementSibling || parentElem.firstElementChild );
| |
| return $nextFrame.addClass( 'animated-active' );
| |
| };
| |
| setInterval( function() {
| |
| $('#mw-content-text').find('.animated').each( function() {
| |
| var $nextFrame = advanceFrame( this, '.animated' );
| |
| if ( $nextFrame.hasClass( 'animated-subframe' ) ) {
| |
| advanceFrame( $nextFrame[0], '.animated-subframe' );
| |
| }
| |
| } );
| |
| }, 2000 );
| |
| */ | |
| /*
| |
| $('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>');
| |
| */
| |