Merge branch 'midgard-master'

This commit is contained in:
redfast00 2020-05-22 18:37:20 +02:00
commit 4aceb15174
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
47 changed files with 1010 additions and 784 deletions

19
.editorconfig Normal file
View file

@ -0,0 +1,19 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
quote_type = double
[*.html]
indent_size = 2
[*.svg]
indent_style = tab
indent_size = unset

View file

@ -2,7 +2,7 @@
A useful map that lists all the public study locations in Ghent. A useful map that lists all the public study locations in Ghent.
We usually use data from [Stad Gent](https://stad.gent/studenten/studeren/bloklocaties) and emails sent by people.. Data is managed in a separate project, [Blokdata](https://github.com/ZeusWPI/Blokdata).
## Development ## Development
@ -11,5 +11,3 @@ You can easily run the site locally by spawning a simple static file server in t
``` ```
(cd src/; python3 -m http.server) (cd src/; python3 -m http.server)
``` ```
You can also validate the JSON with `(cd src/; python -m json.tool data.json > /dev/null)`. If there are no errors, there will be no output.

View file

@ -13,9 +13,6 @@ echo "-> Pulling latest release"
# Apparently, some systems put "up to date", while others put "up-to-date" # Apparently, some systems put "up to date", while others put "up-to-date"
git pull | grep 'Already up[- ]to[- ]date.' && echo "No updates, exiting..." && exit 20 git pull | grep 'Already up[- ]to[- ]date.' && echo "No updates, exiting..." && exit 20
echo "-> Checking validity of data.json"
python -m json.tool src/data.json > /dev/null
# Create release dir and copy sources to that dir # Create release dir and copy sources to that dir
echo "-> This release will be stored in $release_dir" echo "-> This release will be stored in $release_dir"

View file

@ -5,8 +5,8 @@
.leaflet-marker-icon, .leaflet-marker-icon,
.leaflet-marker-shadow, .leaflet-marker-shadow,
.leaflet-tile-container, .leaflet-tile-container,
.leaflet-map-pane svg, .leaflet-pane > svg,
.leaflet-map-pane canvas, .leaflet-pane > canvas,
.leaflet-zoom-box, .leaflet-zoom-box,
.leaflet-image-layer, .leaflet-image-layer,
.leaflet-layer { .leaflet-layer {
@ -16,8 +16,6 @@
} }
.leaflet-container { .leaflet-container {
overflow: hidden; overflow: hidden;
-ms-touch-action: none;
touch-action: none;
} }
.leaflet-tile, .leaflet-tile,
.leaflet-marker-icon, .leaflet-marker-icon,
@ -27,6 +25,10 @@
user-select: none; user-select: none;
-webkit-user-drag: none; -webkit-user-drag: none;
} }
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ /* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile { .leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast; image-rendering: -webkit-optimize-contrast;
@ -45,10 +47,34 @@
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg, .leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img, .leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img, .leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer { .leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important; max-width: none !important;
max-height: none !important;
} }
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile { .leaflet-tile {
filter: inherit; filter: inherit;
visibility: hidden; visibility: hidden;
@ -74,6 +100,7 @@
.leaflet-overlay-pane { z-index: 400; } .leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; } .leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; } .leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; } .leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; } .leaflet-map-pane canvas { z-index: 100; }
@ -95,6 +122,7 @@
.leaflet-control { .leaflet-control {
position: relative; position: relative;
z-index: 800; z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto; pointer-events: auto;
} }
.leaflet-top, .leaflet-top,
@ -145,7 +173,6 @@
opacity: 0; opacity: 0;
-webkit-transition: opacity 0.2s linear; -webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear; transition: opacity 0.2s linear;
} }
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
@ -162,14 +189,12 @@
.leaflet-zoom-anim .leaflet-zoom-animated { .leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); -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); -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); transition: transform 0.25s cubic-bezier(0,0,0.25,1);
} }
.leaflet-zoom-anim .leaflet-tile, .leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile { .leaflet-pan-anim .leaflet-tile {
-webkit-transition: none; -webkit-transition: none;
-moz-transition: none; -moz-transition: none;
-o-transition: none;
transition: none; transition: none;
} }
@ -186,6 +211,7 @@
.leaflet-grab { .leaflet-grab {
cursor: -webkit-grab; cursor: -webkit-grab;
cursor: -moz-grab; cursor: -moz-grab;
cursor: grab;
} }
.leaflet-crosshair, .leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive { .leaflet-crosshair .leaflet-interactive {
@ -201,6 +227,7 @@
cursor: move; cursor: move;
cursor: -webkit-grabbing; cursor: -webkit-grabbing;
cursor: -moz-grabbing; cursor: -moz-grabbing;
cursor: grabbing;
} }
/* marker & overlays interactivity */ /* marker & overlays interactivity */
@ -214,7 +241,9 @@
.leaflet-marker-icon.leaflet-interactive, .leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive, .leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive { .leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto; pointer-events: auto;
} }
@ -289,7 +318,14 @@
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */ /* zoom control */
@ -298,16 +334,10 @@
font: bold 18px 'Lucida Console', Monaco, monospace; font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px; text-indent: 1px;
} }
.leaflet-control-zoom-out {
font-size: 20px;
}
.leaflet-touch .leaflet-control-zoom-in { .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px; font-size: 22px;
} }
.leaflet-touch .leaflet-control-zoom-out {
font-size: 24px;
}
/* layers control */ /* layers control */
@ -345,6 +375,7 @@
} }
.leaflet-control-layers-scrollbar { .leaflet-control-layers-scrollbar {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px; padding-right: 5px;
} }
.leaflet-control-layers-selector { .leaflet-control-layers-selector {
@ -361,6 +392,11 @@
margin: 5px -10px 5px -6px; margin: 5px -10px 5px -6px;
} }
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */ /* attribution and scale controls */
@ -430,6 +466,7 @@
.leaflet-popup { .leaflet-popup {
position: absolute; position: absolute;
text-align: center; text-align: center;
margin-bottom: 20px;
} }
.leaflet-popup-content-wrapper { .leaflet-popup-content-wrapper {
padding: 1px; padding: 1px;
@ -444,11 +481,13 @@
margin: 18px 0; margin: 18px 0;
} }
.leaflet-popup-tip-container { .leaflet-popup-tip-container {
margin: 0 auto;
width: 40px; width: 40px;
height: 20px; height: 20px;
position: relative; position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden; overflow: hidden;
pointer-events: none;
} }
.leaflet-popup-tip { .leaflet-popup-tip {
width: 17px; width: 17px;
@ -460,7 +499,6 @@
-webkit-transform: rotate(45deg); -webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg); -moz-transform: rotate(45deg);
-ms-transform: rotate(45deg); -ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg); transform: rotate(45deg);
} }
.leaflet-popup-content-wrapper, .leaflet-popup-content-wrapper,
@ -521,3 +559,82 @@
background: #fff; background: #fff;
border: 1px solid #666; border: 1px solid #666;
} }
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

