Skip to content
Snippets Groups Projects
Commit b3ea7c50 authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

Misc fixes

parent b56ebbe7
Branches
No related tags found
No related merge requests found
Pipeline #30606 passed
......@@ -121,6 +121,7 @@ private fun inited() {
// Skip display of account chooser and consent dialog for an existing session.
tokenClient.requestAccessToken(js("{prompt: ''}"))
}
Unit
}
logOut = {
......
......@@ -15,24 +15,33 @@ object PekNote {
.toList().lastOrNull() as? HTMLAnchorElement
private val noteCnt get() = document.getElementById("comment-textarea") as? HTMLTextAreaElement
private val btn get() = document.querySelector("#comment-container > div > form.edit_point_detail_comment > article.uk-comment > div.uk-clearfix > div.uk-float-right > input.uk-button") as? HTMLInputElement
?: document.querySelector("#comment-container > div > form.new_point_detail_comment > article.uk-comment > div.uk-clearfix > div.uk-float-right > input.uk-button") as? HTMLInputElement
fun getNote() = noteCnt!!.value
suspend fun setNote(value: String) {
val origCnt = noteCnt
val edit = editBtn
if (edit != null) {
edit.click()
delay(1000)
while (noteCnt == origCnt) {
delay(50)
}
if (noteCnt!!.value == value) {
}
val realValue = value.ifBlank { "⠀" }
if (noteCnt!!.value == value || noteCnt!!.value == realValue) {
return
}
noteCnt!!.value = value
noteCnt!!.value = realValue
btn!!.click()
val origBtn = btn
while (btn == origBtn || btn!!.disabled) {
delay(50)
}
}
suspend fun waitUntilLoaded(person: String, principle: String) {
val expected = "$person - $principle"
while (noteName != expected) {
delay(100)
delay(50)
}
}
}
\ No newline at end of file
......@@ -75,10 +75,13 @@ suspend fun PekTable.clear(
progress: (Double) -> Unit = {}
) {
progress(0.0)
showComments()
people.forEachIndexed { i, person ->
principles.forEachIndexed { j, principle ->
PekTable[person, principle] = 0
PekDelay()
PekNote.waitUntilLoaded(person, principle)
PekNote.setNote("")
progress(calcProgress(i, j, people.size, principles.size))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment