Compare commits

..

2 Commits

53 changed files with 2686 additions and 1004 deletions

2
.gitattributes vendored
View File

@ -1,8 +1,8 @@
* text=auto !eol * text=auto !eol
scripts/mkEvents.csh -text scripts/mkEvents.csh -text
wsgi/showEnv.py -text
www/.htaccess -text www/.htaccess -text
www/copyright.inc.de -text www/copyright.inc.de -text
www/eventsXML.js -text
www/external/TileLayer.Grayscale.js -text www/external/TileLayer.Grayscale.js -text
www/external/css/dvf.css -text www/external/css/dvf.css -text
www/external/css/leaflet.label.css -text www/external/css/leaflet.label.css -text

57
.gitignore vendored
View File

@ -1,56 +1,7 @@
## Visual Studio Code
# Visual Studio Code files
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
## MacOS / OSX
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
## Vagrant
.vagrant/
# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
## Project Files
wsgi/.idea wsgi/.idea
www/dlsv www/dlsv
www/event.xml
www/events.xml
www/geolocation.js
www/geolocationTable.js
www/stations.xml www/stations.xml
www/index.html
www/data/events.xml
www/data/geolocation.js
scripts/*.json
scripts/*.xml

View File

@ -1,13 +0,0 @@
# Version: v1.3 (2023-04-17)
FROM nginx:alpine
# set labels
LABEL org.opencontainers.image.authors="kasper.fischer@rub.de"
# copy nginx config files
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/mime.types /etc/nginx/mime.types
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# copy webpage content
COPY www /usr/share/nginx/html/map

16
Vagrantfile vendored
View File

@ -1,16 +0,0 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.synced_folder ".", "/vagrant"
config.vm.network(:forwarded_port, guest: 80, host: 8888)
config.vm.provision :shell, inline: <<-SHELL
sudo apt-get -y update
sudo apt-get -y install nginx
echo "Starting nginx..."
sudo ln -s /vagrant/www /var/www/html/map
sudo cp /vagrant/www/index.html.en /vagrant/www/index.html
sudo useradd -s /bin/false nginx
sudo service nginx restart
SHELL
end

View File

@ -1,19 +0,0 @@
version: "3.9"
networks:
seisobs:
external: false
services:
map:
build:
context: .
dockerfile: Dockerfile
image: seisobs-map:v1.1
networks:
- seisobs
volumes:
- ./www/data:/usr/share/nginx/html/map/data:ro
ports:
- "${SEISOBS_MAPPORT}:80"
restart: unless-stopped

View File

@ -1,76 +0,0 @@
# Version: v1.3 (2023-04-17)
server {
listen 80;
listen [::]:80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
set $first_language $http_accept_language;
if ($http_accept_language ~* '^(.+?),') {
set $first_language $1;
}
set $language_suffix 'en';
if ($first_language ~* 'de') {
set $language_suffix 'de';
}
#rewrite rules to /map/
rewrite ^(.*)/index(\.html)*$ /map/index.html.$language_suffix last;
rewrite ^/favicon.ico$ /map/favicon.ico last;
rewrite ^/map$ /map/ last;
rewrite ^/map.js$ /map/map.js last;
rewrite ^/karte$ /map/ last;
rewrite ^/karte/$ /map/ last;
rewrite ^/karte/(.*)$ /map/$1 last;
if ($uri !~ "^/map") {
rewrite ^(.*)/(.*)$ /map$1/$2 last;
}
#location /map {
# root /usr/share/nginx/html/;
# index index.html.$language_suffix index.html;
# #try_files $uri.$language_suffix $uri.html.$language_suffix $uri.html $uri index.html.$language_suffix index.html;
#}
location / {
root /usr/share/nginx/html/;
index index.html.$language_suffix index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

View File

@ -1,98 +0,0 @@
types {
text/html html htm shtml de en;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@ -1,32 +0,0 @@
# Version: v1.3 (2023-04-17)
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

View File

@ -1,15 +0,0 @@
#!/bin/bash
# Version: v1.3 (2023-04-17)
# get starting date
# find gdate or date command ( OSX: brew install coreutils)
# the date command on OSX is not compatible to the linux date command
datecmd=$((which gdate || which date )| grep bin)
STIME="${1:-$(${datecmd} -d 6-month-ago +%Y-%m-%d)}"
STIME="${STIME:-$(date +%Y-%m-%d)}"
# get output filename
OUTPUT="${2:--}"
# fetch events
curl -s -o ${OUTPUT} "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&minlat=50.0&maxlat=53.0&minlon=4.0&maxlon=10.0&minmag=0.7"

1
scripts/mkEvents.csh Executable file
View File

@ -0,0 +1 @@
curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=2014-08-01&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1"

View File

@ -1,4 +1,4 @@
#! /usr/bin/env python3 #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
''' '''
@ -8,14 +8,12 @@
The output will will be a javascript structure to be included in the The output will will be a javascript structure to be included in the
SeisObs map service. SeisObs map service.
The script should be updated regularly keep the total number of all The script should be updated regulary keep the total number of all
AJAX calls to the Nominatim service small, e. g. : AJAX calls to the Nominatim service small, e. g. :
curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js curl -s "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js
Version: v1.3 (2023-04-17)
License License
Copyright 2020-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -29,35 +27,30 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
$Id$
''' '''
def mkGeolocationTable(file=''): def mkGeolocationTable(file=''):
## imports # imports
# XML ElementTree
try: try:
import xml.etree.cElementTree as ET import xml.etree.cElementTree as ET
except ImportError: except ImportError:
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from sys import stdin
# json import warnings
import urllib2 as URL
import json as JSON import json as JSON
# sys stdin # constants
from sys import stdin namespaces = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
# geopy
from geopy.geocoders import Photon
from geopy.extra.rate_limiter import RateLimiter
from geopy.exc import GeocoderServiceError
## constants
URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=10'
NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
'qml': 'http://quakeml.org/xmlns/bed/1.2'} 'qml': 'http://quakeml.org/xmlns/bed/1.2'}
def simple_warning(message, category, filename, lineno, file=None, line=None):
return 'Warning: %s\n' % (message)
warnings.formatwarning = simple_warning
# try loading the file # try loading the file
geolocationTable = {}
if file : if file :
try: try:
jsonfile = open(file) jsonfile = open(file)
@ -65,93 +58,73 @@ def mkGeolocationTable(file=''):
geolocationTable = JSON.loads(jsonfileContent) geolocationTable = JSON.loads(jsonfileContent)
except: except:
geolocationTable = {} geolocationTable = {}
logging.warning('Could not parse file %s' %file) warnings.warn('Could not parse file %s' %file)
# parse event.xml # parse event.xml
DOM = ET.parse(stdin).getroot() DOM = ET.parse(stdin).getroot()
geolocator = Photon()
reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=2)
# iterate over all events # iterate over all events
count = 0 for event in DOM.iterfind('qml:eventParameters/qml:event', namespaces):
for event in DOM.iterfind('qml:eventParameters/qml:event', NAMESPACES):
count += 1
publicID = event.attrib['publicID'].split('/')[2] publicID = event.attrib['publicID'].split('/')[2]
lat = float(event.find('./qml:origin/qml:latitude/qml:value', NAMESPACES).text) lat = event.find('./qml:origin/qml:latitude/qml:value', namespaces).text
lng = float(event.find('./qml:origin/qml:longitude/qml:value', NAMESPACES).text) lng = event.find('./qml:origin/qml:longitude/qml:value', namespaces).text
evaluationMode = event.find('./qml:origin/qml:evaluationMode', NAMESPACES).text evaluationMode = event.find('./qml:origin/qml:evaluationMode', namespaces).text
if publicID in geolocationTable: if publicID in geolocationTable:
logging.warning('Skipping cached event {id}'.format(id=publicID)) warnings.warn('Skipping cached event %s' %(publicID))
elif evaluationMode == 'automatic': elif evaluationMode == 'automatic':
logging.warning('Skipping automatic event {id}'.format(id=publicID)) warnings.warn('Skipping automatic event %s' %(publicID))
else: else:
logging.info('Processing event {id}'.format(id=publicID)) #warnings.warn('Processing event %s' %publicID)
try: # send and evaluate nominatim request
locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=10) url = 'https://open.mapquestapi.com/nominatim/v1/reverse.php?lat={0}&lon={1}&zoom=10&format=json'.format(lat, lng)
except GeocoderServiceError: response = URL.urlopen(url)
logging.warning('Reverse Geolocation failed. Skipping event.') if ( response.msg == 'OK' ):
continue data = JSON.loads(response.read())
place = [] city = []
for location in locations:
try: try:
place = location.raw['properties']['city']
except KeyError:
try: try:
place = location.raw['properties']['town'] city = data['address']['city']
except KeyError: except:
warnings.warn('Request {3} for event {0} at {1} N / {2} E did not provide city attribute\n\t(Response: {4})'.format(publicID, lat, lng, url, data))
try: try:
place = location.raw['properties']['village'] city = data['address']['town']
except KeyError: warnings.warn('Using attribute town ({1}) for event {0}'.format(publicID, city))
except:
try: try:
place = location.raw['properties']['county'] city = data['address']['county']
except KeyError: warnings.warn('Using attribute county ({1}) for event {0}'.format(publicID, city))
logging.debug('Could not extract city for event {id} at {lat:.3f} N / {lng:.3f} E (Service: {url}), trying next returned result' except:
.format(id=publicID, lat=lat, lng=lng, url=URL.format(lat=lat,lng=lng))) warnings.warn('Skipping event')
logging.debug(location.raw) continue
if not place: countryCode = data['address']['country_code'].upper()
logging.critical('Could not extract city for event {id} at {lat:.3f} N / {lng:.3f} E (Service: {url})' if ( countryCode == 'DE' ):
.format(id=publicID, lat=lat, lng=lng, url=URL.format(lat=lat,lng=lng))) geolocationTable[publicID] = city.encode('utf-8')
geolocationTable[publicID] = place else:
geolocationTable[publicID] = '{0} ({1})'.format(city.encode('utf-8'), countryCode)
except:
warnings.warn('Could not extract city for event {0} at {1} N / {2} E (URL: {3})'.format(publicID, lat, lng, url))
else:
warnings.warn('Request {0} failed'.format(url))
# dump json # dump json
print('var geolocationTable = {0};'.format(JSON.dumps(geolocationTable, sort_keys=True))) print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';'
logging.info("processed %d events", count)
# __main__ # __main__
if __name__ == "__main__": if __name__ == "__main__":
# use module logging def printline(line):
import logging print line
# parse arguments # parse arguments
import argparse import argparse
versionText = 'v1.3 (2023-04-17)' versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','')
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Reverse geocoding lookup of events in xml format (stdin).', description='Reverese geocoding lookup of events in xml format (stdin).',
epilog=versionText) epilog=versionText)
parser.add_argument('-V', '--version', action='version', version=versionText, parser.add_argument('-v', '-V', '--version', action='version',
help="show version") version=versionText)
parser.add_argument('-f', '--file', action='store', dest='file', parser.add_argument('-f', '--file', action='store', dest='file',
help='read in JSON file containing old output.') help='read in JSON file containing old output.')
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true",
help="increase output verbosity")
group.add_argument("-q", "--quiet", action="store_true",
help="disable output")
group.add_argument("-d", "--debug", action="store_true",
help="show debugging output",
)
cla = parser.parse_args() cla = parser.parse_args()
# set logging level
if cla.quiet:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
elif cla.verbose:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
elif cla.debug:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
else:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARN)
# call mkGeolocationTable(...) # call mkGeolocationTable(...)
mkGeolocationTable(file=cla.file) mkGeolocationTable(file=cla.file)

View File

@ -1,21 +0,0 @@
#!/bin/bash
# version: v1.3 (2023-04-17)
function fail {
printf '%s\n' "$1" >&2 ## Send message to stderr.
exit "${2-1}" ## Return a code specified by $2, or 1 by default.
}
if [ $# -le 1 ] ; then
echo usage: ${0} version_string files ...
exit 0
fi
version="$1"
shift
files="$*"
echo ${version} ${files}
which sponge > /dev/null || fail "sponge util must be installed"
for file in ${files}; do
sed "s/V\{5\}/${version}"/ ${file} | sponge ${file}
done

View File

@ -4,10 +4,11 @@
Get waveform data from FDSN web service and create a fancy plot Get waveform data from FDSN web service and create a fancy plot
This programme runs as a script or as a WSGI application. This programme runs as a script or as a WSGI application.
:version v1.1 (2021-10-31) Subversion information:
$Id$
:license :license
Copyright 2020 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de> Copyright 2015 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -132,7 +133,7 @@ def fancy_plot(st, wsgi=False, img_format='png', color=True):
def trace_dayplot(st, deltat = None, def trace_dayplot(st, deltat = None,
ftype='none', fmin=1.0, fmax=7.0, ftype='bandpass', fmin=1.0, fmax=7.0,
col=('b', 'r', 'g'), interval=20, outpattern='', col=('b', 'r', 'g'), interval=20, outpattern='',
wsgi=False): wsgi=False):
""" """
@ -259,24 +260,18 @@ def main(backend=None, args=None, wsgi=False):
if args['stime']: if args['stime']:
otime = UTCDateTime(args['stime']) otime = UTCDateTime(args['stime'])
else: else:
otime = UTCDateTime() - 3600. - deltat otime = UTCDateTime() - 3600 - deltat
network = args['station'].split('.')[0] network = args['station'].split('.')[0]
station = args['station'].split('.')[1] station = args['station'].split('.')[1]
if args['type'] == 'dayplot': if args['type'] == 'dayplot':
if network == 'Z3': channel = 'BHZ'
channel = 'HHZ'
else:
channel = 'BHZ'
else: else:
if args['length'] < 3600.: if args['length'] < 3600:
channel = 'HH?' channel = 'HH?'
else: else:
if network == 'Z3': channel = 'BH?'
channel = 'HH?'
else:
channel = 'BH?'
else: else:
otime = UTCDateTime() - 3600. otime = UTCDateTime('2014-11-15T11:35:25Z')
deltat = 30 deltat = 30
network = 'GR' network = 'GR'
station = 'BUG' station = 'BUG'
@ -378,7 +373,8 @@ if __name__ == "__main__":
epilog=u'$Revision$ ($Date$, $Author$)'.replace( epilog=u'$Revision$ ($Date$, $Author$)'.replace(
"$", "")) "$", ""))
parser.add_argument(u'-v', u'-V', u'--version', action='version', parser.add_argument(u'-v', u'-V', u'--version', action='version',
version=u'v1.1 (2021-10-31)') version=u'$Revision$ ($Date$, \
$Author$)'.replace('$', ''))
parser.add_argument(u'-u', u'--url', action='store', dest='server', parser.add_argument(u'-u', u'--url', action='store', dest='server',
default=u'https://ariadne.geophysik.ruhr-uni-bochum.de', default=u'https://ariadne.geophysik.ruhr-uni-bochum.de',
help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).') help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).')
@ -402,4 +398,4 @@ if __name__ == "__main__":
if os.getenv('DISPLAY'): if os.getenv('DISPLAY'):
main(args=cla) main(args=cla)
else: else:
main('Agg', cla) main('Agg', cla)

View File

@ -1,19 +0,0 @@
def application(environ, start_response):
"""
Function application - Wrapper to process wsgi request
:param environ: contains information on the wsgi environment
:type environ: dict
:param start_response: function to process response header by the wsgi server
:type start_response: function
:return: response to be sent to the client by the wsgi server
:rtype: list
:version: v1.2 (2022-02-23)
"""
from cgi import FieldStorage
form = FieldStorage(fp=environ['wsgi.input'], environ=environ)
start_response('200 OK', [('Content-Type', 'text/html')])
return [form]

View File

@ -3,10 +3,11 @@
""" """
Produce a dayplot from seismogram recordings Produce a dayplot from seismogram recordings
version: v1.2 (2022-02-23) Subversion information:
$Id$
license: gpl3 license: gpl3
Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum Copyright 2012-2015 Seismological Observatory, Ruhr-University Bochum
http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs
Contributors: Contributors:
Martina Rische <martina.rische@rub.de> Martina Rische <martina.rische@rub.de>

1
www/.htaccess Normal file
View File

@ -0,0 +1 @@
Allow from all

View File

View File

@ -1,12 +0,0 @@
/* last change 2022-20-23 */
var specialEvents = [
// 'bug2016ajgm', // CTBT violation North Korea
// 'bug2016qphy', // Central Italy 6.1
// 'bug2016rslt', // CTBT violation North Korea
// 'bug2016vico', // Central Italy 6.5
// 'bug2017rfxe', // CTBT violation North Korea 6.1
// 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0
// 'bug2021vtgi', // Geilenkirchen 1.9
// 'bug2022ahxi', // Erftstadt 2.9
'bug2023hlmh' // Brüggen 3.3
];

