// ==UserScript==
// @name whut相关网站优化
// @version 0.4.1
// @description 1.进入选课系统不用等待30秒。2.可以查看课程对应的推荐班级。3.评教模块。4.大物实验视频播放页提供下载按钮.5.成绩查询界面
// @namespace TheFirstVoyageOfTheArk
// @author NoahSuo
// @include http*://218.197.102.183/Course/login.do?msg=*
// @include http*://202.114.50.130/EOT/login.do?msg=*
// @include http*://202.114.50.130/Score/login.do?msg=*
// @include http*://jxpt.whut.edu.cn:81/meol/common/stream/player.jsp?fileId=*
// @require http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
// @run-at document-end
// @downloadURL https://update.greasyfork.icu/scripts/401459/whut%E7%9B%B8%E5%85%B3%E7%BD%91%E7%AB%99%E4%BC%98%E5%8C%96.user.js
// @updateURL https://update.greasyfork.icu/scripts/401459/whut%E7%9B%B8%E5%85%B3%E7%BD%91%E7%AB%99%E4%BC%98%E5%8C%96.meta.js
// ==/UserScript==
$(document).ready(function(){
//添加样式
(function(){
var css = document.createElement('style');
css.type='text/css';
css.innerHTML=`.mybutton{background: #2866bd;color: #fff;text-align: center;border: 2px solid #E5E5E5;display: inline-block;cursor:pointer;}`;
document.getElementsByTagName('head')[0].appendChild(css);})();
//评教模块
if(/202.114.50.130\/EOT\/login.do\?msg/g.test(window.location.href)){
$($("ul.nav").children()[4]).after(`
`);
$($("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='评教时间已过
';
return;
}
else if(current>start){
if(state.textContent=="未评") state.innerHTML='可以评教
';
return;
}
else{
if(state.textContent=="未评") state.innerHTML='评教未开始
';
return;
}
})
}
)
$($("ul.nav").children()[5]).after(`▼ `);
$('body').append(`
`)
let setting = $($("ul.nav").children()[6]).children()[1];
let pj_action = $($("ul.nav").children()[6]).children()[0];
$(setting).click(function(){let content = $('#setting-content');
if(content.css("display")=="none") content.css("display","block");else content.css("display","none")
});
$(pj_action).click(function(){let sel = $('input[name="sl-method"]').index($('input[name="sl-method"]:checked'));
let items = $(".unit",$('.pageFormContent'));
for (let i = 0; i < 10; i++) {
if(sel==4) {$(items[i].children[Math.floor(Math.random()*4)]).click();continue;}
$(items[i].children[sel]).click()
}
});
}
//选课系统
if(/218.197.102.183\/Course\/login.do\?msg/g.test(window.location.href)){
(function(){var e = document.getElementById("MyDiv").children[0];
e.outerHTML = `
关闭 `})();
$($("ul.nav").children()[3]).after(` `);
$($("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;
}
let banji = commentFilter().match(/>(.*) `)
$("#myuser").click(function(){window.open($('video').attr('src'));})
}
//成绩查询
if(/202.114.50.130\/Score\/login.do\?msg/g.test(window.location.href)){
$($("ul.nav").children()[4]).after(` `);
$(".accordionContent:eq(0)>ul>li:eq(0)>ul:eq(0)>li:eq(0) a").click(
function(){
$($(".myuserconfig")[0]).css("display","inline-block");//点亮图标
$($(".myuserconfig")[0]).val("自我安慰");
}
);
$($('*[href="xskwxfList.do"]')[0]).click(
function(){
$($(".myuserconfig")[0]).css("display","inline-block");//点亮图标
$($(".myuserconfig")[0]).val("计算课外学分总和");
}
);
$($("ul.nav").children()[5]).click(
function(){
if($($(".myuserconfig")[0]).val()=="自我安慰"){
let trs=$("tr",$("tbody")[1]);
$(trs).each(
function(){
let tds = $("td",this)
if($(tds[3]).text()=="实践课"){
console.log($(tds[2]).text());
$(tds[6]).text("完美");
}
else $(tds[6]).text(100);
$(tds[8]).text(100);
$(tds[9]).text(100);
$(tds[13]).text("5.0");
}
)
}
else if($($(".myuserconfig")[0]).val()=="计算课外学分总和"){
let trs=$("tr",$("tbody")[1]);
let sum=0;
$(trs).each(
function(){
sum+=parseFloat($($("td",this)[5]).text());
console.log($($("td",this)[5]).text());
}
);
alert(sum);
}
}
)
}
});