/**
* Provides the javascript for the message.php script (standard view).
*
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @package IMP
*/
var ImpMessage = {
+ // Set in message.php: pop3delete, stripatc
+
_arrowHandler: function(e)
{
if (e.altKey || e.shiftKey || e.ctrlKey) {
while (Object.isElement(elt)) {
if (elt.match('.msgactions A.widget')) {
+ if (this.pop3delete && elt.hasClassName('deleteAction')) {
+ if (!window.confirm(this.pop3delete)) {
+ e.stop();
+ return;
+ }
+ }
if (elt.hasClassName('moveAction')) {
this._transfer('move_message');
} else if (elt.hasClassName('copyAction')) {
this.submit('spam_report');
} else if (elt.hasClassName('notspamAction')) {
this.submit('notspam_report');
+ } else if (elt.hasClassName('stripAllAtc')) {
+ if (!window.confirm(this.stripatc)) {
+ e.stop();
+ return;
+ }
}
} else if (elt.hasClassName('unblockImageLink')) {
IMP.unblockImages(e);
if (in_array('\\deleted', $flags)) {
$a_template->set('delete', Horde::widget($self_link->copy()->add('actionID', 'undelete_message'), _("Undelete"), 'widget', '', '', _("Undelete"), true));
} else {
- $a_template->set('delete', Horde::widget($self_link->copy()->add('actionID', 'delete_message'), _("Delete"), 'widget', '', ($use_pop) ? "return window.confirm('" . addslashes(_("Are you sure you want to PERMANENTLY delete these messages?")) . "');" : '', _("_Delete"), true));
+ $a_template->set('delete', Horde::widget($self_link->copy()->add('actionID', 'delete_message'), _("Delete"), 'widget', '', '', _("_Delete"), true));
+ if ($use_pop) {
+ Horde::addInlineScript(array(
+ 'ImpMessage.pop3delete = ' . Horde_Serialize::serialize(_("Are you sure you want to PERMANENTLY delete these messages?"), Horde_Serialize::JSON, $registry->getCharset())
+ ));
+ }
}
}
if (count($inlineout['display_ids']) > 2) {
$a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true));
if ($strip_atc) {
- $a_template->set('strip_all', Horde::widget(Horde::selfUrl(true)->remove(array('actionID'))->add(array('actionID' => 'strip_all', 'message_token' => $message_token)), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you want to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true));
+ $a_template->set('strip_all', Horde::widget(Horde::selfUrl(true)->remove(array('actionID'))->add(array('actionID' => 'strip_all', 'message_token' => $message_token)), _("Strip All Attachments"), 'widget stripAllAtc', '', '', _("Strip All Attachments"), true));
+ Horde::addInlineScript(array(
+ 'ImpMessage.stripatc = ' . Horde_Serialize::serialize(_("Are you sure you want to PERMANENTLY delete all attachments?"), Horde_Serialize::JSON, $registry->getCharset())
+ ));
}
$show_atc = true;