]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed URL for attachment thumbnail and XHR
authorSarven Capadisli <csarven@controlyourself.ca>
Mon, 25 May 2009 18:54:45 +0000 (18:54 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Mon, 25 May 2009 18:54:45 +0000 (18:54 +0000)
js/util.js

index 9ee2a19635da2d7b5b968221a7d8106f83aba479..ffaedc690d1e6b51149b4bbecef8b9b336509e64 100644 (file)
@@ -23,20 +23,20 @@ $(document).ready(function(){
 
     //FIXME
     //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);
-    }
+    $('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
+    $('a.thumbnail').hover(
+        function() {
+            anchor = $(this);
+            $.get($('address .url')[0].href+'/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