View File

@ -4,7 +4,7 @@
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -19,9 +19,71 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* process loaded events */
function processEvents(xml, target) {
$(xml).find('event').each(function () {
var id = $(this).attr('publicID').split('/')[2];
var mag = $(this).find('magnitude > mag > value').text();
var otime = $(this).find('origin > time > value').text();
var lng = $(this).find('origin > longitude > value').text();
var lat = $(this).find('origin > latitude > value').text();
var depth = $(this).find('origin > depth > value').text();
var evaluationMode = $(this).find('origin > evaluationMode').text();
var evaluationStatus = $(this).find('origin > evaluationStatus').text();
var type = $(this).find('type').last().text();
var location
// get location, try this in order:
// regional map name, given value, cached value, or nominatim lookup
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() );
// 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'] ) {
// general event info (1st line)
var row = '<tr class="tablesorter-hasChildRow">'
+ '<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>'
+ '</tr>';
// setting up event details (2nd line)
row += '<tr class="tablesorter-childRow event-details">'
+ '<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);
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()));
row += '<tr class="tablesorter-childRow event-download">'
+ '<td colspan="4" eventid="'+id+'">'
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
+ '</td></tr>';
// add row to table
if ( sTime <= oTime && eTime >= oTime ) {
addTableRow(row, 'eventstable');
};
if ( target ) {
addTableRow(row, target);
}
// create marker
if ((sTime <= oTime && eTime >= oTime ) || ( id == eventid )) {
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s</br>', id)
+ sprintf('Type: %s</br>', type)
+ sprintf('Magnitude: %3.1f</br>', Number(mag))
+ sprintf('Ort: %.4f °N, %.4f °O </br>', Number(lat), Number(lng))
+ sprintf('Tiefe: %.1f km</br>', Number(depth)/1000.)
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text);
};
};
});
};
/* adding row(s) to a table and format date strings afterwards */ /* adding row(s) to a table and format date strings afterwards */
function addTableRow(row, table) { function addTableRow(row, table) {
var added = $('#'+table+' tbody').append(row); var added = $('#'+table+' tbody').append(row);
@ -40,23 +102,20 @@ function addTableRow(row, table) {
/* do reverse geolocation lookup */ /* do reverse geolocation lookup */
function getGeolocation(id, lat, lng) { function getGeolocation(id, lat, lng) {
if ( $.inArray(id, geolocationTable) == -1 ) { if ( !geolocationTable[id] ) {
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } ) $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } )
.done(function( json ) { .done(function( json ) {
if ( json.features[0] ) { var city = json.address["city"];
var city = json.features[0].properties.city; var country = json.address["country"];
var countryCode = json.features[0].properties.country; var countryCode = json.address["country_code"].toUpperCase();
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]); $("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache"); $("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]); $("#eventstable").trigger("sorton", [sort]);
} else {
// console.log("Nominatim did not provide a city tag for "+lat+" / "+lng);
};
}; };
}) })
.fail(function( jqxhr, textStatus, error ) { .fail(function( jqxhr, textStatus, error ) {
@ -67,7 +126,7 @@ function getGeolocation(id, lat, lng) {
}; };
/* Load events using ajax */ /* Load events using ajax */
function ajaxLoadEvents(stime, etime, eventid, url, target) { function ajaxLoadEvents(startup, stime, etime, eventid, url, target) {
var mapBounds = map.getBounds(); var mapBounds = map.getBounds();
var request_data = {}; var request_data = {};
var rtime; var rtime;
@ -89,7 +148,7 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
} else { } else {
request_data = { request_data = {
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()), starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
orderby: 'time-asc', orderby: 'time',
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']), minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']), maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']), minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
@ -102,86 +161,30 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
}; };
}; };
if ( etime == '' || !etime ) { etime = new Date(); }; if ( etime == '' || !etime ) { etime = new Date(); };
$.ajax({ if ( startup ) {
type: "GET", processEvents(eventsXML, false);
url: ajax_url, } else {
data: request_data, $.ajax({
dataType: "xml", type: "GET",
success: function (xml) { url: ajax_url,
$(xml).find('event').each(function () { data: request_data,
var id = $(this).attr('publicID').split('/')[2]; dataType: "xml",
var mag = $(this).find('magnitude > mag > value').text(); success: function ( xml ) { processEvents(xml, target) },
var otime = $(this).find('origin > time > value').text(); complete: function () {
var lng = $(this).find('origin > longitude > value').text(); var sort = [[0,1],[1,1],[2,1]];
var lat = $(this).find('origin > latitude > value').text(); $("#eventstable").trigger("update", [true]);
var depth = $(this).find('origin > depth > value').text(); $("#eventstable").trigger("updateCache");
var evaluationMode = $(this).find('origin > evaluationMode').text(); $("#eventstable").trigger("sorton", [sort]);
var evaluationStatus = $(this).find('origin > evaluationStatus').text(); initMapLink();
var type = $(this).find('type').last().text(); eventLayer.bringToBack();
var location highlightFirstEvent();
// create table row: Date, Time, Mag, Location },
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { error: function( jqxhr, textStatus, error ) {
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later var err = textStatus + ", " + error;
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() ); console.log( "Request Failed: " + err );
// general event info (1st line) }
var row = '<tr class="tablesorter-hasChildRow">' });
+ '<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>'
+ '</tr>';
// setting up event details (2nd line)
row += '<tr class="tablesorter-childRow event-details">'
+ '<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);
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()));
row += '<tr class="tablesorter-childRow event-download">'
+ '<td colspan="4" eventid="'+id+'">'
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
+ '</td></tr>';
// add row to table
if ( stime <= oTime && etime >= oTime ) {
addTableRow(row, 'eventstable');
};
if ( target ) {
addTableRow(row, target);
}
// create marker
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s<br />', id)
+ sprintf('Type: %s<br />', type)
+ sprintf('Magnitude: %3.1f<br />', Number(mag))
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng))
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.)
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text);
};
};
});
},
complete: function () {
var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]);
initMapLink();
eventLayer.bringToBack();
highlightFirstEvent();
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
}
});
// create events csv download link // create events csv download link
request_data['format'] = 'text'; request_data['format'] = 'text';
if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) }; if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
@ -283,6 +286,7 @@ function toggleFilteredMarkers() {
/* Highlight the first event of the event list on the map if no /* Highlight the first event of the event list on the map if no
* other event is selected */ * other event is selected */
function highlightFirstEvent() { function highlightFirstEvent() {
$('div.info').show()
var highlightStyle = { var highlightStyle = {
color: config['event']['markerColorH'], color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'], fillColor: config['event']['markerColorH'],
@ -308,6 +312,7 @@ function highlightFirstEvent() {
$(this).text('Karte (rot)'); $(this).text('Karte (rot)');
}; };
}); });
$('div.info').hide()
}; };
function highlightEvent( id ) { function highlightEvent( id ) {
@ -371,18 +376,18 @@ $(document).ready(function() {
// hide child rows // hide child rows
$('#eventstable > tbody > tr.tablesorter-childRow td').hide(); $('#eventstable > tbody > tr.tablesorter-childRow td').hide();
// update map after filtering // update map after filtering
$('#eventstable').on('filterEnd', function(){ $('#eventstable').bind('filterEnd', function(){
toggleFilteredMarkers(); toggleFilteredMarkers();
}); });
// highlight first event // highlight first event
$('#eventstable').on('sortEnd', function(){ $('#eventstable').bind('sortEnd', function(){
highlightFirstEvent(); highlightFirstEvent();
}); });
$('#eventstable').on('pagerComplete', function(){ $('#eventstable').bind('pagerComplete', function(){
highlightFirstEvent(); highlightFirstEvent();
}); });
// show / hide event info // show / hide event info
$('#eventstable').on('click', '.toggle', function(){ $('#eventstable').delegate('.toggle', 'click' , function(){
// load event details // load event details
var eventid = $(this).attr('eventid'); var eventid = $(this).attr('eventid');
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid); ( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
@ -421,16 +426,14 @@ $(document).ready(function() {
case 'earthquake': case 'earthquake':
typetext += 'tektonisches Erdbeben&nbsp;(Stern)'; typetext += 'tektonisches Erdbeben&nbsp;(Stern)';
break; break;
case 'explosion':
typetext += 'Explosion&nbsp;(Sechseck)';
break;
case 'induced or triggered event': case 'induced or triggered event':
typetext += '(bergbau-)induziertes Ereignis&nbsp;(Kreis)'; typetext += '(bergbau-)induziertes Ereignis&nbsp;(Kreis)';
break; break;
case 'quarry blast': case 'quarry blast':
case 'controlled explosion': typetext += 'Steinbruchsprengung&nbsp;(Rad)';
case 'explosion':
typetext += 'Sprengung&nbsp;(Rad)';
break;
case 'nuclear explosion':
typetext += 'Atomwaffentest&nbsp;(Viereck)';
break; break;
}; };
$("#events-type").append(typetext); $("#events-type").append(typetext);

View File

@ -1,10 +1,10 @@
/********************************************************************** /**********************************************************************
* events.js.en * * events.js *
* script for event specific functions and setup * * script for event specific functions and setup *
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* adding row(s) to a table and format date strings afterwards */ /* adding row(s) to a table and format date strings afterwards */
@ -40,23 +40,22 @@ function addTableRow(row, table) {
/* do reverse geolocation lookup */ /* do reverse geolocation lookup */
function getGeolocation(id, lat, lng) { function getGeolocation(id, lat, lng) {
if ( $.inArray(id, geolocationTable) == -1 ) { if ( !geolocationTable[id] ) {
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } ) $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } )
.done(function( json ) { .done(function( json ) {
if ( json.features[0] ) { var city = json.address["city"];
var city = json.features[0].properties.city; var country = json.address["country"];
var countryCode = json.features[0].properties.country; var countryCode = json.address["country_code"].toUpperCase();
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]); $("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache"); $("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]); $("#eventstable").trigger("sorton", [sort]);
} else { } 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 ) { .fail(function( jqxhr, textStatus, error ) {
@ -89,7 +88,7 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
} else { } else {
request_data = { request_data = {
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()), starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
orderby: 'time-asc', orderby: 'time',
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']), minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']), maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']), minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
@ -119,10 +118,12 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
var evaluationStatus = $(this).find('origin > evaluationStatus').text(); var evaluationStatus = $(this).find('origin > evaluationStatus').text();
var type = $(this).find('type').last().text(); var type = $(this).find('type').last().text();
var location var location
// get location, try this in order:
// regional map name, given value, cached value, or nominatim lookup
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() );
// create table row: Date, Time, Mag, Location // create table row: Date, Time, Mag, Location
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.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'] ) {
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() );
// 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>'
@ -136,9 +137,6 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
// 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);
if ( ~oTime ) {
oTime = new Date(otime.split('.')[0]);
};
var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds()); var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds());
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()));
@ -157,11 +155,11 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) {
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) { if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type); var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location) var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s<br />', id) + sprintf('<p>Ereignis: %s</br>', id)
+ sprintf('Type: %s<br />', type) + sprintf('Type: %s</br>', type)
+ sprintf('Magnitude: %3.1f<br />', Number(mag)) + sprintf('Magnitude: %3.1f</br>', Number(mag))
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng)) + sprintf('Ort: %.4f °N, %.4f °O </br>', Number(lat), Number(lng))
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.) + sprintf('Tiefe: %.1f km</br>', Number(depth)/1000.)
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]); + sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text); marker.bindPopup(text);
}; };
@ -371,18 +369,18 @@ $(document).ready(function() {
// hide child rows // hide child rows
$('#eventstable > tbody > tr.tablesorter-childRow td').hide(); $('#eventstable > tbody > tr.tablesorter-childRow td').hide();
// update map after filtering // update map after filtering
$('#eventstable').on('filterEnd', function(){ $('#eventstable').bind('filterEnd', function(){
toggleFilteredMarkers(); toggleFilteredMarkers();
}); });
// highlight first event // highlight first event
$('#eventstable').on('sortEnd', function(){ $('#eventstable').bind('sortEnd', function(){
highlightFirstEvent(); highlightFirstEvent();
}); });
$('#eventstable').on('pagerComplete', function(){ $('#eventstable').bind('pagerComplete', function(){
highlightFirstEvent(); highlightFirstEvent();
}); });
// show / hide event info // show / hide event info
$('#eventstable').on('click', '.toggle', function(){ $('#eventstable').delegate('.toggle', 'click' , function(){
// load event details // load event details
var eventid = $(this).attr('eventid'); var eventid = $(this).attr('eventid');
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid); ( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
@ -421,17 +419,15 @@ $(document).ready(function() {
case 'earthquake': case 'earthquake':
typetext += 'tectonic earthquake&nbsp;(star)'; typetext += 'tectonic earthquake&nbsp;(star)';
break; break;
case 'explosion':
typetext += 'explosion&nbsp;(hexagon)';
break;
case 'induced or triggered event': case 'induced or triggered event':
typetext += '(mining-)induced event&nbsp;(circle)'; typetext += '(mining-)induced event&nbsp;(circle)';
break; break;
case 'quarry blast': case 'quarry blast':
case 'controlled explosion':
case 'explosion':
typetext += 'quarry blast&nbsp;(wheel)'; typetext += 'quarry blast&nbsp;(wheel)';
break; break;
case 'nuclear explosion':
typetext += 'nuclear weapon test&nbsp;(square)';
break;
}; };
$("#events-type").append(typetext); $("#events-type").append(typetext);
}); });

1
www/eventsXML.js Normal file

File diff suppressed because one or more lines are too long

51
www/external/TileLayer.Grayscale.js vendored Normal file
View File

@ -0,0 +1,51 @@
/*
* L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover.
*/
L.TileLayer.Grayscale = L.TileLayer.extend({
options: {
enableCanvas: true
},
initialize: function (url, options) {
var canvasEl = document.createElement('canvas');
if( !(canvasEl.getContext && canvasEl.getContext('2d')) ) {
options.enableCanvas = false;
}
L.TileLayer.prototype.initialize.call(this, url, options);
},
_loadTile: function (tile, tilePoint) {
tile.setAttribute('crossorigin', 'anonymous');
L.TileLayer.prototype._loadTile.call(this, tile, tilePoint);
},
_tileOnLoad: function () {
if (this._layer.options.enableCanvas && !this.canvasContext) {
var canvas = document.createElement("canvas");
canvas.width = canvas.height = this._layer.options.tileSize;
this.canvasContext = canvas.getContext("2d");
}
var ctx = this.canvasContext;
if (ctx) {
this.onload = null; // to prevent an infinite loop
ctx.drawImage(this, 0, 0);
var imgd = ctx.getImageData(0, 0, this._layer.options.tileSize, this._layer.options.tileSize);
var pix = imgd.data;
for (var i = 0, n = pix.length; i < n; i += 4) {
pix[i] = pix[i + 1] = pix[i + 2] = (3 * pix[i] + 4 * pix[i + 1] + pix[i + 2]) / 8;
}
ctx.putImageData(imgd, 0, 0);
this.removeAttribute("crossorigin");
this.src = ctx.canvas.toDataURL();
}
L.TileLayer.prototype._tileOnLoad.call(this);
}
});
L.tileLayer.grayscale = function (url, options) {
return new L.TileLayer.Grayscale(url, options);
};

207
www/external/css/dvf.css vendored Normal file
View File

@ -0,0 +1,207 @@
div.leaflet-div-icon {
text-align: center;
vertical-align: middle;
border-radius: 4px;
padding: 2px 2px 0px 2px;
font-size: small;
margin: 0px auto;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: auto;
background: '#fff';
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(top, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
border: 1px solid #cccccc;
border-bottom-color: #b3b3b3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
div.leaflet-div-icon div {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0px;
padding: 0px;
line-height: 12px;
}
div.leaflet-div-icon div div {
display: block;
font-size: xx-small;
}
div.legend-content {
margin: 0px;
padding: 0px;
}
div.legend-box {
width: 10px;
height: 10px;
display: inline-block;
margin-right: 8px;
border: solid 1px #000;
margin-bottom: 0px;
}
div.leaflet-div-icon div div.legend-box {
width: 5px;
height: 5px;
display: inline-block;
margin-right: 4px;
margin-bottom: 0px;
}
div.leaflet-div-icon div div.key {
margin: 2px 4px 0px 0px;
font-weight: bold;
line-height: 10px;
display: inline-block;
}
.data-layer-legend div {
display: inline-block;
font-size: small;
}
.data-layer-legend .legend-box, .data-layer-legend .key {
vertical-align: middle;
}
.choropleth-text {
font-size: x-small;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
vertical-align: middle;
text-align: center;
}
.scale-bars i {
vertical-align: bottom;
display: inline-block;
background-color: silver;
height: 14px;
}
.min-value, .max-value {
vertical-align: middle;
width: 50px;
}
.min-value {
text-align: right;
margin-right: 6px;
}
.max-value {
text-align: left;
margin-left: 6px;
}
.scale-value {
text-align: center;
position: relative;
}
.data-layer-legend {
padding: 8px 0px 0px 0px;
}
.scale-bars {
vertical-align: middle;
line-height: 10px;
}
.legend-title {
font-weight: bold;
}
.leaflet-popup-content {
overflow: auto;
max-height: 300px;
}
.palette-element {
display: inline-block;
width: 12px;
height: 14px;
}
.leaflet-control-legend {
background-color: rgba(255, 255, 255, 0.7);
padding: 0px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
max-height: 70px;
width: 268px;
box-shadow: 0 1px 7px #999;
overflow: hidden;
}
.leaflet-control-legend.larger {
max-height: 50%;
overflow: auto;
}
.leaflet-control-legend .legend {
padding: 10px;
}
.leaflet-control-legend i {
background-image: none;
vertical-align: text-bottom;
}
.photo {
width: 100%;
height: 100%;
padding: 2px;
background-color: white;
box-shadow: 2px 2px 3px rgba(100, 100, 100, 0.5);
opacity: 0;
-moz-transition: opacity 1s; /* Firefox 4 */
-webkit-transition: opacity 1s; /* Safari and Chrome */
-o-transition: opacity 1s;
transition: opacity 1s;
}
.photo-info {
background-color: rgba(0, 0, 0, 0.6);
padding: 10px;
position: absolute;
top: 0px;
color: white;
margin: 2px;
}
.photo-link {
float: right;
height: 14px;
}
.author-link {
margin-left: 2px;
width: 400px;
display: block;
font-style: italic;
font-weight: bold;
}
text.leaflet-svg-text {
alignment-baseline: central;
dominant-baseline: central;
text-anchor: middle;
}

54
www/external/css/leaflet.label.css vendored Normal file
View File

@ -0,0 +1,54 @@
.leaflet-label {
background: rgb(235, 235, 235);
background: rgba(235, 235, 235, 0.81);
background-clip: padding-box;
border-color: #777;
border-color: rgba(0,0,0,0.25);
border-radius: 4px;
border-style: solid;
border-width: 4px;
color: #111;
display: block;
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 1px 6px;
position: absolute;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
white-space: nowrap;
z-index: 6;
}
.leaflet-label.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-label:before,
.leaflet-label:after {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
content: none;
position: absolute;
top: 5px;
}
.leaflet-label:before {
border-right: 6px solid black;
border-right-color: inherit;
left: -10px;
}
.leaflet-label:after {
border-left: 6px solid black;
border-left-color: inherit;
right: -10px;
}
.leaflet-label-right:before,
.leaflet-label-left:after {
content: "";
}

20
www/external/easyPrint.css vendored Normal file
View File

@ -0,0 +1,20 @@
.leaflet-control-easyPrint a {
background:#fff url(print.png) no-repeat 5px;
background-size:16px 16px;
display: block;
}
@media print {
html {padding: 0px!important;}
.leaflet-control-easyPrint-button{display: none!important;}
}
#map {
width: 1200;
height: 800;
}

161
www/external/jQuery.print.js vendored Normal file
View File

@ -0,0 +1,161 @@
/* jQuery.print, version 1.0.3
* (c) Sathvik Ponangi, Doers' Guild
* Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
*--------------------------------------------------------------------------*/
(function($) {"use strict";
// A nice closure for our definitions
function getjQueryObject(string) {
// Make string a vaild jQuery thing
var jqObj = $("");
try {
jqObj = $(string).clone();
} catch(e) {
jqObj = $("<span />").html(string);
}
return jqObj;
}
function isNode(o) {
/* http://stackoverflow.com/a/384380/937891 */
return !!( typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
}
$.print = $.fn.print = function() {
// Print a given set of elements
var options, $this, self = this;
// console.log("Printing", this, arguments);
if ( self instanceof $) {
// Get the node if it is a jQuery object
self = self.get(0);
}
if (isNode(self)) {
// If `this` is a HTML element, i.e. for
// $(selector).print()
$this = $(self);
if (arguments.length > 0) {
options = arguments[0];
}
} else {
if (arguments.length > 0) {
// $.print(selector,options)
$this = $(arguments[0]);
if (isNode($this[0])) {
if (arguments.length > 1) {
options = arguments[1];
}
} else {
// $.print(options)
options = arguments[0];
$this = $("html");
}
} else {
// $.print()
$this = $("html");
}
}
// Default options
var defaults = {
globalStyles : true,
mediaPrint : false,
stylesheet : null,
noPrintSelector : ".no-print",
iframe : true,
append : null,
prepend : null
};
// Merge with user-options
options = $.extend({}, defaults, (options || {}));
var $styles = $("");
if (options.globalStyles) {
// Apply the stlyes from the current sheet to the printed page
$styles = $("style, link, meta, title");
} else if (options.mediaPrint) {
// Apply the media-print stylesheet
$styles = $("link[media=print]");
}
if (options.stylesheet) {
// Add a custom stylesheet if given
$styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">'));
}
// Create a copy of the element to print
var copy = $this.clone();
// Wrap it in a span to get the HTML markup string
copy = $("<span/>").append(copy);
// Remove unwanted elements
copy.find(options.noPrintSelector).remove();
// Add in the styles
copy.append($styles.clone());
// Appedned content
copy.append(getjQueryObject(options.append));
// Prepended content
copy.prepend(getjQueryObject(options.prepend));
// Get the HTML markup string
var content = copy.html();
// Destroy the copy
copy.remove();
var w, wdoc;
if (options.iframe) {
// Use an iframe for printing
try {
var $iframe = $(options.iframe + "");
var iframeCount = $iframe.length;
if (iframeCount === 0) {
// Create a new iFrame if none is given
$iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>').prependTo('body').css({
"position" : "absolute",
"top" : -999,
"left" : -999
});
}
w = $iframe.get(0);
w = w.contentWindow || w.contentDocument || w;
wdoc = w.document || w.contentDocument || w;
wdoc.open();
wdoc.write(content);
wdoc.close();
setTimeout(function() {
// Fix for IE : Allow it to render the iframe
w.focus();
w.print();
setTimeout(function() {
// Fix for IE
if (iframeCount === 0) {
// Destroy the iframe if created here
$iframe.remove();
}
}, 100);
}, 250);
} catch (e) {
// Use the pop-up method if iframe fails for some reason
console.error("Failed to print from iframe", e.stack, e.message);
w = window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}
} else {
// Use a new window for printing
w = window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}
return this;
};
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,42 @@
/* pager wrapper, div */
.tablesorter-pager {
padding: 5px;
}
/* pager wrapper, in thead/tfoot */
td.tablesorter-pager {
background-color: #e6eeee;
margin: 0; /* needed for bootstrap .pager gets a 18px bottom margin */
}
/* pager navigation arrows */
.tablesorter-pager img {
vertical-align: middle;
margin-right: 2px;
cursor: pointer;
}
/* pager output text */
.tablesorter-pager .pagedisplay {
padding: 0 5px 0 5px;
width: auto;
white-space: nowrap;
text-align: center;
}
/* pager element reset (needed for bootstrap) */
.tablesorter-pager select {
margin: 0;
padding: 0;
}
/*** css used when "updateArrows" option is true ***/
/* the pager itself gets a disabled class when the number of rows is less than the size */
.tablesorter-pager.disabled {
display: none;
}
/* hide or fade out pager arrows when the first or last row is visible */
.tablesorter-pager .disabled {
/* visibility: hidden */
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

478
www/external/leaflet.css vendored Normal file
View File

@ -0,0 +1,478 @@
/* required styles */
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-pane,
.leaflet-tile-container,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-overlay-pane svg,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
-ms-touch-action: none;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container img {
max-width: none !important;
}
/* stupid Android 2 doesn't understand "max-width: none" properly */
.leaflet-container img.leaflet-image-layer {
max-width: 15000px !important;
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-tile-pane { z-index: 2; }
.leaflet-objects-pane { z-index: 3; }
.leaflet-overlay-pane { z-index: 4; }
.leaflet-shadow-pane { z-index: 5; }
.leaflet-marker-pane { z-index: 6; }
.leaflet-popup-pane { z-index: 7; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 7;
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile,
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-tile-loaded,
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile,
.leaflet-touching .leaflet-zoom-animated {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-clickable {
cursor: pointer;
}
.leaflet-container {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-container,
.leaflet-dragging .leaflet-clickable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-control-zoom-out {
font-size: 20px;
}
.leaflet-touch .leaflet-control-zoom-in {
font-size: 22px;
}
.leaflet-touch .leaflet-control-zoom-out {
font-size: 24px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: content-box;
box-sizing: content-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
margin: 0 auto;
width: 40px;
height: 20px;
position: relative;
overflow: hidden;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}

28
www/external/leaflet.easyPrint.js vendored Normal file
View File

@ -0,0 +1,28 @@
L.Control.EasyPrint = L.Control.extend({
options: {
position: 'topright',
title: 'Print map',
},
onAdd: function () {
var container = L.DomUtil.create('div', 'leaflet-control-easyPrint leaflet-bar leaflet-control');
this.link = L.DomUtil.create('a', 'leaflet-control-easyPrint-button leaflet-bar-part', container);
this.link.href = 'javascript:void($("#map").print({stylesheet:"external/easyPrint.css"}))';
return container;
},
_click: function (e) {
L.DomEvent.stopPropagation(e);
L.DomEvent.preventDefault(e);
},
});
L.easyPrint = function() {
return new L.Control.EasyPrint();
};

9
www/external/leaflet.js vendored Normal file

File diff suppressed because one or more lines are too long

9
www/external/leaflet.label.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
www/external/print.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

1
www/external/sprintf.min.js vendored Normal file
View File

@ -0,0 +1 @@
/*! sprintf.js | Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro> | 3 clause BSD license */(function(e){function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};t.format=function(e,n){var s=1,o=e.length,u="",a,f=[],l,c,h,p,d,v;for(l=0;l<o;l++){u=r(e[l]);if(u==="string")f.push(e[l]);else if(u==="array"){h=e[l];if(h[2]){a=n[s];for(c=0;c<h[2].length;c++){if(!a.hasOwnProperty(h[2][c]))throw t('[sprintf] property "%s" does not exist',h[2][c]);a=a[h[2][c]]}}else h[1]?a=n[h[1]]:a=n[s++];if(/[^s]/.test(h[8])&&r(a)!="number")throw t("[sprintf] expecting number but found %s",r(a));switch(h[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=h[7]?a.toExponential(h[7]):a.toExponential();break;case"f":a=h[7]?parseFloat(a).toFixed(h[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&h[7]?a.substring(0,h[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(h[8])&&h[3]&&a>=0?"+"+a:a,d=h[4]?h[4]=="0"?"0":h[4].charAt(1):" ",v=h[6]-String(a).length,p=h[6]?i(d,v):"",f.push(h[5]?a+p:p+a)}}return f.join("")},t.cache={},t.parse=function(e){var t=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null)r.push(n[0]);else if((n=/^\x25{2}/.exec(t))!==null)r.push("%");else{if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))===null)throw"[sprintf] huh?";if(n[2]){i|=1;var s=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))===null)throw"[sprintf] huh?";s.push(u[1]);while((o=o.substring(u[0].length))!=="")if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null)s.push(u[1]);else{if((u=/^\[(\d+)\]/.exec(o))===null)throw"[sprintf] huh?";s.push(u[1])}n[2]=s}else i|=2;if(i===3)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r};var n=function(e,n,r){return r=n.slice(0),r.splice(0,0,e),t.apply(null,r)};e.sprintf=t,e.vsprintf=n})(typeof exports!="undefined"?exports:window);

221
www/external/theme.blue.css vendored Normal file
View File

@ -0,0 +1,221 @@
/*************
Blue Theme
*************/
/* overall */
.tablesorter-blue {
width: 100%;
background-color: #fff;
margin: 10px 0 15px;
text-align: left;
border-spacing: 0;
border: #cdcdcd 1px solid;
border-width: 1px 0 0 1px;
}
.tablesorter-blue th,
.tablesorter-blue td {
border: #cdcdcd 1px solid;
border-width: 0 1px 1px 0;
}
/* header */
.tablesorter-blue th,
.tablesorter-blue thead td {
font: bold 12px/18px Arial, Sans-serif;
color: #000;
background-color: #99bfe6;
border-collapse: collapse;
padding: 4px;
text-shadow: 0 1px 0 rgba(204, 204, 204, 0.7);
}
.tablesorter-blue tbody td,
.tablesorter-blue tfoot th,
.tablesorter-blue tfoot td {
padding: 4px;
vertical-align: top;
}
.tablesorter-blue .header,
.tablesorter-blue .tablesorter-header {
/* black (unsorted) double arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
/* white (unsorted) double arrow */
/* background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); */
/* image */
/* background-image: url(images/black-unsorted.gif); */
background-repeat: no-repeat;
background-position: center right;
padding: 4px 18px 4px 4px;
white-space: normal;
cursor: pointer;
}
.tablesorter-blue .headerSortUp,
.tablesorter-blue .tablesorter-headerSortUp,
.tablesorter-blue .tablesorter-headerAsc {
background-color: #9fbfdf;
/* black asc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
/* white asc arrow */
/* background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); */
/* image */
/* background-image: url(images/black-asc.gif); */
}
.tablesorter-blue .headerSortDown,
.tablesorter-blue .tablesorter-headerSortDown,
.tablesorter-blue .tablesorter-headerDesc {
background-color: #8cb3d9;
/* black desc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
/* white desc arrow */
/* background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); */
/* image */
/* background-image: url(images/black-desc.gif); */
}
.tablesorter-blue thead .sorter-false {
background-image: none;
cursor: default;
padding: 4px;
}
/* tfoot */
.tablesorter-blue tfoot .tablesorter-headerSortUp,
.tablesorter-blue tfoot .tablesorter-headerSortDown,
.tablesorter-blue tfoot .tablesorter-headerAsc,
.tablesorter-blue tfoot .tablesorter-headerDesc {
/* remove sort arrows from footer */
background-image: none;
}
/* tbody */
.tablesorter-blue td {
color: #3d3d3d;
background-color: #fff;
padding: 4px;
vertical-align: top;
}
/* hovered row colors
you'll need to add additional lines for
rows with more than 2 child rows
*/
.tablesorter-blue tbody > tr:hover > td,
.tablesorter-blue tbody > tr:hover + tr.tablesorter-childRow > td,
.tablesorter-blue tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td,
.tablesorter-blue tbody > tr.even:hover > td,
.tablesorter-blue tbody > tr.even:hover + tr.tablesorter-childRow > td,
.tablesorter-blue tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td {
background: #d9d9d9;
}
.tablesorter-blue tbody > tr.odd:hover > td,
.tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow > td,
.tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td {
background: #bfbfbf;
}
/* table processing indicator */
.tablesorter-blue .tablesorter-processing {
background-position: center center !important;
background-repeat: no-repeat !important;
/* background-image: url(../addons/pager/icons/loading.gif) !important; */
background-image: url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=') !important;
}
/* Zebra Widget - row alternating colors */
.tablesorter-blue tbody tr.odd td {
background-color: #ebf2fa;
}
.tablesorter-blue tbody tr.even td {
background-color: #fff;
}
/* Column Widget - column sort colors */
.tablesorter-blue td.primary,
.tablesorter-blue tr.odd td.primary {
background-color: #99b3e6;
}
.tablesorter-blue tr.even td.primary {
background-color: #c2d1f0;
}
.tablesorter-blue td.secondary,
.tablesorter-blue tr.odd td.secondary {
background-color: #c2d1f0;
}
.tablesorter-blue tr.even td.secondary {
background-color: #d6e0f5;
}
.tablesorter-blue td.tertiary,
.tablesorter-blue tr.odd td.tertiary {
background-color: #d6e0f5;
}
.tablesorter-blue tr.even td.tertiary {
background-color: #ebf0fa;
}
/* caption */
caption {
background: #fff;
}
/* filter widget */
.tablesorter-blue .tablesorter-filter-row td {
background: #eee;
line-height: normal;
text-align: center; /* center the input */
-webkit-transition: line-height 0.1s ease;
-moz-transition: line-height 0.1s ease;
-o-transition: line-height 0.1s ease;
transition: line-height 0.1s ease;
}
/* optional disabled input styling */
.tablesorter-blue .tablesorter-filter-row .disabled {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: not-allowed;
}
/* hidden filter row */
.tablesorter-blue .tablesorter-filter-row.hideme td {
/*** *********************************************** ***/
/*** change this padding to modify the thickness ***/
/*** of the closed filter row (height = padding x 2) ***/
padding: 2px;
/*** *********************************************** ***/
margin: 0;
line-height: 0;
cursor: pointer;
}
.tablesorter-blue .tablesorter-filter-row.hideme .tablesorter-filter {
height: 1px;
min-height: 0;
border: 0;
padding: 0;
margin: 0;
/* don't use visibility: hidden because it disables tabbing */
opacity: 0;
filter: alpha(opacity=0);
}
/* filters */
.tablesorter-blue .tablesorter-filter {
width: 98%;
height: auto;
margin: 0;
padding: 4px;
background-color: #fff;
border: 1px solid #bbb;
color: #333;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: height 0.1s ease;
-moz-transition: height 0.1s ease;
-o-transition: height 0.1s ease;
transition: height 0.1s ease;
}
/* rows hidden by filtering (needed for child rows) */
.tablesorter .filtered {
display: none;
}
/* ajax error row */
.tablesorter .tablesorter-errorRow td {
text-align: center;
cursor: pointer;
background-color: #e6bf99;
}

863
www/external/widget-pager.js vendored Normal file
View File

@ -0,0 +1,863 @@
/* Pager widget (beta) for TableSorter 3/31/2014 (v2.15.12) */
/*jshint browser:true, jquery:true, unused:false */
;(function($){
"use strict";
var tsp,
ts = $.tablesorter;
ts.addWidget({
id: "pager",
priority: 55, // load pager after filter widget
options : {
// output default: '{page}/{totalPages}'
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
pager_output: '{startRow} to {endRow} of {totalRows} rows', // '{page}/{totalPages}'
// apply disabled classname to the pager arrows when the rows at either extreme is visible
pager_updateArrows: true,
// starting page of the pager (zero based index)
pager_startPage: 0,
// Number of visible rows
pager_size: 10,
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
pager_savePages: true,
//defines custom storage key
pager_storageKey: 'tablesorter-pager',
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
pager_fixedHeight: false,
// count child rows towards the set page size? (set true if it is a visible table row within the pager)
// if true, child row(s) may not appear to be attached to its parent row, may be split across pages or
// may distort the table if rowspan or cellspans are included.
pager_countChildRows: false,
// remove rows from the table to speed up the sort of large tables.
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
pager_removeRows: false, // removing rows in larger tables speeds up the sort
// use this format: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}"
// where {page} is replaced by the page number, {size} is replaced by the number of records to show,
// {sortList:col} adds the sortList to the url into a "col" array, and {filterList:fcol} adds
// the filterList to the url into an "fcol" array.
// So a sortList = [[2,0],[3,0]] becomes "&col[2]=0&col[3]=0" in the url
// and a filterList = [[2,Blue],[3,13]] becomes "&fcol[2]=Blue&fcol[3]=13" in the url
pager_ajaxUrl: null,
// modify the url after all processing has been applied
pager_customAjaxUrl: function(table, url) { return url; },
// modify the $.ajax object to allow complete control over your ajax requests
pager_ajaxObject: {
dataType: 'json'
},
// set this to false if you want to block ajax loading on init
pager_processAjaxOnInit: true,
// process ajax so that the following information is returned:
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
// example:
// [
// 100, // total rows
// [
// [ "row1cell1", "row1cell2", ... "row1cellN" ],
// [ "row2cell1", "row2cell2", ... "row2cellN" ],
// ...
// [ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
// ],
// [ "header1", "header2", ... "headerN" ] // optional
// ]
pager_ajaxProcessing: function(ajax){ return [ 0, [], null ]; },
// css class names of pager arrows
pager_css: {
container : 'tablesorter-pager',
errorRow : '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)
},
// jQuery selectors
pager_selectors: {
container : '.pager', // target the pager markup
first : '.first', // go to first page arrow
prev : '.prev', // previous page arrow
next : '.next', // next page arrow
last : '.last', // go to last page arrow
goto : '.gotoPage', // go to page selector - select dropdown that sets the current page
pageDisplay : '.pagedisplay', // location of where the "output" is displayed
pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
}
},
init: function(table){
tsp.init(table);
},
// only update to complete sorter initialization
format: function(table, c){
if (!(c.pager && c.pager.initialized)){
return tsp.initComplete(table, c);
}
tsp.moveToPage(table, c.pager, false);
},
remove: function(table, c){
tsp.destroyPager(table, c);
}
});
/* pager widget functions */
tsp = ts.pager = {
init: function(table) {
// check if tablesorter has initialized
if (table.hasInitialized && table.config.pager.initialized) { return; }
var t,
c = table.config,
wo = c.widgetOptions,
s = wo.pager_selectors,
// save pager variables
p = c.pager = $.extend({
totalPages: 0,
filteredRows: 0,
filteredPages: 0,
currentFilters: [],
page: wo.pager_startPage,
size: wo.pager_size,
startRow: 0,
endRow: 0,
ajaxCounter: 0,
$size: null,
last: {}
}, c.pager);
// pager initializes multiple times before table has completed initialization
if (p.isInitializing) { return; }
p.isInitializing = true;
if (c.debug) {
ts.log('Pager initializing');
}
// added in case the pager is reinitialized after being destroyed.
p.$container = $(s.container).addClass(wo.pager_css.container).show();
// goto selector
p.$goto = p.$container.find(s.goto);
// page size selector
p.$size = p.$container.find(s.pageSize);
p.totalRows = c.$tbodies.eq(0).children().length;
p.oldAjaxSuccess = p.oldAjaxSuccess || wo.pager_ajaxObject.success;
c.appender = tsp.appender;
if (ts.filter && $.inArray('filter', c.widgets) >= 0) {
// get any default filter settings (data-value attribute) fixes #388
p.currentFilters = c.$table.data('lastSearch') || ts.filter.setDefaults(table, c, wo) || [];
// set, but don't apply current filters
ts.setFilters(table, p.currentFilters, false);
}
if (wo.pager_savePages && ts.storage) {
t = ts.storage(table, wo.pager_storageKey) || {}; // fixes #387
p.page = isNaN(t.page) ? p.page : t.page;
p.size = ( isNaN(t.size) ? p.size : t.size ) || 10;
$.data(table, 'pagerLastSize', p.size);
}
// clear initialized flag
p.initialized = false;
// before initialization event
c.$table.trigger('pagerBeforeInitialized', c);
tsp.enablePager(table, c, false);
if ( typeof(wo.pager_ajaxUrl) === 'string' ) {
// ajax pager; interact with database
p.ajax = true;
// When filtering with ajax, allow only custom filtering function, disable default filtering since it will be done server side.
wo.filter_serversideFiltering = true;
c.serverSideSorting = true;
tsp.moveToPage(table, p);
} else {
p.ajax = false;
// Regular pager; all rows stored in memory
c.$table.trigger("appendCache", [{}, true]);
tsp.hideRowsSetup(table, c);
}
},
initComplete: function(table, c){
var p = c.pager;
tsp.changeHeight(table, c);
tsp.bindEvents(table, c);
// pager initialized
p.initialized = true;
p.isInitializing = false;
tsp.setPageSize(table, 0, c); // page size 0 is ignored
c.$table.trigger('pagerInitialized', c);
},
bindEvents: function(table, c){
var ctrls, fxn,
p = c.pager,
wo = c.widgetOptions,
s = wo.pager_selectors;
c.$table
.unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
.bind('filterStart.pager', function(e, filters) {
p.currentFilters = filters;
p.page = 0; // fixes #456
})
// update pager after filter widget completes
.bind('filterEnd.pager sortEnd.pager', function() {
if (p.initialized) {
tsp.moveToPage(table, p, false);
tsp.updatePageDisplay(table, c, false);
tsp.fixHeight(table, c);
}
})
.bind('disable.pager', function(e){
e.stopPropagation();
tsp.showAllRows(table, c);
})
.on('enable.pager', function(e){
e.stopPropagation();
tsp.enablePager(table, c, true);
})
.on('destroy.pager', function(e){
e.stopPropagation();
tsp.destroyPager(table, c);
})
.on('update updateRows updateAll addRows '.split(' ').join('.pager '), function(e){
e.stopPropagation();
tsp.hideRows(table, c);
// make sure widgets are applied - fixes #450
c.$table.trigger('applyWidgets');
})
.on('pageSize.pager', function(e,v){
e.stopPropagation();
tsp.setPageSize(table, parseInt(v, 10) || 10, c);
tsp.hideRows(table, c);
tsp.updatePageDisplay(table, c, false);
if (p.$size.length) { p.$size.val(p.size); } // twice?
})
.on('pageSet.pager', function(e,v){
e.stopPropagation();
p.page = (parseInt(v, 10) || 1) - 1;
if (p.$goto.length) { p.$goto.val(c.size); } // twice?
tsp.moveToPage(table, p);
tsp.updatePageDisplay(table, c, false);
});
// clicked controls
ctrls = [ s.first, s.prev, s.next, s.last ];
fxn = [ 'moveToFirstPage', 'moveToPrevPage', 'moveToNextPage', 'moveToLastPage' ];
p.$container.find(ctrls.join(','))
.attr("tabindex", 0)
.unbind('click.pager')
.bind('click.pager', function(e){
e.stopPropagation();
var i,
$c = $(this),
l = ctrls.length;
if ( !$c.hasClass(wo.pager_css.disabled) ) {
for (i = 0; i < l; i++) {
if ($c.is(ctrls[i])) {
tsp[fxn[i]](table, p);
break;
}
}
}
});
if ( p.$goto.length ) {
p.$goto
.unbind('change')
.bind('change', function(){
p.page = $(this).val() - 1;
tsp.moveToPage(table, p);
tsp.updatePageDisplay(table, c, false);
});
}
if ( p.$size.length ) {
p.$size
.unbind('change.pager')
.bind('change.pager', function() {
p.$size.val( $(this).val() ); // in case there are more than one pagers
if ( !$(this).hasClass(wo.pager_css.disabled) ) {
tsp.setPageSize(table, parseInt( $(this).val(), 10 ), c);
tsp.changeHeight(table, c);
}
return false;
});
}
},
// hide arrows at extremes
pagerArrows: function(c, disable) {
var p = c.pager,
dis = !!disable,
first = dis || p.page === 0,
tp = Math.min( p.totalPages, p.filteredPages ),
last = dis || p.page === tp - 1 || p.totalPages === 0,
wo = c.widgetOptions,
s = wo.pager_selectors;
if ( wo.pager_updateArrows ) {
p.$container.find(s.first + ',' + s.prev).toggleClass(wo.pager_css.disabled, first).attr('aria-disabled', first);
p.$container.find(s.next + ',' + s.last).toggleClass(wo.pager_css.disabled, last).attr('aria-disabled', last);
}
},
updatePageDisplay: function(table, c, completed) {
var i, pg, s, out,
wo = c.widgetOptions,
p = c.pager,
f = c.$table.hasClass('hasFilters') && !wo.pager_ajaxUrl,
t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove +
(wo.pager_countChildRows ? '' : ',.' + c.cssChildRow),
sz = p.size || 10; // don't allow dividing by zero
p.$size.add(p.$goto).removeClass(wo.pager_css.disabled).removeAttr('disabled').attr('aria-disabled', 'false');
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr').not('.' + t).length : p.totalRows;
p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages;
if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
t = (p.size * p.page > p.filteredRows);
p.startRow = (t) ? 1 : (p.filteredRows === 0 ? 0 : p.size * p.page + 1);
p.page = (t) ? 0 : p.page;
p.endRow = Math.min( p.filteredRows, p.totalRows, p.size * ( p.page + 1 ) );
out = p.$container.find(wo.pager_selectors.pageDisplay);
// form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output )
// {page} = one-based index; {page+#} = zero based index +/- value
.replace(/\{page([\-+]\d+)?\}/gi, function(m,n){
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
})
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
var str = m.replace(/[{}\s]/g,''),
extra = str.split(':'),
data = p.ajaxData,
// return zero for default page/row numbers
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
});
if (out.length) {
out[ (out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
if ( p.$goto.length ) {
t = '';
pg = Math.min( p.totalPages, p.filteredPages );
for ( i = 1; i <= pg; i++ ) {
t += '<option>' + i + '</option>';
}
p.$goto.html(t).val( p.page + 1 );
}
}
}
tsp.pagerArrows(c);
if (p.initialized && completed !== false) {
c.$table.trigger('pagerComplete', c);
// save pager info to storage
if (wo.pager_savePages && ts.storage) {
ts.storage(table, wo.pager_storageKey, {
page : p.page,
size : p.size
});
}
}
},
fixHeight: function(table, c) {
var d, h,
p = c.pager,
wo = c.widgetOptions,
$b = c.$tbodies.eq(0);
if (wo.pager_fixedHeight) {
$b.find('tr.pagerSavedHeightSpacer').remove();
h = $.data(table, 'pagerSavedHeight');
if (h) {
d = h - $b.height();
if ( d > 5 && $.data(table, 'pagerLastSize') === p.size && $b.children('tr:visible').length < p.size ) {
$b.append('<tr class="pagerSavedHeightSpacer ' + wo.pager_selectors.remove.replace(/(tr)?\./g,'') + '" style="height:' + d + 'px;"></tr>');
}
}
}
},
changeHeight: function(table, c) {
var $b = c.$tbodies.eq(0);
$b.find('tr.pagerSavedHeightSpacer').remove();
$.data(table, 'pagerSavedHeight', $b.height());
tsp.fixHeight(table, c);
$.data(table, 'pagerLastSize', c.pager.size);
},
hideRows: function(table, c){
if (!c.widgetOptions.pager_ajaxUrl) {
var i,
lastIndex = 0,
p = c.pager,
wo = c.widgetOptions,
rows = c.$tbodies.eq(0).children(),
l = rows.length,
s = ( p.page * p.size ),
e = s + p.size,
f = wo && wo.filter_filteredRow || 'filtered',
j = 0; // size counter
for ( i = 0; i < l; i++ ){
if ( !rows[i].className.match(f) ) {
if (j === s && rows[i].className.match(c.cssChildRow)) {
// hide child rows @ start of pager (if already visible)
rows[i].style.display = 'none';
} else {
rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
// don't count child rows
j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !wo.pager_countChildRows ? 0 : 1;
if ( j === e && rows[i].style.display !== 'none' && rows[i].className.match(ts.css.cssHasChild) ) {
lastIndex = i;
}
}
}
}
// add any attached child rows to last row of pager. Fixes part of issue #396
if ( lastIndex > 0 && rows[lastIndex].className.match(ts.css.cssHasChild) ) {
while ( ++lastIndex < l && rows[lastIndex].className.match(c.cssChildRow) ) {
rows[lastIndex].style.display = '';
}
}
}
},
hideRowsSetup: function(table, c){
var p = c.pager;
p.size = parseInt( p.$size.val(), 10 ) || p.size;
$.data(table, 'pagerLastSize', p.size);
tsp.pagerArrows(c);
if ( !c.widgetOptions.pager_removeRows ) {
tsp.hideRows(table, c);
c.$table.on('sortEnd.pager filterEnd.pager', function(){
tsp.hideRows(table, c);
});
}
},
renderAjax: function(data, table, c, xhr, exception){
var p = c.pager,
wo = c.widgetOptions;
// process data
if ( $.isFunction(wo.pager_ajaxProcessing) ) {
// ajaxProcessing result: [ total, rows, headers ]
var i, j, t, hsh, $f, $sh, th, d, l, rr_count,
$t = c.$table,
tds = '',
result = wo.pager_ajaxProcessing(data, table) || [ 0, [] ],
hl = $t.find('thead th').length;
// Clean up any previous error.
ts.showError(table);
if ( exception ) {
if (c.debug) {
ts.log('Ajax Error', xhr, exception);
}
ts.showError(table, exception.message + ' (' + xhr.status + ')');
c.$tbodies.eq(0).empty();
p.totalRows = 0;
} else {
// process ajax object
if (!$.isArray(result)) {
p.ajaxData = result;
p.totalRows = result.total;
th = result.headers;
d = result.rows;
} else {
// allow [ total, rows, headers ] or [ rows, total, headers ]
t = isNaN(result[0]) && !isNaN(result[1]);
// ensure a zero returned row count doesn't fail the logical ||
rr_count = result[t ? 1 : 0];
p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
th = result[2]; // headers
}
l = d.length;
if (d instanceof jQuery) {
// append jQuery object
c.$tbodies.eq(0).empty().append(d);
} else if (l) {
// build table from array
for ( i = 0; i < l; i++ ) {
tds += '<tr>';
for ( j = 0; j < d[i].length; j++ ) {
// build tbody cells; watch for data containing HTML markup - see #434
tds += /^\s*<td/.test(d[i][j]) ? $.trim(d[i][j]) : '<td>' + d[i][j] + '</td>';
}
tds += '</tr>';
}
// add rows to first tbody
if (wo.pager_processAjaxOnInit) {
c.$tbodies.eq(0).html( tds );
} else {
wo.pager_processAjaxOnInit = true;
}
}
// only add new header text if the length matches
if ( th && th.length === hl ) {
hsh = $t.hasClass('hasStickyHeaders');
$sh = hsh ? wo.$sticky.children('thead:first').children().children() : '';
$f = $t.find('tfoot tr:first').children();
// don't change td headers (may contain pager)
c.$headers.filter('th').each(function(j){
var $t = $(this), icn;
// add new test within the first span it finds, or just in the header
if ( $t.find('.' + ts.css.icon).length ) {
icn = $t.find('.' + ts.css.icon).clone(true);
$t.find('.tablesorter-header-inner').html( th[j] ).append(icn);
if ( hsh && $sh.length ) {
icn = $sh.eq(j).find('.' + ts.css.icon).clone(true);
$sh.eq(j).find('.tablesorter-header-inner').html( th[j] ).append(icn);
}
} else {
$t.find('.tablesorter-header-inner').html( th[j] );
if (hsh && $sh.length) {
$sh.eq(j).find('.tablesorter-header-inner').html( th[j] );
}
}
$f.eq(j).html( th[j] );
});
}
}
if (c.showProcessing) {
ts.isProcessing(table); // remove loading icon
}
// make sure last pager settings are saved, prevents multiple server side calls with
// the same parameters
p.totalPages = Math.ceil( p.totalRows / ( p.size || 10 ) );
p.last.totalRows = p.totalRows;
p.last.currentFilters = p.currentFilters;
p.last.sortList = (c.sortList || []).join(',');
tsp.updatePageDisplay(table, c);
tsp.fixHeight(table, c);
$t.trigger('updateCache', [function(){
if (p.initialized) {
// apply widgets after table has rendered
$t.trigger('applyWidgets');
$t.trigger('pagerChange', p);
}
}]);
}
if (!p.initialized) {
c.$table.trigger('applyWidgets');
}
},
getAjax: function(table, c){
var counter,
url = tsp.getAjaxUrl(table, c),
$doc = $(document),
wo = c.widgetOptions,
p = c.pager;
if ( url !== '' ) {
if (c.showProcessing) {
ts.isProcessing(table, true); // show loading icon
}
$doc.on('ajaxError.pager', function(e, xhr, settings, exception) {
tsp.renderAjax(null, table, c, xhr, exception);
$doc.unbind('ajaxError.pager');
});
counter = ++p.ajaxCounter;
wo.pager_ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
wo.pager_ajaxObject.success = function(data) {
// Refuse to process old ajax commands that were overwritten by new ones - see #443
if (counter < p.ajaxCounter){
return;
}
tsp.renderAjax(data, table, c);
$doc.unbind('ajaxError.pager');
if (typeof p.oldAjaxSuccess === 'function') {
p.oldAjaxSuccess(data);
}
};
if (c.debug) {
ts.log('ajax initialized', wo.pager_ajaxObject);
}
$.ajax(wo.pager_ajaxObject);
}
},
getAjaxUrl: function(table, c) {
var p = c.pager,
wo = c.widgetOptions,
url = (wo.pager_ajaxUrl) ? wo.pager_ajaxUrl
// allow using "{page+1}" in the url string to switch to a non-zero based index
.replace(/\{page([\-+]\d+)?\}/, function(s,n){ return p.page + (n ? parseInt(n, 10) : 0); })
.replace(/\{size\}/g, p.size) : '',
sl = c.sortList,
fl = p.currentFilters || $(table).data('lastSearch') || [],
sortCol = url.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),
filterCol = url.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),
arry = [];
if (sortCol) {
sortCol = sortCol[1];
$.each(sl, function(i,v){
arry.push(sortCol + '[' + v[0] + ']=' + v[1]);
});
// if the arry is empty, just add the col parameter... "&{sortList:col}" becomes "&col"
url = url.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join('&') : sortCol );
arry = [];
}
if (filterCol) {
filterCol = filterCol[1];
$.each(fl, function(i,v){
if (v) {
arry.push(filterCol + '[' + i + ']=' + encodeURIComponent(v));
}
});
// if the arry is empty, just add the fcol parameter... "&{filterList:fcol}" becomes "&fcol"
url = url.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join('&') : filterCol );
p.currentFilters = fl;
}
if ( $.isFunction(wo.pager_customAjaxUrl) ) {
url = wo.pager_customAjaxUrl(table, url);
}
if (c.debug) {
ts.log('Pager ajax url: ' + url);
}
return url;
},
renderTable: function(table, rows) {
var i, $tb,
c = table.config,
p = c.pager,
wo = c.widgetOptions,
l = rows && rows.length || 0, // rows may be undefined
s = ( p.page * p.size ),
e = ( s + p.size );
if ( l < 1 ) { return; } // empty table, abort!
if ( p.page >= p.totalPages ) {
// lets not render the table more than once
return tsp.moveToLastPage(table, p);
}
p.isDisabled = false; // needed because sorting will change the page and re-enable the pager
if (p.initialized) { c.$table.trigger('pagerChange', c); }
if ( !wo.pager_removeRows ) {
tsp.hideRows(table, c);
} else {
if ( e > rows.length ) {
e = rows.length;
}
ts.clearTableBody(table);
$tb = ts.processTbody(table, c.$tbodies.eq(0), true);
for ( i = s; i < e; i++ ) {
$tb.append(rows[i]);
}
ts.processTbody(table, $tb, false);
}
tsp.updatePageDisplay(table, c);
if ( !p.isDisabled ) { tsp.fixHeight(table, c); }
wo.pager_startPage = p.page;
wo.pager_size = p.size;
c.$table.trigger('applyWidgets');
if (table.isUpdating) {
c.$table.trigger('updateComplete');
}
},
showAllRows: function(table, c){
var p = c.pager,
wo = c.widgetOptions;
if ( p.ajax ) {
tsp.pagerArrows(c, true);
} else {
p.isDisabled = true;
$.data(table, 'pagerLastPage', p.page);
$.data(table, 'pagerLastSize', p.size);
p.page = 0;
p.size = p.totalRows;
p.totalPages = 1;
c.$table
.addClass('pagerDisabled')
.removeAttr('aria-describedby')
.find('tr.pagerSavedHeightSpacer').remove();
tsp.renderTable(table, c.rowsCopy);
if (c.debug) {
ts.log('pager disabled');
}
}
// disable size selector
p.$size.add(p.$goto).each(function(){
$(this).attr('aria-disabled', 'true').addClass(wo.pager_css.disabled)[0].disabled = true;
});
},
moveToPage: function(table, p, pageMoved) {
if ( p.isDisabled ) { return; }
var c = table.config,
l = p.last,
pg = Math.min( p.totalPages, p.filteredPages );
if ( p.page < 0 ) { p.page = 0; }
if ( p.page > ( pg - 1 ) && pg !== 0 ) { p.page = pg - 1; }
// fixes issue where one current filter is [] and the other is ['','',''],
// making the next if comparison think the filters as different. Fixes #202.
l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
p.currentFilters = (p.currentFilters || []).join('') === '' ? [] : p.currentFilters;
// don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
l.sortList === (c.sortList || []).join(',') ) {
return;
}
if (c.debug) {
ts.log('Pager changing to page ' + p.page);
}
p.last = {
page : p.page,
size : p.size,
// fixes #408; modify sortList otherwise it auto-updates
sortList : (c.sortList || []).join(','),
totalRows : p.totalRows,
currentFilters : p.currentFilters || []
};
if (p.ajax) {
tsp.getAjax(table, c);
} else if (!p.ajax) {
tsp.renderTable(table, c.rowsCopy);
}
$.data(table, 'pagerLastPage', p.page);
if (p.initialized && pageMoved !== false) {
c.$table.trigger('pageMoved', c);
if (!p.ajax && table.isUpdating) {
c.$table.trigger('updateComplete');
}
}
},
setPageSize: function(table, size, c) {
var p = c.pager;
p.size = size || p.size || 10;
p.$size.val(p.size);
$.data(table, 'pagerLastPage', p.page);
$.data(table, 'pagerLastSize', p.size);
p.totalPages = Math.ceil( p.totalRows / p.size );
p.filteredPages = Math.ceil( p.filteredRows / p.size );
tsp.moveToPage(table, p);
},
moveToFirstPage: function(table, p) {
p.page = 0;
tsp.moveToPage(table, p);
},
moveToLastPage: function(table, p) {
p.page = ( Math.min( p.totalPages, p.filteredPages ) - 1 );
tsp.moveToPage(table, p);
},
moveToNextPage: function(table, p) {
p.page++;
if ( p.page >= ( Math.min( p.totalPages, p.filteredPages ) - 1 ) ) {
p.page = ( Math.min( p.totalPages, p.filteredPages ) - 1 );
}
tsp.moveToPage(table, p);
},
moveToPrevPage: function(table, p) {
p.page--;
if ( p.page <= 0 ) {
p.page = 0;
}
tsp.moveToPage(table, p);
},
destroyPager: function(table, c){
var p = c.pager;
tsp.showAllRows(table, c);
p.$container.hide(); // hide pager
c.appender = null; // remove pager appender function
p.initialized = false;
c.$table.unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager');
if (ts.storage) {
ts.storage(table, c.widgetOptions.pager_storageKey, '');
}
},
enablePager: function(table, c, triggered){
var info, p = c.pager;
p.isDisabled = false;
p.page = $.data(table, 'pagerLastPage') || p.page || 0;
p.size = $.data(table, 'pagerLastSize') || parseInt(p.$size.find('option[selected]').val(), 10) || p.size || 10;
p.$size.val(p.size); // set page size
p.totalPages = Math.ceil( Math.min( p.totalRows, p.filteredRows ) / p.size );
c.$table.removeClass('pagerDisabled');
// if table id exists, include page display with aria info
if ( table.id ) {
info = table.id + '_pager_info';
p.$container.find(c.widgetOptions.pager_selectors.pageDisplay).attr('id', info);
c.$table.attr('aria-describedby', info);
}
if ( triggered ) {
c.$table.trigger('updateRows');
tsp.setPageSize(table, p.size, c);
tsp.hideRowsSetup(table, c);
tsp.fixHeight(table, c);
if (c.debug) {
ts.log('pager enabled');
}
}
},
appender: function(table, rows) {
var c = table.config,
wo = c.widgetOptions,
p = c.pager;
if ( !p.ajax ) {
c.rowsCopy = rows;
p.totalRows = c.widgetOptions.pager_countChildRows ? c.$tbodies.eq(0).children().length : rows.length;
p.size = $.data(table, 'pagerLastSize') || p.size || wo.pager_size || 10;
p.totalPages = Math.ceil( p.totalRows / p.size );
tsp.moveToPage(table, p, true);
// update display here in case all rows are removed
tsp.updatePageDisplay(table, c, false);
} else {
tsp.moveToPage(table, p, true);
}
}
};
// see #486
ts.showError = function(table, message){
$(table).each(function(){
var $row,
c = this.config,
errorRow = c.pager && c.pager.cssErrorRow || c.widgetOptions.pager_css && c.widgetOptions.pager_css.errorRow || 'tablesorter-errorRow';
if (c) {
if (typeof message === 'undefined') {
c.$table.find('thead').find(c.selectorRemove).remove();
} else {
$row = ( /tr\>/.test(message) ? $(message) : $('<tr><td colspan="' + c.columns + '">' + message + '</td></tr>') )
.click(function(){
$(this).remove();
})
// add error row to thead instead of tbody, or clicking on the header will result in a parser error
.appendTo( c.$table.find('thead:first') )
.addClass( errorRow + ' ' + c.selectorRemove.replace(/^[.#]/, '') )
.attr({
role : 'alert',
'aria-live' : 'assertive'
});
}
}
});
};
})(jQuery);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

View File

@ -1,23 +1,23 @@
<div class="accordioncontent"> <div class="accordioncontent">
<h4>Anschrift</h4> <h4>Anschrift</h4>
Seismologisches Observatorium der<br /> Seismologisches Observatorium der</br>
Ruhr-Universität Bochum<br /> Ruhr-Universität Bochum</br>
NA 3/174<br /> NA 3/174</br>
44780 Bochum<br /> 44780 Bochum</br>
Tel.: 0234 32-27574<br /> Tel.: 0234 32-27574</br>
Fax: 0234 32-07574<br /> Fax: 0234 32-07574</br>
<p>Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.</p> <p>Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.</p>
<p>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.</p> <p>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.</p>
<p>Umsatzsteuer-Identifikationsnummer: DE 127 056 261</p> <p>Umsatzsteuer-Identifikationsnummer: DE 127 056 261</p>
<h4>Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum</h4> <h4>Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum</h4>
Herr Dr. Kasper D. Fischer<br /> Herr Dr. Kasper D. Fischer</br>
Ruhr-Universität Bochum<br /> Ruhr-Universität Bochum</br>
44780 Bochum<br /> 44780 Bochum</br>
Tel.: 0234 32-27574<br /> Tel.: 0234 32-27574</br>
Fax: 0234 32-07574<br /> Fax: 0234 32-07574</br>
E-Mail: kasper.fischer@ruhr-uni-bochum.de<br /> E-Mail: kasper.fischer@ruhr-uni-bochum.de</br>
<p>Meldungen über missbräuchliche Nutzungen, die von Stationen aus dem IP-Namensbereich ruhr-uni-bochum.de ausgehen, senden Sie bitte an die Email-Adresse <p>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 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

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<!-- Version v1.3 (2023-04-17) --> <!-- $Id$ -->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head> <head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
@ -8,41 +8,44 @@
<!-- Style definitions --> <!-- Style definitions -->
<link rel="stylesheet" href="main.css" /> <link rel="stylesheet" href="main.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/cupertino/jquery-ui.css" /> <!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/css/theme.blue.min.css" integrity="sha512-jJ9r3lTLaH5XXa9ZOsCQU8kLvxdAVzyTWO/pnzdZrshJQfnw1oevJFpoyCDr7K1lqt1hUgqoxA5e2PctVtlSTg==" crossorigin="anonymous" /> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/css/jquery.tablesorter.pager.min.css" integrity="sha512-TWYBryfpFn3IugX13ZCIYHNK3/2sZk3dyXMKp3chZL+0wRuwFr1hDqZR9Qd5SONzn+Lja10hercP2Xjuzz5O3g==" crossorigin="anonymous" /> <link rel="stylesheet" href="external/theme.blue.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf/0.3.1/css/dvf.min.css" integrity="sha512-Ts/IYE5D8PaMBUDHcf6O57lOiV923cai3sEXo0WjhakpTxlwodQQJx1YA2t1mDUKO6fIXEngkKFLQNMXK/kBZg==" crossorigin="anonymous" /> <link rel="stylesheet" href="external/leaflet.css" />
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
<!-- jQuery & jQueryUI --> <!-- jQuery & jQueryUI -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script> <script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- Localtime, sprintf, showdown --> <!-- Localtime & sprintf -->
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script> <!-- current 2020-07-15 --> <script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sprintf/1.1.2/sprintf.min.js" integrity="sha512-pmG0OkYtZVB2EqETE5HPsEaok7sNZFfStp5rNdpHv0tGQjbt1z8Qjzhtx88/4wsttOtDwq5DZGJyKyzEe7ribg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/sprintf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js" integrity="sha512-L03kznCrNOfVxOUovR6ESfCz9Gfny7gihUX/huVbQB9zjODtYpxaVtIaAkpetoiyV2eqWbvxMH9fiSv5enX7bw==" crossorigin="anonymous"></script>
<!-- Tablesorter --> <!-- Tablesorter: required -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js" integrity="sha512-qzgd5cYSZcosqpzpn7zF2ZId8f/8CHmFKZ8j7mU4OUXTNRd5g+ZHBPsgKEwoqxCtdQvExE5LprwwPAgoicguNg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.widgets.min.js" integrity="sha512-dj/9K5GRIEZu+Igm9tC16XPOTz0RdPk9FGxfZxShWf65JJNU2TjbElGjuOo3EhwAJRPhJxwEJ5b+/Ouo+VqZdQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/widgets/widget-pager.min.js" integrity="sha512-+X/dsto9+7foPuqwqjm+mJSPYk6Coovg9jQJvM+aBfscXOyBrAKN69GS5Z2TkMLlVHxeiE5doVqelnMfbsS9XQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/widget-pager.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/extras/jquery.tablesorter.pager.min.js" integrity="sha512-y845ijdup9lDunrcSRQAlFdQICHVhkB5UNguWRX8A3L+guxO7Oow0poojw0PLckhcKij++h85bnyro80fjR9+A==" crossorigin="anonymous"></script> <!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/widgets/widget-scroller.min.js" integrity="sha512-1D2qKse1/4gCgLbgmBBv+9fJluAeJIlDgzIyZkovd1xmoyh1SW30lMIzCrD2X8Xs/sIzitUNDy86YagJRSUmaA==" crossorigin="anonymous"></script> <!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
<!-- Leaflet --> <!-- Leaflet -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script type="text/javascript" src="external/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf/0.3.1/leaflet-dvf.markers.min.js" integrity="sha512-R/iucaxFnDFUTdZRxUvxzc+sypDQhqnxInBmNjgGE0RaiMl/ektVB1wFS/L0xDZmLFPpEGR0Kw3GEBgtQNFHyg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-providers/1.13.0/leaflet-providers.min.js" integrity="sha512-5EYsvqNbFZ8HX60keFbe56Wr0Mq5J1RrA0KdVcfGDhnjnzIRsDrT/S3cxdzpVN2NGxAB9omgqnlh4/06TvWCMw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/leaflet.browser.print@1.0.6/dist/leaflet.browser.print.min.js" integrity="sha256-LrZphoL6+XVEuBR4BfhOIdRAMpRigQvsu3/iCNhQSXw=" crossorigin="anonymous"></script> <script type="text/javascript" src="external/leaflet.label.js"></script>
<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> <script src="external/jQuery.print.js"></script>
<!-- Map, Events & Stations --> <!-- Map, Events & Stations -->
<script type="text/javascript" src="misc.js"></script> <script type="text/javascript" src="misc.js"></script>
<script type="text/javascript" src="geolocation.js"></script>
<script type="text/javascript" src="specialevents.js"></script>
<script type="text/javascript" src="map.js"></script> <script type="text/javascript" src="map.js"></script>
<script type="text/javascript" src="events.js"></script> <script type="text/javascript" src="events.js"></script>
<script type="text/javascript" src="stations.js"></script> <script type="text/javascript" src="stations.js"></script>
<script type="text/javascript" src="data/geolocation.js"></script> <script type="text/javascript" src="eventsXML.js"></script>
<script type="text/javascript" src="data/specialevents.js"></script>
</head> </head>
<body> <body>
@ -111,7 +114,7 @@
<span id="events-type">Symbole:</span> <span id="events-type">Symbole:</span>
</p> </p>
<p class="table-caption"> <p class="table-caption">
Reverse Geolocation courtesy of <a href="http://photon.komoot.io/" target="_blank">Photon by Komoot</a> 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>
</div> </div>
<!-- Stations --> <!-- Stations -->
@ -154,26 +157,26 @@
<p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV-Datei</a>.</p> <p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV-Datei</a>.</p>
</div> </div>
<!-- More --> <!-- More -->
<div class="tab more_de" id="moretab"> <div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
<p>Text wird geladen ...</p>
</div>
<!-- Info --> <!-- Info -->
<div class="tab" id="infotab"> <div class="tab" id="infotab">
<div id="infoaccordion"> <div id="infoaccordion">
<h3 class="aheader">Navigation / Links</h3> <h3 class="aheader">Navigation / Links</h3>
<div class="info_de"><p>Text wird geladen ...</p></div> <!--#include virtual="info.inc.de" -->
<h3 class="aheader">Copyright / Lizenz</h3> <h3 class="aheader">Copyright / Lizenz</h3>
<div class="copyright_de"><p>Text wird geladen ...</p></div> <!--#include virtual="copyright.inc.de" -->
<h3 class="aheader">Impressum</h3> <h3 class="aheader">Impressum</h3>
<div class="imprint_de"><p>Text wird geladen ...</p></div> <!--#include virtual="impressum.inc.de" -->
</div> <div>
</div>
</div>
</div> </div>
</div> </div>
<!-- Logo --> <!-- Logo -->
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum" border="0"/></a></div> <div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum" border="0"/></a></div>
<!-- Map --> <!-- Map -->
<div id="map" class="map"></div> <div id="map" class="map"></div>
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div> <div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/></br>Loading ...</div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<!-- Version v1.3 (2023-04-17) --> <!-- $Id$ -->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head> <head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
@ -8,42 +8,45 @@
<!-- Style definitions --> <!-- Style definitions -->
<link rel="stylesheet" href="main.css" /> <link rel="stylesheet" href="main.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/cupertino/jquery-ui.css" /> <!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/css/theme.blue.min.css" integrity="sha512-jJ9r3lTLaH5XXa9ZOsCQU8kLvxdAVzyTWO/pnzdZrshJQfnw1oevJFpoyCDr7K1lqt1hUgqoxA5e2PctVtlSTg==" crossorigin="anonymous" /> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/css/jquery.tablesorter.pager.min.css" integrity="sha512-TWYBryfpFn3IugX13ZCIYHNK3/2sZk3dyXMKp3chZL+0wRuwFr1hDqZR9Qd5SONzn+Lja10hercP2Xjuzz5O3g==" crossorigin="anonymous" /> <link rel="stylesheet" href="external/theme.blue.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf/0.3.1/css/dvf.min.css" integrity="sha512-Ts/IYE5D8PaMBUDHcf6O57lOiV923cai3sEXo0WjhakpTxlwodQQJx1YA2t1mDUKO6fIXEngkKFLQNMXK/kBZg==" crossorigin="anonymous" /> <link rel="stylesheet" href="external/leaflet.css" />
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
<!-- <link rel="stylesheet" href="external/easyPrint.css"/> -->
<!-- jQuery & jQueryUI --> <!-- jQuery & jQueryUI -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script> <script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- Localtime, sprintf, showdown --> <!-- Localtime & sprintf -->
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script> <!-- current 2020-07-15 --> <script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sprintf/1.1.2/sprintf.min.js" integrity="sha512-pmG0OkYtZVB2EqETE5HPsEaok7sNZFfStp5rNdpHv0tGQjbt1z8Qjzhtx88/4wsttOtDwq5DZGJyKyzEe7ribg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/sprintf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js" integrity="sha512-L03kznCrNOfVxOUovR6ESfCz9Gfny7gihUX/huVbQB9zjODtYpxaVtIaAkpetoiyV2eqWbvxMH9fiSv5enX7bw==" crossorigin="anonymous"></script>
<!-- Tablesorter --> <!-- Tablesorter: required -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js" integrity="sha512-qzgd5cYSZcosqpzpn7zF2ZId8f/8CHmFKZ8j7mU4OUXTNRd5g+ZHBPsgKEwoqxCtdQvExE5LprwwPAgoicguNg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.widgets.min.js" integrity="sha512-dj/9K5GRIEZu+Igm9tC16XPOTz0RdPk9FGxfZxShWf65JJNU2TjbElGjuOo3EhwAJRPhJxwEJ5b+/Ouo+VqZdQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/widgets/widget-pager.min.js" integrity="sha512-+X/dsto9+7foPuqwqjm+mJSPYk6Coovg9jQJvM+aBfscXOyBrAKN69GS5Z2TkMLlVHxeiE5doVqelnMfbsS9XQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/widget-pager.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/extras/jquery.tablesorter.pager.min.js" integrity="sha512-y845ijdup9lDunrcSRQAlFdQICHVhkB5UNguWRX8A3L+guxO7Oow0poojw0PLckhcKij++h85bnyro80fjR9+A==" crossorigin="anonymous"></script> <!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/widgets/widget-scroller.min.js" integrity="sha512-1D2qKse1/4gCgLbgmBBv+9fJluAeJIlDgzIyZkovd1xmoyh1SW30lMIzCrD2X8Xs/sIzitUNDy86YagJRSUmaA==" crossorigin="anonymous"></script> <!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
<!-- Leaflet --> <!-- Leaflet -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script type="text/javascript" src="external/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf/0.3.1/leaflet-dvf.markers.min.js" integrity="sha512-R/iucaxFnDFUTdZRxUvxzc+sypDQhqnxInBmNjgGE0RaiMl/ektVB1wFS/L0xDZmLFPpEGR0Kw3GEBgtQNFHyg==" crossorigin="anonymous"></script> <script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-providers/1.13.0/leaflet-providers.min.js" integrity="sha512-5EYsvqNbFZ8HX60keFbe56Wr0Mq5J1RrA0KdVcfGDhnjnzIRsDrT/S3cxdzpVN2NGxAB9omgqnlh4/06TvWCMw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/leaflet.browser.print@1.0.6/dist/leaflet.browser.print.min.js" integrity="sha256-LrZphoL6+XVEuBR4BfhOIdRAMpRigQvsu3/iCNhQSXw=" crossorigin="anonymous"></script> <script type="text/javascript" src="external/leaflet.label.js"></script>
<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> <!-- <script src="external/jQuery.print.js"></script> -->
<!-- <script src="external/leaflet.easyPrint.js"></script> -->
<!-- Map, Events & Stations --> <!-- Map, Events & Stations -->
<script type="text/javascript" src="misc.js"></script> <script type="text/javascript" src="misc.js"></script>
<script type="text/javascript" src="geolocation.js"></script>
<script type="text/javascript" src="specialevents.js"></script>
<script type="text/javascript" src="map.js.en"></script> <script type="text/javascript" src="map.js.en"></script>
<script type="text/javascript" src="events.js.en"></script> <script type="text/javascript" src="events.js.en"></script>
<script type="text/javascript" src="stations.js.en"></script> <script type="text/javascript" src="stations.js.en"></script>
<script type="text/javascript" src="data/geolocation.js"></script>
<script type="text/javascript" src="data/specialevents.js"></script>
</head> </head>
<body> <body>
@ -93,6 +96,7 @@
<col width="50" /> <col width="50" />
<col width="50" /> <col width="50" />
<col /> <col />
<col width="30" />
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@ -112,7 +116,7 @@
<span id="events-type">Symbols:</span> <span id="events-type">Symbols:</span>
</p> </p>
<p class="table-caption"> <p class="table-caption">
Reverse Geolocation courtesy of <a href="http://photon.komoot.io/" target="_blank">Photon by Komoot</a> 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>
</div> </div>
<!-- Stations --> <!-- Stations -->
@ -155,26 +159,26 @@
<p class="table-caption">Download as <a id="stations-csv-link" href="link" download="stations.csv">CSV file</a>.</p> <p class="table-caption">Download as <a id="stations-csv-link" href="link" download="stations.csv">CSV file</a>.</p>
</div> </div>
<!-- More --> <!-- More -->
<div class="tab more_de" id="moretab"> <div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
<p>Loading text ...</p>
</div>
<!-- Info --> <!-- Info -->
<div class="tab" id="infotab"> <div class="tab" id="infotab">
<div id="infoaccordion"> <div id="infoaccordion">
<h3 class="aheader">Navigation / Links</h3> <h3 class="aheader">Navigation / Links</h3>
<div class="info_de"><p>Loading text ...</p></div> <!--#include virtual="info.inc.de" -->
<h3 class="aheader">Copyright / Licence</h3> <h3 class="aheader">Copyright / License</h3>
<div class="copyright_de"><p>Loading text ...</p></div> <!--#include virtual="copyright.inc.de" -->
<h3 class="aheader">Imprint</h3> <h3 class="aheader">Imprint</h3>
<div class="imprint_de"><p>Loading text ...</p></div> <!--#include virtual="impressum.inc.de" -->
</div> <div>
</div>
</div>
</div> </div>
</div> </div>
<!-- Logo --> <!-- Logo -->
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/en/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-University Bochum" title="Ruhr-University Bochum" border="0"/></a></div> <div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-University Bochum" title="Ruhr-University Bochum" border="0"/></a></div>
<!-- Map --> <!-- Map -->
<div id="map" class="map"></div> <div id="map" class="map"></div>
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div> <div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/></br>Loading ...</div>
</body> </body>
</html> </html>

View File

@ -1,7 +1,7 @@
<div class="accordioncontent"> <div class="accordioncontent">
<h4>Navigation zu den Internetseiten</h4> <h4>Navigation zu den Internetseiten</h4>
<ul> <ul>
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Seismologisches Observatorium</a><br /> der Ruhr-Universität Bochum</li> <li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Seismologisches Observatorium</a></br> der Ruhr-Universität Bochum</li>
<li>der <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seismology">Arbeitsgruppe Seismologie</a></li> <li>der <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seismology">Arbeitsgruppe Seismologie</a></li>
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de">Instituts für Geologie, Mineralogie und Geophysik</a></li> <li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de">Instituts für Geologie, Mineralogie und Geophysik</a></li>
<li>der <a class="intern" href="http://www.rub.de">Ruhr-Universität Bochum</a></li> <li>der <a class="intern" href="http://www.rub.de">Ruhr-Universität Bochum</a></li>
@ -18,5 +18,4 @@
<ul> <ul>
<li>Homepage der <a class="extern" target="_blank" href="http://www.rag.de">RAG</a></li> <li>Homepage der <a class="extern" target="_blank" href="http://www.rag.de">RAG</a></li>
<li><a class="extern" target="_blank" href="http://www.bid.rag.de">Bürgerinformationssystem</a> der RAG</li> <li><a class="extern" target="_blank" href="http://www.bid.rag.de">Bürgerinformationssystem</a> der RAG</li>
</ul>
</div> </div>

View File

@ -4,7 +4,7 @@
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -17,9 +17,9 @@
for more details. for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* add station marker */ /* add station marker */
@ -32,10 +32,10 @@ function addStationMarker(id, lat, lng, station) {
color: config['station']['markerColor'], color: config['station']['markerColor'],
weight: 1, weight: 1,
opacity: 1, opacity: 1,
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'],
className: id+' stationMarker', className: id+' stationMarker',
}); });
marker.bindTooltip('Station '+station); marker.bindLabel('Station '+station);
stationLayer.addLayer(marker); stationLayer.addLayer(marker);
stationTable[id] = marker; stationTable[id] = marker;
}; };
@ -61,12 +61,6 @@ function addEventMarker(id, lat, lng, mag, type) {
case 'earthquake': case 'earthquake':
marker = L.starMarker(L.latLng(lat, lng), markerOptions); marker = L.starMarker(L.latLng(lat, lng), markerOptions);
break; break;
case 'nuclear explosion':
markerOptions['numberOfSides'] = 4;
markerOptions['radius'] = 2.0*markerOptions['radius'];
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
break;
case 'explosion': case 'explosion':
markerOptions['numberOfSides'] = 6; markerOptions['numberOfSides'] = 6;
markerOptions['radius'] = 2.0*markerOptions['radius']; markerOptions['radius'] = 2.0*markerOptions['radius'];
@ -74,7 +68,6 @@ function addEventMarker(id, lat, lng, mag, type) {
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
break; break;
case 'quarry blast': case 'quarry blast':
case 'controlled explosion':
markerOptions['numberOfPoints'] = 7; markerOptions['numberOfPoints'] = 7;
markerOptions['innerRadius'] = 0.3*markerOptions['radius']; markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
marker = L.starMarker(L.latLng(lat, lng), markerOptions); marker = L.starMarker(L.latLng(lat, lng), markerOptions);
@ -139,53 +132,63 @@ function initMapLink() {
**********************************************************************/ **********************************************************************/
$(document).ready(function() { $(document).ready(function() {
map = L.map('map', { // create a map in the "map" div, set the view to a given place and zoom
center: config['map']['centerDefault'], map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
zoom: config['map']['zoomDefault'],
zoomControl: false,
worldCopyJump: true
});
// change baselayer if mapquest is not requested
switch ( config['map']['baselayer'] ) {
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map);
break;
case 'aerial': // add ESRI WordImagery tile layer
L.tileLayer.provider('Esri.WorldImagery').addTo(map);
break;
case 'opentopo': // add OpenTopoMap tile layer
L.tileLayer.provider('OpenTopoMap').addTo(map);
break;
case 'mapnik': // add OpenStreetMap.Mapnik tile layer
L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
break;
case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html)
L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png',
{attribution: '&copy; Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: <a href="http://sg.geodatenzentrum.de/web_public/Datenquellen_TopPlus_Open.pdf">Geodatenzentrum</a>'}).addTo(map);
break;
case 'mapquest':
MQ.mapLayer().addTo(map);
break;
default: // use OpenStreetMap.DE as default
L.tileLayer.provider('OpenStreetMap.DE').addTo(map);
};
// add controls
new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.Control.Zoom({ position: 'topright' }).addTo(map);
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
// create 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: '&copy; <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)
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
{
attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',
maxZoom: 16
}).addTo(map);
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 &copy; Esri &mdash; 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
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
}).addTo(map);
break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
}).addTo(map);
};
// create station and event layer // create station and event layer
// stationLayer = L.geoJson().addTo(map); // stationLayer = L.geoJson().addTo(map);
stationLayer = new L.MarkerGroup().addTo(map); stationLayer = new L.MarkerGroup().addTo(map);
eventLayer = new L.MarkerGroup().addTo(map); eventLayer = new L.MarkerGroup().addTo(map);
// load events // load events
ajaxLoadEvents('', '', '', 'data/events.xml'); ajaxLoadEvents(true);
ajaxLoadEvents(); // ajaxLoadEvents(false, '', '', '', 'events.xml');
specialEvents.map(function(id) { ajaxLoadEvents(false);
ajaxLoadEvents('', '', id) // specialEvents.map(function(id) {
}); // ajaxLoadEvents(false, '', '', id)
//});
toggleFilteredMarkers(); toggleFilteredMarkers();
// bind popupopen event // bind popupopen event
@ -214,8 +217,5 @@ $(document).ready(function() {
}); });
// print icon // print icon
L.control.browserPrint({ // L.easyPrint().addTo(map);
title: 'print map',
position: 'topright',
}).addTo(map);
}); });

View File

@ -1,10 +1,10 @@
/********************************************************************** /**********************************************************************
* map.js.en * * map.js *
* script for map specific functions and setup * * script for map specific functions and setup *
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -17,9 +17,9 @@
for more details. for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* add station marker */ /* add station marker */
@ -32,10 +32,10 @@ function addStationMarker(id, lat, lng, station) {
color: config['station']['markerColor'], color: config['station']['markerColor'],
weight: 1, weight: 1,
opacity: 1, opacity: 1,
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'],
className: id+' stationMarker', className: id+' stationMarker',
}); });
marker.bindTooltip('Station '+station); marker.bindLabel('Station '+station);
stationLayer.addLayer(marker); stationLayer.addLayer(marker);
stationTable[id] = marker; stationTable[id] = marker;
}; };
@ -61,12 +61,6 @@ function addEventMarker(id, lat, lng, mag, type) {
case 'earthquake': case 'earthquake':
marker = L.starMarker(L.latLng(lat, lng), markerOptions); marker = L.starMarker(L.latLng(lat, lng), markerOptions);
break; break;
case 'nuclear explosion':
markerOptions['numberOfSides'] = 4;
markerOptions['radius'] = 2.0*markerOptions['radius'];
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
break;
case 'explosion': case 'explosion':
markerOptions['numberOfSides'] = 6; markerOptions['numberOfSides'] = 6;
markerOptions['radius'] = 2.0*markerOptions['radius']; markerOptions['radius'] = 2.0*markerOptions['radius'];
@ -74,7 +68,6 @@ function addEventMarker(id, lat, lng, mag, type) {
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
break; break;
case 'quarry blast': case 'quarry blast':
case 'controlled explosion':
markerOptions['numberOfPoints'] = 7; markerOptions['numberOfPoints'] = 7;
markerOptions['innerRadius'] = 0.3*markerOptions['radius']; markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
marker = L.starMarker(L.latLng(lat, lng), markerOptions); marker = L.starMarker(L.latLng(lat, lng), markerOptions);
@ -139,49 +132,58 @@ function initMapLink() {
**********************************************************************/ **********************************************************************/
$(document).ready(function() { $(document).ready(function() {
map = L.map('map', { // create a map in the "map" div, set the view to a given place and zoom
center: config['map']['centerDefault'], map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
zoom: config['map']['zoomDefault'],
zoomControl: false,
worldCopyJump: true
});
// change baselayer if mapquest is not requested
switch ( config['map']['baselayer'] ) {
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map);
break;
case 'aerial': // add ESRI WordImagery tile layer
L.tileLayer.provider('Esri.WorldImagery').addTo(map);
break;
case 'opentopo': // add OpenTopoMap tile layer
L.tileLayer.provider('OpenTopoMap').addTo(map);
break;
case 'mapnik': // add OpenStreetMap.Mapnik tile layer
L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
break;
case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html)
L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png',
{attribution: '&copy; Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: <a href="http://sg.geodatenzentrum.de/web_public/Datenquellen_TopPlus_Open.pdf">Geodatenzentrum</a>'}).addTo(map);
break;
case 'mapquest':
MQ.mapLayer().addTo(map);
break;
default: // use OpenStreetMap.DE as default
L.tileLayer.provider('OpenStreetMap.DE').addTo(map);
};
// add controls
new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.Control.Zoom({ position: 'topright' }).addTo(map);
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
// create 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: '&copy; <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)
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
{
attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',
maxZoom: 16
}).addTo(map);
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 &copy; Esri &mdash; 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
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
}).addTo(map);
break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
}).addTo(map);
};
// create station and event layer // create station and event layer
// stationLayer = L.geoJson().addTo(map); // stationLayer = L.geoJson().addTo(map);
stationLayer = new L.MarkerGroup().addTo(map); stationLayer = new L.MarkerGroup().addTo(map);
eventLayer = new L.MarkerGroup().addTo(map); eventLayer = new L.MarkerGroup().addTo(map);
// load events // load events
ajaxLoadEvents('', '', '', 'data/events.xml'); ajaxLoadEvents('', '', '', 'events.xml');
ajaxLoadEvents(); ajaxLoadEvents();
specialEvents.map(function(id) { specialEvents.map(function(id) {
ajaxLoadEvents('', '', id) ajaxLoadEvents('', '', id)
@ -214,8 +216,6 @@ $(document).ready(function() {
}); });
// print icon // print icon
L.control.browserPrint({ // L.easyPrint().addTo(map);
title: 'print map',
position: 'topright',
}).addTo(map);
}); });

