From 1ac4702a75d11a52659b04ca94a7dec66f717009 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 16 Sep 2014 11:11:51 +0000 Subject: [PATCH 01/10] Added support for event type explosion. --- www/events.js | 3 +++ www/map.js | 6 ++++++ www/misc.js | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/www/events.js b/www/events.js index 0d4a738..76fd74b 100644 --- a/www/events.js +++ b/www/events.js @@ -420,6 +420,9 @@ $(document).ready(function() { case 'earthquake': typetext += 'tektonisches Erdbeben (Stern)'; break; + case 'explosion': + typetext += 'Explosion (Sechseck)'; + break; case 'induced or triggered event': typetext += '(bergbau-)induziertes Ereignis (Kreis)'; break; diff --git a/www/map.js b/www/map.js index 23d1516..7e164cc 100644 --- a/www/map.js +++ b/www/map.js @@ -61,6 +61,12 @@ function addEventMarker(id, lat, lng, mag, type) { case 'earthquake': marker = L.starMarker(L.latLng(lat, lng), markerOptions); break; + case 'explosion': + markerOptions['numberOfSides'] = 6; + markerOptions['radius'] = 2.0*markerOptions['radius']; + markerOptions['innerRadius'] = 0.3*markerOptions['radius']; + marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); + break; case 'quarry blast': markerOptions['numberOfPoints'] = 7; markerOptions['innerRadius'] = 0.3*markerOptions['radius']; diff --git a/www/misc.js b/www/misc.js index f93bfaf..66de0d7 100644 --- a/www/misc.js +++ b/www/misc.js @@ -106,7 +106,7 @@ var config = { markerColorH: 'red', minMag: 1.2, minMagDelta: 0.1, - typeWhitelist: ['earthquake', 'induced or triggered event', 'quarry blast'], + typeWhitelist: ['earthquake', 'induced or triggered event', 'quarry blast', 'explosion'], }, map: { zoomDefault: 9, @@ -192,6 +192,4 @@ $(document).ready(function() { heightStyle: 'content', animate: 200, }); - }); - From fd632f2af6045c1e671dce7f709fa4f6db3edee7 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 16 Sep 2014 11:15:13 +0000 Subject: [PATCH 02/10] Added spinner image while loading data. --- www/index.html.de | 1 + www/main.css | 12 ++++++++++++ www/misc.js | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/www/index.html.de b/www/index.html.de index 293ca4b..08deef6 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -176,5 +176,6 @@
+ diff --git a/www/main.css b/www/main.css index fc8c168..333b86b 100644 --- a/www/main.css +++ b/www/main.css @@ -87,4 +87,16 @@ p.table-caption { font-size: smaller; } + div.spinner { + position: fixed; + top: 50%; + left: 50%; + margin-left: -64px; /* half width of the spinner gif */ + margin-top: -8px; /* half height of the spinner gif */ + text-align:center; + z-index: 19000; + overflow: auto; + width: 128px; /* width of the spinner gif */ + height: 40px; /*hight of the spinner gif +2px to fix IE8 issue */ + } diff --git a/www/misc.js b/www/misc.js index 66de0d7..38b500c 100644 --- a/www/misc.js +++ b/www/misc.js @@ -192,4 +192,12 @@ $(document).ready(function() { heightStyle: 'content', animate: 200, }); + // spinner + $(document).bind("ajaxSend", function() { + $("#spinner").show(); + console.log('Starting Spinner at '+Date()); + }).bind("ajaxStop", function() { + $("#spinner").hide(); + console.log('Stopping Spinner at '+Date()); + }); }); From 3b41bc4dfc32cbec607a934bba20f17749d0e315 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 16 Sep 2014 11:16:14 +0000 Subject: [PATCH 03/10] Added spinner image while loading data. --- .gitattributes | 1 + www/spinner.gif | Bin 0 -> 3951 bytes 2 files changed, 1 insertion(+) create mode 100644 www/spinner.gif diff --git a/.gitattributes b/.gitattributes index 296b8ea..e56e247 100644 --- a/.gitattributes +++ b/.gitattributes @@ -23,3 +23,4 @@ www/external/widget-pager.js -text www/impressum.inc.de -text www/info.inc.de -text www/logo_RUB_155x30.png -text +www/spinner.gif -text diff --git a/www/spinner.gif b/www/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..95cb0849ef06ea4b2bca41d8e3a2e33066754fc2 GIT binary patch literal 3951 zcmc(iXH*l|w#TC}7GM&_C^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jskXgMa+ zjnaaI#hml7qs1KLI^R!Ee0;%M1GYQHKy?h1{*x8>zja(*dRn)s6&`j1R&KoIVm9+nTc{w z@r(42J_;%+1wqS7%PTODs%kK)&SG%51R6<1X{@WQZ!V#BwBrFn zFqa3Bu%!}lZ(D1_Xp^F4cx-Zf`u&iM&sty(EsxB0O{}l=tV|8P!0>N9BKZTPI-%iJ zwhaFdjJ-$BJ+b{q^oHh%PC@*B>#K06PP_d(GoaA>s5GU{y{7OcKzq_TE$y$!_3L!M zvh#RZp^J{~h#FOGBz571qE1+pbSNrJ_gn942TqCY_hjEFxpI7`67tv57-5$k5vH@E zhrNa99`HWxq%WK~^VswjZb(iff6AI%e`E9dn8k~*z`Fq+!Qs(fmqJ})ed8iyBCMj4 zAHtvh1C*Nwf}-;Z3iBZ)rC>~PVI{h{sH_B+3k6cBKyn=gTU*7d;ovI>Jd&s!z!b1s zxnMe_p5D?dZ0Gm2$vOt5;t|PELuXe{-RQuye0F$jeq7PiMT4v?Hhm&~Uf4>3s)Gk8 z)?d;-KPsuxCi?B_`26>0)BE+mQRCXGc+aa`<{>rpU}@(P_XYjMgxa(}ak*vt#ThA~ z2s$5J zn3q$Ug~=^IS7cNd0e}P|u%xn#T28|jSJ7+OcnY&lP%mQCk_dc2TL-I=)6MH@@9Pvw zWG$`z!!l{ZfMTraeb0E4oIEn|VRCVLN<6xRpIgCgZ~=DE@flhDuDO2aIo@+QIc%T$ riI^34yOZHfnufsmf0;CjueRt Date: Tue, 16 Sep 2014 11:23:01 +0000 Subject: [PATCH 04/10] Added print button to web map. --- .gitattributes | 4 + www/external/easyPrint.css | 20 ++++ www/external/jQuery.print.js | 161 ++++++++++++++++++++++++++++++ www/external/leaflet.easyPrint.js | 28 ++++++ www/external/print.png | Bin 0 -> 219 bytes www/index.html.de | 3 + www/map.js | 5 +- 7 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 www/external/easyPrint.css create mode 100644 www/external/jQuery.print.js create mode 100644 www/external/leaflet.easyPrint.js create mode 100644 www/external/print.png diff --git a/.gitattributes b/.gitattributes index e56e247..e105340 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,9 @@ www/copyright.inc.de -text www/external/TileLayer.Grayscale.js -text www/external/css/dvf.css -text www/external/css/leaflet.label.css -text +www/external/easyPrint.css -text www/external/first.png -text +www/external/jQuery.print.js -text www/external/jquery.localtime-0.9.1.min.js -text www/external/jquery.tablesorter.min.js -text www/external/jquery.tablesorter.pager.css -text @@ -13,10 +15,12 @@ www/external/jquery.tablesorter.widgets.min.js -text www/external/last.png -text www/external/leaflet-dvf.markers.min.js -text www/external/leaflet.css -text +www/external/leaflet.easyPrint.js -text www/external/leaflet.js -text www/external/leaflet.label.js -text www/external/next.png -text www/external/prev.png -text +www/external/print.png -text www/external/sprintf.min.js -text www/external/theme.blue.css -text www/external/widget-pager.js -text diff --git a/www/external/easyPrint.css b/www/external/easyPrint.css new file mode 100644 index 0000000..d2c6544 --- /dev/null +++ b/www/external/easyPrint.css @@ -0,0 +1,20 @@ + +.leaflet-control-easyPrint a { + background:#fff url(external/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; +} diff --git a/www/external/jQuery.print.js b/www/external/jQuery.print.js new file mode 100644 index 0000000..8942ab9 --- /dev/null +++ b/www/external/jQuery.print.js @@ -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 = $("").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, $('')); + } + + // Create a copy of the element to print + var copy = $this.clone(); + // Wrap it in a span to get the HTML markup string + copy = $("").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 = $('