diff options
author | thomascube <thomas@roundcube.net> | 2006-05-25 18:25:04 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2006-05-25 18:25:04 +0000 |
commit | ed5d29f4b3c57235594931d33dde7cccaf7cd58b (patch) | |
tree | ce9e2f54db0003ee9220913392213db99d5d04f6 /program | |
parent | 079bc8796dc53d2355311324dea9d57aad1c9e77 (diff) |
Finalized GoogieSpell integration
Diffstat (limited to 'program')
-rw-r--r-- | program/js/app.js | 11 | ||||
-rwxr-xr-x | program/js/googiespell.js | 12 | ||||
-rw-r--r-- | program/localization/de_CH/labels.inc | 4 | ||||
-rw-r--r-- | program/localization/de_CH/messages.inc | 10 | ||||
-rw-r--r-- | program/localization/de_DE/labels.inc | 4 | ||||
-rw-r--r-- | program/localization/de_DE/messages.inc | 9 | ||||
-rw-r--r-- | program/localization/en_US/labels.inc | 4 | ||||
-rw-r--r-- | program/localization/en_US/messages.inc | 5 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 30 |
9 files changed, 80 insertions, 9 deletions
diff --git a/program/js/app.js b/program/js/app.js index ae6b00f6a..98a30d330 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -142,7 +142,11 @@ function rcube_webmail() } if (this.env.action=='compose') + { this.enable_command('add-attachment', 'send-attachment', 'send', true); + if (this.env.spellcheck) + this.enable_command('spellcheck', true); + } if (this.env.messagecount) this.enable_command('select-all', 'select-none', 'sort', 'expunge', true); @@ -875,7 +879,12 @@ function rcube_webmail() parent.location.href = url; else location.href = url; - break; + break; + + case 'spellcheck': + if (this.env.spellcheck && this.env.spellcheck.spellCheck) + this.env.spellcheck.spellCheck(this.env.spellcheck.check_link); + break; case 'send': if (!this.gui_objects.messageform) diff --git a/program/js/googiespell.js b/program/js/googiespell.js index 25f9526cd..f318e192c 100755 --- a/program/js/googiespell.js +++ b/program/js/googiespell.js @@ -1035,16 +1035,24 @@ GoogieSpell.getEventElm = function(e) { } GoogieSpell.prototype.removeIndicator = function(elm) { - AJS.removeElement(this.indicator); + // modified by roundcube + if (window.rcube_webmail_client) + rcube_webmail_client.set_busy(false); + //AJS.removeElement(this.indicator); } GoogieSpell.prototype.appendIndicator = function(elm) { + // modified by roundcube + if (window.rcube_webmail_client) + rcube_webmail_client.set_busy(true, 'checking'); +/* var img = AJS.IMG({'src': this.img_dir + 'indicator.gif', 'style': 'margin-right: 5px;'}); img.style.width = "16px"; img.style.height = "16px"; this.indicator = img; img.style.textDecoration = "none"; AJS.insertBefore(img, elm); + */ } /**** @@ -1239,6 +1247,8 @@ GoogieSpell.prototype.checkSpellingState = function() { me.spellCheck(span_chck); } AJS.appendChildNodes(this.spell_container, span_chck, " ", this.switch_lan_pic); + // modified by roundcube + this.check_link = span_chck; } GoogieSpell.prototype.setLanguages = function(lang_dict) { diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc index c7baf0b43..fa3a727fe 100644 --- a/program/localization/de_CH/labels.inc +++ b/program/localization/de_CH/labels.inc @@ -125,6 +125,10 @@ $labels['addattachment'] = 'Datei anfügen'; $labels['charset'] = 'Zeichensatz'; $labels['returnreceipt'] = 'Empfangsbestätigung'; +$labels['checkspelling'] = 'Rechtschreibung prüfen'; +$labels['resumeediting'] = 'Bearbeitung fortzetzen'; +$labels['revertto'] = 'Zurück zu'; + $labels['attachments'] = 'Anhänge'; $labels['upload'] = 'Hochladen'; $labels['close'] = 'Schliessen'; diff --git a/program/localization/de_CH/messages.inc b/program/localization/de_CH/messages.inc index 1e5f0e560..db9670d0b 100644 --- a/program/localization/de_CH/messages.inc +++ b/program/localization/de_CH/messages.inc @@ -86,5 +86,15 @@ $messages['nocontactsreturned'] = 'Es wurden keine Kontakte gefunden'; $messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein'; +$messages['searchsuccessful'] = '$nr Nachrichten gefunden'; + +$messages['searchnomatch'] = 'Keine Treffer'; + +$messages['searching'] = 'Suche...'; + +$messages['checking'] = 'Prüfe...'; + +$messages['nospellerrors'] = 'Keine Rechtschreibfehler gefunden'; + ?>
\ No newline at end of file diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc index 7e7f5de22..ce36168b5 100644 --- a/program/localization/de_DE/labels.inc +++ b/program/localization/de_DE/labels.inc @@ -126,6 +126,10 @@ $labels['addattachment'] = 'Datei anfügen'; $labels['charset'] = 'Zeichensatz'; $labels['returnreceipt'] = 'Empfangsbestätigung'; +$labels['checkspelling'] = 'Rechtschreibung prüfen'; +$labels['resumeediting'] = 'Bearbeitung fortzetzen'; +$labels['revertto'] = 'Zurück zu'; + $labels['attachments'] = 'Anhänge'; $labels['upload'] = 'Hochladen'; $labels['close'] = 'Schließen'; diff --git a/program/localization/de_DE/messages.inc b/program/localization/de_DE/messages.inc index 5646e4244..4a6409c32 100644 --- a/program/localization/de_DE/messages.inc +++ b/program/localization/de_DE/messages.inc @@ -88,5 +88,14 @@ $messages['nocontactsreturned'] = 'Es wurden keine Kontakte gefunden'; $messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein'; +$messages['searchsuccessful'] = '$nr Nachrichten gefunden'; + +$messages['searchnomatch'] = 'Keine Treffer'; + +$messages['searching'] = 'Suche...'; + +$messages['checking'] = 'Prüfe...'; + +$messages['nospellerrors'] = 'Keine Rechtschreibfehler gefunden'; ?>
\ No newline at end of file diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index afb6c8709..ba6d3d53c 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -125,6 +125,10 @@ $labels['addattachment'] = 'Attach a file'; $labels['charset'] = 'Charset'; $labels['returnreceipt'] = 'Return receipt'; +$labels['checkspelling'] = 'Check spelling'; +$labels['resumeediting'] = 'Resume editing'; +$labels['revertto'] = 'Revert to'; + $labels['attachments'] = 'Attachments'; $labels['upload'] = 'Upload'; $labels['close'] = 'Close'; diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc index 820d1b54e..f12dc40f4 100644 --- a/program/localization/en_US/messages.inc +++ b/program/localization/en_US/messages.inc @@ -94,4 +94,9 @@ $messages['searchnomatch'] = 'Search returned no matches'; $messages['searching'] = 'Searching...'; +$messages['checking'] = 'Checking...'; + +$messages['nospellerrors'] = 'No spelling errors found'; + + ?> diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 1f9618d5b..139af6556 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -297,7 +297,7 @@ function rcmail_compose_header_from($attrib) function rcmail_compose_body($attrib) { - global $CONFIG, $OUTPUT, $REPLY_MESSAGE, $FORWARD_MESSAGE; + global $CONFIG, $OUTPUT, $REPLY_MESSAGE, $FORWARD_MESSAGE, $JS_OBJECT_NAME; list($form_start, $form_end) = get_form_tags($attrib); unset($attrib['form']); @@ -335,12 +335,28 @@ function rcmail_compose_body($attrib) $out .= $form_end ? "\n$form_end" : ''; // include GoogieSpell - $OUTPUT->include_script('googiespell.js'); - - $OUTPUT->add_script(sprintf("var googie1 = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n". - "googie1.decorateTextarea('%s');", - $GLOBALS['COMM_PATH'], - $attrib['id']), 'foot'); + if (!empty($CONFIG['enable_spellcheck'])) + { + $OUTPUT->include_script('googiespell.js'); + $OUTPUT->add_script(sprintf("var googie = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n". + "googie.lang_chck_spell = \"%s\";\n". + "googie.lang_rsm_edt = \"%s\";\n". + "googie.lang_close = \"%s\";\n". + "googie.lang_revert = \"%s\";\n". + "googie.lang_no_error_found = \"%s\";\n". + "googie.decorateTextarea('%s');\n". + "%s.set_env('spellcheck', googie);", + $GLOBALS['COMM_PATH'], + rep_specialchars_output(rcube_label('checkspelling')), + rep_specialchars_output(rcube_label('resumeediting')), + rep_specialchars_output(rcube_label('close')), + rep_specialchars_output(rcube_label('revertto')), + rep_specialchars_output(rcube_label('nospellerrors')), + $attrib['id'], + $JS_OBJECT_NAME), 'foot'); + + rcube_add_label('checking'); + } return $out; } |