mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Passive mode improvements
This commit is contained in:
parent
932f215f79
commit
b646640993
1 changed files with 19 additions and 12 deletions
31
main.js
31
main.js
|
@ -23,7 +23,7 @@
|
||||||
var data; // all data, which is in the resource txt
|
var data; // all data, which is in the resource txt
|
||||||
var addEventListener; // add event listener function
|
var addEventListener; // add event listener function
|
||||||
const lastChangeLog =
|
const lastChangeLog =
|
||||||
'TODO';
|
'- Passzív mód: ha bepipálod a menü gomb alatt, akkor nem tölti be minden alkalommal a kérdéseket.\n - Pár lényeges bugfix\n - Ha találkoztok bugokkal, akkor pls report! thanx';
|
||||||
const serverAdress = "https://qmining.tk/";
|
const serverAdress = "https://qmining.tk/";
|
||||||
|
|
||||||
// forcing pages for testing. unless you test, do not set these to true!
|
// forcing pages for testing. unless you test, do not set these to true!
|
||||||
|
@ -912,10 +912,8 @@ function Load(cwith) {
|
||||||
var useNetDB = GM_getValue("useNetDB");
|
var useNetDB = GM_getValue("useNetDB");
|
||||||
let skipLoad = GM_getValue("skipLoad");
|
let skipLoad = GM_getValue("skipLoad");
|
||||||
|
|
||||||
if (skipLoad) {
|
if (skipLoad)
|
||||||
console.log("HAAAAAAAAAAA");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (useNetDB != undefined && useNetDB == 1)
|
if (useNetDB != undefined && useNetDB == 1)
|
||||||
return ReadNetDB(cwith, useNetDB);
|
return ReadNetDB(cwith, useNetDB);
|
||||||
|
@ -1734,7 +1732,7 @@ function ShowMenu() {
|
||||||
var appedtTo = document.body; // will be appended here
|
var appedtTo = document.body; // will be appended here
|
||||||
|
|
||||||
// mainDiv.style.left = (window.innerWidth - width) / 2 + 'px';
|
// mainDiv.style.left = (window.innerWidth - width) / 2 + 'px';
|
||||||
|
|
||||||
var menuButtonDiv = document.createElement("div");
|
var menuButtonDiv = document.createElement("div");
|
||||||
menuButtonDiv.setAttribute("id", "HelperMenuButton");
|
menuButtonDiv.setAttribute("id", "HelperMenuButton");
|
||||||
menuButtonDiv.style.width = buttonWidth + 'px';
|
menuButtonDiv.style.width = buttonWidth + 'px';
|
||||||
|
@ -1782,11 +1780,14 @@ function ShowMenu() {
|
||||||
|
|
||||||
questionsTickBox.addEventListener("click", function() {
|
questionsTickBox.addEventListener("click", function() {
|
||||||
GM_setValue("skipLoad", questionsTickBox.checked);
|
GM_setValue("skipLoad", questionsTickBox.checked);
|
||||||
if (!GM_getValue("skipLoad")){
|
if (GM_getValue("skipLoad")) {
|
||||||
// TODO show msgbox eplaining this, but only once
|
ShowMessage({
|
||||||
|
m: "Passzív mód bekapcsolva, mostantól kérdések nem lesznek betöltve/lekérve.",
|
||||||
|
isSimple: true
|
||||||
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
var loadDataCheckBoxText = CreateNodeWithText(questionsTickBox,
|
var loadDataCheckBoxText = CreateNodeWithText(questionsTickBox,
|
||||||
"Passzív mód", "span");
|
"Passzív mód", "span");
|
||||||
loadDataCheckBoxText.style.fontSize = "12px";
|
loadDataCheckBoxText.style.fontSize = "12px";
|
||||||
|
@ -1896,10 +1897,16 @@ function ShowMenuList() {
|
||||||
{
|
{
|
||||||
var noDataRow = tbl.insertRow();
|
var noDataRow = tbl.insertRow();
|
||||||
var noDataRowCell = noDataRow.insertCell();
|
var noDataRowCell = noDataRow.insertCell();
|
||||||
|
var textBox;
|
||||||
|
|
||||||
var textBox = CreateNodeWithText(noDataRowCell,
|
if (GM_getValue("skipLoad"))
|
||||||
"A kérdéseket nem lehetett beolvasni. Vagy nem elérhető a szerver, vagy ha offline módot használsz, akkor hibás a fájl elérési útja, vagy a fájl maga. Olvasd el a manualt!"
|
textBox = CreateNodeWithText(noDataRowCell,
|
||||||
);
|
"Passszív mód bekapcsolva. Kapcsold ki a kérdések betöltéséhez!"
|
||||||
|
);
|
||||||
|
else
|
||||||
|
textBox = CreateNodeWithText(noDataRowCell,
|
||||||
|
"A kérdéseket nem lehetett beolvasni. Vagy nem elérhető a szerver, vagy ha offline módot használsz, akkor hibás a fájl elérési útja, vagy a fájl maga. Olvasd el a manualt!"
|
||||||
|
);
|
||||||
textBox.style.margin = fiveMargin; // fancy margin
|
textBox.style.margin = fiveMargin; // fancy margin
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue