您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
优化果壳选课界面
当前为
// ==UserScript== // @name 果壳选课优化 // @namespace https://jwxk.ucas.ac.cn/ // @version 0.1 // @description 优化果壳选课界面 // @author You // @include *//jwxk.ucas.ac.cn/courseManage/* // @icon https://www.google.com/s2/favicons?sz=64&domain=ucas.ac.cn // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function hideFullCourse() { let body = document.querySelector("#regfrm > table > tbody") if (body === null) { return } for (let i = 0; i < body.childElementCount; i++) { let node = body.children[i] if (node.firstElementChild.firstElementChild.disabled) { node.style.display = "none" } } } function showEnglishCourseButton() { let box = document.querySelector("#regfrm2 > div:nth-child(9)") if (box === null) { return } let button = document.createElement('button') button.id = 'go-english-btn' button.innerHTML = '跳转英语课' button.setAttribute('class', 'btn btn-primary') button.setAttribute('type', 'submit') button.onclick = function() { document.querySelector("#id_915").checked = true document.querySelector("#regfrm2 > div:nth-child(9) > button").click() } box.appendChild(button) } function showCourseCount() { let body = document.querySelector("#regfrm > table > tbody") if (body === null) { return } let count = 0 for (let i = 0; i < body.childElementCount; i++) { let node = body.children[i] if (!node.firstElementChild.firstElementChild.disabled) { count++ } } let node = document.querySelector("#main-content > div > div.m-cbox.m-lgray > div.mc-body > div.alert-danger") node.innerHTML = node.innerHTML + '<br/>当前可选课程数量:' + count } function start() { console.log('start') hideFullCourse() showEnglishCourseButton() showCourseCount() } setTimeout(start, 100) })();