]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
LinkPreview: link the thumbnails
authorBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 21:58:22 +0000 (13:58 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 21:58:22 +0000 (13:58 -0800)
plugins/LinkPreview/linkpreview.js

index eae6dfd43fd61e95033da3661591f02b5862f886..9f0ed656238fe351dc4b6e1553b8666ddd4a078a 100644 (file)
@@ -73,11 +73,14 @@ $(function() {
                 }
             }
             if (thumb) {
-                var img = $('<img/>')
-                    .attr('src', thumb)
-                    .attr('width', width)
-                    .attr('title', data.title || data.url || url);
-                $('#' + id).append(img);
+                var link = $('<a><img/></a>');
+                link.attr('href', url)
+                    .attr('target', '_blank')
+                    .find('img')
+                        .attr('src', thumb)
+                        .attr('width', width)
+                        .attr('title', data.title || data.url || url);
+                $('#' + id).append(link);
             }
         });
     }