Browse Source

adding link check for preview

master
erqan 11 years ago
parent
commit
917cd1301b
  1. 14
      js/interface_common.js

14
js/interface_common.js

@ -336,16 +336,16 @@ 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){
$(previewContainer).append($("<img src='" + link.html() + "' class='image-preview' />")); if (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase())){
$(previewContainer).append($("<img src='" + link.html() + "' class='image-preview' />"));
}
} }
} }
} }

Loading…
Cancel
Save