From: Jan Schneider Date: Wed, 29 Jul 2009 07:36:30 +0000 (+0200) Subject: Fix toggling wysiwyg editor. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=95aa771a474f3dd6d8fd959e374cb779ef1c349b;p=horde.git Fix toggling wysiwyg editor. --- diff --git a/imp/compose.php b/imp/compose.php index 00626a63a..42808fe02 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -713,12 +713,12 @@ if ($get_sig && isset($msg) && !empty($sig)) { /* Open the passphrase window here. */ if ($pgp_passphrase_dialog || $pgp_symmetric_passphrase_dialog) { if ($pgp_passphrase_dialog) { - $notification->push(IMP::passphraseDialogJS('PGPPersonal', 'uniqSubmit(\'send_message\')'), 'javascript'); + $notification->push(IMP::passphraseDialogJS('PGPPersonal', 'ImpCompose.uniqSubmit(\'send_message\')'), 'javascript'); } else { - $notification->push(IMP::passphraseDialogJS('PGPSymmetric', 'uniqSubmit(\'send_message\')', array('symmetricid' => 'imp_compose_' . $composeCacheID)), 'javascript'); + $notification->push(IMP::passphraseDialogJS('PGPSymmetric', 'ImpCompose.uniqSubmit(\'send_message\')', array('symmetricid' => 'imp_compose_' . $composeCacheID)), 'javascript'); } } elseif ($smime_passphrase_dialog) { - $notification->push(IMP::passphraseDialogJS('SMIMEPersonal', 'uniqSubmit(\'send_message\')'), 'javascript'); + $notification->push(IMP::passphraseDialogJS('SMIMEPersonal', 'ImpCompose.uniqSubmit(\'send_message\')'), 'javascript'); } /* If PGP encryption is set by default, and we have a recipient list on first @@ -822,7 +822,7 @@ if ($redirect) { $t->set('has_search', true); $t->set('abook', Horde::link('#', _("Address Book"), 'widget', null, 'window.open(\'' . Horde_Util::addParameter(Horde::applicationUrl('contacts.php'), array('formname' => 'redirect', 'to_only' => 1)) . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;') . Horde::img('addressbook_browse.png') . '
' . _("Address Book") . ''); if (!$has_js) { - $t->set('expand', Horde::link('#', _("Expand Names"), 'widget', null, "$('actionID').value='redirect_expand_addr';uniqSubmit();return false;") . Horde::img('expand.png') . '
' . _("Expand Names") . '', true); + $t->set('expand', Horde::link('#', _("Expand Names"), 'widget', null, "$('actionID').value='redirect_expand_addr';ImpCompose.uniqSubmit();return false;") . Horde::img('expand.png') . '
' . _("Expand Names") . '', true); } } @@ -1059,7 +1059,7 @@ if ($redirect) { $compose_options[] = array( 'url' => Horde::link( '#', '', 'widget', null, - "uniqSubmit('compose_expand_addr'); return false;", + "ImpCompose.uniqSubmit('compose_expand_addr'); return false;", '', '', array('name' => 'btn_compose_expand_addr')), 'img' => Horde::img('expand.png'), 'label' => $show_text ? _("Expand Names") : ''); @@ -1119,7 +1119,7 @@ if ($redirect) { $t->set('compose_html', (!is_null($rtemode) && !$prefs->isLocked('compose_html'))); if ($t->get('compose_html')) { $t->set('html_img', Horde::img('compose.png', _("Switch Composition Method"))); - $t->set('html_switch', Horde::link('#', _("Switch Composition Method"), '', '', "$('rtemode').value='" . ($rtemode ? 0 : 1) . "';uniqSubmit();return false;")); + $t->set('html_switch', Horde::link('#', _("Switch Composition Method"), '', '', "$('rtemode').value='" . ($rtemode ? 0 : 1) . "';ImpCompose.uniqSubmit('toggle_editor');return false;")); $t->set('rtemode', $rtemode); } diff --git a/imp/js/src/compose.js b/imp/js/src/compose.js index e55238749..23b58fe2e 100644 --- a/imp/js/src/compose.js +++ b/imp/js/src/compose.js @@ -151,7 +151,9 @@ var ImpCompose = { { var form; - e.stop(); + if (!Object.isUndefined(e)) { + e.stop(); + } switch (actionID) { case 'redirect': @@ -192,6 +194,10 @@ var ImpCompose = { $('actionID').setValue(actionID); break; + case 'toggle_editor': + form = $('compose'); + break; + default: return; } diff --git a/imp/lib/api.php b/imp/lib/api.php index 3d8b7f068..c8a979c99 100644 --- a/imp/lib/api.php +++ b/imp/lib/api.php @@ -573,7 +573,7 @@ function _imp_cacheOutput($params) 'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ";\n" . /* To more closely match "normal" textarea behavior, send * send
on enter instead of

. */ - "FCKConfig.EnterMode = \'br\';\n" . + "FCKConfig.EnterMode = 'br';\n" . 'FCKConfig.ShiftEnterMode = \'p\';', 'type' => 'text/javascript' );