summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-10-30 14:02:51 +0100
committerSarven Capadisli <csarven@status.net>2009-10-30 14:02:51 +0100
commitb55b2fa7d0667a635fad06af793ed00683f188b1 (patch)
treeec7e2008443a4962f7d0f885823575dd5307906b /js/util.js
parent0e5cf9b3b4002d4da092633150e0faf35b166dcf (diff)
Updated NoticeAttachments
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js103
1 files changed, 52 insertions, 51 deletions
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('<button>&#215;</button>');
- $('#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('<button>&#215;</button>');
+ $('#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');
+ }
+ );
}
}
}