Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #44 from microp11/master

Minor cosmetics + fixed issue #45...
  • Loading branch information...
commit 61c1670b0bfecacfd2e8e5e629d18cbdfe7cc3ce 2 parents 040f31d + 92c2cbf
@alejandro alejandro authored
Showing with 3 additions and 13 deletions.
  1. +3 −13 public/js/app.js
View
16 public/js/app.js
@@ -4,7 +4,6 @@ $(document).ready(function() {
nickname = null,
nicks = [], //could be an object if later we decide to add the nick attributes (+,... @)
webNicks = [], //web irc users
- doNotReconnect = false, //prohibit reconnect to nodester server after a socket disconnect, no retries
motdPrevLineEmpty = false, //flag for determining if the prev motd line was only spaces and asterisks
//html elements
textInput = $('#text_input'),
@@ -116,7 +115,6 @@ $(document).ready(function() {
joinForm.on('submit', function(e) {
e.preventDefault();
- doNotReconnect = false;
if (nickText.val() !== '') {
loginWrong.addClass('off');
loginMsg.removeClass('off');
@@ -124,7 +122,7 @@ $(document).ready(function() {
if (sock !== null && sock.socket.connected === false) {
sock.socket.reconnect();
} else {
- sock = io.connect('http://' + window.location.host);
+ sock = io.connect('http://' + window.location.host, {'reconnect': false});
sock.on('message', handleMessage);
sock.on('disconnect', handleDisconnect);
sock.on('connect', handleConnect);
@@ -405,8 +403,8 @@ $(document).ready(function() {
requestWebUsers();
}
var header_class = (c.getStatsEnabled() == true) ? 'header-stats' : 'header-stats off';
- nickLabel.html('<span class="'+header_class+'">Server up for: ' + c.getServerTime()
- + ', mem: ' + c.getMinRss() + '/' + c.getMaxRss() + 'MB</span> ' + nickname);
+ nickLabel.html('<span class="'+header_class+'">Server up for ' + c.getServerTime()
+ + ', using ' + c.getMinRss() + '-' + c.getMaxRss() + ' MB of RAM</span> ' + nickname);
break;
case "webusers":
webNicks = obj.wu;
@@ -422,10 +420,6 @@ $(document).ready(function() {
};
var handleConnect = function () {
- //cancel reconnect
- if (doNotReconnect == true) {
- return;
- }
loginMsg.text("");
loginStatus.html("");
var nick = window.nick = getNickname(nickText.val());
@@ -440,13 +434,9 @@ $(document).ready(function() {
/*
* set a time delay for disconnect
- *
* in case we exit the form we do not want the user to see it
- * the socket has a reconnect timeout that does not help us with irc here
- * so we make sure the socket won't reconnect: doNotReconnect = true
*/
var handleDisconnect = function () {
- doNotReconnect = true;
setTimeout( function () {
appendEvent("*", "disconnected", false);
nicks = [];
Please sign in to comment.
Something went wrong with that request. Please try again.