MDL-34674 use browser built-in spell checking in all browsers except < IE10

This commit is contained in:
Petr Škoda
2013-04-12 11:33:23 +02:00
parent b3661ab272
commit 0ac97084fa
10 changed files with 24 additions and 11 deletions
@@ -32,6 +32,10 @@ class tinymce_spellchecker extends editor_tinymce_plugin {
array $options = null) {
global $CFG;
if (!$this->is_legacy_browser()) {
return;
}
// Check at least one language is supported.
$spelllanguagelist = $this->get_config('spelllanguagelist', '');
if ($spelllanguagelist !== '') {
@@ -48,4 +52,13 @@ class tinymce_spellchecker extends editor_tinymce_plugin {
$params['spellchecker_languages'] = $spelllanguagelist;
}
}
protected function is_legacy_browser() {
// IE8 and IE9 are the only supported browsers that do not have spellchecker.
if (check_browser_version('MSIE', 5) and !check_browser_version('MSIE', 10)) {
return true;
}
// The rest of browsers supports spellchecking or is horribly outdated and we do not care...
return false;
}
}