mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-15 01:12:12 +00:00
adding link check for preview
This commit is contained in:
parent
3d27a0e418
commit
917cd1301b
@ -336,19 +336,19 @@ var postExpandFunction = function( e, postLi )
|
|||||||
|
|
||||||
$postExpandedContent.slideDown( "fast" );
|
$postExpandedContent.slideDown( "fast" );
|
||||||
|
|
||||||
if ($.Options.getShowPreviewOpt() == 'enable')
|
if ($.Options.getShowPreviewOpt() == 'enable'){
|
||||||
{
|
|
||||||
var previewContainer=$postExpandedContent.find(".preview-container")[0];
|
var previewContainer=$postExpandedContent.find(".preview-container")[0];
|
||||||
/* was the preview added before... */
|
/* was the preview added before... */
|
||||||
if ($(previewContainer).children().length == 0)
|
if ($(previewContainer).children().length == 0) {
|
||||||
{
|
|
||||||
var link = originalPost.find("a[rel='nofollow']");
|
var link = originalPost.find("a[rel='nofollow']");
|
||||||
if (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase()))
|
/*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' />"));
|
$(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