- Stop spellchecking when switching to html editor (#1485362)
| | |
| | | CHANGELOG RoundCube Webmail |
| | | --------------------------- |
| | | |
| | | 2008/10/01 (alec) |
| | | - Stop spellchecking when switching to html editor (#1485362) |
| | | |
| | | 2008/09/29 (alec) |
| | | ---------- |
| | | - Added 'mime_param_folding' option with possibility to choose |
| | |
| | | this.display_spellcheck_controls = function(vis) |
| | | { |
| | | if (this.env.spellcheck) { |
| | | // stop spellchecking process |
| | | if (!vis && !this.spellcheck_ready) |
| | | { |
| | | exec_event(this.env.spellcheck.check_link, 'click'); |
| | | this.set_spellcheck_state('ready'); |
| | | } |
| | | |
| | | this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden'; |
| | | this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden'; |
| | | } |
| | |
| | | return o; |
| | | } |
| | | } |
| | | |
| | | |
| | | // Fire event on specified element |
| | | function exec_event(element,event) |
| | | { |
| | | if (document.createEventObject) { |
| | | // dispatch for IE |
| | | var evt = document.createEventObject(); |
| | | return element.fireEvent('on'+event,evt) |
| | | } |
| | | else { |
| | | // dispatch for firefox + others |
| | | var evt = document.createEvent("HTMLEvents"); |
| | | evt.initEvent(event, true, true); // event type,bubbling,cancelable |
| | | return !element.dispatchEvent(evt); |
| | | } |
| | | } |
| | |
| | | // do the appropriate conversion |
| | | if (selectedEditor == 'html') |
| | | { |
| | | rcmail.display_spellcheck_controls(false); |
| | | var composeElement = document.getElementById('compose-body'); |
| | | var htmlText = "<pre>" + composeElement.value + "</pre>"; |
| | | composeElement.value = htmlText; |
| | | tinyMCE.execCommand('mceAddControl', true, 'compose-body'); |
| | | htmlFlag.value = "1"; |
| | | rcmail.display_spellcheck_controls(false); |
| | | } |
| | | else |
| | | { |