[mms] SECURITY: Don't cache local PGP public keys retrieved from the
addressbook (found by Peter Meier <peter.meier@immerda.ch>).
+[mms] If using spellcheck on send, automatically send if no spelling errors
+ exist (Request #6892).
[jan] Show all addresses when printing messages.
[mms] Fix cache issues in folder tree when deleting a mailbox (Bug #7745).
[mms] Fix updating POP3 indices when deleting in mailbox view (Bug #8035).
*/
var SpellChecker = Class.create({
+
// Vars used and defaulting to null:
// bad, choices, choicesDiv, curWord, htmlArea, htmlAreaParent, locale,
- // localeChoices, onAfterSpellCheck, onBeforeSpellCheck, reviewDiv,
- // statusButton, statusClass, suggestions, target, url
+ // localeChoices, onAfterSpellCheck, onBeforeSpellCheck, onNoError,
+ // reviewDiv, statusButton, statusClass, suggestions, target, url
options: {},
resumeOnDblClick: true,
state: 'CheckSpelling',
e.stop();
},
- spellCheck: function()
+ // noerror - (function) A callback function to run if no errors are
+ // identified. If not specified, will remain in spell check
+ // mode even if no errors are present.
+ spellCheck: function(noerror)
{
if (this.onBeforeSpellCheck) {
this.onBeforeSpellCheck();
this.status('Checking');
this.removeChoices();
+ this.onNoError = noerror;
+
p.set(this.target, this.targetValue());
opts.parameters = p.toQueryString();
this.removeChoices();
if (Object.isUndefined(result)) {
- this.resume();
this.status('Error');
return;
}
- bad = result.bad || [];
this.suggestions = result.suggestions || [];
+ if (this.onNoError && !this.suggestions.size()) {
+ this.status('CheckSpelling');
+ this.onNoError();
+ return;
+ }
+
+ bad = result.bad || [];
+
content = this.targetValue();
if (this.htmlAreaParent) {
content = content.replace(/\r?\n/g, '');
var ImpCompose = {
/* Variables defined in compose.php:
* cancel_url, spellcheck, cursor_pos, identities, max_attachments,
- * popup, redirect, reloaded, rtemode, smf_check */
+ * popup, redirect, reloaded, rtemode, smf_check, skip_spellcheck */
display_unload_warning: true,
textarea_ready: true,
return;
}
- if (this.spellcheck &&
+ if (!this.skip_spellcheck &&
+ this.spellcheck &&
IMP.SpellCheckerObject &&
!IMP.SpellCheckerObject.isActive()) {
- IMP.SpellCheckerObject.spellCheck();
+ IMP.SpellCheckerObject.spellCheck(this.onNoSpellError.bind(this, actionID, e));
return;
}
+
}
+ this.skip_spellcheck = false;
+
if (IMP.SpellCheckerObject) {
IMP.SpellCheckerObject.resume();
}
}
},
+ onNoSpellError: function(actionID, e)
+ {
+ this.skip_spellcheck = true;
+ this.uniqSubmit(actionID, e);
+ },
+
attachmentChanged: function()
{
var fields = [],