Massive Reset for Lon-Capa

One click button to reset whole section

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Massive Reset for Lon-Capa
// @description One click button to reset whole section
// @namespace   https://peijunz.github.io
// @author      Peijun Zhu
// @include     http://nplq1.phyast.pitt.edu/adm/grades
// @include     http://homework.phyast.pitt.edu/adm/grades
// @version     2017.09.07.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);
}