/* Attach spellchecker & auto completer. */
$imp_ui->attachAutoCompleter(array('to', 'cc', 'bcc'));
-$imp_ui->attachSpellChecker('dimp');
+$imp_ui->attachSpellChecker();
$show_editor = false;
$title = _("New Message");
try {
Horde_SpellChecker::factory($conf['spell']['driver'], array());
$spellcheck = true;
- $imp_ui->attachSpellChecker('imp', true);
+ $imp_ui->attachSpellChecker();
} catch (Exception $e) {
Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
}
{
var c = $('compose');
- if (DIMP.SpellCheckerObject &&
- DIMP.SpellCheckerObject.isActive()) {
- DIMP.SpellCheckerObject.resume();
+ if (DIMP.SpellChecker &&
+ DIMP.SpellChecker.isActive()) {
+ DIMP.SpellChecker.resume();
this.skip_spellcheck = true;
}
if (!this.skip_spellcheck &&
DIMP.conf_compose.spellcheck &&
- DIMP.SpellCheckerObject &&
- !DIMP.SpellCheckerObject.isActive()) {
+ DIMP.SpellChecker &&
+ !DIMP.SpellChecker.isActive()) {
this.sc_submit = action;
- DIMP.SpellCheckerObject.spellCheck();
+ DIMP.SpellChecker.spellCheck();
return;
}
break;
DimpCore.loadingImg('sendingImg', 'composeMessageParent', disable);
DimpCore.toggleButtons($('compose').select('DIV.dimpActions A'), disable);
[ $('compose') ].invoke(disable ? 'disable' : 'enable');
- if (DIMP.SpellCheckerObject) {
- DIMP.SpellCheckerObject.disable(disable);
+ if (DIMP.SpellChecker) {
+ DIMP.SpellChecker.disable(disable);
}
if (this.editor_on) {
this.RTELoading(disable ? 'show' : 'hide', true);
return;
}
noupdate = noupdate || false;
- if (DIMP.SpellCheckerObject) {
- DIMP.SpellCheckerObject.resume();
+ if (DIMP.SpellChecker) {
+ DIMP.SpellChecker.resume();
}
var config, text;
_onSpellCheckBefore: function()
{
- DIMP.SpellCheckerObject.htmlAreaParent = this.editor_on
+ DIMP.SpellChecker.htmlAreaParent = this.editor_on
? 'composeMessageParent'
: null;
if (!this.skip_spellcheck &&
this.spellcheck &&
- IMP.SpellCheckerObject &&
- !IMP.SpellCheckerObject.isActive()) {
+ IMP.SpellChecker &&
+ !IMP.SpellChecker.isActive()) {
this.sc_submit = { a: actionID, e: e };
- IMP.SpellCheckerObject.spellCheck();
+ IMP.SpellChecker.spellCheck();
return;
}
this.skip_spellcheck = false;
- if (IMP.SpellCheckerObject) {
- IMP.SpellCheckerObject.resume();
+ if (IMP.SpellChecker) {
+ IMP.SpellChecker.resume();
}
// fall through
_onBeforeSpellCheck: function()
{
- IMP.SpellCheckerObject.htmlAreaParent = 'composeMessageParent';
+ IMP.SpellChecker.htmlAreaParent = 'composeMessageParent';
$('composeMessage').next().hide();
CKEDITOR.instances.composeMessage.updateElement();
},
/**
* Attach the spellchecker to the current compose form.
*/
- public function attachSpellChecker($mode, $add_br = false)
+ public function attachSpellChecker()
{
$menu_view = $GLOBALS['prefs']->getValue('menu_view');
- $show_text = ($menu_view == 'text' || $menu_view == 'both');
- $br = ($add_br) ? '<br />' : '';
$spell_img = Horde::img('spellcheck.png');
+
+ if (IMP::getViewMode() == 'imp') {
+ $br = '<br />';
+ $id = 'DIMP.SpellChecker';
+ } else {
+ $br = '';
+ $id = 'IMP.SpellChecker';
+ }
+
$args = array(
- 'id' => ($mode == 'dimp' ? 'DIMP.' : 'IMP.') . 'SpellCheckerObject',
+ 'id' => $id,
'targetId' => 'composeMessage',
'triggerId' => 'spellcheck',
'states' => array(
- 'CheckSpelling' => $spell_img . ($show_text ? $br . _("Check Spelling") : ''),
- 'Checking' => $spell_img . $br . _("Checking ..."),
+ 'CheckSpelling' => $spell_img . (($menu_view == 'text' || $menu_view == 'both') ? $br . _("Check Spelling") : ''),
+ 'Checking' => $spell_img . $br . _("Checking..."),
'ResumeEdit' => $spell_img . $br . _("Resume Editing"),
'Error' => $spell_img . $br . _("Spell Check Failed")
)
}
Horde::addInlineScript(array(
- 'if (!window.IMP) { window.IMP = {}; }',
+ 'window.IMP = window.IMP || {}',
'IMP.ckeditor_config = {' . implode(',', $config) . '}'
));
}
/* Attach spellchecker & auto completer. */
$imp_ui->attachAutoCompleter(array('to', 'cc', 'bcc'));
- $imp_ui->attachSpellChecker('dimp');
+ $imp_ui->attachSpellChecker();
$js_out = array_merge($js_out, $compose_result['js']);
$scripts[] = array('compose-dimp.js', 'imp');