Reload table after each QSO in case of >1 PC used for logging
这个提交包含在:
		
							父节点
							
								
									bf213b1773
								
							
						
					
					
						当前提交
						bc76514096
					
				
					共有  1 个文件被更改,包括 71 次插入 和 66 次删除
				
			
		|  | @ -1,8 +1,10 @@ | ||||||
| // Callsign always has focus on load
 | // Callsign always has focus on load
 | ||||||
| $("#callsign").focus(); | $("#callsign").focus(); | ||||||
| 
 | 
 | ||||||
| $(document).ready(function () { | var sessiondata={}; | ||||||
| 	getSession().done(restoreContestSession); | $(document).ready(async function () { | ||||||
|  | 	sessiondata=await getSession(); | ||||||
|  | 	await restoreContestSession(sessiondata); | ||||||
| 	setRst($("#mode").val()); | 	setRst($("#mode").val()); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | @ -435,8 +437,6 @@ function logQso() { | ||||||
| 			vuccr, | 			vuccr, | ||||||
| 		]]; | 		]]; | ||||||
| 
 | 
 | ||||||
| 		table.rows.add(data).draw(); |  | ||||||
| 		 |  | ||||||
| 		var formdata = new FormData(document.getElementById("qso_input")); | 		var formdata = new FormData(document.getElementById("qso_input")); | ||||||
| 		$.ajax({ | 		$.ajax({ | ||||||
| 			url: base_url + 'index.php/qso/saveqso', | 			url: base_url + 'index.php/qso/saveqso', | ||||||
|  | @ -445,7 +445,7 @@ function logQso() { | ||||||
| 			processData: false, | 			processData: false, | ||||||
| 			contentType: false, | 			contentType: false, | ||||||
| 			enctype: 'multipart/form-data', | 			enctype: 'multipart/form-data', | ||||||
| 			success: function (html) { | 			success: async function (html) { | ||||||
| 				var exchangetype = $("#exchangetype").val(); | 				var exchangetype = $("#exchangetype").val(); | ||||||
| 				if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') { | 				if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') { | ||||||
| 					$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1); | 					$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1); | ||||||
|  | @ -462,6 +462,7 @@ function logQso() { | ||||||
| 				$("#callsign").focus(); | 				$("#callsign").focus(); | ||||||
| 				setSession(formdata); | 				setSession(formdata); | ||||||
| 				 | 				 | ||||||
|  | 				await refresh_qso_table(sessiondata); | ||||||
| 				var qTable = $('.qsotable').DataTable(); | 				var qTable = $('.qsotable').DataTable(); | ||||||
| 				qTable.search('').order([0, 'desc']).draw(); | 				qTable.search('').order([0, 'desc']).draw(); | ||||||
| 
 | 
 | ||||||
|  | @ -470,14 +471,14 @@ function logQso() { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function getSession() { | async function getSession() { | ||||||
| 	return $.ajax({ | 	return await $.ajax({ | ||||||
| 		url: base_url + 'index.php/contesting/getSession', | 		url: base_url + 'index.php/contesting/getSession', | ||||||
| 		type: 'post', | 		type: 'post', | ||||||
| 	}); | 	}); | ||||||
| } | } | ||||||
| 	 | 	 | ||||||
| function restoreContestSession(data) { | async function restoreContestSession(data) { | ||||||
| 	if (data) { | 	if (data) { | ||||||
| 		if (data.copytodok == "1") { | 		if (data.copytodok == "1") { | ||||||
| 			$('#copyexchangetodok').prop('checked', true); | 			$('#copyexchangetodok').prop('checked', true); | ||||||
|  | @ -498,13 +499,21 @@ function restoreContestSession(data) { | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (data.qso != "") { | 		if (data.qso != "") { | ||||||
|  | 			await refresh_qso_table(data); | ||||||
|  | 		} | ||||||
|  | 	} else { | ||||||
|  | 		$("#exch_serial_s").val("1"); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | async function refresh_qso_table(data) { | ||||||
| 	$.ajax({ | 	$.ajax({ | ||||||
| 		url: base_url + 'index.php/contesting/getSessionQsos', | 		url: base_url + 'index.php/contesting/getSessionQsos', | ||||||
| 		type: 'post', | 		type: 'post', | ||||||
| 		data: { 'qso': data.qso, }, | 		data: { 'qso': data.qso, }, | ||||||
| 		success: function (html) { | 		success: function (html) { | ||||||
| 			var mode = ''; | 			var mode = ''; | ||||||
| 	 | 			$(".contest_qso_table_contents").empty(); | ||||||
| 			$.each(html, function () { | 			$.each(html, function () { | ||||||
| 				if (this.col_submode == null || this.col_submode == '') { | 				if (this.col_submode == null || this.col_submode == '') { | ||||||
| 					mode = this.col_mode; | 					mode = this.col_mode; | ||||||
|  | @ -556,10 +565,6 @@ function restoreContestSession(data) { | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
| 		} |  | ||||||
| 	} else { |  | ||||||
| 		$("#exch_serial_s").val("1"); |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function pad (str, max) { | function pad (str, max) { | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用