Added column for type information in eventstable.
This commit is contained in:
		
							parent
							
								
									8d8e0c5ff7
								
							
						
					
					
						commit
						78ea7b0397
					
				
				
				Notes:
				
					subgit
				
				2018-03-07 17:58:57 +01:00 
			
			r662 www/trunk
@ -106,6 +106,17 @@ function ajaxLoadEvents(stime, etime, id, target) {
 | 
				
			|||||||
				var evaluationMode = $(this).find('evaluationMode').text();
 | 
									var evaluationMode = $(this).find('evaluationMode').text();
 | 
				
			||||||
				var evaluationStatus = $(this).find('evaluationStatus').text();
 | 
									var evaluationStatus = $(this).find('evaluationStatus').text();
 | 
				
			||||||
				var type = $(this).find('type').last().text();
 | 
									var type = $(this).find('type').last().text();
 | 
				
			||||||
 | 
									var typeId;
 | 
				
			||||||
 | 
									switch ( type ) {
 | 
				
			||||||
 | 
										case 'earthquake':
 | 
				
			||||||
 | 
											typeId = 'EQ';
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										case 'quarry blast':
 | 
				
			||||||
 | 
											typeId = 'QB';
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										default:
 | 
				
			||||||
 | 
											typeId = 'IE';
 | 
				
			||||||
 | 
									};
 | 
				
			||||||
				var location
 | 
									var location
 | 
				
			||||||
				// get location, try this in order:
 | 
									// get location, try this in order:
 | 
				
			||||||
				// regional map name, given value, cached value,  or nominatim lookup
 | 
									// regional map name, given value, cached value,  or nominatim lookup
 | 
				
			||||||
@ -119,10 +130,11 @@ function ajaxLoadEvents(stime, etime, id, target) {
 | 
				
			|||||||
							+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
 | 
												+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
 | 
				
			||||||
							+ sprintf('<td class="ar">%.1f</td>', Number(mag))
 | 
												+ sprintf('<td class="ar">%.1f</td>', Number(mag))
 | 
				
			||||||
							+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
 | 
												+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
 | 
				
			||||||
 | 
												+ '<td class="ar">'+typeId+'</td>'
 | 
				
			||||||
							+ '</tr>';
 | 
												+ '</tr>';
 | 
				
			||||||
					// setting up event details (2nd line)
 | 
										// setting up event details (2nd line)
 | 
				
			||||||
					row += '<tr class="tablesorter-childRow event-details">'
 | 
										row += '<tr class="tablesorter-childRow event-details">'
 | 
				
			||||||
						+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
 | 
											+ '<td colspan="5" eventid="'+id+'">Daten werden geladen ...</td></tr>';
 | 
				
			||||||
					// setting up download links (3nd line)
 | 
										// setting up download links (3nd line)
 | 
				
			||||||
					var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id);
 | 
										var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id);
 | 
				
			||||||
					var oTime = new Date(otime);
 | 
										var oTime = new Date(otime);
 | 
				
			||||||
@ -130,7 +142,7 @@ function ajaxLoadEvents(stime, etime, id, target) {
 | 
				
			|||||||
					var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds());
 | 
										var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds());
 | 
				
			||||||
					var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(sTime.getUTCFullYear()), Number(sTime.getUTCMonth())+1, Number(sTime.getUTCDate()), Number(sTime.getUTCHours()), Number(sTime.getUTCMinutes()), Number(sTime.getUTCSeconds()), Number(eTime.getUTCFullYear()), Number(eTime.getUTCMonth())+1, Number(eTime.getUTCDate()), Number(eTime.getUTCHours()), Number(eTime.getUTCMinutes()), Number(eTime.getUTCSeconds()));
 | 
										var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(sTime.getUTCFullYear()), Number(sTime.getUTCMonth())+1, Number(sTime.getUTCDate()), Number(sTime.getUTCHours()), Number(sTime.getUTCMinutes()), Number(sTime.getUTCSeconds()), Number(eTime.getUTCFullYear()), Number(eTime.getUTCMonth())+1, Number(eTime.getUTCDate()), Number(eTime.getUTCHours()), Number(eTime.getUTCMinutes()), Number(eTime.getUTCSeconds()));
 | 
				
			||||||
					row +=  '<tr class="tablesorter-childRow event-download">'
 | 
										row +=  '<tr class="tablesorter-childRow event-download">'
 | 
				
			||||||
						+ '<td colspan="4" eventid="'+id+'">'
 | 
											+ '<td colspan="5" eventid="'+id+'">'
 | 
				
			||||||
						+ sprintf('Download <a class="xml-link" target="_blank" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" href="%s">miniSEED</a>', xmlurl, mseedurl)
 | 
											+ sprintf('Download <a class="xml-link" target="_blank" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" href="%s">miniSEED</a>', xmlurl, mseedurl)
 | 
				
			||||||
						+ '</td></tr>';
 | 
											+ '</td></tr>';
 | 
				
			||||||
					// add row to table
 | 
										// add row to table
 | 
				
			||||||
