I tried to embed auto internet connection detection and server availability in my nitrogen driven application by including the script in the template bare.html available at http://github.hubspot.com/offline/ like this example below
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" .......">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- default tags in the bare.html template here -->
<!-- start of the block of code embedded -->
<script src="/js/offline-0.7.3/offline.min.js"></script>
<link rel="stylesheet" href="/js/offline-0.7.3/themes/offline-theme-chrome.css" />
<link rel="stylesheet" href="/js/offline-0.7.3/themes/offline-language-english.css" />
<script>
var run = function(){
var req = new XMLHttpRequest();
req.timeout = 5000;
req.open('GET', 'http://mysite/favico.ico', true);
req.send();
}
setInterval(run, 3000);
</script>
<!-- End of the block of code -->
</head>
<body>
[[[page:body()]]]
<script>[[[script]]] </script>
</body>
</html>
I down loaded the zip file from the site mentioned above and unzipped it from the nitrogen/site/static/js directory.
I rendered the page and then disconnected the internet, no notification appeared!!
I followed the example in the ./test/index.html file of the test directory of the unzipped directory offline-0.7.3.zip
Any help or alternative solution is highly welcomed