]>
Commit | Line | Data |
---|---|---|
96f28062 CP |
1 | qwebirc.ui.HilightController = new Class({ |
2 | initialize: function(parent) { | |
3 | this.parent = parent; | |
4 | this.regex = null; | |
5 | this.prevnick = null; | |
6 | }, | |
7 | match: function(text) { | |
8 | var nick = this.parent.nickname; | |
9 | if(nick != this.prevnick) | |
10 | this.regex = new RegExp('\\b' + RegExp.escape(nick) + '\\b', "i"); | |
11 | ||
12 | if(text.match(this.regex)) | |
13 | return true; | |
14 | return false; | |
15 | } | |
16 | }); |