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:
		
							
								
								
									
										31
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								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 | ||||
|  | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user