Browse files

Apply preformatted text via CSS class rather than html manipulation.

  • Loading branch information...
1 parent 89e0d78 commit 61d526098de7b6e3362b603d2cfd716031c22a32 @akavlie akavlie committed Jan 28, 2012
Showing with 15 additions and 15 deletions.
  1. +11 −7 assets/css/subway.css
  2. +1 −5 assets/js/models.js
  3. +3 −3 views/templates.jade
View
18 assets/css/subway.css
@@ -200,22 +200,26 @@
background-image:url('/assets/images/part.png');
}
-.chat_name{
+.chat-name {
display: table-cell;
width: 14%;
vertical-align: top;
padding: 1% 0% 1% 1%;
}
-.chat_message{
+.chat-message {
display: table-cell;
width: 66%;
padding: 1%;
border-left: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
}
-.chat_message .embed img{
+.chat-message.motd {
+ white-space: pre;
+}
+
+.chat-message .embed img{
display: block;
max-width: 100%;
max-height: 60%;
@@ -234,7 +238,7 @@
border-right: 1px solid #DDDDDD;
}
-.chat_time {
+.chat-time {
display: table-cell;
vertical-align: top;
color: #888888;
@@ -243,20 +247,20 @@
width: 20%;
}
-#user-window{
+#user-window {
height: 100%;
width: 20%;
position: absolute;
margin-left: 80%;
background: #E7E9ED;
}
-#user-list{
+#user-list {
overflow-y: auto;
height: 95%;
}
-.userlist_user{
+.userlist_user {
border-bottom: 1px solid #CCCCCC;
display: table;
width: 100%;
View
6 assets/js/models.js
@@ -26,14 +26,10 @@ var Message = Backbone.Model.extend({
} else {
output = ich.message({
user: nick,
+ type: this.get('type'),
content: this.get('raw'),
renderedTime: this._formatDate(Date.now())
}, true);
- // Change rendering for motd
- if (this.get('type') === 'motd') {
- output = output.replace('<span>', '<span><pre>');
- output = output.replace('</span>', '</pre></span>');
- }
}
var result = this._linkify(output);
View
6 views/templates.jade
@@ -97,9 +97,9 @@ script(id="action", type="text/html")
span {{renderedTime}}
script(id="message", type="text/html")
- .chat_name
+ .chat-name
b {{user}}
- .chat_message
+ div(class="chat-message {{type}}")
span {{content}}
- .chat_time
+ .chat-time
span {{renderedTime}}

0 comments on commit 61d5260

Please sign in to comment.