From da433548391eb1b893aea27f7afa98eeb60ba7d6 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 20 Feb 2009 00:39:06 -0700 Subject: [PATCH] Use our own JS to display quote blocks --- imp/js/src/DimpCore.js | 11 +++++++++++ imp/js/src/message.js | 24 +++++++++++++++++++----- imp/lib/Mime/Viewer/plain.php | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/imp/js/src/DimpCore.js b/imp/js/src/DimpCore.js index 1ccee0ec3..dec9badde 100644 --- a/imp/js/src/DimpCore.js +++ b/imp/js/src/DimpCore.js @@ -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(); diff --git a/imp/js/src/message.js b/imp/js/src/message.js index 349763cc1..373b4c9ab 100644 --- a/imp/js/src/message.js +++ b/imp/js/src/message.js @@ -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(); } } diff --git a/imp/lib/Mime/Viewer/plain.php b/imp/lib/Mime/Viewer/plain.php index b49f8b3c2..86f0ebcdf 100644 --- a/imp/lib/Mime/Viewer/plain.php +++ b/imp/lib/Mime/Viewer/plain.php @@ -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. -- 2.11.0