Passive mode improvements

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-04 22:07:26 +01:00
parent 932f215f79
commit b646640993

21
main.js
View file

@ -23,7 +23,7 @@
var data; // all data, which is in the resource txt
var addEventListener; // add event listener function
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/";
// 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");
let skipLoad = GM_getValue("skipLoad");
if (skipLoad) {
console.log("HAAAAAAAAAAA");
if (skipLoad)
return -1;
}
if (useNetDB != undefined && useNetDB == 1)
return ReadNetDB(cwith, useNetDB);
@ -1782,8 +1780,11 @@ function ShowMenu() {
questionsTickBox.addEventListener("click", function() {
GM_setValue("skipLoad", questionsTickBox.checked);
if (!GM_getValue("skipLoad")){
// TODO show msgbox eplaining this, but only once
if (GM_getValue("skipLoad")) {
ShowMessage({
m: "Passzív mód bekapcsolva, mostantól kérdések nem lesznek betöltve/lekérve.",
isSimple: true
}, 10);
}
});
@ -1896,8 +1897,14 @@ function ShowMenuList() {
{
var noDataRow = tbl.insertRow();
var noDataRowCell = noDataRow.insertCell();
var textBox;
var textBox = CreateNodeWithText(noDataRowCell,
if (GM_getValue("skipLoad"))
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