Browse Source

Fix #408, add support of /code

pull/411/head
Timothée Jaussoin 9 years ago
parent
commit
6e385254d4
  1. 8
      app/widgets/Chat/chat.css
  2. 10
      app/widgets/Chat/chat.js
  3. 3
      themes/material/css/typo.css

8
app/widgets/Chat/chat.css

@ -81,6 +81,14 @@
width: auto;
}
#chat_widget li.room > p.message.code,
#chat_widget li div.bubble > p.code {
display: block;
margin: 0;
font-size: 1.6rem;
margin-top: 0.75rem;
color: white;
}
#chat_widget li.room {
padding: 0.25rem 0;

10
app/widgets/Chat/chat.js

@ -238,6 +238,11 @@ var Chat = {
message.body = message.body.substr(4);
}
if(message.body.match(/^\/code/)) {
p.classList.add('code');
message.body = message.body.substr(6).trim();
}
if (message.quoted) {
p.classList.add('quoted');
}
@ -326,6 +331,11 @@ var Chat = {
data.body = data.body.substr(4);
}
if(data.body.match(/^\/code/)) {
p.classList.add('code');
data.body = data.body.substr(6).trim();
}
if (data.id != null) {
msg.setAttribute("id", data.id);
if (data.newid != null) {

3
themes/material/css/typo.css

@ -69,13 +69,14 @@ code {
border-radius: 0.3rem;
}
li p.code,
pre,
xmp {
color: white;
padding: 1rem;
font-size: 1.6rem;
margin: 1rem 0;
border-left: 1rem solid gray;
border-left: 0.75rem solid gray;
background-color: #333;
white-space:pre-wrap; word-wrap:break-word;
direction: ltr;

Loading…
Cancel
Save