Greasy Fork

Greasy Fork is available in English.

whut相关网站优化

1.进入选课系统不用等待30秒。2.可以查看课程对应的推荐班级

目前为 2020-05-10 提交的版本。查看 最新版本

// ==UserScript==
// @name   whut相关网站优化
// @version      0.3.6
// @description  1.进入选课系统不用等待30秒。2.可以查看课程对应的推荐班级
// @namespace TheFirstVoyageOfTheArk
// @author       NoahSuo
// @include http*://218.197.102.183/Course/login.do?msg=*
// @include http*://202.114.50.130/EOT/login.do?msg=*
// @require http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
// @run-at       document-end
// ==/UserScript==

$(document).ready(function(){
if(/202.114.50.130\/EOT\/login.do\?msg/g.test(window.location.href)){
    $($("ul.nav").children()[4]).after(`<li id="myuser"><input type="submit" class="myuserconfig" value="查看状态" style="background: #2866bd;
    color: #fff;text-align: center;border: 2px solid #E5E5E5;display: inline-block;cursor:pointer;"></li>`);
    $($("ul.nav").children()[5]).click(
        function(){
            $('tr',$('tbody')[1]).each(function(){
                let start = $('td',this)[3].textContent;
                let end = $('td',this)[4].textContent;
                let state = $('td',this)[5];
                let current = (new Date()).formatDate("y-MM-dd");
                if(current>end){
                    if(state.textContent=="未评") state.innerHTML='<div style="background-color:red;">评教时间已过</div>';
                    return;
                }
                else if(current>start){
                    if(state.textContent=="未评") state.innerHTML='<div style="background-color:green;">可以评教</div>';
                    return;
                }
                else{
                    if(state.textContent=="未评") state.innerHTML='<div>评教未开始</div>';
                    return;
                }
            })
        }
    )
}
if(/218.197.102.183\/Course\/login.do\?msg/g.test(window.location.href)){
    (function(){var e = document.getElementById("MyDiv").children[0];
e.outerHTML = `<div style="text-align: right; cursor: default; height: 15px;">
<h1 style="font-size: 20px;"
onclick="CloseDiv('MyDiv','fade')">关闭</h1></div>`})();

$($("ul.nav").children()[3]).after(`<li id="myuser"><input type="submit" class="myuserconfig" value="排课班级" style="background: #2866bd;
    color: #fff;text-align: center;border: 2px solid #E5E5E5;display: inline-block;cursor:pointer;"></li>`);
$($("ul.nav").children()[4]).click(
    function(){
        $("div[title='备注']").first().text("排课班级");
        $('tr[target="suid_obj"]').each(
            function(){
                let tr = $(this).contents()
                function commentFilter(){
                    var str = "";
                    tr.filter(function() {
                        if(this.nodeType==8) str = this.data;
                      })
                      return str;
                }
                banji = commentFilter().match(/>(.*)</gs)[0].slice(1,-1);
                $("td",$(this)).eq(-2).text(banji);
            }
        )
    }
)
}
});