From b646640993ded8dcbe28b5906f7ebc1f3da05506 Mon Sep 17 00:00:00 2001 From: YourFriendlyNeighborhoodDealer Date: Mon, 4 Mar 2019 22:07:26 +0100 Subject: [PATCH] Passive mode improvements --- main.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/main.js b/main.js index 00d400b..1885203 100644 --- a/main.js +++ b/main.js @@ -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); @@ -1734,7 +1732,7 @@ function ShowMenu() { var appedtTo = document.body; // will be appended here // mainDiv.style.left = (window.innerWidth - width) / 2 + 'px'; - + var menuButtonDiv = document.createElement("div"); menuButtonDiv.setAttribute("id", "HelperMenuButton"); menuButtonDiv.style.width = buttonWidth + 'px'; @@ -1782,11 +1780,14 @@ 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); } - - }); + + }); var loadDataCheckBoxText = CreateNodeWithText(questionsTickBox, "Passzív mód", "span"); loadDataCheckBoxText.style.fontSize = "12px"; @@ -1896,10 +1897,16 @@ function ShowMenuList() { { var noDataRow = tbl.insertRow(); var noDataRowCell = noDataRow.insertCell(); + var textBox; - var 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!" - ); + 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 }