]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Updated NoticeAttachments
authorSarven Capadisli <csarven@status.net>
Fri, 30 Oct 2009 13:02:51 +0000 (14:02 +0100)
committerSarven Capadisli <csarven@status.net>
Fri, 30 Oct 2009 13:02:51 +0000 (14:02 +0100)
js/util.js

index 9182cb9f1668b6e9e6b24316a7477f7589e3e108..fcfc0b95abcb24c20685a330f7976c59b97da995 100644 (file)
@@ -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');
+                }
+            );
         }
     }
 }