Use our own JS to display quote blocks
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Feb 2009 07:39:06 +0000 (00:39 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Feb 2009 07:39:06 +0000 (00:39 -0700)
imp/js/src/DimpCore.js
imp/js/src/message.js
imp/lib/Mime/Viewer/plain.php

index 1ccee0e..dec9bad 100644 (file)
@@ -486,6 +486,17 @@ DimpCore = {
                 tmp = elt.down();
                 [ tmp.down(), tmp.down(1), tmp.next() ].invoke('toggle');
                 break;
+
+            default:
+                // CSS class based matching
+                if (elt.match('SPAN.toggleQuoteShow')) {
+                    [ elt, elt.next() ].invoke('toggle');
+                    Effect.BlindDown(elt.next(1), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
+                } else if (elt.match('SPAN.toggleQuoteHide')) {
+                    [ elt, elt.previous() ].invoke('toggle');
+                    Effect.BlindUp(elt.next(), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
+                }
+                break;
             }
 
             elt = elt.up();
index 349763c..373b4c9 100644 (file)
@@ -162,14 +162,28 @@ var ImpMessage = {
 
     _clickHandler: function(e)
     {
+        if (e.isRightClick()) {
+            return;
+        }
+
         var elt = e.element();
 
-        if (elt.match('.msgactions A.widget')) {
-            if (elt.hasClassName('moveAction')) {
-                this._transfer('move_message');
-            } else if (elt.hasClassName('copyAction')) {
-                this._transfer('copy_message');
+        while (Object.isElement(elt)) {
+            if (elt.match('.msgactions A.widget')) {
+                if (elt.hasClassName('moveAction')) {
+                    this._transfer('move_message');
+                } else if (elt.hasClassName('copyAction')) {
+                    this._transfer('copy_message');
+                }
+            } else if (elt.match('SPAN.toggleQuoteShow')) {
+                [ elt, elt.next() ].invoke('toggle');
+                Effect.BlindDown(elt.next(1), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
+            } else if (elt.match('SPAN.toggleQuoteHide')) {
+                [ elt, elt.previous() ].invoke('toggle');
+                Effect.BlindUp(elt.next(), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
             }
+
+            elt = elt.up();
         }
     }
 
index b49f8b3..86f0ebc 100644 (file)
@@ -87,7 +87,7 @@ class IMP_Horde_Mime_Viewer_plain extends Horde_Mime_Viewer_plain
                 $list_info = $imp_ui->getListInformation($header);
                 $hideBlocks = $list_info['exists'];
             }
-            $filters['highlightquotes'] = array('hideBlocks' => $hideBlocks);
+            $filters['highlightquotes'] = array('hideBlocks' => $hideBlocks, 'outputJS' => false);
         }
 
         // Highlight simple markup of an email.