Skip to content

Instantly share code, notes, and snippets.

@icecoldfire
Last active September 2, 2020 09:50
Show Gist options
  • Save icecoldfire/bf8a6ba81cceb8d9115d879e52433f23 to your computer and use it in GitHub Desktop.
Save icecoldfire/bf8a6ba81cceb8d9115d879e52433f23 to your computer and use it in GitHub Desktop.
Improve smartschool.be
// ==UserScript==
// @name Smartschool
// @namespace http://stijngoethals.be/
// @version 0.1
// @description Improve smartschool.be
// @author Stijn Goethals
// @match https://*.smartschool.be/index.php?module=Yearplan&file=teacher&yearplanID=*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
// Your code here...
const editModeButton = document.getElementById("editModeButton");
editModeButton.addEventListener("click", changeRowWidth, false);
function changeRowWidthDelayed(){
setTimeout(changeRowWidth, 100);
}
function changeRowWidth(){
const list = document.querySelectorAll(".row");
var index;
for (index = 0; index < list.length; index++) {
var row = list[index];
if(row.childElementCount === 8){
const selector = row.children[0];
if(selector.className === "selector"){
const voet = row.children[6];
selector.style.width = "20px";
selector.style.backgroundColor = "black";
selector.style.backgroundImage = "none";
const voetWidth = +voet.style.width.replace("px", "");
voet.style.width = (voetWidth - 20) + "px";
}else{
changeRowWidthDelayed();
break;
}
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment