Skip to content

Commit 7d4d951

Browse files
committed
Templated environment code (remove in other env)
1 parent 7fa8cde commit 7d4d951

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

js/src/irc/Nodeconnection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// <% if(pkg.build['node server']) { %> only include this code if "node server" set in package.json
22
irc.NodeConnection = new Class({
33
Implements: [Options, Events],
44
Binds: ["_recv", "_error"],
@@ -150,3 +150,5 @@ irc.NodeConnection = new Class({
150150
return _.delay(this.autoretry, next, this);
151151
}*/
152152
});
153+
154+
// <% } %>

js/src/irc/ircclient.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ irc.IRCClient = new Class({
3232
self.nickname = options.nickname;
3333
self.lowerNickname = self.toIRCLower(self.nickname);
3434

35+
//sorry ugly bit of templating :(
36+
37+
// <% if(pkg.build['twisted server'] && pkg.build['node server']) { %>
3538
if(options.node) {
39+
// <% } %>
40+
//<% if(pkg.build['node server']) { %>
3641
var conn = self.connection = new irc.NodeConnection({
3742
account: options.account,
3843
nickname: self.nickname,
@@ -46,7 +51,11 @@ irc.IRCClient = new Class({
4651
"connected": self.connected,
4752
"lostConnection": self.lostConnection
4853
});
54+
// <% } %>
55+
// <% if(pkg.build['twisted server'] && pkg.build['node server']) { %>
4956
} else {
57+
// <% } %>
58+
//<% if(pkg.build['twisted server']) { %>
5059
self.connection = new irc.TwistedConnection({
5160
nickname: self.nickname,
5261
serverPassword: options.serverPassword,
@@ -56,7 +65,10 @@ irc.IRCClient = new Class({
5665
// "retry": self.retry,
5766
"lostConnection": self.lostConnection
5867
});
68+
// <% } %>
69+
// <% if(pkg.build['twisted server'] && pkg.build['node server']) { %>
5970
}
71+
// <% } %>
6072

6173
// self.commandparser = new irc.Commands(self);
6274
// self.exec = self.commandparser.exec;

js/src/irc/ircconnection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// /* This could do with a rewrite from scratch. */
2-
//going to rewrite using socket.io commet.
1+
// <% if(pkg.build['twisted server']) { %> only include this code if "twisted server" set in package.json
32
// //uris = dict(p=push, n=newConnection, s=subscribe)
43
(function() {
54
//http://blog.mibbit.com/?p=143
@@ -48,12 +47,12 @@
4847
initialize: function(options) {
4948
this.setOptions(options);
5049
this.__timeout = this.options.initialTimeout;
50+
this.cacheAvoidance = util.randHexString(16);
5151
},
5252

5353
connect: function() {
5454
var self = this;
5555
self.connected = true;
56-
self.cacheAvoidance = util.randHexString(16);
5756
var request = self.newRequest("n");
5857

5958
request.addEvent("complete", function(stream) {
@@ -299,3 +298,4 @@
299298
}
300299
});
301300
})();
301+
// <% } %>

0 commit comments

Comments
 (0)