Merge.
This commit is contained in:
parent
6b3c421ba8
commit
5bfa403288
Notes:
subgit
2018-03-07 17:58:57 +01:00
r659 www/branches/life
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
www/dlsv
|
||||||
www/event.xml
|
www/event.xml
|
||||||
www/geolocation.js
|
www/geolocation.js
|
||||||
www/stations.xml
|
www/stations.xml
|
||||||
|
@ -50,24 +50,29 @@ function getGeolocation(id, lat, lng) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Load events using ajax */
|
/* Load events using ajax */
|
||||||
function ajaxLoadEvents(stime, etime) {
|
function ajaxLoadEvents(stime, etime, id) {
|
||||||
var request_data = {};
|
|
||||||
if ( !stime ) {
|
|
||||||
stime = new Date();
|
|
||||||
stime.setDate(stime.getDate()-config['map']['timespan']);
|
|
||||||
};
|
|
||||||
var mapBounds = map.getBounds();
|
var mapBounds = map.getBounds();
|
||||||
request_data = {
|
var request_data = {};
|
||||||
starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
if ( id ) {
|
||||||
orderby: 'time-asc',
|
if ( id == 'bug2014jptq' ) console.log('Loading special event '+id);
|
||||||
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
|
request_data = { eventid: id };
|
||||||
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
|
} else {
|
||||||
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
|
if ( !stime ) {
|
||||||
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
|
stime = new Date();
|
||||||
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
|
stime.setDate(stime.getDate()-config['map']['timespan']);
|
||||||
};
|
};
|
||||||
if ( etime ) {
|
request_data = {
|
||||||
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
|
starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
orderby: 'time-asc',
|
||||||
|
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
|
||||||
|
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
|
||||||
|
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
|
||||||
|
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
|
||||||
|
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
|
||||||
|
};
|
||||||
|
if ( etime ) {
|
||||||
|
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
|
||||||
|
};
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -87,10 +92,12 @@ function ajaxLoadEvents(stime, etime) {
|
|||||||
var type = $(this).find('type').last().text();
|
var type = $(this).find('type').last().text();
|
||||||
var location
|
var location
|
||||||
// get location, try this in order:
|
// get location, try this in order:
|
||||||
// cached value, nominatim lookup, regional map name, or given value
|
// regional map name, given value, cached value, or nominatim lookup
|
||||||
location = geolocationTable[id] || getGeolocation(id, lat, lng) || getLocation(lat, lng)[0] || $(this).find('description > text').text();
|
location = ( getLocation(lat, lng)[0] || $(this).find('description > text').text() );
|
||||||
|
location = ( geolocationTable[id] || getGeolocation(id, lat, lng) );
|
||||||
// create table row: Date, Time, Mag, Location
|
// create table row: Date, Time, Mag, Location
|
||||||
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
|
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
|
||||||
|
if ( id == 'bug2014jptq' ) console.log('Adding row for special event '+id);
|
||||||
// general event info (1st line)
|
// general event info (1st line)
|
||||||
var row = '<tr class="tablesorter-hasChildRow">'
|
var row = '<tr class="tablesorter-hasChildRow">'
|
||||||
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
|
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
|
||||||
|
@ -115,8 +115,8 @@
|
|||||||
<colgroup>
|
<colgroup>
|
||||||
<col width="77" />
|
<col width="77" />
|
||||||
<col/>
|
<col/>
|
||||||
<col width="77" />
|
<col width="77" align="char" char="." />
|
||||||
<col width="77" />
|
<col width="77" align="char" char="." />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -129,6 +129,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p>Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV</a></p>
|
||||||
</div>
|
</div>
|
||||||
<!-- More -->
|
<!-- More -->
|
||||||
<div class="tab" id="moretab"></div>
|
<div class="tab" id="moretab"></div>
|
||||||
|
53
www/map.js
53
www/map.js
@ -42,25 +42,32 @@ function addStationMarker(id, lat, lng, station) {
|
|||||||
|
|
||||||
/* add event marker */
|
/* add event marker */
|
||||||
function addEventMarker(id, lat, lng, mag) {
|
function addEventMarker(id, lat, lng, mag) {
|
||||||
var markerOptions = {
|
if ( id == 'bug2014jptq' ) console.log('Adding marker for special event '+id);
|
||||||
gradient: true,
|
if ( eventTable[id] ) {
|
||||||
dropShadow: false,
|
return eventTable[id];
|
||||||
fillColor: config['event']['markerColor'],
|
console.log('Marker allready exists ID: '+id);
|
||||||
fillOpacity: config['event']['markerOpacity'],
|
} else {
|
||||||
color: config['event']['markerColor'],
|
var markerOptions = {
|
||||||
weight: 0,
|
gradient: true,
|
||||||
opacity: 1,
|
dropShadow: false,
|
||||||
className: id+' eventMarker',
|
fillColor: config['event']['markerColor'],
|
||||||
radius: mag2radius(mag)
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
weight: 0,
|
||||||
|
opacity: 1,
|
||||||
|
className: id+' eventMarker',
|
||||||
|
radius: mag2radius(mag)
|
||||||
|
};
|
||||||
|
var marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
eventLayer.addLayer(marker);
|
||||||
|
eventTable[id] = marker;
|
||||||
|
return marker;
|
||||||
};
|
};
|
||||||
var marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
|
|
||||||
eventLayer.addLayer(marker);
|
|
||||||
eventTable[id] = marker;
|
|
||||||
return marker;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* handle to show events on map */
|
/* handle to show events on map */
|
||||||
function initMapLink() {
|
function initMapLink() {
|
||||||
|
$("#eventstable > tbody > tr > td > a.map-link").off('click');
|
||||||
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
|
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
|
||||||
var highlightStyle = {
|
var highlightStyle = {
|
||||||
color: config['event']['markerColorH'],
|
color: config['event']['markerColorH'],
|
||||||
@ -89,15 +96,15 @@ function initMapLink() {
|
|||||||
if ( $(this).hasClass('selected') ) {
|
if ( $(this).hasClass('selected') ) {
|
||||||
$(this).removeClass('selected');
|
$(this).removeClass('selected');
|
||||||
$(this).text('Karte');
|
$(this).text('Karte');
|
||||||
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
|
||||||
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
||||||
highlightFirstEvent();
|
highlightFirstEvent();
|
||||||
// unselected -> selected
|
// unselected -> selected
|
||||||
} else {
|
} else {
|
||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
$(this).text('im Fokus (rot)');
|
$(this).text('im Fokus (rot)');
|
||||||
eventTable[$(this).attr('eventid')].setStyle(highlightStyle);
|
|
||||||
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
|
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
|
||||||
|
eventTable[$(this).attr('eventid')].setStyle(highlightStyle)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@ -116,6 +123,12 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// create baselayer
|
// create baselayer
|
||||||
switch ( config['map']['baselayer'] ) {
|
switch ( config['map']['baselayer'] ) {
|
||||||
|
case 'osmde': // add OpenStreetMap.DE tile layer
|
||||||
|
L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
|
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
|
||||||
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
|
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
|
||||||
{
|
{
|
||||||
@ -123,6 +136,12 @@ $(document).ready(function() {
|
|||||||
maxZoom: 16
|
maxZoom: 16
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
break;
|
break;
|
||||||
|
case 'aerial': // add ESRI WordImagery tile layer
|
||||||
|
L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
|
||||||
|
{
|
||||||
|
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
case 'mapquestgray': // add MapQuestOSM tile layer
|
case 'mapquestgray': // add MapQuestOSM tile layer
|
||||||
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
{
|
{
|
||||||
@ -150,6 +169,8 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// load events
|
// load events
|
||||||
ajaxLoadEvents();
|
ajaxLoadEvents();
|
||||||
|
//ajaxLoadEvents([], [], ['bug2014jptq', 'gfz2013yvko']);
|
||||||
|
ajaxLoadEvents([], [], 'bug2014jptq');
|
||||||
toggleFilteredMarkers();
|
toggleFilteredMarkers();
|
||||||
|
|
||||||
// bind popupopen event
|
// bind popupopen event
|
||||||
|
21
www/misc.js
21
www/misc.js
@ -92,6 +92,7 @@ var config = {
|
|||||||
ajax: {
|
ajax: {
|
||||||
timeout: 10000, // 10 seconds
|
timeout: 10000, // 10 seconds
|
||||||
eventURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query',
|
eventURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query',
|
||||||
|
dlsvURL: 'dlsv',
|
||||||
mseedURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query',
|
mseedURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query',
|
||||||
stationURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query',
|
stationURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query',
|
||||||
nominatimURL: '//open.mapquestapi.com/nominatim/v1/reverse.php',
|
nominatimURL: '//open.mapquestapi.com/nominatim/v1/reverse.php',
|
||||||
@ -121,11 +122,27 @@ var config = {
|
|||||||
GE_IBBN: 10,
|
GE_IBBN: 10,
|
||||||
GR_BUG: 10,
|
GR_BUG: 10,
|
||||||
GR_KAST: 10,
|
GR_KAST: 10,
|
||||||
|
NL_HGN: 3,
|
||||||
NL_OPLO: 3,
|
NL_OPLO: 3,
|
||||||
|
NL_VKB: 3,
|
||||||
|
NL_WIT: 3,
|
||||||
NL_WTSB: 3,
|
NL_WTSB: 3,
|
||||||
},
|
},
|
||||||
|
networkBlacklist: ['NL', 'X5'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
var networkURL = {
|
||||||
|
GE: 'http://dx.doi.org/10.14470/TR560404',
|
||||||
|
GR: 'http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seismometer_Stationen/Stationsnetze/d_stationsnetz_node.html',
|
||||||
|
NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html',
|
||||||
|
};
|
||||||
|
var networkText = {
|
||||||
|
GE: '<a href="'+networkURL['GE']+'" target="_blank">GEOFON</a> Program, GFZ Potsdam',
|
||||||
|
GR: '<a href="'+networkURL['GR']+'" target="_blank">German Regional Seismic Network</a>, BGR Hannover',
|
||||||
|
NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands',
|
||||||
|
RN: 'RuhrNet - Ruhr-University Bochum, Germany',
|
||||||
|
};
|
||||||
|
var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP'];
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* document ready *
|
* document ready *
|
||||||
@ -136,6 +153,9 @@ $(document).ready(function() {
|
|||||||
if ( parameters['baselayer'] ) {
|
if ( parameters['baselayer'] ) {
|
||||||
config['map']['baselayer'] = parameters['baselayer'][0];
|
config['map']['baselayer'] = parameters['baselayer'][0];
|
||||||
};
|
};
|
||||||
|
if ( Number(parameters['lat']) && Number(parameters['lon']) ) {
|
||||||
|
config['map']['centerDefault'] = [Number(parameters['lat']), Number(parameters['lon'])];
|
||||||
|
};
|
||||||
if ( Number(parameters['minmag']) ) {
|
if ( Number(parameters['minmag']) ) {
|
||||||
config['event']['minMag'] = Number(parameters['minmag']);
|
config['event']['minMag'] = Number(parameters['minmag']);
|
||||||
};
|
};
|
||||||
@ -162,6 +182,7 @@ $(document).ready(function() {
|
|||||||
var tabOptions = {
|
var tabOptions = {
|
||||||
active: 0,
|
active: 0,
|
||||||
disabled: [2, 3],
|
disabled: [2, 3],
|
||||||
|
activate: function( event, ui ) { ui['newPanel'].find('table').trigger("update", [true]); },
|
||||||
};
|
};
|
||||||
$('#tabs').tabs(tabOptions);
|
$('#tabs').tabs(tabOptions);
|
||||||
});
|
});
|
||||||
|
@ -40,6 +40,7 @@ function loadStations(stime, etime) {
|
|||||||
var request_data = {
|
var request_data = {
|
||||||
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'station',
|
||||||
minlat: S-config['map']['latlngDelta'],
|
minlat: S-config['map']['latlngDelta'],
|
||||||
maxlat: N+config['map']['latlngDelta'],
|
maxlat: N+config['map']['latlngDelta'],
|
||||||
minlon: W-config['map']['latlngDelta'],
|
minlon: W-config['map']['latlngDelta'],
|
||||||
@ -53,19 +54,46 @@ function loadStations(stime, etime) {
|
|||||||
success: function (xml) {
|
success: function (xml) {
|
||||||
$(xml).find('Network').each(function () {
|
$(xml).find('Network').each(function () {
|
||||||
var network = $(this).attr('code');
|
var network = $(this).attr('code');
|
||||||
$(this).find('Station').each(function () {
|
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
|
||||||
var station = $(this).attr('code'),
|
$(this).find('Station').each(function () {
|
||||||
lat = $(this).find('Latitude').text(),
|
var station = $(this).attr('code'),
|
||||||
lng = $(this).find('Longitude').text(),
|
lat = $(this).find('Latitude').text(),
|
||||||
stationID = network+'_'+station,
|
lng = $(this).find('Longitude').text(),
|
||||||
stationText = network+'.'+station;
|
stationID = network+'_'+station,
|
||||||
if ( !stationTable[stationID] ) { // && N >= lat && S <= lat && W<= lng && E >= lng
|
stationText = network+'.'+station;
|
||||||
var row = sprintf('<tr><td>%s</td><td>%s</td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
|
if ( !stationTable[stationID] ) {
|
||||||
var r = $(row);
|
// general station info (1st line)
|
||||||
$('#stationstable tbody').append(r);
|
var row = sprintf('<tr><td><a href="#" class="toggle">%s</a></td><td><a href="#" class="toggle">%s</a></td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
|
||||||
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
|
// setting up network details (2nd line)
|
||||||
};
|
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
|
||||||
});
|
row += ( $.inArray(station, bochumStation)+1 ) ? '</br><em>Betreiber:</em> Ruhr-Universität Bochum</td></tr>' : '</td></tr>' ;
|
||||||
|
if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) {
|
||||||
|
// setting up station details (3rd line)
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">not implemented</td></tr>';
|
||||||
|
// setting up download links (4th line)
|
||||||
|
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
|
||||||
|
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
|
||||||
|
fdsnxmlURL = URL + '&level=station&format=xml';
|
||||||
|
fdsnxmlRespURL = URL + '&level=response&format=xml';
|
||||||
|
sc3mlURL = URL + '&level=station&format=sc3ml';
|
||||||
|
sc3mlRespURL = URL + '&level=response&format=sc3ml';
|
||||||
|
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
|
||||||
|
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
|
||||||
|
+ sprintf('Download details: <a href="%s" target="_blank">FDSNxml</a> or <a href="%s" target="_blank">SC3ml</a></br> ', fdsnxmlURL, sc3mlURL)
|
||||||
|
+ sprintf('Response files: <a href="%s" target="_blank">FDSNxml</a>, <a href="%s" target="_blank">SC3ml</a> ', fdsnxmlRespURL, sc3mlRespURL)
|
||||||
|
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
|
||||||
|
+ '</td></tr>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">Kontaktieren Sie den ';
|
||||||
|
row += ( networkURL[network.toUpperCase()] ) ? '<a href="'+networkURL[network.toUpperCase()]+'" target="_blank">Netzwerkkoordinator</a>' : 'Netzwerkkoordinator';
|
||||||
|
row += ' für weitere Details.</td></tr>';
|
||||||
|
};
|
||||||
|
$('#stationstable tbody').append(row);
|
||||||
|
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
@ -79,6 +107,9 @@ function loadStations(stime, etime) {
|
|||||||
stationLayer.bringToFront();
|
stationLayer.bringToFront();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// create stations csv download link
|
||||||
|
request_data['format'] = 'text';
|
||||||
|
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
|
||||||
};
|
};
|
||||||
|
|
||||||
/* initStationTable */
|
/* initStationTable */
|
||||||
@ -110,7 +141,7 @@ function initStationTable() {
|
|||||||
// css class names of pager arrows
|
// css class names of pager arrows
|
||||||
pager_css: {
|
pager_css: {
|
||||||
container : 'stations-tablesorter-pager',
|
container : 'stations-tablesorter-pager',
|
||||||
errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning)
|
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning)
|
||||||
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
|
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
|
||||||
},
|
},
|
||||||
// jQuery pager selectors
|
// jQuery pager selectors
|
||||||
@ -126,7 +157,7 @@ function initStationTable() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
filter_childRows : true,
|
filter_childRows : true,
|
||||||
filter_cssFilter : 'tablesorter-filter',
|
filter_cssFilter : 'stations-tablesorter-filter',
|
||||||
filter_startsWith : false,
|
filter_startsWith : false,
|
||||||
filter_ignoreCase : true,
|
filter_ignoreCase : true,
|
||||||
scroller_height: $('div.map').height() - 250,
|
scroller_height: $('div.map').height() - 250,
|
||||||
@ -137,6 +168,12 @@ function initStationTable() {
|
|||||||
showProcessing: true,
|
showProcessing: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// hide child rows
|
||||||
|
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
|
||||||
|
// update map after filtering
|
||||||
|
// $('#stationsstable').bind('filterEnd', function(){
|
||||||
|
// toggleFilteredMarkers();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
@ -144,4 +181,30 @@ function initStationTable() {
|
|||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
loadStations();
|
loadStations();
|
||||||
|
// show / hide station info
|
||||||
|
$('#stationstable').delegate('.toggle', 'click' , function(){
|
||||||
|
// toggle visibility of selected row
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
||||||
|
// mark currently selected row and remove class selected from all other rows
|
||||||
|
// hide other rows
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
||||||
|
$(this).closest('tbody').find('td.selected').each(function(){
|
||||||
|
if ( ! $(this).hasClass('selected-now') ) {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
|
||||||
|
$(this).removeClass('selected-now');
|
||||||
|
var selected = $(this).hasClass('selected');
|
||||||
|
if ( selected ) {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
//highlightFirstEvent();
|
||||||
|
} else {
|
||||||
|
$(this).addClass('selected');
|
||||||
|
//toggleHighlightStation($(this).attr('stationid'));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user