MDL-60458 Mathjax: Restore the accessible config

Undo the changes to the accessible config that were introduced by the previous library upgrade.
This commit is contained in:
Damyon Wiese 2017-10-20 11:49:43 +08:00
parent 849405177f
commit 89ceede3bf
4 changed files with 30 additions and 8 deletions

View File

@ -169,5 +169,33 @@ MathJax.Hub.Config({
upgrade_plugin_savepoint(true, 2017101200, 'filter', 'mathjaxloader');
}
if ($oldversion < 2017102000) {
// Re-add Accessible.js (we should not have removed it).
$previousdefault = '
MathJax.Hub.Config({
config: ["default.js", "MMLorHTML.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';
$newdefault = '
MathJax.Hub.Config({
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';
$mathjaxconfig = get_config('filter_mathjaxloader', 'mathjaxconfig');
if (empty($mathjaxconfig) || filter_mathjaxloader_upgrade_mathjaxconfig_equal($mathjaxconfig, $previousdefault)) {
set_config('mathjaxconfig', $newdefault, 'filter_mathjaxloader');
}
upgrade_plugin_savepoint(true, 2017102000, 'filter', 'mathjaxloader');
}
return true;
}

View File

@ -18,9 +18,3 @@ Upgrading the default MathJax version
3. Check and eventually update the list of language mappings in filter.php.
Also see the unit test for the language mappings.
Changes
-------
* The MathJax 2.7.2 seems to have a bug causing the accessibility extensions
fail in web apps using RequireJS (such as Moodle). We had to stop using the
Accessible.js config for that reason. See MDL-60209 for details.

View File

@ -45,7 +45,7 @@ if ($ADMIN->fulltree) {
$default = '
MathJax.Hub.Config({
config: ["default.js", "MMLorHTML.js", "Safe.js"],
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"

View File

@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2017101200;
$plugin->version = 2017102000;
$plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->component= 'filter_mathjaxloader';