mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Message on passive mode, and simplifyquery bug fix
This commit is contained in:
parent
054a30d6c8
commit
4e4c5c723a
1 changed files with 14 additions and 10 deletions
20
main.js
20
main.js
|
@ -268,11 +268,11 @@ function Main() {
|
|||
}
|
||||
});
|
||||
|
||||
console.log("Moodle Test Script run time:");
|
||||
console.timeEnd('main');
|
||||
|
||||
if (forceTestPage || forceResultPage || forceDefaultPage)
|
||||
alert("TEST MODE");
|
||||
|
||||
console.log("Main run time:");
|
||||
console.timeEnd('main');
|
||||
}
|
||||
//: }}}
|
||||
|
||||
|
@ -1821,12 +1821,16 @@ function ShowMenu() {
|
|||
|
||||
questionsTickBox.addEventListener("click", function() {
|
||||
GM_setValue("skipLoad", questionsTickBox.checked);
|
||||
if (GM_getValue("skipLoad")) {
|
||||
var msg = "";
|
||||
if (GM_getValue("skipLoad"))
|
||||
msg = "Passzív mód bekapcsolva, mostantól kérdések nem lesznek betöltve/lekérve.";
|
||||
else
|
||||
msg = "Passzív mód kikapcsolva, frissíts az érvénybe lépéshez!";
|
||||
|
||||
ShowMessage({
|
||||
m: "Passzív mód bekapcsolva, mostantól kérdések nem lesznek betöltve/lekérve.",
|
||||
m: msg,
|
||||
isSimple: true
|
||||
}, 10);
|
||||
}
|
||||
}, 6);
|
||||
|
||||
});
|
||||
var loadDataCheckBoxText = CreateNodeWithText(questionsTickBox,
|
||||
|
@ -2125,7 +2129,7 @@ function RemoveMultipleItems(array) {
|
|||
|
||||
// removes some crap from "q"
|
||||
function SimplifyQuery(q) {
|
||||
var result = q.replace(/\n/g, "").replace(/\s/g, ' '); // WHY TF ARE THERE TWO KINDA SPACES??? (charcode 160 n 32)
|
||||
var result = q.replace(/\n/g, " ").replace(/\s/g, ' '); // WHY TF ARE THERE TWO KINDA SPACES??? (charcode 160 n 32)
|
||||
return RemoveUnnecesarySpaces(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue