Created
November 14, 2009 07:10
-
-
Save crabtw/234423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name portal corse list | |
// @namespace portal | |
// @include https://portal.yzu.edu.tw/VC2/Student/classLeft_S.aspx | |
// ==/UserScript== | |
var sw = GM_getValue("switch", null) || "on"; | |
if(sw == "on") { | |
document.body.innerHTML = document.body.innerHTML.replace( | |
/(課程名稱【(\W+)[A-Z] ?班】[^>]*>)[^<]+<\/a>/g, "$1$2</a>" | |
); | |
} | |
var link = document.createElement("a"); | |
link.href = "#"; | |
link.textContent = "switch: " + sw; | |
link.className = "left_menu"; | |
link.addEventListener("click", function(e) { | |
sw = sw == "on" ? "off" : "on"; | |
GM_setValue("switch", sw); | |
location.reload(); | |
}, false); | |
var menu = document.getElementsByClassName("menu")[0]; | |
var thead = menu.createTHead(); | |
thead.align = "center"; | |
thead.appendChild(link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment