MDL-52752 filters: Update MathJax to version 2.6
authorAdrian Greeve <adrian@moodle.com>
Tue, 15 Mar 2016 02:58:14 +0000 (10:58 +0800)
committerAdrian Greeve <adrian@moodle.com>
Mon, 21 Mar 2016 06:10:00 +0000 (14:10 +0800)
filter/mathjaxloader/db/upgrade.php
filter/mathjaxloader/settings.php
filter/mathjaxloader/upgrade.txt [deleted file]
filter/mathjaxloader/version.php

index 056cc18..6d5ad10 100644 (file)
@@ -111,5 +111,25 @@ MathJax.Hub.Config({
     // Moodle v3.0.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.1.0 release upgrade line.
+    // Put any upgrade step following this.
+
+    if ($oldversion < 2015111601) {
+
+        $httpurl = get_config('filter_mathjaxloader', 'httpurl');
+        // Don't change the config if it has been manually changed to something besides the default setting value.
+        if ($httpurl === "http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") {
+            set_config('httpurl', 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader');
+        }
+
+        $httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
+        // Don't change the config if it has been manually changed to something besides the default setting value.
+        if ($httpsurl === "https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") {
+            set_config('httpsurl', 'https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader');
+        }
+
+        upgrade_plugin_savepoint(true, 2015111601, 'filter', 'mathjaxloader');
+    }
+
     return true;
 }
index 2c681f0..481e902 100644 (file)
@@ -33,14 +33,14 @@ if ($ADMIN->fulltree) {
     $item = new admin_setting_configtext('filter_mathjaxloader/httpurl',
                                          new lang_string('httpurl', 'filter_mathjaxloader'),
                                          new lang_string('httpurl_help', 'filter_mathjaxloader'),
-                                         'http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js',
+                                         'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js',
                                          PARAM_RAW);
     $settings->add($item);
 
     $item = new admin_setting_configtext('filter_mathjaxloader/httpsurl',
                                          new lang_string('httpsurl', 'filter_mathjaxloader'),
                                          new lang_string('httpsurl_help', 'filter_mathjaxloader'),
-                                         'https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js',
+                                         'https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js',
                                          PARAM_RAW);
     $settings->add($item);
 
diff --git a/filter/mathjaxloader/upgrade.txt b/filter/mathjaxloader/upgrade.txt
deleted file mode 100644 (file)
index 87db75e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-=== 2.9 ===
-
-* Update to the latest version of MathJax setting "httpurl" and "httpsurl" to:
-  http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js
-
-  and
-
-  https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js
-
-=== Before 2.9 ===
-
-Setting "httpsurl" default changed from:
-
-https://c328740.ssl.cf1.rackcdn.com/mathjax/2.3-latest/MathJax.js
-
-to:
-
-https://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js
index 3791f7d..08fd2ba 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version  = 2015111600;
+$plugin->version  = 2015111601;
 $plugin->requires = 2015111000;  // Requires this Moodle version.
 $plugin->component= 'filter_mathjaxloader';