Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ready for pull. #43

Merged
merged 4 commits into from Apr 9, 2012
View
28 irc.js
@@ -24,14 +24,16 @@ var http = require('http')
, io = require('socket.io').listen(app);
//when the app started
-var startTime = (new Date()).getTime();
-var statTime = startTime;
+var startTime = (new Date()).getTime(),
+ statTime = startTime;
+
//get usage RAM in bytes
-var currMem = process.memoryUsage().rss;
-var minMem = currMem;
-var maxMem = currMem;
-var webUsers = [];
-var bWebUsersDirty = false; //flag to indicate if the webUsers changed
+var currMem = process.memoryUsage().rss,
+ minMem = currMem,
+ maxMem = currMem;
+
+var webUsers = [],
+ bWebUsersDirty = false; //flag to indicate if the webUsers changed
//every 15 seconds poll for the memory
var tmr = setInterval(function () {
@@ -76,9 +78,9 @@ console.log('IRC#nodester is running on %d',app.address().port)
*/
io.set('log level', 1); //reduce debug messages
io.sockets.on('connection', function (client) {
- var socket = client;
- var irc = null;
- var nickname = null;
+ var socket = client,
+ irc = null,
+ nickname = null;
client.on('message', function(data) {
var obj = JSON.parse(data);
if (obj.hasOwnProperty('nickname')) {
@@ -211,8 +213,8 @@ io.sockets.on('connection', function (client) {
* Handler for server reporting nick change
*/
irc.addListener('nick', function (message) {
- var prevNick = message.person.nick;
- var newNick = message.params[0];
+ var prevNick = message.person.nick,
+ newNick = message.params[0];
/*
* if ever this client will send commands, the code below will be needed
*
@@ -321,7 +323,7 @@ io.sockets.on('connection', function (client) {
/*
* Handler for all irc server errors
- * This has nothing to do with the irc-js implementation errors
+ * This has nothing to do with the eventual irc-js implementation errors
* Handles all error messages but 433 handled above
*/
for (var err = 400; err < 600; err++) {
View
@@ -3,27 +3,24 @@
}
html {
background: url(/grad.png);
- font-family:"Open Sans";
+ font-family: "Open Sans";
+}
+#rocket {
+ margin-left: auto;
+ margin-right: auto;
+ width: 8em;
+ top: 30px;
}
-body {
-
- /* background: #d0d0d0;
- color: #222;
- font: 12px Helvetica, Arial, sans-serif;
- padding: 0 0 30px;
- opacity:0.7;
- */
-
- margin:0;
-}
-#rocket { margin-left: auto; margin-right: auto; width: 8em;top:30px;}
#rocket img {
height:150px;
padding-top: 3px;
margin-left: -10px;
}
.rocket {
- margin-left: auto; margin-right: auto; width: 100%;top:30px;
+ margin-left: auto;
+ margin-right: auto;
+ width: 100%;
+ top:30px;
text-align:center;
}
.btn.real {
@@ -51,7 +48,6 @@ body {
font-size: 13px;
line-height: 18px;
color: #333;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
background-color: whiteSmoke;
background-repeat: repeat-x;
@@ -96,9 +92,8 @@ a {
.stats {
right: 150px;
}
-
#nickLabel {
- margin-top: 7px;
+ margin-top: 9px;
position: absolute;
right: 270px;
text-align: right;
@@ -145,14 +140,15 @@ a {
padding-left: 20px;
font-weight: bold;
width:100% !important;
- vertical-align: -webkit-baseline-middle
+ vertical-align: -webkit-baseline-middle;
position: fixed;
-moz-box-shadow:2px 2px #ccc;
-webkit-box-shadow:2px 2px #ccc;
box-shadow:2px 2px #ccc;
z-index:2e9;
position: fixed;
margin-top:-30px;
+ height: 36px;
}
.header img {
height:27px !important;
@@ -197,7 +193,7 @@ a {
border-bottom: 1px solid #CCC;
padding-bottom: 5px;
padding-top: 5px;
- font-size: 15px;
+ font-size: 14px;
}
#chat_scroller {
margin-top: 38px;
@@ -217,7 +213,8 @@ a {
font-weight: bold;
padding: 2px 4px 2px 10px;
text-align: right;
- width: 100px;
+ width: 105px;
+ word-wrap: break-word;
}
#chat_body .msg {
background: #ccc;
@@ -227,14 +224,36 @@ a {
#chat_body .me .author {
font-style: italic;
}
-.me > .msg {
+.me > .msg,
+.me > .msg > .msg-join {
background: #444 !important;
color:#fff;
}
-.me > .author{
+.me > .author {
background:#444;
color:#fff;
}
+.msg-join {
+ color: #006600;
+}
+.msg-quitpart {
+ color: #663300;
+}
+.msg-nick {
+ color: #006666;
+}
+.msg-connected {
+ color: #669966;
+ font-weight: bold;
+}
+.msg-disconnected,
+.msg-unknown {
+ color: #999966;
+ font-weight: bold;
+}
+/*#chat_body .btn > .default {
+ color: #000;
+}*/
#chat_body tr:nth-child(2n) .msg {
background: #efefef;
}
@@ -261,6 +280,7 @@ a {
position: absolute;
right: 85px;
line-height: 30px;
+ /*width: 86%;*/
}
#chat_bar button {
padding: 0;
@@ -272,6 +292,16 @@ a {
clear: both;
height: 2em;
}
-.gold {background-color:#FFD700 !important;}
-.me .time {color:#ccc !important;}
-.off {display: none;}
+.gold {
+ background-color:#FFD700 !important;
+ /*text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75);*/
+}
+.me .time {
+ color:#ccc !important;
+}
+.off {
+ display: none;
+}
+.msg {
+ color: black;
+}
View
@@ -20,7 +20,7 @@ <h2>IRC #nodester channel</h2>
<p class="off" id="login-msg"></p>
<form id="join-form">
<input type="text" id="nick" class="btn" placeholder="username">
- <button href="#" class="btn btn-info" id="join"> Join</button>
+ <button href="#" class="btn btn-info" id="join">Join</button>
</form>
</div>
<table id="login-status">
@@ -35,7 +35,7 @@ <h2>IRC #nodester channel</h2>
<img src="/rocket-md-right-small.png">
<span> IRC #nodester </span>
<span id="nickLabel">nick</span>
- <button type="button" class="btn btn-settings stats " id="btnStats">Enable stats</button>
+ <button type="button" class="btn btn-settings stats" id="btnStats">Show stats</button>
<button type="button" class="btn btn-settings tones" id="btnTones">Disable tones</button>
</div>
<div id="top_section">
Oops, something went wrong.