@ -248,16 +260,17 @@ function ajaxLoadEventInfo(id) {
 | 
				
			|||||||
/* toggles visibility of filtered markers
 | 
					/* toggles visibility of filtered markers
 | 
				
			||||||
 * only events in the event list are shown */
 | 
					 * only events in the event list are shown */
 | 
				
			||||||
function toggleFilteredMarkers() {
 | 
					function toggleFilteredMarkers() {
 | 
				
			||||||
 | 
						console.log('toggleFilteredMarkers');
 | 
				
			||||||
	// show all shown events in map
 | 
						// show all shown events in map
 | 
				
			||||||
	$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
 | 
						$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
 | 
				
			||||||
		if ( $(this).attr("eventid") ) {
 | 
							if ( $(this).attr("eventid") ) {
 | 
				
			||||||
			eventTable[$(this).attr("eventid")].setStyle({opacity: 1, strokeOpacity: 1, fillOpacity: config['event']['markerOpacity']});
 | 
								map.addLayer(eventTable[$(this).attr("eventid")]);
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
	// hide filtered events in map
 | 
						// hide filtered events in map
 | 
				
			||||||
	$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
 | 
						$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
 | 
				
			||||||
		if ( $(this).attr("eventid") ) {
 | 
							if ( $(this).attr("eventid") ) {
 | 
				
			||||||
			eventTable[$(this).attr("eventid")].setStyle({opacity: 0, strokeOpacity: 0, fillOpacity: 0});
 | 
								map.removeLayer(eventTable[$(this).attr("eventid")]);
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
	highlightFirstEvent();
 | 
						highlightFirstEvent();
 | 
				
			||||||
@ -394,4 +407,22 @@ $(document).ready(function() {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
						// update selection / type info
 | 
				
			||||||
 | 
						$("#events-timespan").text(config['map']['timespan']);
 | 
				
			||||||
 | 
						$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
 | 
				
			||||||
 | 
						config['event']['typeWhitelist'].map(function(type) {
 | 
				
			||||||
 | 
							var typetext;
 | 
				
			||||||
 | 
							switch ( type ) {
 | 
				
			||||||
 | 
								case 'earthquake':
 | 
				
			||||||
 | 
									typetext = 'EQ - tektonisches Erdbeben';
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								case 'induced or triggered event':
 | 
				
			||||||
 | 
									typetext = 'IE - (bergbau-)induziertes Ereignis';
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								case 'quarry blast':
 | 
				
			||||||
 | 
									typetext = 'QB - Steinbruchsprengung';
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
							$("#events-type").append(' '+typetext);
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
@ -56,6 +56,7 @@
 | 
				
			|||||||
		</ul>
 | 
							</ul>
 | 
				
			||||||
		<!-- Ereignisse -->
 | 
							<!-- Ereignisse -->
 | 
				
			||||||
		<div class="tab" id="eventstab">
 | 
							<div class="tab" id="eventstab">
 | 
				
			||||||
 | 
								<p>Ereignisse der letzten <span id="events-timespan">180</span> Tage ab Magnitude <span id="events-minmag">1.2</span></p>
 | 
				
			||||||
			<div class="pager events" id="eventspager">
 | 
								<div class="pager events" id="eventspager">
 | 
				
			||||||
				<img src="external/first.png" class="first" alt="First" />
 | 
									<img src="external/first.png" class="first" alt="First" />
 | 
				
			||||||
				<img src="external/prev.png" class="prev" alt="Prev" />
 | 
									<img src="external/prev.png" class="prev" alt="Prev" />
 | 
				
			||||||
@ -79,6 +80,7 @@
 | 
				
			|||||||
					<col width="50" />
 | 
										<col width="50" />
 | 
				
			||||||
					<col width="50" />
 | 
										<col width="50" />
 | 
				
			||||||
					<col />
 | 
										<col />
 | 
				
			||||||
 | 
										<col width="30" />
 | 
				
			||||||
				</colgroup>
 | 
									</colgroup>
 | 
				
			||||||
				<thead>
 | 
									<thead>
 | 
				
			||||||
					<tr>
 | 
										<tr>
 | 
				
			||||||
@ -86,12 +88,14 @@
 | 
				
			|||||||
						<th>Zeit</th>
 | 
											<th>Zeit</th>
 | 
				
			||||||
						<th>Mag.</th>
 | 
											<th>Mag.</th>
 | 
				
			||||||
						<th>Ort</th>
 | 
											<th>Ort</th>
 | 
				
			||||||
 | 
											<th>Typ</th>
 | 
				
			||||||
					</tr>
 | 
										</tr>
 | 
				
			||||||
				</thead>
 | 
									</thead>
 | 
				
			||||||
				<tbody>
 | 
									<tbody>
 | 
				
			||||||
				</tbody>
 | 
									</tbody>
 | 
				
			||||||
			</table>
 | 
								</table>
 | 
				
			||||||
			<p>Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img alt="Mapquest Logo" src="//developer.mapquest.com/content/osm/mq_logo.png" /></p>
 | 
								<p><span id="events-type">Typ:</span></br>
 | 
				
			||||||
 | 
								Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img alt="Mapquest Logo" src="//developer.mapquest.com/content/osm/mq_logo.png" /></p>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
		<!-- Stations -->
 | 
							<!-- Stations -->
 | 
				
			||||||
		<div class="tab" id="stationstab">
 | 
							<div class="tab" id="stationstab">
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user