default:
// CSS class based matching
- if (elt.match('SPAN.toggleQuoteShow')) {
+ if (elt.hasClassName('unblockImageLink')) {
+ IMP.unblockImages(e);
+ } 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')) {
};
/**
- * Use DOM manipulation to un-block images that had been redirected.
+ * Use DOM manipulation to un-block images.
*/
-IMP.unblockImages = function(p, message)
+IMP.unblockImages = function(e)
{
- var tmp;
+ var elt = e.element().up('TABLE.mimeStatusMessage');
- if (!p) {
- return true;
- }
-
- $(p).select('[blocked]').each(function(elt) {
+ elt.next('.htmlMessage').select('[blocked]').each(function(elt) {
var src = decodeURIComponent(elt.readAttribute('blocked'));
if (elt.hasAttribute('src')) {
elt.writeAttribute('src', src);
}
});
- message = $(message);
- if (message) {
- tmp = message.up();
- message.remove();
- if (!tmp.childElements().size()) {
- tmp = tmp.up('TABLE.mimeStatusMessage');
- if (tmp) {
- tmp.remove();
- }
- }
- }
+ Effect.Fade(elt, { duration: 0.6, afterFinish: function() { elt.remove(); } });
- // On success return false to stop event propagation.
- return false;
+ e.stop();
};
document.observe('dom:loaded', function() {
} else if (elt.hasClassName('notspamAction')) {
this.submit('notspam_report');
}
+ } else if (elt.hasClassName('unblockImageLink')) {
+ IMP.unblockImages(e);
} 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 } });
if ($inline) {
/* Put div around message. */
- $data = '<div id="html-message">' . $data . '</div>';
+ $data = '<div class="htmlMessage">' . $data . '</div>';
}
/* Only display images if specifically allowed by user. */
preg_match($this->_img_regex, $data)) {
/* Make sure the URL parameters are correct for the current
* message. */
- $url = Util::removeParameter(Horde::selfUrl(true), array('index'));
- if ($inline) {
- $url = Util::removeParameter($url, array('actionID'));
- }
+ $url = Util::removeParameter(Horde::selfUrl(true), array('actionID', 'index'));
$url = Util::addParameter($url, 'index', $this->_params['contents']->getIndex());
$view_img = Util::getFormData('view_html_images');
$data .= Util::bufferOutput(array('Horde', 'addScriptFile'), 'prototype.js', 'horde', true) .
Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp', true);
+ // Unblock javascript code in js/src/imp.js
$cleanhtml['status'][] = array(
'icon' => Horde::img('mime/image.png'),
- 'id' => 'impblockimages',
'text' => array(
String::convertCharset(_("Images have been blocked to protect your privacy."), $charset, $msg_charset),
- Horde::link(Util::addParameter($url, 'view_html_images', 1), '', '', '', 'return IMP.unblockImages(' . (!$inline ? 'document.body' : '$(\'html-message\')') . ', \'impblockimages\');', '', '', $inline ? array() : array('style' => 'color:blue')) . String::convertCharset(_("Show Images?"), $charset, $msg_charset) . '</a>'
+ Horde::link(Util::addParameter($url, 'view_html_images', 1), '', 'unblockImageLink') . String::convertCharset(_("Show Images?"), $charset, $msg_charset) . '</a>'
)
);
}
/* Fixes li & ol list numbering issues in HTML messages. */
-#html-message ul li, #html-message ol li {
+.htmlMessage ul li, .htmlMessage ol li {
margin-left: 2em;
}
*/
/* Fixes li & ol list numbering issues in HTML messages. */
-#html-message ul li, #html-message ol li {
+.htmlMessage ul li, .htmlMessage ol li {
margin-left: 2em;
}
}
/* Fixes li & ol list numbering issues in HTML messages. */
-#html-message ul li , #html-message ol li {
+.htmlMessage ul li , .htmlMessage ol li {
margin-left: 2em;
}
*/
/* Fixes li & ol list numbering issues in HTML messages. */
-#html-message ul li, #html-message ol li {
+.htmlMessage ul li, .htmlMessage ol li {
margin-left: 2em;
}
}
/* Based on the Mozilla default defintions */
-#html-message blockquote[type="cite"] {
+.htmlMessage blockquote[type="cite"] {
padding-left: 0;
padding-right: 1em;
}
}
/* Based on the Mozilla default definitions */
-#html-message td {
+.htmlMessage td {
padding: 0;
}
-#html-message ul {
+.htmlMessage ul {
display: block;
list-style-type: disc;
margin: 1em 0;
-moz-padding-start: 40px;
}
-#html-message ol {
+.htmlMessage ol {
display: block;
list-style-type: decimal;
margin: 1em 0;
-moz-padding-start: 40px;
}
-#html-message p {
+.htmlMessage p {
display: block;
margin: 1em 0;
}
-#html-message blockquote {
+.htmlMessage blockquote {
margin: 1em 40px;
}
-#html-message blockquote[type="cite"] {
+.htmlMessage blockquote[type="cite"] {
margin-left: 0;
margin-right: 0;
padding-left: 1em;