summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-04-08 12:57:25 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-04-08 12:57:25 +0200
commit330c4374f6e1824c265fb77ec3ae4e34c297bf85 (patch)
treec90921645798c721755b3f7492b234f7a899472e /js
parente646e25937bfdcc2c72f458569be966b3e06f530 (diff)
downloadsite-330c4374f6e1824c265fb77ec3ae4e34c297bf85.tar.gz
Remove spaces from URLs (improve slugs)
Diffstat (limited to 'js')
-rw-r--r--js/campus-coords.js6
-rw-r--r--js/campus.js4
-rw-r--r--js/sitemap.js2
3 files changed, 8 insertions, 4 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');