alecpl
2008-10-01 f4b8681160110659f5f78b309237de6f43c32537
- Stop spellchecking when switching to html editor (#1485362)


4 files modified
29 ■■■■■ changed files
CHANGELOG 3 ●●●●● patch | view | raw | blame | history
program/js/app.js 7 ●●●●● patch | view | raw | blame | history
program/js/common.js 17 ●●●●● patch | view | raw | blame | history
program/js/editor.js 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,9 @@
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 
program/js/app.js
@@ -1971,6 +1971,13 @@
  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';
    }
program/js/common.js
@@ -650,3 +650,20 @@
    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);
   }
}
program/js/editor.js
@@ -58,12 +58,12 @@
  // 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
    {