mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-15 08:00:33 +03:00
Add styles and templates for embedded images and downloads
This commit is contained in:
parent
dd338dfaf6
commit
45896cc266
@ -15,6 +15,8 @@ var DISCORD = (function(){
|
||||
var templateChannelServer;
|
||||
var templateChannelPrivate;
|
||||
var templateMessage;
|
||||
var templateEmbedImage;
|
||||
var templateEmbedDownload;
|
||||
|
||||
return {
|
||||
setup: function(){
|
||||
@ -38,6 +40,14 @@ var DISCORD = (function(){
|
||||
"<div class='message'>{contents}</div>",
|
||||
"</div>"
|
||||
].join(""));
|
||||
|
||||
templateEmbedImage = new TEMPLATE([
|
||||
"<a href='{url}' class='embed'><img src='{url}' title='(image attachment not found)'></a>"
|
||||
].join(""));
|
||||
|
||||
templateEmbedDownload = new TEMPLATE([
|
||||
"<a href='{url}' class='embed download'>Download {filename}</a>"
|
||||
].join(""));
|
||||
},
|
||||
|
||||
getChannelHTML: function(channel){
|
||||
|
@ -166,7 +166,7 @@ body {
|
||||
* MESSAGE CONTENT *
|
||||
*******************/
|
||||
|
||||
#messages .message {
|
||||
.message {
|
||||
margin-top: 6px;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 15px;
|
||||
@ -193,12 +193,29 @@ body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.message .embed {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.message img {
|
||||
max-height: 320px;
|
||||
max-width: calc(100vw - 299px);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.message .download {
|
||||
display: inline-block;
|
||||
margin-right: 8px;
|
||||
padding: 8px 9px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.message .embed:first-child, .message .download + .download {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.message code {
|
||||
background-color: #2E3136;
|
||||
border: 2px solid #282B30;
|
||||
|
Loading…
x
Reference in New Issue
Block a user