View File

@ -4,7 +4,7 @@
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2023 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -19,13 +19,13 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* calculate marker radius from magnitude /* calculate marker radius from magnitude
* both formulas have equal radii at mag=1.2 */ * both formulas have equal radii at mag=1.2 */
function mag2radius(mag) { function mag2radius(mag) {
return 3*mag; // radius proportional to magnitude return 3*mag; // radius proportional to magagnitude
// return 8.104*Math.pow(30,mag) // radius proportional to energy // return 8.104*Math.pow(30,mag) // radius proportional to energy
}; };
@ -67,7 +67,9 @@ function getLocation(lat, lng) {
}; };
/* window resize */ /* window resize */
$( window ).on('resize', function() { setInfoHeight(); }); $( window ).resize(function() {
setInfoHeight();
});
/* parseQueryString */ /* parseQueryString */
function parseQueryString() { function parseQueryString() {
@ -81,7 +83,6 @@ function parseQueryString() {
} }
/* create global vars */ /* create global vars */
var jahr = new Date().getFullYear();
var map; var map;
var openMarkerID; var openMarkerID;
var eventTable = {}; var eventTable = {};
@ -89,38 +90,36 @@ var eventDetails = {};
var stationTable = {}; var stationTable = {};
var config = { var config = {
ajax: { ajax: {
timeout: 20000, // 20 seconds timeout: 10000, // 10 seconds
eventURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query', eventURL: '/fdsnws/event/1/query',
dlsvURL: 'dlsv', dlsvURL: 'dlsv',
mseedURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query', mseedURL: '/fdsnws/dataselect/1/query',
stationURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query', stationURL: '/fdsnws/station/1/query',
nominatimURL: 'https://photon.komoot.io/reverse', nominatimURL: '//open.mapquestapi.com/nominatim/v1/reverse.php',
timespan: 400, // nominatimURL: '//nominatim.openstreetmap.org/reverse',
timespan: 60,
}, },
event: { event: {
evaluationBlacklist: ['automatic', 'preliminary', 'rejected'], evaluationBlacklist: ['automatic', 'preliminary', 'rejected'],
markerOpacity: 0.4, markerOpacity: 0.4,
markerColor: 'blue', markerColor: 'blue',
markerColorH: 'red', markerColorH: 'red',
minMag: 0.7, minMag: 1.2,
minMagDelta: 0.1, minMagDelta: 0.1,
typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion'], typeWhitelist: ['earthquake', 'induced or triggered event'],
// typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion', 'nuclear explosion'],
// typeWhitelist: ['earthquake', 'induced or triggered event'],
}, },
map: { map: {
zoomDefault: 9, zoomDefault: 9,
zoomFocus: 12, zoomFocus: 12,
centerDefault: [51.85, 7.0], centerDefault: [51.65, 7.2],
timespan: 180, timespan: 180,
latlngDelta: 0.1, latlngDelta: 0.1,
baselayer: 'OpenStreetMap.DE',
}, },
station: { station: {
markerColor: 'darkgreen', markerColor: 'darkgreen',
markerOpacity: 1, markerOpacity: 1,
markerSize: { markerSize: {
defaultSize: 8, default: 8,
GE_IBBN: 10, GE_IBBN: 10,
GR_BUG: 10, GR_BUG: 10,
GR_KAST: 10, GR_KAST: 10,
@ -130,11 +129,7 @@ var config = {
NL_WIT: 3, NL_WIT: 3,
NL_WTSB: 3, NL_WTSB: 3,
}, },
networkBlacklist: ['NL', 'X5', '1A', 'AM'], networkBlacklist: ['NL', 'X5', '1A'],
stationBlacklist: ['RN_WEA2', 'RN_ACN', 'RN_BHE', 'RN_ENT', 'RN_GSH', 'RN_HES', 'RN_JCKS', 'RN_LOH',
'RN_OLF', 'RN_PLH', 'RN_RWB', 'RN_SOR', 'RN_TDN', 'RN_WBS',
'RN_HAM1', 'RN_HAM2', 'RN_HAM3', 'RN_HAM4', 'RN_HAM5', 'RN_HAM6', 'RN_HAM7', 'RN_HAM8', 'RN_HAM9',
'RN_HAM10', 'RN_HAM11', 'RN_HAM12', 'RN_HAM13', 'RN_HAM14', 'RN_HAM15', 'RN_HAM16', 'RN_HAM17'],
}, },
tab: { tab: {
active: 0, active: 0,
@ -145,18 +140,13 @@ var config = {
var networkURL = { var networkURL = {
GE: 'http://dx.doi.org/10.14470/TR560404', 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', GR: 'http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seismometer_Stationen/Stationsnetze/d_stationsnetz_node.html',
NH: 'http://www.gd.nrw.de/gg_le.htm',
NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html', NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html',
RN: 'https://doi.org/10.7914/SN/RN',
YD: 'https://doi.org/10.7914/SN/YD_2020',
}; };
var networkText = { var networkText = {
GE: '<a href="'+networkURL['GE']+'" target="_blank">GEOFON Seismic Network</a> - Deutsches GeoForschungsZentrum GFZ', 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', GR: '<a href="'+networkURL['GR']+'" target="_blank">German Regional Seismic Network</a>, BGR Hannover',
NH: '<a href="'+networkURL['NH']+'" target="_blank">Geologischer Dienst NRW</a>, Krefeld',
NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands', NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands',
RN: '<a href="'+networkURL['RN']+'" target="_blank">RuhrNet - Ruhr-University Bochum, Germany</a>', RN: 'RuhrNet - Ruhr-University Bochum, Germany',
YD: '<a href="'+networkURL['YD']+'" target="_blank">FloodRisk Seismic Network</a>',
}; };
var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP']; var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP'];
@ -169,12 +159,9 @@ if (typeof console == "undefined") var console = { log: function() {} };
$(document).ready(function() { $(document).ready(function() {
// parse query string // parse query string
var parameters = parseQueryString(); var parameters = parseQueryString();
if ( parameters['baselayer']) { if ( parameters['baselayer'] ) {
config['map']['baselayer'] = parameters['baselayer'][0]; config['map']['baselayer'] = parameters['baselayer'][0];
}; };
if ( parameters['basemap'] ) {
config['map']['baselayer'] = parameters['basemap'][0];
};
if ( Number(parameters['lat']) && Number(parameters['lon']) ) { if ( Number(parameters['lat']) && Number(parameters['lon']) ) {
config['map']['centerDefault'] = [Number(parameters['lat']), Number(parameters['lon'])]; config['map']['centerDefault'] = [Number(parameters['lat']), Number(parameters['lon'])];
}; };
@ -198,10 +185,6 @@ $(document).ready(function() {
config['tab']['active'] = Number(parameters['tab']); config['tab']['active'] = Number(parameters['tab']);
}; };
}; };
if ( Number(parameters['zoom']) ) {
config['map']['zoomDefault'] = Number(parameters['zoom']);
config['map']['zoomFocus'] = Number(parameters['zoom']+3);
};
// AJAX setup // AJAX setup
$.ajaxSetup({timeout: config['ajax']['timeout']}); $.ajaxSetup({timeout: config['ajax']['timeout']});
@ -223,29 +206,12 @@ $(document).ready(function() {
animate: 200, animate: 200,
}); });
// spinner // spinner
$(document).on("ajaxSend", function() { $(document).bind("ajaxSend", function() {
$("#spinner").show(); $("#spinner").show();
}).on("ajaxStop", function() { }).bind("ajaxStop", function() {
$("#spinner").hide(); $("#spinner").hide();
}); });
// load more tab content // hide info container
$.get("more_de.md", function( data ) { $('div.info').hide()
var converter = new showdown.Converter(); });
$('.more_de').html(converter.makeHtml(data));
});
$.get("more_en.md", function( data ) {
var converter = new showdown.Converter();
$('.more_en').html(converter.makeHtml(data));
});
// load info tab content
$.get("info.inc.de", function( data ) {
$('.info_de, .info_en').html(data);
});
$.get("copyright.inc.de", function( data ) {
$('.copyright_de, .copyright_en').html(data);
});
$.get("impressum.inc.de", function( data ) {
$('.imprint_de, .imprint_en').html(data);
});
});

1
www/more.inc.de Normal file
View File

@ -0,0 +1 @@
Das seismologische Netz der Ruhr-Universität besteht aus 13 Stationen. Zwei breitbandige Stationen (BUG und IBBN) sind gleichzeitig Bestandteil des Deutschen Seismologischen Regionalnetzes (GRSN). Sie befinden sich in der Nähe der Ruhr-Universität in einem stillgelegten Stollen der Zeche Klosterbusch bzw. bei Ibbenbüren. Weitere Außenstationen gibt es bei Rheinberg (BRHE) und Hünxe (ZERL, westliches Ruhrgebiet), bei Haltern (BAVN, nörldiches Ruhrgebiet) und Hamm (HMES, östliches Ruhrgebiet). In Ibbenbüren ergänzen die kurzperiodischen Stationen IBBE und IBBS das Stationsnetz. Im Bereich der Ruhr-Universität werden weiterhin 5 kurzperiodische Stationen (BTEZ, BSHA, BKLB, BHOF, BULI) betrieben, die zur Ortung von Ereignissen im Ruhrgebiet verwendet werden. Das von den Seismometern registrierte Messsignal wird an den Stationen digitalisiert und kontinuierlich an die Auswertezentrale an der Ruhr-Universität Bochum übertragen.

View File

@ -1,9 +0,0 @@
# Seismologisches Observatorium
## Stationsnetz
Das seismologische Observatorium der Ruhr-Universität Bochum betreibt mehrere seismologische Stationen im Ruhrgebiet, im Raum Ibbenbüren und im Alpenvorland. Zwei breitbandige Stationen (BUG und IBBN) sind gleichzeitig Bestandteil des Deutschen Seismologischen Regionalnetzes (GRSN). Sie befinden sich in der Nähe der Ruhr-Universität in einem stillgelegten Stollen der Zeche Klosterbusch bzw. bei Ibbenbüren.
## Seismologische Netzwerke
### RuhrNet (RN)
### FloodRisk (YD)
### AlpArray (Z3)

View File

@ -1,9 +0,0 @@
# Seismological Observatory
## Station Network
The seismological observatory of the Ruhr-University Bochum (Germany) maintains several seismolocical stations in the Ruhr area, around Ibbenbueren and in the foreland of the Alps. Two broadband stations (BUG and IBBN) are also part of the German Regional Seismological Network (GRSN). These are located near the Ruhr-University in an abandoned coal mine and near the city of Ibbenbueren.
## Seismological Networks
### RuhrNet (RN)
### FloodRisk (YD)
### AlpArray (Z3)

14
www/specialevents.js Normal file
View File

@ -0,0 +1,14 @@
/* $Id$ */
var specialEvents = [
//'bug2014ytlk', // Vechta 3.0
//'bug2014wjwx', // Haltern 3.6
//'bug2014ldts', // Darmstadt
//'bug2014kowj', // Vogtland 5.0
//'bug2014jptq', // Seeheim-Jugenheim
//'bug2014infb', // Troisdorf
//'bug2014ilxd', // Bassum
//'bug2014gfzw', // Darmstadt
//'bug2014datb', // Groningen
'bug2013yvko', // Haltern 3.4
'bug2015fdpy', // Darmstadt 3.0
];

View File

@ -4,7 +4,7 @@
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -19,11 +19,11 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* Load the stations using ajax */ /* Load the stations using ajax */
function loadStations(station, stime, etime) { function loadStations(stime, etime) {
var mapBounds = map.getBounds(); var mapBounds = map.getBounds();
var N = mapBounds.getNorth(); var N = mapBounds.getNorth();
var E = mapBounds.getEast(); var E = mapBounds.getEast();
@ -37,23 +37,14 @@ function loadStations(station, stime, etime) {
var etime = new Date(); var etime = new Date();
etime.setDate(etime.getDate()+1); etime.setDate(etime.getDate()+1);
}; };
if ( !station ) { 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: 'channel',
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'], maxlon: E+config['map']['latlngDelta'],
maxlon: E+config['map']['latlngDelta'],
};
} else {
var request_data = {
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'channel',
station: station,
};
}; };
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -70,13 +61,13 @@ function loadStations(station, stime, etime) {
lng = $(this).find('Longitude:first').text(), lng = $(this).find('Longitude:first').text(),
stationID = network+'_'+station, stationID = network+'_'+station,
stationText = network+'.'+station; stationText = network+'.'+station;
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) { if ( !stationTable[stationID] ) {
// general station info (1st line) // general station info (1st line)
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)); 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));
// setting up network details (2nd line) // setting up network details (2nd line)
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || ''); 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>' ; row += ( $.inArray(station, bochumStation)+1 ) ? '</br><em>Betreiber:</em> Ruhr-Universität Bochum</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) { if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) {
// setting up station details (3rd line) // setting up station details (3rd line)
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">'; row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this)); row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
@ -90,7 +81,7 @@ function loadStations(station, stime, etime) {
sc3mlRespURL = URL + '&level=response&format=sc3ml'; sc3mlRespURL = URL + '&level=response&format=sc3ml';
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">' row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a></br> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
+ '</td></tr>'; + '</td></tr>';
@ -123,16 +114,7 @@ function loadStations(station, stime, etime) {
} }
}); });
// create stations csv download link // create stations csv download link
var request_data = { request_data['format'] = 'text';
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'station',
minlat: S-config['map']['latlngDelta'],
maxlat: N+config['map']['latlngDelta'],
minlon: W-config['map']['latlngDelta'],
maxlon: E+config['map']['latlngDelta'],
format: 'text',
};
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data)); $('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
}; };
@ -142,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat
var elevation = stationObject.find('Elevation:first').text(); var elevation = stationObject.find('Elevation:first').text();
var name = stationObject.find('Site > Name').text(); var name = stationObject.find('Site > Name').text();
output = '<pre>' output = '<pre>'
+ name + '<br />' + name + '</br>'
+ 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN<br />'; + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN</br>';
stationObject.find('Channel').each(function() { stationObject.find('Channel').each(function() {
var code = $(this).attr('code'); var code = $(this).attr('code');
var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sensor = $(this).find('Sensor > Type').text().split(',')[0];
var sampleRate = $(this).find('SampleRate').text(); var sampleRate = $(this).find('SampleRate').text();
output += '<br />Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; output += '</br>Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor;
}); });
output += '</pre>'; output += '</pre>';
return output; return output;
@ -213,7 +195,7 @@ function initStationTable() {
// hide child rows // hide child rows
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide(); $('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
// update map after filtering // update map after filtering
// $('#stationsstable').on('filterEnd', function(){ // $('#stationsstable').bind('filterEnd', function(){
// toggleFilteredMarkers(); // toggleFilteredMarkers();
// }); // });
}; };
@ -223,22 +205,8 @@ function initStationTable() {
**********************************************************************/ **********************************************************************/
$(document).ready(function() { $(document).ready(function() {
loadStations(); loadStations();
loadStations('A100A');
loadStations('A101B');
loadStations('A102A');
loadStations('A103A');
loadStations('A103B');
loadStations('A104A');
loadStations('A104B');
loadStations('A105A');
loadStations('A106B');
loadStations('A107C');
loadStations('A108A');
loadStations('A109A');
// loadStations('KERA');
// loadStations('KARP');
// show / hide station info // show / hide station info
$('#stationstable').on('click', '.toggle' , function(){ $('#stationstable').delegate('.toggle', 'click' , function(){
// toggle visibility of selected row // toggle visibility of selected row
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
// mark currently selected row and remove class selected from all other rows // mark currently selected row and remove class selected from all other rows

View File

@ -1,10 +1,10 @@
/********************************************************************** /**********************************************************************
* stations.js.en * * stations.js *
* script for station specific functions and setup * * script for station specific functions and setup *
**********************************************************************/ **********************************************************************/
/* License /* License
Copyright 2014-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
@ -19,11 +19,11 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.3 (2023-04-17) $Id$
*/ */
/* Load the stations using ajax */ /* Load the stations using ajax */
function loadStations(station, stime, etime) { function loadStations(stime, etime) {
var mapBounds = map.getBounds(); var mapBounds = map.getBounds();
var N = mapBounds.getNorth(); var N = mapBounds.getNorth();
var E = mapBounds.getEast(); var E = mapBounds.getEast();
@ -37,23 +37,14 @@ function loadStations(station, stime, etime) {
var etime = new Date(); var etime = new Date();
etime.setDate(etime.getDate()+1); etime.setDate(etime.getDate()+1);
}; };
if ( !station ) { 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: 'channel',
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'], maxlon: E+config['map']['latlngDelta'],
maxlon: E+config['map']['latlngDelta'],
};
} else {
var request_data = {
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'channel',
station: station,
};
}; };
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -70,13 +61,13 @@ function loadStations(station, stime, etime) {
lng = $(this).find('Longitude:first').text(), lng = $(this).find('Longitude:first').text(),
stationID = network+'_'+station, stationID = network+'_'+station,
stationText = network+'.'+station; stationText = network+'.'+station;
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) { if ( !stationTable[stationID] ) {
// general station info (1st line) // general station info (1st line)
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)); 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));
// setting up network details (2nd line) // setting up network details (2nd line)
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || ''); row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
row += ( $.inArray(station, bochumStation)+1 ) ? '<br /><em>Operator:</em> Ruhr-University Bochum, Germany</td></tr>' : '</td></tr>' ; row += ( $.inArray(station, bochumStation)+1 ) ? '</br><em>Operator:</em> Ruhr-University Bochum</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) { if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) {
// setting up station details (3rd line) // setting up station details (3rd line)
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">'; row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this)); row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
@ -90,7 +81,7 @@ function loadStations(station, stime, etime) {
sc3mlRespURL = URL + '&level=response&format=sc3ml'; sc3mlRespURL = URL + '&level=response&format=sc3ml';
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">' row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a></br> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
+ '</td></tr>'; + '</td></tr>';
@ -123,16 +114,7 @@ function loadStations(station, stime, etime) {
} }
}); });
// create stations csv download link // create stations csv download link
var request_data = { request_data['format'] = 'text';
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'station',
minlat: S-config['map']['latlngDelta'],
maxlat: N+config['map']['latlngDelta'],
minlon: W-config['map']['latlngDelta'],
maxlon: E+config['map']['latlngDelta'],
format: 'text',
};
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data)); $('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
}; };
@ -142,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat
var elevation = stationObject.find('Elevation:first').text(); var elevation = stationObject.find('Elevation:first').text();
var name = stationObject.find('Site > Name').text(); var name = stationObject.find('Site > Name').text();
output = '<pre>' output = '<pre>'
+ name + '<br />' + name + '</br>'
+ 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.<br />'; + 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.</br>';
stationObject.find('Channel').each(function() { stationObject.find('Channel').each(function() {
var code = $(this).attr('code'); var code = $(this).attr('code');
var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sensor = $(this).find('Sensor > Type').text().split(',')[0];
var sampleRate = $(this).find('SampleRate').text(); var sampleRate = $(this).find('SampleRate').text();
output += '<br />Channel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; output += '</br>Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor;
}); });
output += '</pre>'; output += '</pre>';
return output; return output;
@ -213,7 +195,7 @@ function initStationTable() {
// hide child rows // hide child rows
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide(); $('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
// update map after filtering // update map after filtering
// $('#stationsstable').on('filterEnd', function(){ // $('#stationsstable').bind('filterEnd', function(){
// toggleFilteredMarkers(); // toggleFilteredMarkers();
// }); // });
}; };
@ -223,22 +205,8 @@ function initStationTable() {
**********************************************************************/ **********************************************************************/
$(document).ready(function() { $(document).ready(function() {
loadStations(); loadStations();
loadStations('A100A');
loadStations('A101B');
loadStations('A102A');
loadStations('A103A');
loadStations('A103B');
loadStations('A104A');
loadStations('A104B');
loadStations('A105A');
loadStations('A106B');
loadStations('A107C');
loadStations('A108A');
loadStations('A109A');
// loadStations('KERA');
// loadStations('KARP');
// show / hide station info // show / hide station info
$('#stationstable').on('click', '.toggle' , function(){ $('#stationstable').delegate('.toggle', 'click' , function(){
// toggle visibility of selected row // toggle visibility of selected row
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
// mark currently selected row and remove class selected from all other rows // mark currently selected row and remove class selected from all other rows