From: Michael M Slusarz Date: Thu, 29 Jul 2010 17:27:26 +0000 (-0600) Subject: Cleaner implementation of onclick handler X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=09c2479da76035d3828e51bc92c6f44eed56dd7b;p=horde.git Cleaner implementation of onclick handler --- diff --git a/imp/thread.php b/imp/thread.php index 8e5772731..78f50a895 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -155,7 +155,10 @@ if ($mode == 'thread') { foreach ($thread as $val) { $delete_link->add(array('indices[]' => strval(new IMP_Indices(IMP::$mailbox, $val)), 'start' => $imp_mailbox->getArrayIndex($val))); } - $template->set('delete', Horde::link('#', _("Delete Thread"), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete all messages in this thread?")) . "')) { window.location = '" . $delete_link . "'; } return false;") . Horde::img('delete.png', _("Delete Thread")) . ''); + $template->set('delete', Horde::link($delete_link, _("Delete Thread"), null, null, null, null, null, array('id' => 'threaddelete')) . Horde::img('delete.png', _("Delete Thread")) . ''); + Horde::addInlineScript(array( + '$("threaddelete").observe("click", function(e) { if (!window.confirm(' . Horde_Serialize::serialize(_("Are you sure you want to delete all messages in this thread?"), Horde_Serialize::JSON, $charset) . ')) { e.stop(); } })' + ), 'dom'); } $template->set('thread', $mode == 'thread'); $template->set('messages', $msgs);