diff options
-rw-r--r-- | js/campus-coords.js | 6 | ||||
-rw-r--r-- | js/campus.js | 4 | ||||
-rw-r--r-- | js/sitemap.js | 2 | ||||
-rw-r--r-- | pages/campus.html | 12 |
4 files changed, 14 insertions, 10 deletions
diff --git a/js/campus-coords.js b/js/campus-coords.js index 3654a56..fc0f3cc 100644 --- a/js/campus-coords.js +++ b/js/campus-coords.js @@ -1,6 +1,6 @@ define(function() { 'use strict'; - return [ + var buildings = [ { "name": "Students Sports Centre", "description": "Have you ever heard about bossaball, underwater hockey, canoepolo or kempo jitsu? Besides all educational optionalities on the campus, there’s also the <a href=\"\http://venus.tue.nl/sci-cgi/index.opl\"\>Student Sports Centre</a> (SSC) which offers an extensive variety of sports for you to try out and practice, all in order to keep the TU/e-students wholesome. With 70 kinds of sports, special courses, a broad range of facilities, doors that are open 7 days per week, qualified sports instructors, 38 student sports associations and over 11000 members, the SSC is among the largest student collectives in Eindhoven.", @@ -109,4 +109,8 @@ define(function() { ] } ]; + buildings.forEach(function(building) { + building.id = building.name.toLowerCase().replace(/ /g, '-'); + }); + return buildings; }); diff --git a/js/campus.js b/js/campus.js index 234e1b9..8d6846b 100644 --- a/js/campus.js +++ b/js/campus.js @@ -33,7 +33,7 @@ define(['campus-coords', 'd3'], function(coords, d3) { .enter() .append('a') .attr('xlink:href', function(d) { - return '#/campus/' + d.name; + return '#/campus/' + d.id; }) .append('polygon') .attr('class', 'building') @@ -53,7 +53,7 @@ define(['campus-coords', 'd3'], function(coords, d3) { var citems = document.getElementById('campus-items'); coords.forEach(function(building) { var header = document.createElement('h2'); - header.id = '/campus/' + building.name; + header.id = '/campus/' + building.id; header.textContent = building.name; citems.appendChild(header); diff --git a/js/sitemap.js b/js/sitemap.js index 65b05c8..e4c4e77 100644 --- a/js/sitemap.js +++ b/js/sitemap.js @@ -22,7 +22,7 @@ define(['courses', 'campus-coords'], function(courses, campus_coords) { var campus_links = add(links, 'Campus', 'campus'); campus_coords.forEach(function(building) { - add(campus_links, building.name, 'campus/' + building.name); + add(campus_links, building.name, 'campus/' + building.id); }); add(links, 'Career', 'career'); diff --git a/pages/campus.html b/pages/campus.html index b39d3d7..e319174 100644 --- a/pages/campus.html +++ b/pages/campus.html @@ -6,12 +6,12 @@ require(['campus'], function(main) { main(); }); <p> The successes of the Technical University of Eindhoven are built on its lively heart; meet the TU/e campus. Any location can be reached within five minutes by -<a href="#/campus/Bike Repair Shop">bicycle</a> while a <a href="#/campus/Bus -Stops">shuttle bus</a> travels between various locations on the campus and the -train station in the centre of Eindhoven. There are also enough <a -href="#/campus/Parking">parking possibilities</a> on the campus. Feel free to -explore the map below to gain knowledge about the multifunctionality of the -campus. +<a href="#/campus/bike-repair-shop">bicycle</a> while a <a +href="#/campus/bus-stops">shuttle bus</a> travels between various locations on +the campus and the train station in the centre of Eindhoven. There are also +enough <a href="#/campus/parking">parking possibilities</a> on the campus. Feel +free to explore the map below to gain knowledge about the multifunctionality of +the campus. </p> <div id="campus-map"></div> |