Last active
August 29, 2015 13:57
-
-
Save rickcnagy/9611925 to your computer and use it in GitHub Desktop.
Refresh attendance (including previously unenrolled students) for all days starting at the next day visible.
This file contains hidden or 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
| // | |
| // RefreshAttendance_SchoolDaysOnly.js | |
| // Rick Nagy | |
| // 2014-03-17 | |
| // | |
| // run via js console | |
| refreshCount = -1; | |
| function nextDay() { | |
| refreshCount++; | |
| if (!(refreshCount % 10) && !confirm("Next day?")) return | |
| if (!$(".nextCanvas").is(":visible")) return; | |
| $(".nextCanvas").click() | |
| afterLoad(function() { | |
| refreshList(); | |
| }); | |
| } | |
| function refreshList() { | |
| var refreshLink = $(".linkWidget:contains('Refresh')") | |
| if (refreshLink.is(":visible")) { | |
| refreshLink.click() | |
| $(".theCheckBox").prop("checked", true) | |
| $(".ui-button:contains('Ok')").click() | |
| } | |
| afterLoad(nextDay) | |
| } | |
| function afterLoad(callback, param) { | |
| var loading = setInterval(function() { | |
| if ($("*[class^='load']:not('.ribbonSelectorWidget *'):visible").length === 0) { | |
| clearInterval(loading); | |
| callback(param); | |
| } | |
| }, 10, param); | |
| } | |
| nextDay() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment