added basic maintenance message

This commit is contained in:
shiin 2012-05-15 23:02:19 +02:00
parent 26262541a4
commit 6665207066
4 changed files with 70 additions and 0 deletions

View File

@ -19,6 +19,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
// [has to be loaded directly after OSRM.base] // [has to be loaded directly after OSRM.base]
OSRM.DEFAULTS = { OSRM.DEFAULTS = {
MAINTENANCE: true,
HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute',
HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/',
HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp',

View File

@ -425,6 +425,32 @@ html, body {
width:390px; width:390px;
height:80px; height:80px;
} }
#notification-wrapper
{
width:600px;
height:170px;
top: 50%;
left: 50%;
margin-top:-85px;
margin-left:-300px;
}
#notification-content
{
width:580px;
height:150px;
}
#notification-blanket
{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
background-color:#666666;
background-color:rgba(0, 0, 0, 0.25);
z-index:100;
display:none;
}
/* styles for content of other gui boxes */ /* styles for content of other gui boxes */
@ -458,6 +484,10 @@ html, body {
{ {
float: right; float: right;
} }
#notification-box
{
margin:5px 5px 5px 5px;
}
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */

View File

@ -86,6 +86,31 @@ or see http://www.gnu.org/licenses/agpl.txt.
<!-- map --> <!-- map -->
<div id="map"></div> <div id="map"></div>
<!-- notification -->
<div id="notification-blanket">
<div id="notification-wrapper" class="box-wrapper not-selectable">
<div id="notification-content" class="box-content">
<!-- header -->
<div id="notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
<div id="gui-notification-label" class="box-label">Scheduled Maintenance</div>
<!-- notification text -->
<div id="notification-box">
The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed.
The site will be back online shortly.
<br/>
<br/>
In the meantime you may want to go out an map a friendly neighborhood near you...
<br/>
<br/>
<br/>
<br/>
[OSRM]
</div>
</div>
</div>
</div>
<!-- config gui --> <!-- config gui -->
<div id="config-wrapper" class="box-wrapper not-selectable"> <div id="config-wrapper" class="box-wrapper not-selectable">
<div id="config-content" class="box-content"> <div id="config-content" class="box-content">

View File

@ -31,6 +31,10 @@ OSRM.init = function() {
OSRM.Printing.init(); OSRM.Printing.init();
OSRM.Routing.init(); OSRM.Routing.init();
// stop if in maintenance mode
if( OSRM.inMaintenance() == true )
return;
// check if the URL contains some GET parameter, e.g. for showing a route // check if the URL contains some GET parameter, e.g. for showing a route
OSRM.parseParameters(); OSRM.parseParameters();
@ -263,5 +267,15 @@ 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-toggle').style.display = "none";
return true;
}
return false;
};
// onload event // onload event
OSRM.Browser.onLoadHandler( OSRM.init ); OSRM.Browser.onLoadHandler( OSRM.init );