lib/client/myelements.jquery.js
function(cb) {
    // If we're inside phonegap use its event.
    if (window.phonegap) {
      return document.addEventListener("offline", cb, false);
    } else if (window.addEventListener) {
      // With the offline HTML5 event from the window
      this.addLocalEventListener(window, "offline", cb);
    } else {
      /*
      Works in IE with the Work Offline option in the 
      File menu and pulling the ethernet cable
      Ref: http://robertnyman.com/html5/offline/online-offline-events.html
    */
      document.body.onoffline = cb;
    }
  }
function(cb) {
    // If we're inside phonegap use its event.
    if (window.phonegap) {
      return document.addEventListener("offline", cb, false);
    } else if (window.addEventListener) {
      // With the offline HTML5 event from the window
      this.addLocalEventListener(window, "offline", cb);
    } else {
      /*
      Works in IE with the Work Offline option in the 
      File menu and pulling the ethernet cable
      Ref: http://robertnyman.com/html5/offline/online-offline-events.html
    */
      document.body.onoffline = cb;
    }
  }
function ( cb ) { // If we're inside phonegap use its event. if ( window . phonegap ) { return document . addEventListener ( "offline" , cb , false ) ; } else if ( window . addEventListener ) { // With the offline HTML5 event from the window this . addLocalEventListener ( window , "offline" , cb ) ; } else { /*
      Works in IE with the Work Offline option in the 
      File menu and pulling the ethernet cable
      Ref: http://robertnyman.com/html5/offline/online-offline-events.html
    */ document . body . onoffline = cb ; } }
Calls cb when the app is offline from the backend

TODO: Find a kludge for this, for Firefox. Firefox only triggers offline when
the user sets the browser to "Offline mode"

@param {Function} cb.
Calls cb when the app is offline from the backend