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:
		
							
								
								
									
										25
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								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); | ||||||
| @@ -1782,8 +1780,11 @@ 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); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 		}); | 		}); | ||||||
| @@ -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 | ||||||
|  |  | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user