summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-25 11:13:13 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-25 11:13:13 -0400
commit84edf12791dc3d44625b156cda6296f1f74f8a9d (patch)
tree5de74fe285407a93c1ab6ff9270994b4512df8aa /js
parent5f3acc252738e408ea2447b7541eae66c1e9e09a (diff)
Display thumbnail on hover over links in notices when appropriate.
Diffstat (limited to 'js')
-rw-r--r--js/util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index b6848abaa..9ee2a1963 100644
--- a/js/util.js
+++ b/js/util.js
@@ -25,6 +25,19 @@ $(document).ready(function(){
//need to link to proper url depending on site config (path name and theme, for instance)
$('a.attachment').click(function() {$().jOverlay({url:'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
$('.entry-title a.attachment').append('&nbsp;<img style="display: inline; vertical-align: middle" src="/theme/base/images/icons/clip-inline.png" alt="Attachment" />');
+ $('a.thumbnail').hover(function() {
+ anchor = $(this);
+ $.get('/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
+ anchor.append(data);
+ $('#thumbnail').fadeIn('def');
+ });
+ },
+ function() {
+ setTimeout(function() {
+ $('#thumbnail').fadeOut('slow', function() {$(this).remove();});
+ }, 500);
+ }
+ );
// count character on keyup
function counter(event){