View file

@ -18,11 +18,12 @@ html, body {
.leaflet-popup-content-wrapper { .leaflet-popup-content-wrapper {
width: 600px; width: 600px;
max-height: 400px; max-height: 400px;
overflow-y:auto overflow-y: auto;
overflow-wrap: anywhere;
} }
.leaflet-popup-content { .leaflet-popup-content {
width:auto !important; width: auto !important;
} }
a img { a img {
@ -35,12 +36,20 @@ h4 {
margin-bottom: 5px; margin-bottom: 5px;
} }
.location, .period {
margin-bottom: 3px;
}
table { table {
padding-bottom: 10px; padding-bottom: 10px;
border-spacing: 0; border-spacing: 0;
width: 100% width: 100%
} }
td {
white-space: pre-line;
}
.desktop tr td { .desktop tr td {
padding-right: 5px; padding-right: 5px;
width: 75; width: 75;
@ -61,14 +70,35 @@ table {
font: 14px/16px Arial, Helvetica, sans-serif; font: 14px/16px Arial, Helvetica, sans-serif;
background: white; background: white;
background: rgba(255,255,255,0.0); background: rgba(255,255,255,0.0);
text-align: right;
} }
#zeus { .author-icon {
padding-left: 10px; margin-left: 10px;
} }
#GSR { .share {
float: right; background-color: rgba(255, 255, 255, 0.7);
padding-right: 5px;
margin-left: 10px;
}
.share img {
vertical-align: middle;
margin-left: -10px;
}
.share a {
text-decoration: none;
}
.share a:hover {
text-decoration: underline;
}
a.img-and-text-link:hover {
text-decoration: none;
}
a.img-and-text-link:hover span {
text-decoration: underline;
} }
.legend { .legend {
@ -119,18 +149,14 @@ table {
width: 213px; width: 213px;
} }
h3, .text { .location, .period {
max-width: 150px; margin-bottom: 8px;
} }
} }
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
.info { .author-icon {
max-width: 90px;s display: block;
}
#zeus {
width: 75px;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
src/img/Andere.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3 KiB

61
src/img/facebook.svg Normal file
View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="20"
height="20"
version="1.1"
id="svg8"
sodipodi:docname="facebook.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1043"
id="namedview10"
showgrid="false"
inkscape:zoom="22.627417"
inkscape:cx="9.2776978"
inkscape:cy="-0.76716337"
inkscape:window-x="0"
inkscape:window-y="37"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<path
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:18.33872604;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
d="M 11.571808,19.876973 C 11.059776,19.957939 10.534798,20 10,20 9.470853,20 8.9513195,19.958841 8.4444262,19.879533 -16.009211,-2.1035465 38.618255,-2.3039341 11.571808,19.877009 Z"
id="path821"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscc" />
<path
d="M 20,10.001126 C 20,4.4780969 15.522407,0 10,0 4.4775931,0 0,4.4780969 0,10.001126 c 0,4.991368 3.6563075,9.129087 8.4376465,9.880155 V 12.892716 H 5.8978981 v -2.89159 H 8.4376465 V 7.7971424 c 0,-2.5061407 1.4934564,-3.8916303 3.7772645,-3.8916303 1.094081,0 2.238707,0.195555 2.238707,0.195555 v 2.4612498 h -1.26142 c -1.241735,0 -1.629862,0.7707181 -1.629862,1.5625655 v 1.8762246 h 2.773191 l -0.442965,2.891591 h -2.330281 v 6.988565 c 4.781339,-0.749661 8.437647,-4.887345 8.437647,-9.880336"
id="path4"
style="fill:#1877f2;fill-opacity:1;stroke-width:1.80274773"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="nl">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Bloklocaties in Vlaanderen</title> <title>Bloklocaties in Vlaanderen</title>
<meta name="apple-itunes-app" content="app-id=602640924"> <meta name="apple-itunes-app" content="app-id=602640924">
<meta name="google-play-app" content="app-id=be.ugent.zeus.hydra"> <meta name="google-play-app" content="app-id=be.ugent.zeus.hydra">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta property="og:site_name" content="Zeus WPI"> <meta property="og:site_name" content="Zeus WPI">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
@ -20,23 +20,24 @@
<meta name="twitter:description" content="Heb je nood aan een plek om te blokken? Zeus en de Gentse Studentenraad maakten een overzicht van alle beschikbare bloklocaties op één kaart."> <meta name="twitter:description" content="Heb je nood aan een plek om te blokken? Zeus en de Gentse Studentenraad maakten een overzicht van alle beschikbare bloklocaties op één kaart.">
<meta name="twitter:image" content="https://blok.ugent.be/img/share_square.png"> <meta name="twitter:image" content="https://blok.ugent.be/img/share_square.png">
<link rel="stylesheet" href="css/leaflet.css" /> <link rel="stylesheet" href="css/leaflet-1.6.0.css">
<link rel="stylesheet" href="css/map.css" /> <link rel="stylesheet" href="css/map.css">
<script type="text/javascript" src="js/leaflet.js"></script> <script type="text/javascript" src="js/leaflet-1.6.0.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script> <script type="text/javascript" src="js/handlebars-2.0.0.js"></script>
<script type="text/javascript" src="js/map.js"></script> <script type="text/javascript" src="js/map.js"></script>
</head> </head>
<body> <body>
<div id="map"></div> <div id="map"></div>
<script id="popup-template" type="text/x-handlebars-template"> <script id="popup-template" type="text/x-handlebars-template">
<div id="resto-popup"> <div id="resto-popup">
<h3>{{name}} ({{capacity}} pl.)</h3> <h3>{{name}} ({{capacity}} pl.)</h3>
<img src="img/{{type}}.png" class="type"> <img src="img/{{type}}.png" class="type">
<div class="text">Locatie: {{address}}<br /> <div class="location">Locatie: {{address}}</div>
{{#if period.start}} <div class="period">{{#if period.start}}
Van {{period.start}} tot {{period.end}} Periode: {{date period.start}} tot {{date period.end}}
{{else}} {{else}}
Open gedurende het hele jaar. Open gedurende het hele jaar.
{{/if}} {{/if}}
@ -51,56 +52,56 @@
<td>Vrijdag</td> <td>Vrijdag</td>
<td>Zaterdag</td> <td>Zaterdag</td>
<td>Zondag</td> <td>Zondag</td>
</tr> </tr><tr>
<tr> <td>{{#if hours.monday}}{{hours.monday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.monday}}{{{hours.monday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.tuesday}}{{hours.tuesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.tuesday}}{{{hours.tuesday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.wednesday}}{{hours.wednesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.wednesday}}{{{hours.wednesday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.thursday}}{{hours.thursday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.thursday}}{{{hours.thursday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.friday}}{{hours.friday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.friday}}{{{hours.friday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.saturday}}{{hours.saturday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.saturday}}{{{hours.saturday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.sunday}}{{{hours.sunday}}}{{else}}Gesloten{{/if}}</td>
</tr> </tr>
</table> </table>
<table class="mobile"> <table class="mobile">
<tr> <tr>
<td>Maandag</td> <td>Maandag</td>
<td>{{#if hours.monday}}{{{hours.monday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.monday}}{{hours.monday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr><tr>
<tr>
<td>Dinsdag</td> <td>Dinsdag</td>
<td>{{#if hours.tuesday}}{{{hours.tuesday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.tuesday}}{{hours.tuesday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr><tr>
<tr>
<td>Woensdag</td> <td>Woensdag</td>
<td>{{#if hours.wednesday}}{{{hours.wednesday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.wednesday}}{{hours.wednesday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr><tr>
<tr>
<td>Donderdag</td> <td>Donderdag</td>
<td>{{#if hours.thursday}}{{{hours.thursday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.thursday}}{{hours.thursday}}{{else}}Gesloten{{/if}}</td>
</tr><tr> </tr><tr>
<td>Vrijdag</td> <td>Vrijdag</td>
<td>{{#if hours.friday}}{{{hours.friday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.friday}}{{hours.friday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr><tr>
<tr>
<td>Zaterdag</td> <td>Zaterdag</td>
<td>{{#if hours.saturday}}{{{hours.saturday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.saturday}}{{hours.saturday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr><tr>
<tr>
<td>Zondag</td> <td>Zondag</td>
<td>{{#if hours.sunday}}{{{hours.sunday}}}{{else}}Gesloten{{/if}}</td> <td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
</tr> </tr>
</table> </table>
{{#if extra}}{{{extra}}}{{/if}} {{#if extra}}{{{extra}}}{{/if}}
</div> </div>
</script> </script>
<script id="info-template" type="text/x-handlebars-template"> <script id="info-template" type="text/x-handlebars-template">
<a href="http://zeus.ugent.be/"><img id="zeus" src="img/zeus.png"></a> <a href="https://zeus.gent/" class="author-icon"><img src="img/zeus.png" alt="Zeus WPI"></a>
<a href="https://gentsestudentenraad.be/"><img id="GSR" src="img/GSR.png"></a> <a href="https://gentsestudentenraad.be/" class="author-icon"><img src="img/GSR.png" alt="Gentse Studentenraad"></a>
</script> </script>
<script id="share-template" type="text/x-handlebars-template"> <script id="share-template" type="text/x-handlebars-template">
<div class="fb-share-button" data-href="//blok.ugent.be" data-layout="button_count"></div> <div class="share">
<a href="https://www.facebook.com/Blokmap-Vlaanderen-105861927804347/" class="img-and-text-link"><img src="img/facebook.svg" alt=""> <span>Facebookpagina</span></a> |
<a href="https://docs.google.com/forms/d/e/1FAIpQLSeLlxXAr932j4SA-JUweKZYl-1mbx8wY-JCuBJ39xAYrDPo_A/viewform">Locatie melden</a>
</div>
</script> </script>
<script id="legend-template" type="text/x-handlebars-template"> <script id="legend-template" type="text/x-handlebars-template">
<div style="padding-top: 5px;"> <div style="padding-top: 5px;">
<div style="width: 125px; height: 18px; padding-top: 5px; padding-left: 5px;"> <div style="width: 125px; height: 18px; padding-top: 5px; padding-left: 5px;">
@ -118,25 +119,15 @@
</div> </div>
</script> </script>
<!-- Facebook SDK -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=146947948791011&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Google Analytics SDK --> <!-- Google Analytics SDK -->
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
ga('create', 'UA-25444917-8', 'auto');
ga('send', 'pageview');
ga("create", "UA-25444917-8", "auto");
ga("send", "pageview");
</script> </script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

4
src/js/jquery-1.11.0.js vendored Normal file

File diff suppressed because one or more lines are too long

5
src/js/leaflet-1.6.0.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,23 +1,27 @@
$(document).ready(function() { $(document).ready(function() {
/* change image path */ L.Icon.Default.imagePath = "img/";
L.Icon.Default.imagePath = 'img';
var popuptemplate = Handlebars.compile($("#popup-template").html());
var popuptemplate = Handlebars.compile($('#popup-template').html());
var RedIcon = L.Icon.Default.extend({ var RedIcon = L.Icon.Default.extend({
options: { options: {
iconUrl: 'img/red-marker.png' iconUrl: "red-marker.png"
} }
}); });
var ChristmasIcon = L.Icon.Default.extend({ var ChristmasIcon = L.Icon.Default.extend({
options: { options: {
iconUrl: 'img/christmas-marker.png' iconUrl: "christmas-marker.png"
} }
}); });
var blueIcon = new L.Icon.Default();
var redIcon = new RedIcon(); var redIcon = new RedIcon();
var BlueIcon = L.Icon.Default.extend({});
var blueIcon = new BlueIcon();
var christmasIcon = new ChristmasIcon(); var christmasIcon = new ChristmasIcon();
var christmasHoliday = Date.now() < new Date("2016-01-04").getTime();
var now = new Date();
var christmasSeason =
now.getTime() > new Date(now.getFullYear() + "-12-20").getTime() ||
now.getTime() < new Date(now.getFullYear() + "-01-04").getTime();
function onEachFeature(feature, layer) { function onEachFeature(feature, layer) {
if (feature.properties) { if (feature.properties) {
@ -28,25 +32,24 @@ $(document).ready(function() {
} }
function pointToLayer(feature, latlng) { function pointToLayer(feature, latlng) {
var marker = new HoverMarker(latlng, { icon: redIcon, riseOnHover: true}); var icon = redIcon;
if (feature.properties) { if (feature.properties) {
if (feature.properties.holidays && christmasHoliday) { if (feature.properties.holidays && christmasSeason) {
var marker = new HoverMarker(latlng, { icon: christmasIcon, riseOnHover: true}); icon = christmasIcon;
} } else if (!feature.properties.hours.saturday && !feature.properties.hours.sunday) {
if (!feature.properties.hours.saturday && !feature.properties.hours.sunday) { icon = blueIcon;
var marker = new HoverMarker(latlng, { icon: blueIcon, riseOnHover: true});
} }
} }
return marker return new HoverMarker(latlng, { icon: icon, riseOnHover: true});
} }
var map = L.map('map').setView([50.702, 4.335], 9); var map = L.map("map").setView([50.702, 4.335], 9);
var osm = L.tileLayer('https://{s}.tiles.mapbox.com/v3/feliciaan.keoaj8d5/{z}/{x}/{y}{r}.png', { var osm = L.tileLayer("https://{s}.tiles.mapbox.com/v3/feliciaan.keoaj8d5/{z}/{x}/{y}{r}.png", {
attribution: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> | © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-contributors | Made with ❤ by <a href="https://zeus.ugent.be">Zeus WPI</a>', attribution: 'Achtergrondkaart © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-bijdragers (data) en © <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> (stijl) | <span lang="en">Made with ❤ by <a href="https://zeus.gent/">Zeus WPI</a></span>',
detectRetina: true detectRetina: true
}).addTo(map); }).addTo(map);
$.getJSON('https://blokdata.zeus.gent/data.json') $.getJSON("https://blokdata.zeus.gent/data.json")
.done(function(data) { .done(function(data) {
var geojson = L.geoJson(data, { var geojson = L.geoJson(data, {
onEachFeature: onEachFeature, onEachFeature: onEachFeature,
@ -63,65 +66,55 @@ $(document).ready(function() {
}, },
onAdd: function (map) { onAdd: function (map) {
this._div = L.DomUtil.create('div', this.divClass); this._div = L.DomUtil.create("div", this.divClass);
this._div.innerHTML = this.template(); this._div.innerHTML = this.template();
return this._div; return this._div;
} }
}); });
// code copied from http://jsfiddle.net/sowelie/3JbNY/ // code copied from http://jsfiddle.net/sowelie/3JbNY/
var HoverMarker = L.Marker.extend({ var HoverMarker = L.Marker.extend({
bindPopup: function(htmlContent, options) { bindPopup: function(htmlContent, options) {
if (options && options.showOnMouseOver) { if (options && options.showOnMouseOver) {
// call the super method
L.Marker.prototype.bindPopup.apply(this, [htmlContent, options]); L.Marker.prototype.bindPopup.apply(this, [htmlContent, options]);
// unbind the click event
this.off("click", this.openPopup, this); this.off("click", this.openPopup, this);
// bind to mouse over
this.on("mouseover", function(e) { this.on("mouseover", function(e) {
// get the element that the mouse hovered onto // get the element that the mouse hovered onto
var target = e.originalEvent.fromElement || e.originalEvent.relatedTarget; var target = e.originalEvent.fromElement || e.originalEvent.relatedTarget;
var parent = this._getParent(target, "leaflet-popup"); var ancestor = this._findAncestorWithClass(target, "leaflet-popup");
// check to see if the element is a popup, and if it is this marker's popup // check to see if the element is a popup, and if it is this marker's popup
if (parent == this._popup._container) if (ancestor && ancestor === this._popup._container)
return true; return true;
// show the popup
this.openPopup(); this.openPopup();
}, this); }, this);
// and mouse out
this.on("mouseout", function(e) { this.on("mouseout", function(e) {
// get the element that the mouse hovered onto // get the element that the mouse hovered onto
var target = e.originalEvent.toElement || e.originalEvent.relatedTarget; var target = e.originalEvent.toElement || e.originalEvent.relatedTarget;
// check to see if the element is a popup // check to see if the element is a popup
if (this._getParent(target, "leaflet-popup")) { if (this._findAncestorWithClass(target, "leaflet-popup")) {
L.DomEvent.on(this._popup._container, "mouseout", this._popupMouseOut, this); L.DomEvent.on(this._popup._container, "mouseout", this._popupMouseOut, this);
return true; return true;
} }
// hide the popup
this.closePopup(); this.closePopup();
}, this); }, this);
} }
}, },
_popupMouseOut: function(e) { _popupMouseOut: function(e) {
// detach the event // detach the event
L.DomEvent.off(this._popup, "mouseout", this._popupMouseOut, this); L.DomEvent.off(this._popup, "mouseout", this._popupMouseOut, this);
@ -129,45 +122,41 @@ $(document).ready(function() {
var target = e.toElement || e.relatedTarget; var target = e.toElement || e.relatedTarget;
// check to see if the element is a popup // check to see if the element is a popup
if (this._getParent(target, "leaflet-popup")) if (this._findAncestorWithClass(target, "leaflet-popup"))
return true; return true;
// check to see if the marker was hovered back onto // check to see if the marker was hovered back onto
if (target == this._icon) if (target === this._icon)
return true; return true;
// hide the popup
this.closePopup(); this.closePopup();
}, },
_getParent: function(element, className) { _findAncestorWithClass: function(element, className) {
while (element) {
var parent = element.parentNode; if (element.className && L.DomUtil.hasClass(element, className))
return element;
while (parent != null) { element = element.parentNode;
if (parent.className && L.DomUtil.hasClass(parent, className))
return parent;
parent = parent.parentNode;
} }
return false; return null;
} }
}); });
var info = new SimpleControl('#info-template', 'info', { var info = new SimpleControl("#info-template", "info", {
position: 'topright' position: "topright"
}).addTo(map); }).addTo(map);
var sharePane = new SimpleControl('#share-template', 'info', { var sharePane = new SimpleControl("#share-template", "info", {
position: 'bottomleft' position: "bottomleft"
}).addTo(map); }).addTo(map);
var legend = new SimpleControl('#legend-template', christmasHoliday ? "holiday-legend" : "legend", { var legend = new SimpleControl("#legend-template", christmasSeason ? "holiday-legend" : "legend", {
position: 'bottomright' position: "bottomright"
}).addTo(map); }).addTo(map);
Handlebars.registerHelper("date", function (ddmyyyy) {
return ddmyyyy.replace(/-/g, "/");
})
}); });