mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-15 16:10:32 +03:00
Work on message rendering (wrap contents in <p>, update stylesheets)
This commit is contained in:
parent
7af9ca8302
commit
dd338dfaf6
@ -59,6 +59,10 @@ var DISCORD = (function(){
|
||||
return date.toLocaleDateString()+", "+date.toLocaleTimeString();
|
||||
}
|
||||
else if (property === "contents"){
|
||||
if (value.length === 0){
|
||||
return "";
|
||||
}
|
||||
|
||||
var processed = DOM.escapeHTML(value)
|
||||
.replace(REGEX.formatBold, "<b>$1</b>")
|
||||
.replace(REGEX.formatItalic, "<i>$1</i>")
|
||||
@ -70,7 +74,7 @@ var DISCORD = (function(){
|
||||
.replace(REGEX.mentionChannel, (full, match) => "<span class='link mention-chat'>#"+STATE.getChannelName(match)+"</span>")
|
||||
.replace(REGEX.mentionUser, (full, match) => "<span class='link mention-user'>@"+STATE.getUserName(match)+"</span>");
|
||||
|
||||
return processed;
|
||||
return "<p>"+processed+"</p>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -175,28 +175,31 @@ body {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#messages .message .link {
|
||||
.message .link {
|
||||
color: #7289DA;
|
||||
background-color: rgba(115, 139, 215, 0.1);
|
||||
}
|
||||
|
||||
#messages .message a {
|
||||
.message a {
|
||||
color: #0096CF;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#messages .message a:hover {
|
||||
.message a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#messages .message img {
|
||||
margin-top: 4px;
|
||||
.message p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.message img {
|
||||
max-height: 320px;
|
||||
max-width: calc(100vw - 299px);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#messages .message code {
|
||||
.message code {
|
||||
background-color: #2E3136;
|
||||
border: 2px solid #282B30;
|
||||
border-radius: 5px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user