Browse Source

- Stop spellchecking when switching to html editor (#1485362)

release-0.6
alecpl 17 years ago
parent
commit
f4b8681160
  1. 3
      CHANGELOG
  2. 7
      program/js/app.js
  3. 17
      program/js/common.js
  4. 2
      program/js/editor.js

3
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

7
program/js/app.js

@ -1971,6 +1971,13 @@ function rcube_webmail()
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';
}

17
program/js/common.js

@ -650,3 +650,20 @@ if (bw.ie)
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);
}
}

2
program/js/editor.js

@ -58,12 +58,12 @@ function rcmail_toggle_editor(toggler)
// 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
{

Loading…
Cancel
Save