MDL-34674 use browser built-in spell checking in all browsers except < IE10
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user