Added eventstable caption with symbol information and download link. Removed type column from table.

This commit is contained in:
Kasper D. Fischer 2014-05-20 13:46:00 +00:00
parent 63f9d9d43a
commit 021046ec29
Notes: subgit 2018-03-07 17:58:58 +01:00
r664 www/trunk
3 changed files with 24 additions and 25 deletions

View File

@ -106,17 +106,6 @@ function ajaxLoadEvents(stime, etime, id, target) {
var evaluationMode = $(this).find('evaluationMode').text();
var evaluationStatus = $(this).find('evaluationStatus').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
// get location, try this in order:
// regional map name, given value, cached value, or nominatim lookup
@ -129,12 +118,11 @@ function ajaxLoadEvents(stime, etime, id, target) {
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
+ 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 class="ar">'+typeId+'</td>'
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a> <a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
+ '</tr>';
// setting up event details (2nd line)
row += '<tr class="tablesorter-childRow event-details">'
+ '<td colspan="5" eventid="'+id+'">Daten werden geladen ...</td></tr>';
+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
// setting up download links (3nd line)
var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id);
var oTime = new Date(otime);
@ -142,7 +130,7 @@ function ajaxLoadEvents(stime, etime, id, target) {
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()));
row += '<tr class="tablesorter-childRow event-download">'
+ '<td colspan="5" eventid="'+id+'">'
+ '<td colspan="4" 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)
+ '</td></tr>';
// add row to table
@ -180,6 +168,9 @@ function ajaxLoadEvents(stime, etime, id, target) {
console.log( "Request Failed: " + err );
}
});
// create events csv download link
request_data['format'] = 'text';
if ( id == '' || !id ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
};
/* ajaxLoadEventInfo */
@ -260,7 +251,6 @@ function ajaxLoadEventInfo(id) {
/* toggles visibility of filtered markers
* only events in the event list are shown */
function toggleFilteredMarkers() {
console.log('toggleFilteredMarkers');
// show all shown events in map
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
@ -412,17 +402,18 @@ $(document).ready(function() {
$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
config['event']['typeWhitelist'].map(function(type) {
var typetext;
( $("#events-type").text() == "Symbole:" ) ? typetext = ' ' : typetext = ', ';
switch ( type ) {
case 'earthquake':
typetext = 'EQ - tektonisches Erdbeben';
typetext += 'tektonisches Erdbeben&nbsp;(Stern)';
break;
case 'induced or triggered event':
typetext = 'IE - (bergbau-)induziertes Ereignis';
typetext += '(bergbau-)induziertes Ereignis&nbsp;(Kreis)';
break;
case 'quarry blast':
typetext = 'QB - Steinbruchsprengung';
typetext += 'Steinbruchsprengung&nbsp;(Rad)';
break;
};
$("#events-type").append(' '+typetext);
$("#events-type").append(typetext);
});
});

View File

@ -64,7 +64,6 @@
</ul>
<!-- Ereignisse -->
<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">
<img src="external/first.png" class="first" alt="First" />
<img src="external/prev.png" class="prev" alt="Prev" />
@ -96,14 +95,20 @@
<th>Zeit</th>
<th>Mag.</th>
<th>Ort</th>
<th>Typ</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<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>
<p class="table-caption">
Ereignisse der letzten <span id="events-timespan">180</span> Tage ab Magnitude <span id="events-minmag">1.2</span> im Bereich der Karte und besondere Ereignisse in angrenzenden Bereichen. Download als <a id="events-csv-link" href="link" download="events.csv">CSV</a>.
</p>
<p class="table-caption">
<span id="events-type">Symbole:</span>
</p>
<p class="table-caption">
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>
<!-- Stations -->
<div class="tab" id="stationstab">
@ -142,7 +147,7 @@
<tbody>
</tbody>
</table>
<p>Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV</a></p>
<p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV</a>.</p>
</div>
<!-- More -->
<div class="tab" id="moretab"></div>

View File

@ -73,4 +73,7 @@
td.ar {
text-align: right;
}
p.table-caption {
font-size: smaller;
}
</style>