From 2134402e937fdd3afad0e03d6e9a93e58deeb3d4 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 4 Sep 2015 13:13:58 +0000 Subject: [PATCH] Fixed date bug which surfaced in Chromium Browser --- www/events.js | 19 ++++++++++++------- www/events.js.en | 19 ++++++++++++------- www/impressum.inc.de | 24 ++++++++++++------------ www/index.html.de | 2 +- www/index.html.en | 2 +- www/info.inc.de | 2 +- www/map.js | 2 +- www/map.js.en | 2 +- www/misc.js | 4 ++-- www/stations.js | 10 +++++----- www/stations.js.en | 10 +++++----- 11 files changed, 53 insertions(+), 43 deletions(-) diff --git a/www/events.js b/www/events.js index f958781..1d736c5 100644 --- a/www/events.js +++ b/www/events.js @@ -44,10 +44,12 @@ function getGeolocation(id, lat, lng) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } ) .done(function( json ) { var city = json.address["city"]; + if ( ~city ) { city = json.address["town"]; }; + if ( ~city ) { city = json.address["village"]; }; var country = json.address["country"]; var countryCode = json.address["country_code"].toUpperCase(); geolocationTable[id] = city; - ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; if ( city ) { $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); var sort = [[0,1],[1,1],[2,1]]; @@ -55,7 +57,7 @@ function getGeolocation(id, lat, lng) { $("#eventstable").trigger("updateCache"); $("#eventstable").trigger("sorton", [sort]); } else { - console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); }; }) .fail(function( jqxhr, textStatus, error ) { @@ -137,6 +139,9 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { // 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); + if ( ~oTime ) { + oTime = new Date(otime.split('.')[0]); + }; var sTime = new Date(oTime.getTime()-10*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())); @@ -155,11 +160,11 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) { var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type); var text = sprintf('

%s

', id, location) - + sprintf('

Ereignis: %s
', id) - + sprintf('Type: %s
', type) - + sprintf('Magnitude: %3.1f
', Number(mag)) - + sprintf('Ort: %.4f °N, %.4f °O
', Number(lat), Number(lng)) - + sprintf('Tiefe: %.1f km
', Number(depth)/1000.) + + sprintf('

Ereignis: %s
', id) + + sprintf('Type: %s
', type) + + sprintf('Magnitude: %3.1f
', Number(mag)) + + sprintf('Ort: %.4f °N, %.4f °O
', Number(lat), Number(lng)) + + sprintf('Tiefe: %.1f km
', Number(depth)/1000.) + sprintf('Zeit: %sZ

', otime.split('.')[0], otime.split('.')[0]); marker.bindPopup(text); }; diff --git a/www/events.js.en b/www/events.js.en index b059173..0bf8c60 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -44,10 +44,12 @@ function getGeolocation(id, lat, lng) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } ) .done(function( json ) { var city = json.address["city"]; + if ( ~city ) { city = json.address["town"]; }; + if ( ~city ) { city = json.address["village"]; }; var country = json.address["country"]; var countryCode = json.address["country_code"].toUpperCase(); geolocationTable[id] = city; - ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; if ( city ) { $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); var sort = [[0,1],[1,1],[2,1]]; @@ -55,7 +57,7 @@ function getGeolocation(id, lat, lng) { $("#eventstable").trigger("updateCache"); $("#eventstable").trigger("sorton", [sort]); } else { - console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); }; }) .fail(function( jqxhr, textStatus, error ) { @@ -137,6 +139,9 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { // 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); + if ( ~oTime ) { + oTime = new Date(otime.split('.')[0]); + }; var sTime = new Date(oTime.getTime()-10*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())); @@ -155,11 +160,11 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) { var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type); var text = sprintf('

%s

', id, location) - + sprintf('

Ereignis: %s
', id) - + sprintf('Type: %s
', type) - + sprintf('Magnitude: %3.1f
', Number(mag)) - + sprintf('Ort: %.4f °N, %.4f °O
', Number(lat), Number(lng)) - + sprintf('Tiefe: %.1f km
', Number(depth)/1000.) + + sprintf('

Ereignis: %s
', id) + + sprintf('Type: %s
', type) + + sprintf('Magnitude: %3.1f
', Number(mag)) + + sprintf('Ort: %.4f °N, %.4f °O
', Number(lat), Number(lng)) + + sprintf('Tiefe: %.1f km
', Number(depth)/1000.) + sprintf('Zeit: %sZ

', otime.split('.')[0], otime.split('.')[0]); marker.bindPopup(text); }; diff --git a/www/impressum.inc.de b/www/impressum.inc.de index 698ebde..c4c5a1e 100644 --- a/www/impressum.inc.de +++ b/www/impressum.inc.de @@ -1,23 +1,23 @@

Anschrift

- Seismologisches Observatorium der
- Ruhr-Universität Bochum
- NA 3/174
- 44780 Bochum
- Tel.: 0234 32-27574
- Fax: 0234 32-07574
+ Seismologisches Observatorium der
+ Ruhr-Universität Bochum
+ NA 3/174
+ 44780 Bochum
+ Tel.: 0234 32-27574
+ Fax: 0234 32-07574

Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.

Zuständige Aufsichtsbehörde ist das Ministerium für Innovation, Wissenschaft und Forschung des Landes Nordrhein-Westfalen, Völklinger Straße 49, 40221 Düsseldorf.

Umsatzsteuer-Identifikationsnummer: DE 127 056 261

Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum

- Herr Dr. Kasper D. Fischer
- Ruhr-Universität Bochum
- 44780 Bochum
- Tel.: 0234 32-27574
- Fax: 0234 32-07574
- E-Mail: kasper.fischer@ruhr-uni-bochum.de
+ Herr Dr. Kasper D. Fischer
+ Ruhr-Universität Bochum
+ 44780 Bochum
+ Tel.: 0234 32-27574
+ Fax: 0234 32-07574
+ E-Mail: kasper.fischer@ruhr-uni-bochum.de

Meldungen über missbräuchliche Nutzungen, die von Stationen aus dem IP-Namensbereich ruhr-uni-bochum.de ausgehen, senden Sie bitte an die Email-Adresse abuse@ruhr-uni-bochum.de. Gleichfalls bittet die Ruhr-Universität um Mitteilung an dieselbe Email-Adresse, wenn rechtswidrige Inhalte durch Links auf Seiten der Ruhr-Universität zu diff --git a/www/index.html.de b/www/index.html.de index 860674c..f51b766 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -178,6 +178,6 @@

- + diff --git a/www/index.html.en b/www/index.html.en index 6e6fca5..0474a92 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -179,6 +179,6 @@
- + diff --git a/www/info.inc.de b/www/info.inc.de index d0b0059..2b6c14b 100644 --- a/www/info.inc.de +++ b/www/info.inc.de @@ -1,7 +1,7 @@

Navigation zu den Internetseiten

    -
  • des Seismologisches Observatorium
    der Ruhr-Universität Bochum
  • +
  • des Seismologisches Observatorium
    der Ruhr-Universität Bochum
  • der Arbeitsgruppe Seismologie
  • des Instituts für Geologie, Mineralogie und Geophysik
  • der Ruhr-Universität Bochum
  • diff --git a/www/map.js b/www/map.js index abbc059..3a673b2 100644 --- a/www/map.js +++ b/www/map.js @@ -32,7 +32,7 @@ function addStationMarker(id, lat, lng, station) { color: config['station']['markerColor'], weight: 1, opacity: 1, - radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'], + radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], className: id+' stationMarker', }); marker.bindLabel('Station '+station); diff --git a/www/map.js.en b/www/map.js.en index 3f9663c..44c6fde 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -32,7 +32,7 @@ function addStationMarker(id, lat, lng, station) { color: config['station']['markerColor'], weight: 1, opacity: 1, - radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'], + radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], className: id+' stationMarker', }); marker.bindLabel('Station '+station); diff --git a/www/misc.js b/www/misc.js index d0a5970..33ca0fc 100644 --- a/www/misc.js +++ b/www/misc.js @@ -119,7 +119,7 @@ var config = { markerColor: 'darkgreen', markerOpacity: 1, markerSize: { - default: 8, + defaultSize: 8, GE_IBBN: 10, GR_BUG: 10, GR_KAST: 10, @@ -211,4 +211,4 @@ $(document).ready(function() { }).bind("ajaxStop", function() { $("#spinner").hide(); }); -}); \ No newline at end of file +}); diff --git a/www/stations.js b/www/stations.js index 4daea2f..fb41de5 100644 --- a/www/stations.js +++ b/www/stations.js @@ -66,7 +66,7 @@ function loadStations(stime, etime) { var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); - row += ( $.inArray(station, bochumStation)+1 ) ? '
    Betreiber: Ruhr-Universität Bochum' : '' ; + row += ( $.inArray(station, bochumStation)+1 ) ? '
    Betreiber: Ruhr-Universität Bochum' : '' ; if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; @@ -81,7 +81,7 @@ function loadStations(stime, etime) { sc3mlRespURL = URL + '&level=response&format=sc3ml'; dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); row += '' - + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Response files: FDSNxml, SC3ml ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('or datalessSEED', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + ''; @@ -124,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat var elevation = stationObject.find('Elevation:first').text(); var name = stationObject.find('Site > Name').text(); output = '
    '
    -		+ name + '
    ' - + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN
    '; + + name + '
    ' + + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN
    '; stationObject.find('Channel').each(function() { var code = $(this).attr('code'); var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sampleRate = $(this).find('SampleRate').text(); - output += '
    Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; + output += '
    Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; }); output += '
    '; return output; diff --git a/www/stations.js.en b/www/stations.js.en index 5d6c1ba..255ec32 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -66,7 +66,7 @@ function loadStations(stime, etime) { var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); - row += ( $.inArray(station, bochumStation)+1 ) ? '
    Operator: Ruhr-University Bochum' : '' ; + row += ( $.inArray(station, bochumStation)+1 ) ? '
    Operator: Ruhr-University Bochum' : '' ; if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; @@ -81,7 +81,7 @@ function loadStations(stime, etime) { sc3mlRespURL = URL + '&level=response&format=sc3ml'; dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); row += '' - + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Response files: FDSNxml, SC3ml ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('or datalessSEED', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + ''; @@ -124,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat var elevation = stationObject.find('Elevation:first').text(); var name = stationObject.find('Site > Name').text(); output = '
    '
    -		+ name + '
    ' - + 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.
    '; + + name + '
    ' + + 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.
    '; stationObject.find('Channel').each(function() { var code = $(this).attr('code'); var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sampleRate = $(this).find('SampleRate').text(); - output += '
    Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; + output += '
    Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; }); output += '
    '; return output;