diff options
Diffstat (limited to 'sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html')
-rw-r--r-- | sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html index 0b364b1753..f2e4f6695a 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html @@ -36,26 +36,29 @@ appcache.get = function(uri) { var u = h == -1? uri : uri.substring(0, h); // Get resource from local storage first - var item = localStorage.getItem(u); + var ls = window.lstorage || localStorage; + var item = null; + try { item = ls.getItem(u); } catch(e) {} if (item != null && item != '') return item; // Get resource from network var http = new XMLHttpRequest(); http.open("GET", u, false); + http.setRequestHeader("Accept", "*/*"); http.send(null); if (http.status == 200) { if (http.getResponseHeader("X-Login") != null) { - if (log) log('http error', u, 'X-Login'); + if (debug) debug('http error', u, 'X-Login'); return null; } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) { - if (log) log('http error', u, 'No-Content'); + if (debug) debug('http error', u, 'No-Content'); return null; } - localStorage.setItem(u, http.responseText); + try { ls.setItem(u, http.responseText); } catch(e) {} return http.responseText; } - if (log) log('http error', u, http.status, http.statusText); + if (debug) debug('http error', u, http.status, http.statusText); return null; }; @@ -71,7 +74,7 @@ appcache.get = function(uri) { </script> </head> <body class="delayed" onload="onload();"> -<div id="bodydiv" class="mainbodydiv"> +<div id="mainbodydiv" class="mainbodydiv"> <div id="headdiv" class="hsection"> <script type="text/javascript"> @@ -81,29 +84,35 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js')) </script> </div> -<div id="menu"></div> +<div id="menubackground" class="tbarbackground fixed"></div> +<div id="menu" class="tbarmenu fixed"></div> -<div id="content" class="viewloaded3d"> +<div id="viewheadbackground" class="viewheadbackground fixed"></div> +<div id="viewhead" class="viewhead fixed"></div> -<table style="width: 100%;"> -<tr><td><h2><span id="h1"></span></h2></td></tr> -</table> +<div id="viewcontainer"> +<div id="view"> +<div id="viewcontent" class="viewcontent" style="margin-left: auto; margin-right: auto; text-align: center;"> -<div style="margin-left: auto; margin-right: auto; text-align: center;"> +<br/> <div class="hd2">Sorry, that page was not found.</div> <div>You may have clicked an expired link or mistyped the address.</div> -</div> </div> +</div> +</div> <script type="text/javascript"> -// Set page title -$('h1').innerHTML = ui.hometitle(location.hostname); - // Init div variables var mdiv = $('menu'); -var cdiv = $('content'); +var hdiv = $('viewhead'); +$('viewcontainer').className = ui.isMobile()? 'viewcontainer3d' : 'viewcontainer3dm'; +$('view').className = ui.isMobile()? 'viewloaded3d' : 'viewloaded3dm'; + +// Set page title +document.title = ui.windowtitle(location.hostname) + ' - Page not found'; +$('viewhead').innerHTML = '<span class="bcmenu">' + config.pagetitle + '</span>'; /** * Build and show the menu bar. @@ -115,7 +124,6 @@ function showmenu(mdiv) { } showmenu(mdiv); -cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight); /** * Log the current user out. @@ -123,9 +131,8 @@ cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight); function logout() { // Clear session cookie and user-specific local storage entries clearauthcookie(); - localStorage.removeItem('/r/EditWidget/accounts'); - localStorage.removeItem('/r/EditWidget/dashboards'); - //localStorage.clear(); + lstorage.removeItem('/r/EditWidget/accounts'); + lstorage.removeItem('/r/EditWidget/dashboards'); document.location = '/login/'; return true; } @@ -134,11 +141,12 @@ function logout() { * Handle orientation change. */ document.body.onorientationchange = function(e) { - //log('onorientationchange'); - - // Scroll to the top and hide the address bar - window.scrollTo(0, 0); + //debug('onorientationchange'); + ui.onorientationchange(e); + // Resize menu and view header + mdiv.style.width = ui.pixpos(document.documentElement.clientWidth); + hdiv.style.width = ui.pixpos(document.documentElement.clientWidth); return true; }; @@ -146,13 +154,11 @@ document.body.onorientationchange = function(e) { * Load post processing. */ function onload() { - //log('onload'); + //debug('onload'); + ui.onload(); // Show the page document.body.style.visibility = 'visible'; - - // Scroll to the top and hide the address bar - window.scrollTo(0, 0); return true; } |