|
|
|
|
|
|
84
|
}
|
84
|
}
|
|
85
|
}, { re: /.*/, fn: function(match) { return new Text(match[0]); }}];
|
85
|
}, { re: /.*/, fn: function(match) { return new Text(match[0]); }}];
|
|
86
|
|
86
|
|
|
87
|
function expandWord(word) {
|
|
|
|
|
|
87
|
function expandWord(word, msgEl) {
|
|
88
|
for (var i = 0; i < word_matchers.length; i++) {
|
88
|
for (var i = 0; i < word_matchers.length; i++) {
|
|
89
|
var matcher = word_matchers[i];
|
89
|
var matcher = word_matchers[i];
|
|
90
|
var match = word.match(matcher.re);
|
90
|
var match = word.match(matcher.re);
|
|
91
|
if (match) {
|
91
|
if (match) {
|
|
92
|
return matcher.fn(match);
|
|
|
|
|
|
92
|
return matcher.fn(match, msgEl);
|
|
93
|
}
|
93
|
}
|
|
94
|
}
|
94
|
}
|
|
95
|
}
|
95
|
}
|
|
|
|
|
|
|
101
|
var words = msg.content.split(/\s/);
|
101
|
var words = msg.content.split(/\s/);
|
|
102
|
for (var i = 0; i < words.length; i++) {
|
102
|
for (var i = 0; i < words.length; i++) {
|
|
103
|
msgEl.appendChild(new Text(" "));
|
103
|
msgEl.appendChild(new Text(" "));
|
|
104
|
msgEl.appendChild(expandWord(words[i]));
|
|
|
|
|
|
104
|
msgEl.appendChild(expandWord(words[i], msgEl));
|
|
105
|
}
|
105
|
}
|
|
106
|
messagesEl.appendChild(msgEl);
|
106
|
messagesEl.appendChild(msgEl);
|
|
107
|
if (window.scrollY >= window.scrollMaxY - 2 * inputEl.clientHeight) {
|
107
|
if (window.scrollY >= window.scrollMaxY - 2 * inputEl.clientHeight) {
|