diff --git a/WebContent/base/osrm/OSRM.Marker.js b/WebContent/base/osrm/OSRM.Marker.js index 7b6d402e7..8f2185f3e 100644 --- a/WebContent/base/osrm/OSRM.Marker.js +++ b/WebContent/base/osrm/OSRM.Marker.js @@ -99,6 +99,7 @@ onDrag: function(e) { OSRM.Geocoder.updateLocation( this.parent.label ); }, onDragStart: function(e) { + OSRM.GUI.clear_timeout(0); OSRM.G.dragging = true; this.switchIcon(this.options.dragicon); diff --git a/WebContent/gui/OSRM.Timers.js b/WebContent/gui/OSRM.Timers.js new file mode 100644 index 000000000..b0c54a83d --- /dev/null +++ b/WebContent/gui/OSRM.Timers.js @@ -0,0 +1,56 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM Timers +// [handles notification timers] + + +OSRM.GUI.extend( { + +// notifications +notifications: [ + { time:30000, + header: "[Tooltip] Clicking and Dragging", + body: "You can simply click on the map to set source and target markers. " + + "Then you can continue and drag the markers over the map or create. " + + "

" + + "You can even create additional markers by dragging them off of the main route." + + "Markers can be simply deleted by clicking on them." + } +], + +// init +init: function() { + // init variables + var notifications = OSRM.GUI.notifications; + OSRM.G.notification_timers = new Array( notifications.length ); + + // init timers + for( var i=0, iEnd=notifications.length; i + diff --git a/WebContent/main.js b/WebContent/main.js index 2dd7465ba..7267f8ac3 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -270,14 +270,27 @@ OSRM.parseParameters = function(){ // check whether to activate maintenance mode OSRM.inMaintenance = function(){ if( OSRM.DEFAULTS.MAINTENANCE == true ) { - document.getElementById('notification-blanket').style.display = "block"; - document.getElementById('notification-label').innerHTML = OSRM.DEFAULTS.MAINTENANCE_HEADER; - document.getElementById('notification-box').innerHTML = OSRM.DEFAULTS.MAINTENANCE_TEXT; - document.getElementById('notification-toggle').style.display = "none"; + OSRM.notify( OSRM.DEFAULTS.MAINTENANCE_HEADER, OSRM.DEFAULTS.MAINTENANCE_TEXT, false); return true; } return false; }; + +//general notification box +OSRM.notify = function( header, text, closable ){ + document.getElementById('notification-blanket').style.display = "block"; + document.getElementById('notification-label').innerHTML = header; + document.getElementById('notification-box').innerHTML = text; + if( closable ) + document.getElementById('notification-toggle').onclick = OSRM.denotify; + else + document.getElementById('notification-toggle').style.display = "none"; +}, +OSRM.denotify = function() { + document.getElementById('notification-blanket').style.display = "none"; +}; + + // onload event OSRM.Browser.onLoadHandler( OSRM.init ); \ No newline at end of file