From 917cd1301b9a0be1ee115bc5a6628b8e041886e0 Mon Sep 17 00:00:00 2001 From: erqan Date: Wed, 2 Apr 2014 11:21:01 +0300 Subject: [PATCH 1/2] adding link check for preview --- js/interface_common.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 24feac1..c38c426 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -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($("")); + /*is there any link in the post?*/ + if (link.siblings().length > 0){ + if (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase())){ + $(previewContainer).append($("")); + } } } } From 1c9889072ca2ac935ae4104758e9c8250a4864cd Mon Sep 17 00:00:00 2001 From: erqan Date: Wed, 2 Apr 2014 12:03:14 +0300 Subject: [PATCH 2/2] fixing wide image issue --- css/style.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/css/style.css b/css/style.css index 59ab5d3..4147575 100644 --- a/css/style.css +++ b/css/style.css @@ -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 {