From c38c0b6f035965d1028277f104a82c716eb5647a Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 4 Jul 2012 09:00:11 +0100 Subject: [PATCH 01/10] added notifications --- WebContent/base/osrm/OSRM.Marker.js | 1 + WebContent/gui/OSRM.Timers.js | 56 +++++++++++++++++++++++++++++ WebContent/main.html | 1 + WebContent/main.js | 21 ++++++++--- 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 WebContent/gui/OSRM.Timers.js 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 From f385ea4e974d240025f4fbde5761010ef807700c Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 4 Jul 2012 12:36:43 +0100 Subject: [PATCH 02/10] modified notification markers, so that a trigger function can be named that will prevent the notification from happening --- WebContent/base/osrm/OSRM.Marker.js | 2 +- WebContent/gui/OSRM.Timers.js | 34 +++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/WebContent/base/osrm/OSRM.Marker.js b/WebContent/base/osrm/OSRM.Marker.js index 8f2185f3e..9ab1377c1 100644 --- a/WebContent/base/osrm/OSRM.Marker.js +++ b/WebContent/base/osrm/OSRM.Marker.js @@ -99,7 +99,7 @@ onDrag: function(e) { OSRM.Geocoder.updateLocation( this.parent.label ); }, onDragStart: function(e) { - OSRM.GUI.clear_timeout(0); + //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 index b0c54a83d..19224d06f 100644 --- a/WebContent/gui/OSRM.Timers.js +++ b/WebContent/gui/OSRM.Timers.js @@ -23,34 +23,50 @@ OSRM.GUI.extend( { // notifications notifications: [ - { time:30000, + { 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." + "Markers can be simply deleted by clicking on them.", + _class: "Routing", + _func: "getRoute_Dragging" } ], -// init +// initialize notification timers 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 Date: Wed, 4 Jul 2012 15:35:06 +0100 Subject: [PATCH 03/10] separated normal notifications from important notifications (that lock the screen) --- WebContent/gui/OSRM.Timers.js | 57 +++++++++++++++++--------- WebContent/images/down.png | Bin 0 -> 2902 bytes WebContent/images/down_active.png | Bin 0 -> 2919 bytes WebContent/images/down_hover.png | Bin 0 -> 2909 bytes WebContent/images/up.png | Bin 0 -> 2911 bytes WebContent/images/up_active.png | Bin 0 -> 2933 bytes WebContent/images/up_hover.png | Bin 0 -> 2924 bytes WebContent/main.css | 20 +++++++-- WebContent/main.html | 20 +++++++-- WebContent/main.js | 65 +++++++++++++++++++++++++----- 10 files changed, 128 insertions(+), 34 deletions(-) create mode 100644 WebContent/images/down.png create mode 100644 WebContent/images/down_active.png create mode 100644 WebContent/images/down_hover.png create mode 100644 WebContent/images/up.png create mode 100644 WebContent/images/up_active.png create mode 100644 WebContent/images/up_hover.png diff --git a/WebContent/gui/OSRM.Timers.js b/WebContent/gui/OSRM.Timers.js index 19224d06f..ab65537af 100644 --- a/WebContent/gui/OSRM.Timers.js +++ b/WebContent/gui/OSRM.Timers.js @@ -23,44 +23,65 @@ 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.", - _class: "Routing", - _func: "getRoute_Dragging" - } + { time: 7000, + 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.", + _classes: ["Routing"], + _funcs: ["getRoute_Dragging"] + }, + { time: 4000, + header: "[Tooltip] Clicking and Dragging 2", + 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.", + _classes: ["Routing"], + _funcs: ["getRoute_Dragging"] + } ], // initialize notification timers init: function() { - // init variables + // init timers var notifications = OSRM.GUI.notifications; OSRM.G.notification_timers = new Array( notifications.length ); - - // init timers for( var i=0, iEnd=notifications.length; iG`3`0&5B@7@rCkc{81!l-F!jKd& zA&V=pf`~{`1Q7*XaCHf?ii#)(L_q-qx`QkN%DT9UsHohGe(OS3MK)E37H+oO9nu;ThOoeZSL2IYYA_H z8P83R=5ZsFw84Kn|1?W1P58j0GUAic_2RkzqjQA&z3LR=^V%7u1AMNk=34b?-< z&@a$A=rVKz8ipQ1lh7RWH}nxkU=mD+6<`h60A|7VuqPYPcFkq;;g ziiTpM^iWnPH&h^sjY>srM-`*0Q72KIsD9Kv)Ff&F^#x5v%cFJCmS}f$2s##>g)Tr> zpqtPg=&R^a^fdY%27_T>G%@BFH%urd0h5C%#vI19V=iHaF;kdDEEX$+)x}z4eXx<( zb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VE8~ZZ$xNHfn#}iEL0Mc{vWhxV@CTebH~A*b+Wkzr9q(Whc|@y(x%eyaRwWnav` zp%Sx_Bc+&9Zt2*5+x;iYB+9bOrVe-?=qzWJ7nZ+0xar`H3X_VuLxe*ahxnCVmEBcp zRi#y*s^h9hYaD9YYvpVA)-E0993DAhcciUOp{}UzGKKh3I0j{ll{%+&CM-tr`Fza<$qOaDgx>t#m5bRI7cZq;n!g--d8%(y-{UJGSMK-w^$%V3yn6kb%e5;5 z_5&BMTVFqa!}7+to2;8%x6E#J4w?>j+%~=4F=RH>dB^-t_g#y-J;Q5;dq-?XF5h#y zckRCW{ad4JM~BA(#~zG_kMkdJ9?U*WdieTL=A-4uJ15W+g-^tvR6Lb`+VH#f@9lgu z{)I`W$-!sqo;{voPrdvj?T=5>`OnGED`u2tnrDq?&(FEc-F>nC#q`URm&@}7e@gsW z`%3H8uYcM7HMkJ6F#VeMdgbrpH!^Qdyft~-x9Ge0^j-41<)y;+GVf1*V0{?)82oW& zIqMVlQ{`vv&plr}zf7zoudIk%K;!}<7ZACC$OS|$AaVhb3y54m?F_g@+-(ut7^cM2DWWqp<$Zl zO_pVBbD1>Ig9chK8-pl{)b&0KP1Byb;Hn9gEqr3JnHxROV@QTXwCQiGeHoN>2!KZYhb_zaV6j;2tEw7N6ABN9!?!q&52>y+Xl|j!WDBlsp>2p&lQy_E z#I9q6NfX{W#+`qpfBBVnzD$2zXO82(5nb2$7or9?U38|V_y7O^07*qoM6N<$f{#mz AG5`Po literal 0 HcmV?d00001 diff --git a/WebContent/images/down_active.png b/WebContent/images/down_active.png new file mode 100644 index 0000000000000000000000000000000000000000..546d6cfb2c2e2e76d4327ade2145e3e0fe37ec84 GIT binary patch literal 2919 zcmV-t3z+nYP)G`3`0&5B@7@rCkc{81!l-F!jKd& zA&V=pf`~{`1Q7*XaCHf?ii#)(L_q-qx`QkN%DT9UsHohGe(OS3MK)E37H+oO9nu;ThOoeZSL2IYYA_H z8P83R=5ZsFw84Kn|1?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}3O zbz&P;yx;)M*u)V&aBEABsulN{#j)Iw+^ezjZ=drw$DUscUJ1?i00000NkvXX Hu0mjfLH?3z literal 0 HcmV?d00001 diff --git a/WebContent/images/up.png b/WebContent/images/up.png new file mode 100644 index 0000000000000000000000000000000000000000..0a2f090dc37c778455a2091f1de51bba6d3bd529 GIT binary patch literal 2911 zcmV-l3!wCgP)G`3`0&5B@7@rCkc{81!l-F!jKd& zA&V=pf`~{`1Q7*XaCHf?ii#)(L_q-qx`QkN%DT9UsHohGe(OS3MK)E37H+oO9nu;ThOoeZSL2IYYA_H z8P83R=5ZsFw84Kn|1?W1P58j0GUAic_2RkzqjQA&z3LR=^V%7u1AMNk=34b?-< z&@a$A=rVKz8ipQ1lh7RWH}nxkU=mD+6<`h60A|7VuqPYPcFkq;;g ziiTpM^iWnPH&h^sjY>srM-`*0Q72KIsD9Kv)Ff&F^#x5v%cFJCmS}f$2s##>g)Tr> zpqtPg=&R^a^fdY%27_T>G%@BFH%urd0h5C%#vI19V=iHaF;kdDEEX$+)x}z4eXx<( zbZh~(3VRBB5j%pN#=gf9aY{I2oC_`t$HnF0DsU~hUfc+72DgkC$E)Kl@jiGCek;BN z--z$Q-@#AgmkAOCO@cKcfRI4gMW`gS5v~#@2yci)q6*Q1=tqnv?j%+cPZO^bCy5_O zRFV$KkrYnKAnhZaAYCFoB)uV%$r@xkau_+CypP;WzCwOVelJE7(-(6W?EaeVmUK}s3A?_$1DZX92M*N)kxcH(3O~OdRMM`mS>J$y3snQ&2Y}#&GBkd|}nvS7s(%tC^^dkDt^db6!BvsNx zGDvcZWR2tnNj?K%XfWIvNsJQ48O9jnqm+V_y;QW+Ua2;z5ve6+ zk1|XdXPHEq{W4uLPh?TDIQ7u>PQ(aI~Qu9{JRclpyq>fi-smG}wQXf!X z($Lfh*4U%br7^21t?90rt=XzMp+(lR)k@WB(7LaU(Pn8UY9H3Vs{`wp>cr{P=-knT zb}sn@DEsn5{&($CZH(tl;3W)Nnu-(bMti=nAu zl3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ft~-x9Ge0^j-41<)y;+GVf1*V0{?)82oW& zIqMVlQ{`vv&plr}zf7zoudIk%K;!}<7ZACC$OS|$AaVhb3y54m#%*U|Z5#JKNdIz__r6Tqu5;dJg4lJPe*u75E*U{2>{|c;002ov JPDHLkV1ijLkEZ|t literal 0 HcmV?d00001 diff --git a/WebContent/images/up_active.png b/WebContent/images/up_active.png new file mode 100644 index 0000000000000000000000000000000000000000..8d8d4d38449365b62cb0d4538622b90b592f6ce4 GIT binary patch literal 2933 zcmV-*3ySoKP)G`3`0&5B@7@rCkc{81!l-F!jKd& zA&V=pf`~{`1Q7*XaCHf?ii#)(L_q-qx`QkN%DT9UsHohGe(OS3MK)E37H+oO9nu;ThOoeZSL2IYYA_H z8P83R=5ZsFw84Kn|1?W1P58j0GUAic_2RkzqjQA&z3LR=^V%7u1AMNk=34b?-< z&@a$A=rVKz8ipQ1lh7RWH}nxkU=mD+6<`h60A|7VuqPYPcFkq;;g ziiTpM^iWnPH&h^sjY>srM-`*0Q72KIsD9Kv)Ff&F^#x5v%cFJCmS}f$2s##>g)Tr> zpqtPg=&R^a^fdY%27_T>G%@BFH%urd0h5C%#vI19V=iHaF;kdDEEX$+)x}z4eXx<( zbZh~(3VRBB5j%pN#=gf9aY{I2oC_`t$HnF0DsU~hUfc+72DgkC$E)Kl@jiGCek;BN z--z$Q-@#AgmkAOCO@cKcfRI4gMW`gS5v~#@2yci)q6*Q1=tqnv?j%+cPZO^bCy5_O zRFV$KkrYnKAnhZaAYCFoB)uV%$r@xkau_+CypP;WzCwOVelJE7(-(6W?EaeVmUK}s3A?_$1DZX92M*N)kxcH(3O~OdRMM`mS>J$y3snQ&2Y}#&GBkd|}nvS7s(%tC^^dkDt^db6!BvsNx zGDvcZWR2tnNj?K%XfWIvNsJQ48O9jnqm+V_y;QW+Ua2;z5ve6+ zk1|XdXPHEq{W4uLPh?TDIQ7u>PQ(aI~Qu9{JRclpyq>fi-smG}wQXf!X z($Lfh*4U%br7^21t?90rt=XzMp+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>dB^-t_g#y-J;Q5;dq-?XF5h#y zckRCW{ad4JM~BA(#~zG_kMkdJ9?U*WdieTL=A-4uJ15W+g-^tvR6Lb`+VH#f@9lgu z{)I`W$-!sqo;{voPrdvj?T=5>`OnGED`u2tnrDq?&(FEc-F>nC#q`URm&@}7e@gsW z`%3H8uYcM7HMkJ6F#VeMdgbrpH!^Qdyft~-x9Ge0^j-41<)y;+GVf1*V0{?)82oW& zIqMVlQ{`vv&plr}zf7zoudIk%K;!}<7ZACC$OS|$AaVhb3y54mqh6_Rv{2%N@$zc;DgauH!oYEde&b5*Vki0V?1K)O4_?&cmPt9zXyF z!4w%+k@~|DAwUP*(f0!|{eD zns<-oj&jaoXRM&Cf)Btncv3qdnyMryvcv*MB-XU-K~s&fKuu8+)R`m+4pkDHMHrK$ zrXDsi#}&?S|9y+t=eG=FbKxes>N4$vH7>~qM
- -
+ +
+
+
+ +
+
Notification
+ + +
+
+
+
+ +
+
+
Notification
-
diff --git a/WebContent/main.js b/WebContent/main.js index 7267f8ac3..2e5e14dce 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -63,6 +63,12 @@ OSRM.prefetchImages = function() { {id:'restore', url:'images/restore.png'}, {id:'restore_active', url:'images/restore_active.png'}, {id:'restore_hover', url:'images/restore_hover.png'}, + {id:'up', url:'images/up.png'}, + {id:'up_active', url:'images/up_active.png'}, + {id:'up_hover', url:'images/up_hover.png'}, + {id:'down', url:'images/down.png'}, + {id:'down_active', url:'images/down_active.png'}, + {id:'down_hover', url:'images/down_hover.png'}, {id:'config', url:'images/config.png'}, {id:'config_active', url:'images/config_active.png'}, {id:'config_hover', url:'images/config_hover.png'}, @@ -136,6 +142,14 @@ OSRM.prefetchCSSIcons = function() { { id:'.cancel-marker:hover', image_id:'cancel_hover'}, { id:'.cancel-marker:active', image_id:'cancel_active'}, + { id:'.up-marker', image_id:'up'}, + { id:'.up-marker:hover', image_id:'up_hover'}, + { id:'.up-marker:active', image_id:'up_active'}, + + { id:'.down-marker', image_id:'down'}, + { id:'.down-marker:hover', image_id:'down_hover'}, + { id:'.down-marker:active', image_id:'down_active'}, + { id:'#input-mask-header', image_id:'osrm-logo'}, { id:'.styled-select', image_id:'selector'}, @@ -270,25 +284,56 @@ OSRM.parseParameters = function(){ // check whether to activate maintenance mode OSRM.inMaintenance = function(){ if( OSRM.DEFAULTS.MAINTENANCE == true ) { - OSRM.notify( OSRM.DEFAULTS.MAINTENANCE_HEADER, OSRM.DEFAULTS.MAINTENANCE_TEXT, false); + OSRM.xnotify( 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"; +// important notifications +OSRM.xnotify = function( header, text, closable ){ + document.getElementById('important-notification-blanket').style.display = "block"; + document.getElementById('important-notification-label').innerHTML = header; + document.getElementById('important-notification-box').innerHTML = text; + if( closable ) + document.getElementById('important-notification-toggle').onclick = OSRM.xdenotify; + else + document.getElementById('important-notification-toggle').style.display = "none"; +}; +OSRM.xdenotify = function() { + document.getElementById('important-notification-blanket').style.display = "none"; +}; + +// normal notification box +OSRM.notify = function( header, text ){ + document.getElementById('notification-wrapper').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"; -}, + document.getElementById('notification-box').style.display = "block"; // trick to always obtain a closed notification box + OSRM.resize(); + + document.getElementById('notification-toggle').onclick = OSRM.denotify; + document.getElementById('notification-resize').onclick = OSRM.resize; +}; +OSRM.resize = function() { + if( document.getElementById('notification-box').style.display == "none" ) { + document.getElementById('notification-content').style.height = "200px"; + document.getElementById('notification-wrapper').style.height = "220px"; + document.getElementById('notification-box').style.display = "block"; + document.getElementById('notification-resize').className = "iconic-button up-marker top-right-button"; + } else { + document.getElementById('notification-content').style.height = "18px"; + document.getElementById('notification-wrapper').style.height = "38px"; + document.getElementById('notification-box').style.display = "none"; + document.getElementById('notification-resize').className = "iconic-button down-marker top-right-button"; + } +}; OSRM.denotify = function() { - document.getElementById('notification-blanket').style.display = "none"; + document.getElementById('notification-wrapper').style.display = "none"; +}; +OSRM.isNotifyVisible = function() { + return document.getElementById('notification-wrapper').style.display == "block"; }; From 770f3b5979a3ea616f18588e4bebe9908c29a239 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 4 Jul 2012 16:36:10 +0100 Subject: [PATCH 04/10] added some notifications --- WebContent/gui/OSRM.Timers.js | 40 ++++++++++++++++++----------------- WebContent/main.js | 1 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/WebContent/gui/OSRM.Timers.js b/WebContent/gui/OSRM.Timers.js index ab65537af..9d20d60f1 100644 --- a/WebContent/gui/OSRM.Timers.js +++ b/WebContent/gui/OSRM.Timers.js @@ -23,26 +23,28 @@ OSRM.GUI.extend( { // notifications notifications: [ - { time: 7000, - 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.", - _classes: ["Routing"], - _funcs: ["getRoute_Dragging"] - }, { time: 4000, - header: "[Tooltip] Clicking and Dragging 2", - 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. " + + header: "[Tooltip] Localization", + body: "You can use the pulldown menu in the upper left corner to select your favorite language." + "

" + - "You can even create additional markers by dragging them off of the main route." + - "Markers can be simply deleted by clicking on them.", + "If you cannot find your preferred language, you can help us to provide additionals translations!", + _classes: [], + _funcs: [] + }, + { time: 6000, + header: "[Tooltip] Clicking to set markers", + body: "You can simply click on the map to set a source or target marker. " + + "When you click on a marker again, it will be deleted.", + _classes: ["Map"], + _funcs: ["click"] + }, + { time: 8000, + header: "[Tooltip] Dragging markers", + body: "You can drag a marker over the map and get instantanous route updates. " + + "You can even create additional markers by dragging them off of the main route.", _classes: ["Routing"], _funcs: ["getRoute_Dragging"] - } + } ], // initialize notification timers @@ -58,17 +60,17 @@ init: function() { notifications[i].old_functions = []; for(var j=0, jEnd=notifications[i]._classes.length; j Date: Wed, 4 Jul 2012 17:25:04 +0100 Subject: [PATCH 05/10] wrapper function for localization pulldown menu to work as trigger function for notifications --- WebContent/localization/OSRM.Localization.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 25bc56901..193763b54 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -42,12 +42,15 @@ init: function() { } // generate selectors - OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguage); - OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguage); + OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguageWrapper); + OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguageWrapper); // set default language OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); }, +setLanguageWrapper: function(language) { + OSRM.Localization.setLanguage(language); +}, setLanguage: function(language) { // change value of both language selectors OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language ); From 0c946f1476bd6e26601b9b3c6fdffc517e218541 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 4 Jul 2012 17:27:08 +0100 Subject: [PATCH 06/10] added additional notifications, better argument passing to wrapped trigger functions for notifications, notification boxes adapt in size to contained text, notification functions renamed, --- WebContent/gui/OSRM.Timers.js | 37 +++++++++++++++++++++-------------- WebContent/main.js | 15 +++++++------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/WebContent/gui/OSRM.Timers.js b/WebContent/gui/OSRM.Timers.js index 9d20d60f1..9f5d87c8e 100644 --- a/WebContent/gui/OSRM.Timers.js +++ b/WebContent/gui/OSRM.Timers.js @@ -25,23 +25,30 @@ OSRM.GUI.extend( { notifications: [ { time: 4000, header: "[Tooltip] Localization", - body: "You can use the pulldown menu in the upper left corner to select your favorite language." + + body: "You can use the pulldown menu in the upper left corner to select your favorite language. " + "

" + - "If you cannot find your preferred language, you can help us to provide additionals translations!", - _classes: [], - _funcs: [] + "Don't despair if you cannot find your language of choice. " + + "If you want, you can help to provide additional translations! " + + "Visit here for more information.", + _classes: ["Localization"], + _funcs: ["setLanguageWrapper"] }, { time: 6000, header: "[Tooltip] Clicking to set markers", - body: "You can simply click on the map to set a source or target marker. " + - "When you click on a marker again, it will be deleted.", + body: "You can click on the map with the left mouse button to set a source marker (green) or a target marker (red), " + + "if the source marker already exists. " + + "The address of the selected location will be displayed in the boxes to the left. " + + "

" + + "You can delete a marker by clicking on it again with the left mouse button.", _classes: ["Map"], _funcs: ["click"] }, { time: 8000, header: "[Tooltip] Dragging markers", - body: "You can drag a marker over the map and get instantanous route updates. " + - "You can even create additional markers by dragging them off of the main route.", + body: "You can drag a marker by clicking on it with the left mouse button and holding the button pressed. " + + "Then you can move the marker around the map and the route will be updated instantaneously. " + + "

" + + "You can even create additional markers by dragging them off of the main route! ", _classes: ["Routing"], _funcs: ["getRoute_Dragging"] } @@ -66,11 +73,13 @@ init: function() { }, // wrapper function to clear timeouts -notification_wrapper: function(id, id2, params) { +notification_wrapper: function(id, id2) { var notifications = OSRM.GUI.notifications; clearTimeout( notifications[id].timer ); - notifications[id].old_functions[id2](params); + //notifications[id].old_functions[id2](params); + var args = Array.prototype.slice.call(arguments, 2); + notifications[id].old_functions[id2].apply(this, args); for(var j=0, jEnd=notifications[id]._classes.length; j Date: Thu, 5 Jul 2012 13:00:57 +0100 Subject: [PATCH 07/10] removed comment --- WebContent/base/osrm/OSRM.Marker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/WebContent/base/osrm/OSRM.Marker.js b/WebContent/base/osrm/OSRM.Marker.js index 9ab1377c1..7b6d402e7 100644 --- a/WebContent/base/osrm/OSRM.Marker.js +++ b/WebContent/base/osrm/OSRM.Marker.js @@ -99,7 +99,6 @@ 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); From efa959d112d5ff4691deb578e0211db932a74524 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 5 Jul 2012 13:01:27 +0100 Subject: [PATCH 08/10] added clarifying comment --- WebContent/localization/OSRM.Localization.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 193763b54..4bd69eeb4 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -49,7 +49,7 @@ init: function() { OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); }, setLanguageWrapper: function(language) { - OSRM.Localization.setLanguage(language); + OSRM.Localization.setLanguage(language); // wrapping required as trigger function for suppressing notifications }, setLanguage: function(language) { // change value of both language selectors From 8f6cd99ff676ab026c35516da7f98f0448dfec2c Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 5 Jul 2012 13:53:07 +0100 Subject: [PATCH 09/10] changed notification triggers from wrapped functions to simple function calls --- WebContent/base/OSRM.Map.js | 1 + WebContent/base/osrm/OSRM.Marker.js | 1 + WebContent/gui/OSRM.Notifications.js | 162 +++++++++++++++++++ WebContent/gui/OSRM.Timers.js | 102 ------------ WebContent/localization/OSRM.Localization.js | 5 +- WebContent/main.css | 10 +- WebContent/main.html | 30 ++-- WebContent/main.js | 50 +----- 8 files changed, 188 insertions(+), 173 deletions(-) create mode 100644 WebContent/gui/OSRM.Notifications.js delete mode 100644 WebContent/gui/OSRM.Timers.js diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index 6a298fc04..b53ffd89c 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -86,6 +86,7 @@ zoomed: function(e) { contextmenu: function(e) {;}, mousemove: function(e) { OSRM.Via.drawDragMarker(e); }, click: function(e) { + OSRM.GUI.deactivateTooltip( "clicking" ); if( !OSRM.G.markers.hasSource() ) { var index = OSRM.G.markers.setSource( e.latlng ); OSRM.Geocoder.updateAddress( OSRM.C.SOURCE_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG ); diff --git a/WebContent/base/osrm/OSRM.Marker.js b/WebContent/base/osrm/OSRM.Marker.js index 7b6d402e7..aa7560330 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.deactivateTooltip( "dragging" ); OSRM.G.dragging = true; this.switchIcon(this.options.dragicon); diff --git a/WebContent/gui/OSRM.Notifications.js b/WebContent/gui/OSRM.Notifications.js new file mode 100644 index 000000000..e9098651d --- /dev/null +++ b/WebContent/gui/OSRM.Notifications.js @@ -0,0 +1,162 @@ +/* +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 Notifications +// [handles notifications: timed tooltips and exclusive notifications] + + +OSRM.GUI.extend( { + +// tooltips +tooltips: { + localization: + { timeout: 4000, + header: "[Tooltip] Localization", + body: "You can use the pulldown menu in the upper left corner to select your favorite language. " + + "

" + + "Don't despair if you cannot find your language of choice. " + + "If you want, you can help to provide additional translations! " + + "Visit here for more information." + // triggered by OSRM.Localization.setLanguageWrapper + }, + clicking: + { timeout: 6000, + header: "[Tooltip] Clicking to set markers", + body: "You can click on the map with the left mouse button to set a source marker (green) or a target marker (red), " + + "if the source marker already exists. " + + "The address of the selected location will be displayed in the boxes to the left. " + + "

" + + "You can delete a marker by clicking on it again with the left mouse button." + // triggered by OSRM.Map.click + }, + dragging: + { timeout: 8000, + header: "[Tooltip] Dragging markers", + body: "You can drag a marker by clicking on it with the left mouse button and holding the button pressed. " + + "Then you can move the marker around the map and the route will be updated instantaneously. " + + "

" + + "You can even create additional markers by dragging them off of the main route! " + // triggered by OSRM.Routing.getRoute_Dragging + } +}, + + +// initialize notifications and tooltip timers +init: function() { + // notifications + // [nothing to be done at the moment] + + // tooltip timers + var tooltips = OSRM.GUI.tooltips; + for( id in tooltips ) { + // start timer + tooltips[id]._timer = setTimeout( + function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id), + tooltips[id].timeout + ); + + // mark tooltip as pending + tooltips[id]._pending = true; + } +}, + + +// deactivate pending tooltip +deactivateTooltip: function(id) { + var tooltips = OSRM.GUI.tooltips; + if(tooltips[id] == undefined) + return; + + // mark tooltip as no longer pending + tooltips[id]._pending = false; +}, +// show tooltip after timer expired +_showTooltip: function(id) { + var tooltips = OSRM.GUI.tooltips; + if(tooltips[id] == undefined) + return; + + // only show tooltip if it is still pending + if( tooltips[id]._pending == false ) { + return; + } + + // if a notification is currently shown, restart timer + if( OSRM.GUI.isTooltipVisible() ) { + tooltips[id]._timer = setTimeout( + function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id), + tooltips[id].timeout + ); + return; + } + + // show notification + OSRM.GUI.tooltipNotify( tooltips[id].header, tooltips[id].body ); + + // mark tooltip as no longer pending + tooltips[id]._pending = false; +}, + + +// exclusive notification +exclusiveNotify: function( header, text, closable ){ + document.getElementById('exclusive-notification-blanket').style.display = "block"; + document.getElementById('exclusive-notification-label').innerHTML = header; + document.getElementById('exclusive-notification-box').innerHTML = text; + if( closable ) + document.getElementById('exclusive-notification-toggle').onclick = OSRM.GUI.exclusiveDenotify; + else + document.getElementById('exclusive-notification-toggle').style.display = "none"; +}, +exclusiveDenotify: function() { + document.getElementById('exclusive-notification-blanket').style.display = "none"; +}, + + +// tooltip notification +tooltipNotify: function( header, text ){ + document.getElementById('tooltip-notification-wrapper').style.display = "block"; + document.getElementById('tooltip-notification-label').innerHTML = header; + document.getElementById('tooltip-notification-box').innerHTML = text; + document.getElementById('tooltip-notification-box').style.display = "block"; // simple trick to always start with a minimized tooltip + OSRM.GUI.tooltipResize(); + + document.getElementById('tooltip-notification-toggle').onclick = OSRM.GUI.tooltipDenotify; + document.getElementById('tooltip-notification-resize').onclick = OSRM.GUI.tooltipResize; +}, +tooltipResize: function() { + if( document.getElementById('tooltip-notification-box').style.display == "none" ) { + document.getElementById('tooltip-notification-box').style.display = "block"; + var height = document.getElementById('tooltip-notification-box').clientHeight; + document.getElementById('tooltip-notification-content').style.height = (height + 28) + "px"; + document.getElementById('tooltip-notification-wrapper').style.height = (height + 48) + "px"; + document.getElementById('tooltip-notification-resize').className = "iconic-button up-marker top-right-button"; + } else { + document.getElementById('tooltip-notification-box').style.display = "none"; + document.getElementById('tooltip-notification-content').style.height = "18px"; + document.getElementById('tooltip-notification-wrapper').style.height = "38px"; + document.getElementById('tooltip-notification-resize').className = "iconic-button down-marker top-right-button"; + } +}, +tooltipDenotify: function() { + document.getElementById('tooltip-notification-wrapper').style.display = "none"; +}, +isTooltipVisible: function() { + return document.getElementById('tooltip-notification-wrapper').style.display == "block"; +} + +}); diff --git a/WebContent/gui/OSRM.Timers.js b/WebContent/gui/OSRM.Timers.js deleted file mode 100644 index 9f5d87c8e..000000000 --- a/WebContent/gui/OSRM.Timers.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -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: 4000, - header: "[Tooltip] Localization", - body: "You can use the pulldown menu in the upper left corner to select your favorite language. " + - "

" + - "Don't despair if you cannot find your language of choice. " + - "If you want, you can help to provide additional translations! " + - "Visit here for more information.", - _classes: ["Localization"], - _funcs: ["setLanguageWrapper"] - }, - { time: 6000, - header: "[Tooltip] Clicking to set markers", - body: "You can click on the map with the left mouse button to set a source marker (green) or a target marker (red), " + - "if the source marker already exists. " + - "The address of the selected location will be displayed in the boxes to the left. " + - "

" + - "You can delete a marker by clicking on it again with the left mouse button.", - _classes: ["Map"], - _funcs: ["click"] - }, - { time: 8000, - header: "[Tooltip] Dragging markers", - body: "You can drag a marker by clicking on it with the left mouse button and holding the button pressed. " + - "Then you can move the marker around the map and the route will be updated instantaneously. " + - "

" + - "You can even create additional markers by dragging them off of the main route! ", - _classes: ["Routing"], - _funcs: ["getRoute_Dragging"] - } -], - -// initialize notification timers -init: function() { - // init timers - var notifications = OSRM.GUI.notifications; - OSRM.G.notification_timers = new Array( notifications.length ); - for( var i=0, iEnd=notifications.length; i - + @@ -87,31 +87,31 @@ or see http://www.gnu.org/licenses/agpl.txt.
- -
-
-
+ +
+
+
-
-
Notification
+
+
Notification
-
+
- -
-
+ +
+
-
+
-
-
Notification
+
+
Notification
-
+
diff --git a/WebContent/main.js b/WebContent/main.js index 4c757b664..d9af675d2 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -284,60 +284,12 @@ OSRM.parseParameters = function(){ // check whether to activate maintenance mode OSRM.inMaintenance = function(){ if( OSRM.DEFAULTS.MAINTENANCE == true ) { - OSRM.xnotify( OSRM.DEFAULTS.MAINTENANCE_HEADER, OSRM.DEFAULTS.MAINTENANCE_TEXT, false); + OSRM.GUI.exclusiveNotify( OSRM.DEFAULTS.MAINTENANCE_HEADER, OSRM.DEFAULTS.MAINTENANCE_TEXT, false); return true; } return false; }; -// important notifications -OSRM.xnotify = function( header, text, closable ){ - document.getElementById('important-notification-blanket').style.display = "block"; - document.getElementById('important-notification-label').innerHTML = header; - document.getElementById('important-notification-box').innerHTML = text; - if( closable ) - document.getElementById('important-notification-toggle').onclick = OSRM.xdenotify; - else - document.getElementById('important-notification-toggle').style.display = "none"; -}; -OSRM.xdenotify = function() { - document.getElementById('important-notification-blanket').style.display = "none"; -}; - - -// normal notification box -OSRM.notify = function( header, text ){ - document.getElementById('notification-wrapper').style.display = "block"; - document.getElementById('notification-label').innerHTML = header; - document.getElementById('notification-box').innerHTML = text; - document.getElementById('notification-box').style.display = "block"; // trick to always obtain a closed notification box - OSRM.resizeNotify(); - - document.getElementById('notification-toggle').onclick = OSRM.denotify; - document.getElementById('notification-resize').onclick = OSRM.resizeNotify; -}; -OSRM.resizeNotify = function() { - if( document.getElementById('notification-box').style.display == "none" ) { - document.getElementById('notification-box').style.display = "block"; - var height = document.getElementById('notification-box').clientHeight; - document.getElementById('notification-content').style.height = (height + 28) + "px"; - document.getElementById('notification-wrapper').style.height = (height + 48) + "px"; - document.getElementById('notification-resize').className = "iconic-button up-marker top-right-button"; - } else { - document.getElementById('notification-box').style.display = "none"; - document.getElementById('notification-content').style.height = "18px"; - document.getElementById('notification-wrapper').style.height = "38px"; - document.getElementById('notification-resize').className = "iconic-button down-marker top-right-button"; - } -}; -OSRM.denotify = function() { - document.getElementById('notification-wrapper').style.display = "none"; -}; -OSRM.isNotifyVisible = function() { - return document.getElementById('notification-wrapper').style.display == "block"; -}; - - // onload event OSRM.Browser.onLoadHandler( OSRM.init ); \ No newline at end of file From 5e2474982603ec2d9275c9d55ffa6110494a4c6a Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 5 Jul 2012 14:00:47 +0100 Subject: [PATCH 10/10] clarified comments --- WebContent/gui/OSRM.Notifications.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/WebContent/gui/OSRM.Notifications.js b/WebContent/gui/OSRM.Notifications.js index e9098651d..0b26d65dd 100644 --- a/WebContent/gui/OSRM.Notifications.js +++ b/WebContent/gui/OSRM.Notifications.js @@ -23,34 +23,34 @@ OSRM.GUI.extend( { // tooltips tooltips: { + // triggered in OSRM.Localization.setLanguageWrapper localization: - { timeout: 4000, + { timeout: 1800000, // 30min header: "[Tooltip] Localization", body: "You can use the pulldown menu in the upper left corner to select your favorite language. " + "

" + "Don't despair if you cannot find your language of choice. " + "If you want, you can help to provide additional translations! " + "Visit here for more information." - // triggered by OSRM.Localization.setLanguageWrapper - }, + }, + // triggered in OSRM.Map.click clicking: - { timeout: 6000, + { timeout: 60000, // 1min header: "[Tooltip] Clicking to set markers", body: "You can click on the map with the left mouse button to set a source marker (green) or a target marker (red), " + "if the source marker already exists. " + "The address of the selected location will be displayed in the boxes to the left. " + "

" + "You can delete a marker by clicking on it again with the left mouse button." - // triggered by OSRM.Map.click }, + // triggered in OSRM.Routing.getRoute_Dragging dragging: - { timeout: 8000, + { timeout: 120000, // 2min header: "[Tooltip] Dragging markers", body: "You can drag a marker by clicking on it with the left mouse button and holding the button pressed. " + "Then you can move the marker around the map and the route will be updated instantaneously. " + "

" + "You can even create additional markers by dragging them off of the main route! " - // triggered by OSRM.Routing.getRoute_Dragging } },