// ==UserScript== // @name 形势与政策,可挂后台,自动切换专题 // @namespace http://tampermonkey.net/ // @version 2.3.7 // @description 进入个人学习界面后选择好要挂的专题以及时长,即可开始挂课 // @author Lai // @match http://xsyzc.gzcc.cn/* // @grant none /* globals jQuery, $, waitForKeyElements */ // @downloadURL none // ==/UserScript== function x_y() { var x = Math.random() * 1000; var y = Math.random() * 1000; x = parseInt(x).toString(); y = parseInt(y).toString(); $("#xID").attr("value", x); $("#yID").attr("value", y); setTimeout(() => { x_y() }, 5000) } function win111(){ var a = []; var b = []; for (var i = 1; i < 6; i++) { var n = "q" + i; var q = document.getElementsByName(n); if(q[0].checked){ a.push(parseInt(q[0].value)); b.push(parseFloat(q[1].value)); } } fun(0,a,b); } function fun(n, p, q) { var xx = document.querySelectorAll(".nav-item .dropdown-menu li a"); xx[p[n]].click(); setTimeout(function () { $('#win').window('close'); fun(n++, p, q); }, q[n++] * 60 * 1000); setTimeout(() => { x_y() }, 5000) } const info = $("
\n" + "
\n"+ "

受网络影响,建议输入时长比预期时长多0.5~1分钟

\n" + " 专题1时长:(分钟)
\n" + " 专题2时长:(分钟)
\n" + " 专题3时长:(分钟)
\n" + " 专题4时长:(分钟)
\n" + " 专题5时长:(分钟)
\n" + " \n" + "
\n"+ " \n"+ "
") $("html").append(info) $("#btn").click(() => { win111(); }) var fa = document.getElementById("fa"); var zi = document.getElementById("zi"); var zizi = document.getElementById("zizi"); function dragFunc(id) { var Drag = document.getElementById(id); Drag.onmousedown = function (event) { var ev = event || window.event; event.stopPropagation(); var disX = ev.clientX - Drag.offsetLeft; var disY = ev.clientY - Drag.offsetTop; document.onmousemove = function (event) { var ev = event || window.event; Drag.style.left = ev.clientX - disX + "px"; Drag.style.top = ev.clientY - disY + "px"; Drag.style.cursor = "move"; }; }; Drag.onmouseup = function () { document.onmousemove = null; this.style.cursor = "default"; }; }; dragFunc("fa") var tp = true; fa.ondblclick = function () { // 缩小 if (tp) { fa.style.width = 40 + "px"; fa.style.height = 40 + "px"; zi.style.display = "none" zizi.style.display = "block" tp = !tp; } else { //放大 fa.style.width = 380+"px"; fa.style.height = 250 + "px"; zizi.style.display = "none" zi.style.display = "block" tp = !tp; } }