Skip to content

Commit

Permalink
Merge branch 'MDL-48543-28' of git://github.com/damyon/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_28_STABLE
  • Loading branch information
David Monllao committed Feb 17, 2015
2 parents a9e2dd4 + 68b7d5c commit 95337e5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
41 changes: 41 additions & 0 deletions filter/mathjaxloader/db/upgrade.php
Expand Up @@ -46,6 +46,47 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2014111001) {

$oldconfig = get_config('filter_mathjaxloader', 'mathjaxconfig');
$olddefault = 'MathJax.Hub.Config({
config: ["MMLorHTML.js", "Safe.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
menuSettings: {
zoom: "Double-Click",
mpContext: true,
mpMouse: true
},
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';
$newdefault = '
MathJax.Hub.Config({
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';

// Ignore white space changes.
$oldconfig = trim(preg_replace('/\s+/', ' ', $oldconfig));
$olddefault = trim(preg_replace('/\s+/', ' ', $olddefault));

// Update the default config for mathjax only if it has not been customised.

if ($oldconfig == $olddefault) {
set_config('mathjaxconfig', $newdefault, 'filter_mathjaxloader');
}

upgrade_plugin_savepoint(true, 2014111001, 'filter', 'mathjaxloader');
}

return true;
}
12 changes: 1 addition & 11 deletions filter/mathjaxloader/settings.php
Expand Up @@ -52,17 +52,7 @@

$default = '
MathJax.Hub.Config({
config: ["MMLorHTML.js", "Safe.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
menuSettings: {
zoom: "Double-Click",
mpContext: true,
mpMouse: true
},
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
Expand Down
2 changes: 1 addition & 1 deletion filter/mathjaxloader/version.php
Expand Up @@ -24,6 +24,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2014111000;
$plugin->version = 2014111001;
$plugin->requires = 2014110400; // Requires this Moodle version
$plugin->component= 'filter_mathjaxloader';

0 comments on commit 95337e5

Please sign in to comment.