make chat copy&paste friendly again

This commit is contained in:
Stefan Breunig 2013-02-16 10:56:58 +01:00
parent 6d41221131
commit 5445006d5a
2 changed files with 55 additions and 50 deletions

View File

@ -338,7 +338,8 @@ window.chat.renderMsg = function(msg, nick, time, team) {
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>'; var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
var s = 'style="color:'+COLORS[team]+'"'; var s = 'style="color:'+COLORS[team]+'"';
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : ''; var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
return '<tr><td>'+t+'</td><td><mark '+s+'>'+nick+'</mark></td><td>'+msg+'</td></tr>'; var i = ['<span class="invisep">&lt;</span>', '<span class="invisep">&gt;</span>'];
return '<tr><td>'+t+'</td><td>'+i[0]+'<mark '+s+'>'+nick+'</mark>'+i[1]+'</td><td>'+msg+'</td></tr>';
} }

102
style.css
View File

@ -156,7 +156,7 @@ a:hover {
#chat { #chat {
position: absolute; position: absolute;
width: 708px; width: 708px;
bottom: 24px; bottom: 23px;
left: 0; left: 0;
z-index: 3000; z-index: 3000;
background: rgba(8, 48, 78, 0.9); background: rgba(8, 48, 78, 0.9);
@ -164,6 +164,9 @@ a:hover {
color: #eee; color: #eee;
border: 1px solid #20A8B1; border: 1px solid #20A8B1;
border-bottom: 0; border-bottom: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} }
em { em {
@ -176,53 +179,67 @@ em {
top: 25px; top: 25px;
} }
#chatpublic, #chatfull, #chatcompact, /* FIXME DEPRECATED: */#chatautomated { #chatpublic, #chatfull, #chatcompact {
display: none; display: none;
} }
#chat > div { #chat > div {
overflow-x:hidden; overflow-x:hidden;
overflow-y:scroll; overflow-y:scroll;
height: 100%; /* fallback for Opera which doesnt support calc */ height: 100%;
height: calc(100% - 4px); -webkit-box-sizing: border-box;
height: -webkit-calc(100% - 4px); -moz-box-sizing: border-box;
height: -moz-calc(100% - 4px); box-sizing: border-box;
padding: 2px; padding: 2px;
position:relative; position:relative;
} }
#chat p { #chat table, #chatinput table {
display: block; width: 100%;
padding: 1px 2px; height: 100%;
margin:0; table-layout: fixed;
border-spacing: 0m;
border-collapse: collapse;
}
#chat td, #chatinput td {
font-family: Verdana, sans-serif;
font-size: 12.6px;
vertical-align: top;
padding-bottom: 3px;
}
/* time */
#chat td:first-child, #chatinput td:first-child {
width: 44px;
overflow: hidden;
padding-left: 2px;
color: #bbb;
} }
#chat time { #chat time {
cursor: help; cursor: help;
} }
time, mark, #chat span, #chat a { /* nick */
font-family: Verdana, sans-serif; #chat td:nth-child(2), #chatinput td:nth-child(2) {
font-size: 12.6px; width: 91px;
vertical-align: top;
}
time {
display: inline-block;
width: 44px;
color: #bbb;
overflow: hidden; overflow: hidden;
padding-left: 2px;
} }
mark { mark {
display: inline-block;
width: 91px;
margin-right:4px;
overflow:hidden;
vertical-align: top;
background: transparent; background: transparent;
} }
.invisep {
display: inline-block;
width:0;
height:0;
overflow:hidden;
}
/* divider */
summary { summary {
color: #bbb; color: #bbb;
display: inline-block; display: inline-block;
@ -231,49 +248,36 @@ summary {
overflow: hidden; overflow: hidden;
padding: 0 2px; padding: 0 2px;
white-space: nowrap; white-space: nowrap;
width: 683px; width: 100%;
}
#chat span {
display: inline-block;
width: 540px;
} }
#chatinput { #chatinput {
line-height:22px;
padding: 0 4px;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
padding: 0 2px;
background: rgba(8, 48, 78, 0.9); background: rgba(8, 48, 78, 0.9);
width: 700px; width: 708px;
border: 1px solid #20A8B1; border: 1px solid #20A8B1;
z-index: 3001; z-index: 3001;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} }
#chat .invisibleseparator { #chatinput td {
color: rgba(8, 48, 78, 0.0); padding-bottom: 1px;
overflow: hidden; vertical-align: middle;
width: 0px;
} }
#chatinput span {
font-family: Verdana,sans-serif;
display: inline-block;
font-size: 12.6px;
width: 84px;
color: red;
padding: 0 4px 0 1px;
width: 85px;
}
#chatinput input { #chatinput input {
background: transparent; background: transparent;
font-size: 12.6px; font-size: 12.6px;
font-family: Verdana,sans-serif; font-family: Verdana,sans-serif;
color: #EEEEEE; color: #EEEEEE;
width: 558px width: 100%;
height: 100%;
} }