whole_func_string: function visibilityChange(ev) {  // {{{2
    var that = this;
  
    if (this.visibilityTimeout) {
      clearTimeout(this.visibilityTimeout);
      this.visibilityTimeout = undefined;
    }
  
    switch (document.visibilityState) {
    case 'hidden':
  //    console.log('DOCUMENT HIDE');
  
      // Wait 10 seconds before peer disconnect.
      this.visibilityTimeout = setTimeout(function() {
        that.visibilityTimeout = undefined;
        O.gw.disconnect();
      }, 10 * 1000);
      return;
    case 'visible':
  //    console.log('DOCUMENT SHOW');
  
      if (! O.gw.isConnected()) {
        O.gw.connect();
      }
      return;
    }
  }
func_code_string: function visibilityChange(ev) {  // {{{2
    var that = this;
  
    if (this.visibilityTimeout) {
      clearTimeout(this.visibilityTimeout);
      this.visibilityTimeout = undefined;
    }
  
    switch (document.visibilityState) {
    case 'hidden':
  //    console.log('DOCUMENT HIDE');
  
      // Wait 10 seconds before peer disconnect.
      this.visibilityTimeout = setTimeout(function() {
        that.visibilityTimeout = undefined;
        O.gw.disconnect();
      }, 10 * 1000);
      return;
    case 'visible':
  //    console.log('DOCUMENT SHOW');
  
      if (! O.gw.isConnected()) {
        O.gw.connect();
      }
      return;
    }
  }
func_documentation_string: Event handlers {{{1