opts.style = '';\r
}\r
\r
- // Escape any HTML that may be in here\r
- // This doesn't seem right to be here.. should be in view (??)\r
- msg = $('<div />').text(msg).html();\r
-\r
// Run through the plugins\r
message_obj = {"msg": msg, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style};\r
//tmp = kiwi.plugs.run('addmsg', message_obj);\r
message_obj.msg = '';\r
}\r
\r
- // Convert IRC formatting into HTML formatting\r
- message_obj.msg = formatIRCMsg(message_obj.msg);\r
-\r
// Update the scrollback\r
bs = this.get("scrollback");\r
bs.push(message_obj);\r
// TODO: make sure that the message pane is scrolled to the bottom (Or do we? ~Darren)\r
var re, line_msg, $this = this.$el;\r
\r
+ // Escape any HTML that may be in here\r
+ msg.msg = $('<div />').text(msg.msg).html();\r
+\r
// Make the channels clickable\r
- // TODO: HTML parsing may be going into the model.. move this?\r
- re = new RegExp('\\B(' + kiwi.gateway.channel_prefix + '[^ ,.\\007]+)', 'g');\r
+ re = new RegExp('\\B([' + kiwi.gateway.get('channel_prefix') + '][^ ,.\\007]+)', 'g');\r
msg.msg = msg.msg.replace(re, function (match) {\r
return '<a class="chan">' + match + '</a>';\r
});\r
\r
+\r
+ // Convert IRC formatting into HTML formatting\r
+ msg.msg = formatIRCMsg(msg.msg);\r
+\r
// Build up and add the line\r
line_msg = '<div class="msg <%= type %>"><div class="time"><%- time %></div><div class="nick"><%- nick %></div><div class="text" style="<%= style %>"><%= msg %> </div></div>';\r
$this.append(_.template(line_msg, msg));\r
}\r
},\r
chanClick: function (x) {\r
- console.log(x);\r
+ kiwi.gateway.join($(x.srcElement).text());\r
},\r
show: function () {\r
var $this = this.$el;\r
},\r
\r
setCurrentTopic: function (new_topic) {\r
- $('input', this.$el).val(new_topic);\r
+ new_topic = new_topic || '';\r
+\r
+ // We only want a plain text version\r
+ new_topic = $('<div>').html(formatIRCMsg(new_topic));\r
+ $('input', this.$el).val(new_topic.text());\r
}\r
});\r
\r