]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Bunch of UI fixes/improvements for attachments (hover, overlay, notice view,
authorSarven Capadisli <csarven@controlyourself.ca>
Wed, 27 May 2009 19:43:43 +0000 (19:43 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Wed, 27 May 2009 19:43:43 +0000 (19:43 +0000)
clip)

js/util.js
lib/attachmentlist.php
theme/base/css/display.css
theme/base/images/icons/twotone/green/clip-02.gif [new file with mode: 0644]
theme/default/css/display.css
theme/identica/css/display.css

index b1b6ec82bd93e21d268aa3129f33d5f617dc2780..08cc1d370550614215810538912ae45131872f6b 100644 (file)
  */
 
 $(document).ready(function(){
-    $('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() {
-            var anchor = $(this);
-            $("a.thumbnail").children('img').remove();
-
-            setTimeout(function() {
-                anchor.closest(".entry-title").addClass('ov');
-                $.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
-                    anchor.append(data);
-                });
-            }, 250);
-
-            setTimeout(function() {
-                anchor.children('img').remove();
-                anchor.closest(".entry-title").removeClass('ov');
-            }, 3000);
-        },
-        function() {
-            $(this).children('img').remove();
-            $(this).closest(".entry-title").removeClass('ov');
-        }
-    );
-
        // count character on keyup
        function counter(event){
                var maxLength = 140;
@@ -238,6 +214,7 @@ $(document).ready(function(){
        $("#form_notice").each(addAjaxHidden);
     NoticeHover();
     NoticeReply();
+    NoticeAttachments();
 });
 
 
@@ -276,3 +253,50 @@ function NoticeReplySet(nick,id) {
        }
        return true;
 }
+
+function NoticeAttachments() {
+    $.fn.jOverlay.options = {
+        method : 'GET',
+        data : '',
+        url : '',
+        color : '#000',
+        opacity : '0.6',
+        zIndex : 9999,
+        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;
+    });
+    $("body:not(#shownotice) a.thumbnail").hover(
+        function() {
+            var anchor = $(this);
+            $("a.thumbnail").children('img').remove();
+            anchor.closest(".entry-title").addClass('ov');
+
+            setTimeout(function() {
+                $.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
+                    anchor.append(data);
+                });
+            }, 500);
+
+            setTimeout(function() {
+                anchor.children('img').remove();
+                anchor.closest(".entry-title").removeClass('ov');
+            }, 3000);
+        },
+        function() {
+            $("a.thumbnail").children('img').remove();
+            $(this).closest(".entry-title").removeClass('ov');
+        }
+    );
+}
+
index d0478bad354e2b2004b2954285915d5ffd833cc3..559962accab60e4614f35773001a22182c5fb734 100644 (file)
@@ -80,10 +80,10 @@ class AttachmentList extends Widget
 
     function show()
     {
-        $this->out->elementStart('dl', array('id' =>'attachment'));
+        $this->out->elementStart('dl', array('id' =>'attachments'));
         $this->out->element('dt', null, _('Attachments'));
         $this->out->elementStart('dd');
-        $this->out->elementStart('ul', array('class' => 'attachments'));
+        $this->out->elementStart('ol', array('class' => 'attachments'));
 
         $atts = new File;
         $att = $atts->getAttachments($this->notice->id);
@@ -93,7 +93,7 @@ class AttachmentList extends Widget
         }
 
         $this->out->elementEnd('dd');
-        $this->out->elementEnd('ul');
+        $this->out->elementEnd('ol');
         $this->out->elementEnd('dl');
 
         return count($att);
index 9bc1417b170954bb38273b0bd13bf87fecdff706..16c9e3c0091000d77dc9b4af8a7f16ab4da6e5e1 100644 (file)
@@ -855,20 +855,6 @@ display:inline-block;
 text-transform:lowercase;
 }
 
-.notice .attachment {
-position:relative;
-}
-.notice .attachment img {
-position:absolute;
-top:18px;
-left:0;
-z-index:99;
-}
-#shownotice .notice .attachment img {
-position:static;
-}
-
-
 .notice-options {
 position:relative;
 font-size:0.95em;
@@ -936,6 +922,59 @@ padding:0;
 }
 
 
+.notice .attachment {
+position:relative;
+padding-left:16px;
+}
+#attachments .attachment {
+padding-left:0;
+}
+.notice .attachment img {
+position:absolute;
+top:18px;
+left:0;
+z-index:99;
+}
+#shownotice .notice .attachment img {
+position:static;
+}
+
+#attachments {
+clear:both;
+float:left;
+width:100%;
+margin-top:18px;
+}
+#attachments dt {
+font-weight:bold;
+font-size:1.3em;
+margin-bottom:4px;
+}
+
+#attachments li {
+margin-bottom:18px;
+list-style-type:decimal;
+float:left;
+clear:both;
+}
+
+#jOverlayContent,
+#jOverlayContent #content {
+width: auto !important;
+}
+#jOverlayContent .external span {
+display:block;
+margin-bottom:11px;
+}
+#jOverlayContent button {
+position:absolute;
+top:0;
+right:0;
+padding:3px 4px;
+font-weight:bold;
+}
+
+
 #usergroups #new_group {
 float: left;
 margin-right: 2em;
diff --git a/theme/base/images/icons/twotone/green/clip-02.gif b/theme/base/images/icons/twotone/green/clip-02.gif
new file mode 100644 (file)
index 0000000..77a7297
Binary files /dev/null and b/theme/base/images/icons/twotone/green/clip-02.gif differ
index 737db7ce9691125103befaac6311e8da62d0cff3..e08a4783bd6ba8882fe5246aa50db084c80c6796 100644 (file)
@@ -175,6 +175,12 @@ background-image:url(../../base/images/icons/twotone/green/shield.gif);
 }
 
 /* NOTICES */
+.notice .attachment {
+background:transparent url(../../base/images/icons/twotone/green/clip-02.gif) no-repeat 0 45%;
+}
+#attachments .attachment {
+background:none;
+}
 .notice-options .notice_reply a,
 .notice-options form input.submit {
 background-color:transparent;
index f7abac482364621572b2da6c541834b6c90c9ea9..1f1298737cd19430cc3393db22e8accfde5be3a6 100644 (file)
@@ -175,6 +175,12 @@ background-image:url(../../base/images/icons/twotone/green/shield.gif);
 }
 
 /* NOTICES */
+.notice .attachment {
+background:transparent url(../../base/images/icons/twotone/green/clip-02.gif) no-repeat 0 45%;
+}
+#attachments .attachment {
+background:none;
+}
 .notice-options .notice_reply a,
 .notice-options form input.submit {
 background-color:transparent;