mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-12 05:21:18 +00:00
Merge pull request #130 from erqan/preview-no-link-fix
Preview no link fix
This commit is contained in:
commit
13d354e98c
@ -954,12 +954,14 @@ button.disabled:hover
|
||||
.image-preview
|
||||
{
|
||||
max-height: 500px;
|
||||
max-width: 530px;
|
||||
width: auto;
|
||||
}
|
||||
.preview-container
|
||||
{
|
||||
max-height: 500px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.post-stats
|
||||
{
|
||||
|
@ -336,16 +336,16 @@ var postExpandFunction = function( e, postLi )
|
||||
|
||||
$postExpandedContent.slideDown( "fast" );
|
||||
|
||||
if ($.Options.getShowPreviewOpt() == 'enable')
|
||||
{
|
||||
if ($.Options.getShowPreviewOpt() == 'enable'){
|
||||
var previewContainer=$postExpandedContent.find(".preview-container")[0];
|
||||
/* was the preview added before... */
|
||||
if ($(previewContainer).children().length == 0)
|
||||
{
|
||||
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' />"));
|
||||
/*is there any link in the post?*/
|
||||
if (link.siblings().length > 0){
|
||||
if (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase())){
|
||||
$(previewContainer).append($("<img src='" + link.html() + "' class='image-preview' />"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user