First of all, I looked through your code and couldn't understand how this was implemented. After I found it and researched, it's clear that it's essentially useless[1].
I'm not bashing on your project, I like it, but aside from being a cool gimmick, I can't think of any real world usages?
...Unless your application is LAN-based , offline-heavy, or your have pixies that run around your office pulling out your network cable regularly * chuckles *.
I'll explain, but please correct me if I am way off the mark.
The project connects to the network events
this.events = {
network: ['online', 'offline']
};
These events fire from observing the attribute window.navigator.onLine
This attribute returns true, when the system is connected to a network, but returns false when it isn't.The importance of this is that the attribute is inherently unreliable. A computer can be connected to a network without having Internet access. [2]
This is a barebones minimal example that doesn't have the features you added:
<!DOCTYPE HTML>
<html>
<head>
<title>Online status</title>
<script>
function updateIndicator() {
document.getElementById('indicator').textContent =
navigator.onLine ? 'online' : 'offline';
}
</script>
</head>
<body onload="updateIndicator()" onoffline="updateIndicator()">
<p>The network is: <span id="indicator">(state unknown)</span>
</body>
</html>
You can see the fiddle here: http://jsfiddle.net/3rRWK/If you disconnect yourself from your network you will see the fiddle update to "Offline", however, if you pull your phone-line from your router, it will still stay at "Online".
[1] : It's inherently unreliable.
A computer can be connected to a network without internet access.
[2] : http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html