Greasy Fork

来自缓存

Massive Reset for Lon-Capa

One click button to reset whole section

目前为 2017-09-08 提交的版本。查看 最新版本

// ==UserScript==
// @name        Massive Reset for Lon-Capa
// @namespace   Peijun Zhu
// @description One click button to reset whole section
// @include     http://nplq1.phyast.pitt.edu/adm/grades
// @include     http://homework.phyast.pitt.edu/adm/grades
// @version     2
// @grant       none
// @icon        http://www.courseweaver.com/images/lc_logo.png
// ==/UserScript==
function resetAll() {
    l = document.getElementsByTagName('select');
    for (index = 0; index < l.length; ++index) {
        if (!l[index].value) {
            l[index].value = 'reset status';
        }
    }
}
id = "resetall_button";
t=document.getElementById(id);
if(t===null){
    var resetButton=document.createElement("input");
    resetButton.setAttribute("id", id);
    resetButton.type="button";
    resetButton.value="Reset Current Section";
    resetButton.onclick = resetAll;
    document.body.appendChild(resetButton);
}