// ==UserScript==
// @name 中国电信网上大学知识中心自动挂课
// @namespace http://tampermonkey.net/
// @version 0.7
// @description 点击知识中心右下加的启动按钮,开启无人值守自动挂课模式!
// @author HuangDingYun
// @match https://kc.zhixueyun.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=zhixueyun.com
// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// @grant unsafeWindow
// @grant GM_openInTab
// @grant GM.openInTab
// @grant GM_getValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM.setValue
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @grant GM_registerMenuCommand
// @grant GM_addValueChangeListener
// @downloadURL none
// ==/UserScript==
var $ = unsafeWindow.jQuery;
var classList = new Array();
var classList1 = new Array();
var nowCount = 0;
var divButton = '
';
var mideaButton = '';
(function() {
'use strict';
setTimeout(function(){
var url=window.location.hash
var urlStr=url.toString()
//增加页面功能按钮
if(urlStr.match("/study/subject/detail/")){
$("#D60toolbarTab").append(divButton)
}
//判断是否是课程页面
if($("div.vjs-control-bar").length!=0){
console.log("检测播放进度")
isFinished()
}
},2500);
setTimeout(function(){
if($("button.videojs-referse-btn").length!=0){
console.log("开始播放")
playMedil()
}
},4000);
// Your code here...
})();
unsafeWindow.startAutoClass =function (){
$("div.item.current-hover").each(function(index,element){
if($(this).find("i.icon-reload").length==0 && $(this)[0].firstElementChild.querySelector("span.section-type").innerText == "课程"){
classList1.push($(this).attr("id"))
}
})
console.log(classList1)
if(classList1.length!=0){
openClassPage2(0)
}else{
alert("已经完成当前课题下的全部课程!")
}
}
GM_onMessage('_.unique.name.greetings', function(src, message) {
console.log('[onMessage]', src, '=>', message);
nowCount++;
if(nowCount