Fix message and topic text wrapping

This commit is contained in:
Pavel Djundik 2016-03-22 18:04:34 +02:00
parent eadcca0b5e
commit 2bb3951476
2 changed files with 3 additions and 25 deletions

View file

@ -607,6 +607,7 @@ button,
#windows .header .topic {
color: #777;
margin-left: 8px;
word-break: break-all;
}
#windows .window .header {
@ -699,6 +700,7 @@ button,
#chat .messages {
display: table;
table-layout: fixed;
width: 100%;
padding: 10px 0;
}
@ -754,14 +756,6 @@ button,
padding-right: 6px;
}
#chat .wrap,
#chat .text a {
font-style: normal;
word-break: break-all;
word-wrap: break-word;
display: inline-block;
}
#chat .self .text {
color: #999;
}

View file

@ -1,29 +1,13 @@
Handlebars.registerHelper(
"parse", function(text) {
var wrap = wraplong(text);
text = Handlebars.Utils.escapeExpression(text);
text = colors(text);
text = channels(text);
text = uri(text);
if (wrap) {
return "<i class='wrap'>" + text + "</i>";
} else {
return text;
}
return text;
}
);
function wraplong(text) {
var wrap = false;
var split = text.split(" ");
for (var i in split) {
if (split[i].length > 40) {
wrap = true;
}
}
return wrap;
}
function uri(text) {
return URI.withinString(text, function(url, start, end, source) {
if (url.indexOf("javascript:") === 0) {