From b55b2fa7d0667a635fad06af793ed00683f188b1 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 30 Oct 2009 14:02:51 +0100 Subject: Updated NoticeAttachments --- js/util.js | 103 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 51 deletions(-) (limited to 'js') diff --git a/js/util.js b/js/util.js index 9182cb9f1..fcfc0b95a 100644 --- a/js/util.js +++ b/js/util.js @@ -100,62 +100,12 @@ $(document).ready(function(){ SN.U.FormNoticeXHR(); SN.U.NoticeReply(); - NoticeAttachments(); + SN.U.NoticeAttachments(); NoticeDataAttach(); }); -function NoticeAttachments() { - $.fn.jOverlay.options = { - method : 'GET', - data : '', - url : '', - color : '#000', - opacity : '0.6', - zIndex : 99, - center : false, - imgLoading : $('address .url')[0].href+'theme/base/images/illustrations/illu_progress_loading-01.gif', - bgClickToClose : true, - success : function() { - $('#jOverlayContent').append(''); - $('#jOverlayContent button').click($.closeOverlay); - }, - timeout : 0, - autoHide : true, - css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} - }; - - $('#content .notice 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) #content .notice 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'); - } - ); -} function NoticeDataAttach() { NDA = $('#notice_data-attach'); @@ -335,6 +285,57 @@ var SN = { // StatusNet } } return true; + }, + + NoticeAttachments: function() { + $.fn.jOverlay.options = { + method : 'GET', + data : '', + url : '', + color : '#000', + opacity : '0.6', + zIndex : 99, + center : false, + imgLoading : $('address .url')[0].href+'theme/base/images/illustrations/illu_progress_loading-01.gif', + bgClickToClose : true, + success : function() { + $('#jOverlayContent').append(''); + $('#jOverlayContent button').click($.closeOverlay); + }, + timeout : 0, + autoHide : true, + css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} + }; + + $('#content .notice 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) #content .notice 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'); + } + ); } } } -- cgit v1.2.3-54-g00ecf