MDL-34674 use browser built-in spell checking in all browsers except < IE10
This commit is contained in:
@@ -22,6 +22,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['pluginname'] = 'Check spelling';
|
||||
$string['pluginname'] = 'Legacy spell checker';
|
||||
|
||||
/* This plugin abuses strings from the standard TinyMCE spellchecker plugin, there is no need to duplicate them here. */
|
||||
|
||||
@@ -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