Last active
March 11, 2021 22:26
-
-
Save RKursatV/73a5ff8435932736cf88116d5d9abc13 to your computer and use it in GitHub Desktop.
Metu Add Course Tool
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
console.log('im in'); | |
var userActive = true; | |
function inactivityTime() { | |
var time; | |
// events | |
window.onload = resetTime; | |
window.onclick = resetTime; | |
window.onkeypress = resetTime; | |
window.ontouchstart = resetTime; | |
window.onmousemove = resetTime; | |
window.onmousedown = resetTime; | |
window.addEventListener('scroll', resetTime, true); | |
function alertUser() { | |
userActive = false; | |
console.log('pasif'); | |
} | |
function resetTime() { | |
clearTimeout(time); | |
console.log('aktif'); | |
userActive = true; | |
time = setTimeout(alertUser, 1000 * 10); // 10 seconds | |
} | |
}; | |
inactivityTime(); | |
function keep() { | |
if (userActive == false){ | |
document.getElementsByName('submitReplaceCourse')[0].click(); | |
} | |
else {console.log('aktif oldugun icin sayfayi yenilemedim');} | |
} | |
setInterval(keep, 100000); | |
document.getElementById('textAddCourseCode').value = ''; //course code | |
document.getElementById('textAddCourseSection').value = ''; //section | |
document.getElementById('selectAddCourseCategory').value = ''; // must -> 1, restricted -> 4, free -> 5, tech -> 7, nontech -> 8, ni -> 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment