From 2cd1c682a24a2585336b744697c3e54e3804f1cb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 11 Apr 2014 00:10:58 +0100 Subject: Improvements to the room popup Reorder contents and features, and add content to contents and pictures. --- src/leaflet-soton.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 7f84154..f1a3fe9 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -811,13 +811,13 @@ SELECT * WHERE {\ var tabs = [ { - id: 'features', - name: 'Features', + id: 'contents', + name: 'Contents', active: true }, { - id: 'contents', - name: 'Contents', + id: 'features', + name: 'Features', }, { id: 'bookings', @@ -832,7 +832,7 @@ SELECT * WHERE {\ if ('contents' in properties) { properties.contents.forEach(function(feature) { - createBlankLink(feature.feature, feature.label, tabs.features); + createBlankLink(feature.feature, feature.label, tabs.contents); if (feature.subject === "http://id.southampton.ac.uk/point-of-interest-category/iSolutions-Workstations") { var content = '' + feature.label + ''; @@ -848,9 +848,66 @@ SELECT * WHERE {\ }); } + if ('features' in properties) { + var featureList = document.createElement("ul"); + + properties.features.forEach(function(feature) { + var featureLi = document.createElement("li"); + + createBlankLink(feature.feature, feature.label, featureLi); + + featureList.appendChild(featureLi); + }); + + tabs.features.appendChild(featureList); + } + if ('images' in properties) { properties.images.forEach(function(image) { + var versions = image.versions; + var url, + imageWidth, + imageHeight; + + for (var i=0; i