Skip to content
Snippets Groups Projects
Commit 43680e04 authored by Kevin Abel's avatar Kevin Abel
Browse files

* Moved some CSS to the .css file

* Fixed the jitter when hovering over a building LI
* Updated the Max/Min UI
* Fixed the hashchange listener and added a scrollTo top when a building LI is clicked.
parent ca72ba10
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name> <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments> <arguments>
...@@ -18,5 +23,6 @@ ...@@ -18,5 +23,6 @@
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.php.core.PHPNature</nature> <nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>
...@@ -274,6 +274,26 @@ ...@@ -274,6 +274,26 @@
outline:2px solid #828282; outline:2px solid #828282;
} }
/* Max UI
************************/
div.google-ctl {
background-color: #fff;
cursor: pointer;
border:1px solid #bbb;
margin: 7px 0 0 23px;
padding: 0 4px;
font-family: Arial, san-serif;
font-size: 12px;
font-weight: bold;
color: #6688cc;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
box-shadow: 2px 2px 1px #888888;
-moz-box-shadow: 2px 2px 1px #888888;
-webkit-box-shadow: 2px 2px 1px #888888;
}
/* Point List /* Point List
************************/ ************************/
...@@ -292,8 +312,7 @@ ...@@ -292,8 +312,7 @@
#pointlist li:hover a span.buildingCode { #pointlist li:hover a span.buildingCode {
background:#093f81; background:#093f81;
color:#fff; color:#fff;
border:0; border-color:#093f81;
margin-right:2px;
} }
/* Info Window /* Info Window
......
...@@ -64,11 +64,6 @@ UNLTourMap = new function() { ...@@ -64,11 +64,6 @@ UNLTourMap = new function() {
UNLTourMap.openBuildingInfo(code); UNLTourMap.openBuildingInfo(code);
} }
}); });
$(".buildings a:not(.external)").click(function(e){
e.preventDefault();
window.location.hash = $(this).attr('href'); //this.href returns the whole URL
});
}; };
this.setUpGoogleMap = function() { this.setUpGoogleMap = function() {
...@@ -111,8 +106,7 @@ UNLTourMap = new function() { ...@@ -111,8 +106,7 @@ UNLTourMap = new function() {
}); });
// Setup the Maximize button and add to navigation controls // Setup the Maximize button and add to navigation controls
var fullViewportControlDiv = document.createElement('DIV'); var fullViewportControlDiv = this.fullViewportControl();
var fullViewportControl = new this.fullViewportControl(fullViewportControlDiv);
fullViewportControlDiv.index = 1; fullViewportControlDiv.index = 1;
map.controls[google.maps.ControlPosition.LEFT].push(fullViewportControlDiv); map.controls[google.maps.ControlPosition.LEFT].push(fullViewportControlDiv);
}; };
...@@ -135,48 +129,48 @@ UNLTourMap = new function() { ...@@ -135,48 +129,48 @@ UNLTourMap = new function() {
return div; return div;
}; };
this.fullViewportControl = function(controlDiv) { this.fullViewportControl = function() {
// Set CSS styles for the DIV containing the control var minText = 'Min -';
controlDiv.style.padding = '7px 0 0 23px'; var maxText = 'Max +';
var maxTitle = 'Click to maximize in your browser window';
// Set CSS for the control border var minTitle = 'Click to return to normal size';
var controlUI = document.createElement('DIV');
controlUI.style.backgroundColor = 'white'; var controlDiv = $('<div class="google-ctl" />');
controlUI.style.borderStyle = 'solid';
controlUI.style.borderWidth = '1px'; var toggleMaxUI = function(full) {
controlUI.style.borderColor = '#BBBBBB'; controlDiv.text(full ? minText : maxText);
controlUI.style.borderRadius = '6px'; controlDiv.attr('title', full ? minTitle : maxTitle);
controlUI.style.cursor = 'pointer'; };
controlUI.style.textAlign = 'center';
controlUI.style.boxShadow = '2px 2px 1px #888888';
controlUI.title = 'Click to maximize in your browser window';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior
var controlText = document.createElement('DIV');
controlText.style.fontFamily = 'Arial,sans-serif';
controlText.style.fontSize = '12px';
controlText.style.fontWeight = 'bold';
controlText.style.color = '#6688CC';
controlText.style.paddingLeft = '4px';
controlText.style.paddingRight = '4px';
controlText.innerHTML = 'Max +';
controlUI.appendChild(controlText);
var fullScreen = false; var fullScreen = false;
google.maps.event.addDomListener(controlUI, 'click', function() { toggleMaxUI(fullScreen);
var zenbox = $('#map_canvas').parent();
var oldWidth = zenbox.css('width');
var oldHeight =zenbox.css('height');
controlDiv.click(function() {
if (!fullScreen) { if (!fullScreen) {
$("#map_canvas").css({'position':'fixed','top':'0','left':'0','z-index':'125'}); $("#map_canvas").css({'position':'fixed','top':'0','left':'0','z-index':'125'});
$("#mapLegend").css({'position':'fixed','z-index':'150'}); $("#mapLegend").css({'position':'fixed','z-index':'150'});
zenbox.css({width: 0, height: 0});
$("#mapnav, #mapExternalActions").hide();
controlDiv.text(minText);
google.maps.event.trigger(map,'resize'); google.maps.event.trigger(map,'resize');
fullScreen = true; fullScreen = true;
toggleMaxUI(fullScreen);
} else { } else {
$("#map_canvas").css({'position':'relative','z-index':'1'}); $("#map_canvas").css({'position':'relative','z-index':'1'});
$("#mapLegend").css({'position':'absolute','z-index':'1'}); $("#mapLegend").css({'position':'absolute','z-index':'1'});
zenbox.css({width: oldWidth, height: oldHeight});
$("#mapnav, #mapExternalActions").show();
controlDiv.text(maxText);
google.maps.event.trigger(map,'resize'); google.maps.event.trigger(map,'resize');
fullScreen = false; fullScreen = false;
toggleMaxUI(fullScreen);
} }
}); });
return controlDiv[0];
}; };
this.defaultMarkers = function() { this.defaultMarkers = function() {
...@@ -188,7 +182,6 @@ UNLTourMap = new function() { ...@@ -188,7 +182,6 @@ UNLTourMap = new function() {
for (var code in markerData['buildings']) { for (var code in markerData['buildings']) {
UNLTourMap.addLocation(markerData['buildings'][code], 'buildings'); UNLTourMap.addLocation(markerData['buildings'][code], 'buildings');
} }
$(window).trigger('hashchange');
<?php <?php
if ($context->getRawObject() instanceof UNL_TourMap_GoogleMap_DynamicCenter) { if ($context->getRawObject() instanceof UNL_TourMap_GoogleMap_DynamicCenter) {
echo 'UNLTourMap.openBuildingInfo("'.$context->options['code'].'");'; echo 'UNLTourMap.openBuildingInfo("'.$context->options['code'].'");';
...@@ -271,8 +264,8 @@ UNLTourMap = new function() { ...@@ -271,8 +264,8 @@ UNLTourMap = new function() {
}); });
$('a[href$="/'+loc.code+'"]').live('click', function(e){ $('a[href$="/'+loc.code+'"]').live('click', function(e){
showinfo(); $('html').animate({scrollTop: $('#titlegraphic').offset().top }, 400);
e.preventDefault(); window.location.hash = loc.code;
return false; return false;
}); });
...@@ -309,11 +302,11 @@ UNLTourMap = new function() { ...@@ -309,11 +302,11 @@ UNLTourMap = new function() {
WDN.jQuery(window).load(function($){ WDN.jQuery(window).load(function(e){
UNLTourMap.initialize(); UNLTourMap.initialize();
UNLTourMap.setUpMarkers('policestations'); UNLTourMap.setUpMarkers('policestations');
if (window.location.hash) { if (window.location.hash) {
$(window).trigger('hashchange'); WDN.jQuery(window).trigger('hashchange');
} }
}); });
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment