Last active
July 16, 2019 23:14
-
-
Save wsanchez/67b1d4552dbdefab4b8685de1564340e 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
function check_all_on_page() { | |
for (const checkbox of document.getElementsByClassName("checkbox")) { | |
if (checkbox.checked == false) { | |
checkbox.click(); | |
} | |
} | |
} | |
function open_approve_dialog() { | |
const approve = document.getElementById("utility_6f7351657f795bc1357a53142b1184cc"); | |
if (approve === null) { | |
window.requestAnimationFrame(open_approve_dialog); | |
} else { | |
approve.click(); | |
allow_requested(); | |
} | |
} | |
function allow_requested() { | |
const yes = document.getElementById("give_requested"); | |
if (yes === null) { | |
window.requestAnimationFrame(allow_requested); | |
} else { | |
yes.click(); | |
submit_approval(); | |
} | |
} | |
function submit_approval() { | |
const buttons = document.getElementsByClassName("button_input"); | |
if (buttons.length == 0) { | |
window.requestAnimationFrame(submit_approval); | |
} else { | |
buttons[0].click(); | |
} | |
// // This works, but doesn't return you to the list, gives you an empty JSON dict instead | |
// const form = document.getElementById("status_form"); | |
// if (form === null) { | |
// window.requestAnimationFrame(submit_approval); | |
// } else { | |
// form.submit(); | |
// } | |
} | |
function approve_checked() { | |
open_approve_dialog(); | |
} | |
function approve() { | |
check_all_on_page(); | |
approve_checked(); | |
} | |
approve(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment