mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-09-14 15:22:02 +00:00
Adding preview for the direct image links
This commit is contained in:
parent
a77e3db435
commit
2f14512025
@ -951,6 +951,16 @@ button.disabled:hover
|
|||||||
display: none;
|
display: none;
|
||||||
padding: 5px 5px 0 5px;
|
padding: 5px 5px 0 5px;
|
||||||
}
|
}
|
||||||
|
.image-preview
|
||||||
|
{
|
||||||
|
max-height: 500px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
.preview-container
|
||||||
|
{
|
||||||
|
max-height: 500px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.post-stats
|
.post-stats
|
||||||
{
|
{
|
||||||
margin: 0 10px 0 55px;
|
margin: 0 10px 0 55px;
|
||||||
|
@ -244,6 +244,8 @@
|
|||||||
<!-- use "avatar-row-template" here -->
|
<!-- use "avatar-row-template" here -->
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div class="preview-container">
|
||||||
|
</div>
|
||||||
<div class="post-reply-content" style="display: block;">
|
<div class="post-reply-content" style="display: block;">
|
||||||
<form class="post-area-new">
|
<form class="post-area-new">
|
||||||
<textarea placeholder="Reply..."></textarea>
|
<textarea placeholder="Reply..."></textarea>
|
||||||
|
@ -307,7 +307,17 @@ var postExpandFunction = function( e, postLi )
|
|||||||
originalLi.append(originalPost);
|
originalLi.append(originalPost);
|
||||||
|
|
||||||
$postExpandedContent.slideDown( "fast" );
|
$postExpandedContent.slideDown( "fast" );
|
||||||
|
|
||||||
|
var previewContainer=$postExpandedContent.find(".preview-container")[0];
|
||||||
|
/* was the preview added before... */
|
||||||
|
if ($(previewContainer).children().length == 0)
|
||||||
|
{
|
||||||
|
var link = originalPost.find("a[rel='nofollow']");
|
||||||
|
if (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase()))
|
||||||
|
{
|
||||||
|
$(previewContainer).append($("<img src='" + link.html() + "' class='image-preview' />"));
|
||||||
|
}
|
||||||
|
}
|
||||||
// insert "reply_to" before
|
// insert "reply_to" before
|
||||||
requestRepliedBefore(originalLi);
|
requestRepliedBefore(originalLi);
|
||||||
// insert replies to this post after
|
// insert replies to this post after
|
||||||
|
Loading…
x
Reference in New Issue
Block a user