Changeset 340546c in github
- Timestamp:
- May 31, 2011 3:38:56 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 09c59ab
- Parents:
- 644e3ad9
- Location:
- program
- Files:
-
- 3 edited
-
js/app.js (modified) (1 diff)
-
js/googiespell.js (modified) (4 diffs)
-
steps/mail/sendmail.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
r644e3ad9 r340546c 3018 3018 } 3019 3019 }; 3020 3021 // resume spellchecking, highlight provided mispellings without new ajax request 3022 this.spellcheck_resume = function(ishtml, data) 3023 { 3024 if (ishtml) { 3025 var ed = tinyMCE.get(this.env.composebody); 3026 sp = ed.plugins.spellchecker; 3027 3028 sp.active = 1; 3029 sp._markWords(data); 3030 ed.nodeChanged(); 3031 } 3032 else { 3033 var sp = this.env.spellcheck; 3034 sp.prepare(false, true); 3035 sp.processData(data); 3036 } 3037 } 3020 3038 3021 3039 this.set_draft_id = function(id) -
program/js/googiespell.js
r644e3ad9 r340546c 204 204 205 205 this.spellCheck = function(ignore) { 206 this.cnt_errors_fixed = 0; 207 this.cnt_errors = 0; 208 this.setStateChanged('checking_spell'); 209 210 if (this.main_controller) 211 this.appendIndicator(this.spell_span); 212 213 this.error_links = []; 214 this.ta_scroll_top = this.text_area.scrollTop; 215 this.ignore = ignore; 216 this.hideLangWindow(); 217 218 if ($(this.text_area).val() == '' || ignore) { 219 if (!this.custom_no_spelling_error) 220 this.flashNoSpellingErrorState(); 221 else 222 this.custom_no_spelling_error(this); 223 this.removeIndicator(); 224 return; 225 } 226 227 this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight); 228 this.createErrorWindow(); 229 $('body').append(this.error_window); 230 231 try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } 232 catch (e) { } 233 234 if (this.main_controller) 235 $(this.spell_span).unbind('click'); 236 237 this.orginal_text = $(this.text_area).val(); 238 var req_text = this.escapeSpecial(this.orginal_text); 239 var ref = this; 206 this.prepare(ignore); 207 208 var req_text = this.escapeSpecial(this.orginal_text), 209 ref = this; 240 210 241 211 $.ajax({ type: 'POST', url: this.getUrl(), … … 253 223 }, 254 224 success: function(data) { 255 var r_text = data; 256 ref.results = ref.parseResult(r_text); 257 if (r_text.match(/<c.*>/) != null) { 258 // Before parsing be sure that errors were found 259 ref.showErrorsInIframe(); 260 ref.resumeEditingState(); 261 } else { 225 ref.processData(data); 226 if (!ref.results.length) { 262 227 if (!ref.custom_no_spelling_error) 263 228 ref.flashNoSpellingErrorState(); … … 274 239 // Spell checking functions 275 240 ///// 241 this.prepare = function(ignore, no_indicator) 242 { 243 this.cnt_errors_fixed = 0; 244 this.cnt_errors = 0; 245 this.setStateChanged('checking_spell'); 246 247 if (!no_indicator && this.main_controller) 248 this.appendIndicator(this.spell_span); 249 250 this.error_links = []; 251 this.ta_scroll_top = this.text_area.scrollTop; 252 this.ignore = ignore; 253 this.hideLangWindow(); 254 255 if ($(this.text_area).val() == '' || ignore) { 256 if (!this.custom_no_spelling_error) 257 this.flashNoSpellingErrorState(); 258 else 259 this.custom_no_spelling_error(this); 260 this.removeIndicator(); 261 return; 262 } 263 264 this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight); 265 this.createErrorWindow(); 266 $('body').append(this.error_window); 267 268 try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } 269 catch (e) { } 270 271 if (this.main_controller) 272 $(this.spell_span).unbind('click'); 273 274 this.orginal_text = $(this.text_area).val(); 275 }; 276 276 277 this.parseResult = function(r_text) { 277 278 // Returns an array: result[item] -> ['attrs'], ['suggestions'] … … 312 313 }; 313 314 315 this.processData = function(data) 316 { 317 this.results = this.parseResult(data); 318 if (this.results.length) { 319 this.showErrorsInIframe(); 320 this.resumeEditingState(); 321 } 322 }; 314 323 315 324 ////// -
program/steps/mail/sendmail.inc
r644e3ad9 r340546c 412 412 // Check spelling before send 413 413 if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck'] 414 && empty($_SESSION['compose']['spell_checked']) 414 && empty($_SESSION['compose']['spell_checked']) && !empty($message_body) 415 415 ) { 416 416 $spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC)); … … 420 420 421 421 if (!$spell_result) { 422 $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml(); 422 423 $OUTPUT->show_message('mispellingsfound', 'error'); 423 $OUTPUT->command(' command', 'spellcheck');424 $OUTPUT->command('spellcheck_resume', $isHtml, $result); 424 425 $OUTPUT->send('iframe'); 425 426 }
Note: See TracChangeset
for help on using the changeset viewer.
