From 0bc3e098ac79150629f5066db6a59c018cf844bb Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 13 Mar 2012 14:15:07 +0100 Subject: [PATCH] added GUI support for IE9 and IE10, changed GUI legal text, changed via-node deletion to click only, moved default entries for input boxes to config file, made input boxes selectable again --- WebContent/OSRM.Browser.js | 2 +- WebContent/OSRM.GUI.js | 7 ++++--- WebContent/OSRM.Localization.js | 4 ++-- WebContent/OSRM.Markers.js | 4 ++-- WebContent/OSRM.config.js | 6 ++++-- WebContent/main.css | 13 ++++++++++++- WebContent/main.html | 4 ++-- WebContent/main.js | 7 +++++-- 8 files changed, 32 insertions(+), 15 deletions(-) diff --git a/WebContent/OSRM.Browser.js b/WebContent/OSRM.Browser.js index 73a945a0c..7ecc0afbe 100644 --- a/WebContent/OSRM.Browser.js +++ b/WebContent/OSRM.Browser.js @@ -6,7 +6,7 @@ OSRM.Browser = { FF3: useragent.search(/Firefox\/3/), - IE6_8: useragent.search(/MSIE (6|7|8)/), + IE6_9: useragent.search(/MSIE (6|7|8|9)/), }; }()); diff --git a/WebContent/OSRM.GUI.js b/WebContent/OSRM.GUI.js index ea78c6a81..4c81fafd3 100644 --- a/WebContent/OSRM.GUI.js +++ b/WebContent/OSRM.GUI.js @@ -13,7 +13,7 @@ toggleMain: function() { document.getElementById('blob-wrapper').style.visibility="hidden"; document.getElementById('main-wrapper').style.left="5px"; - if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_8!=-1 ) { + if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) { getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; } // hide main-gui @@ -23,17 +23,18 @@ toggleMain: function() { getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px"; document.getElementById('main-wrapper').style.left="-410px"; - if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_8!=-1 ) { + if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) { document.getElementById('blob-wrapper').style.visibility="visible"; getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; } } // execute after animation - if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_8==-1 ) { + if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_9==-1 ) { document.getElementById('main-wrapper').addEventListener("transitionend", OSRM.GUI.onMainTransitionEnd, false); document.getElementById('main-wrapper').addEventListener("webkitTransitionEnd", OSRM.GUI.onMainTransitionEnd, false); document.getElementById('main-wrapper').addEventListener("oTransitionEnd", OSRM.GUI.onMainTransitionEnd, false); + document.getElementById('main-wrapper').addEventListener("MSTransitionEnd", OSRM.GUI.onMainTransitionEnd, false); } }, diff --git a/WebContent/OSRM.Localization.js b/WebContent/OSRM.Localization.js index acb27ca41..0c0e49135 100644 --- a/WebContent/OSRM.Localization.js +++ b/WebContent/OSRM.Localization.js @@ -26,7 +26,7 @@ OSRM.Localization["de"] = { "GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Stra�en hervorheben", "GUI_START_TOOLTIP": "Startposition eingeben", "GUI_END_TOOLTIP": "Zielposition eingeben", -"GUI_LEGAL_NOTICE": "GUI von Dennis Schieferdecker", +"GUI_LEGAL_NOTICE": "GUI2 v0.1 120313 - OSRM hosting by KIT - Geocoder by MapQuest", // geocoder "SEARCH_RESULTS": "Suchergebnisse", "TIMED_OUT": "Zeit�berschreitung", @@ -55,7 +55,7 @@ OSRM.Localization["en"] = { "GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", "GUI_START_TOOLTIP": "Enter start", "GUI_END_TOOLTIP": "Enter destination", -"GUI_LEGAL_NOTICE": "GUI by Dennis Schieferdecker", +"GUI_LEGAL_NOTICE": "GUI2 v0.1 120313 - OSRM hosting by KIT - Geocoder by MapQuest", // geocoder "SEARCH_RESULTS": "Search Results", "TIMED_OUT": "Timed Out", diff --git a/WebContent/OSRM.Markers.js b/WebContent/OSRM.Markers.js index 7ce45f9d9..72191ffb9 100644 --- a/WebContent/OSRM.Markers.js +++ b/WebContent/OSRM.Markers.js @@ -74,8 +74,8 @@ OSRM.RouteMarker = function ( label, style, position ) { OSRM.inheritFrom( OSRM.RouteMarker, OSRM.Marker ); OSRM.extend( OSRM.RouteMarker, { onClick: function(e) { - if(!e.ctrlKey) - return; +// if(!e.ctrlKey) +// return; for( var i=0; i Start: - + Suchen Ende: - + Suchen diff --git a/WebContent/main.js b/WebContent/main.js index dbb357ee5..6a06aaa22 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -57,7 +57,10 @@ function initLocale() { document.getElementById("gui-search-target-label").innerHTML = OSRM.loc("GUI_END")+":"; document.getElementById("input-source-name").title = OSRM.loc("GUI_START_TOOLTIP"); document.getElementById("input-target-name").title = OSRM.loc("GUI_END_TOOLTIP"); - document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); + document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); + + document.getElementById('input-source-name').value = OSRM.DEFAULTS.ONLOAD_SOURCE; + document.getElementById('input-target-name').value = OSRM.DEFAULTS.ONLOAD_TARGET; } @@ -116,7 +119,7 @@ function initMap() { getElementsByClassName(document,'leaflet-control-zoom')[0].style.left="420px"; getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px"; - map.setView( new L.LatLng( OSRM.DEFAULTS.START_LATITUDE, OSRM.DEFAULTS.START_LONGITUDE-0.02), OSRM.DEFAULTS.ZOOM_LEVEL); + map.setView( new L.LatLng( OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE-0.02), OSRM.DEFAULTS.ZOOM_LEVEL); map.on('zoomend', function(e) { getRoute(OSRM.FULL_DESCRIPTION); }); // onmousemove test