summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-31 17:12:04 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-31 17:12:04 -0400
commitebeb5f744cbfd5bfea0da1b350a3757865ec4b3b (patch)
treee94ceadeeba967759cb332211a5adb5d6dceab0b /js/util.js
parent3e0c291810d23bb54c337c0fe95c1ba441459c4c (diff)
parent36fe5a85b2de9f71a5c963abd0074dd5b7ae1e61 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into upload
Conflicts: js/util.js lib/attachmentlist.php
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index 85ab48b4c..acf44a17c 100644
--- a/js/util.js
+++ b/js/util.js
@@ -250,6 +250,7 @@ $(document).ready(function(){
$("#form_notice").each(addAjaxHidden);
NoticeHover();
NoticeReply();
+ NoticeAttachments();
});
@@ -288,3 +289,53 @@ function NoticeReplySet(nick,id) {
}
return true;
}
+
+function NoticeAttachments() {
+ $.fn.jOverlay.options = {
+ method : 'GET',
+ data : '',
+ url : '',
+ color : '#000',
+ opacity : '0.6',
+ zIndex : 99,
+ center : true,
+ imgLoading : $('address .url')[0].href+'theme/base/images/illustrations/illu_progress_loading-01.gif',
+ bgClickToClose : true,
+ success : function() {
+ $('#jOverlayContent').append('<button>&#215;</button>');
+ $('#jOverlayContent button').click($.closeOverlay);
+ },
+ timeout : 0
+ };
+
+ $('a.attachment').click(function() {
+ $().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'});
+ return false;
+ });
+
+ var t;
+ $("body:not(#shownotice) a.thumbnail").hover(
+ function() {
+ var anchor = $(this);
+ $("a.thumbnail").children('img').hide();
+ anchor.closest(".entry-title").addClass('ov');
+
+ if (anchor.children('img').length == 0) {
+ t = setTimeout(function() {
+ $.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
+ anchor.append(data);
+ });
+ }, 500);
+ }
+ else {
+ anchor.children('img').show();
+ }
+ },
+ function() {
+ clearTimeout(t);
+ $("a.thumbnail").children('img').hide();
+ $(this).closest(".entry-title").removeClass('ov');
+ }
+ );
+}
+