Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The wording of "Use MathJax Content Delivery Network (CDN)" checkbox in the configuration does not make sense. It actually means "use the mathjax library given in the URL below". If it is not checked, it will look in libraries/mathjax/mathjax.js.
Comment | File | Size | Author |
---|---|---|---|
#19 | interdiff.txt | 1.16 KB | pmagunia |
#19 | ClarifyMathJaxOptionText3.patch | 7.48 KB | pmagunia |
#14 | interdiff.txt | 4.89 KB | pmagunia |
#14 | ClarifyMathJaxOptionText2.patch | 7.38 KB | pmagunia |
#13 | Preview - With Patch.png | 39.08 KB | hameerabbasi |
Comments
Comment #1
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedComment #2
cilefen CreditAttribution: cilefen commentedYou must check the CDN box, even if you are using your own copy of the library. The wording is poor in that dialog. To not check the box means "use the library from the default libraries location".
There is the answer. This is something to fix in terms of the wording.
I've bumped this to 8.x-2.x because it looks the same there too.
Comment #3
cilefen CreditAttribution: cilefen commentedI would redesign this with radio buttons with this approximate wording:
Comment #4
pmaguniaI'd be happy to create a patch for this based on @cilefen comment #3. Will have something within in a week if that is OK.
Comment #5
pmaguniaComment #6
pmaguniaComment #7
pmaguniaPatch submitted for review
Comment #8
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedWhere do I apply this? I've tried
patch -p1 < ClarifyMathJaxOptionText.patch
in multiple locations, including sites/all/modules/mathjax, /sites/all/modules, /sites/all, /sites and /. It gives me a File to patch prompt every time.Comment #9
cilefen CreditAttribution: cilefen commented@hameerabbasi Thank you for testing this.
Usually, use
git apply
. In this case, you should be in the module directory. Note, the patch is for Drupal 8 and you must patch against a git checkout of this project. In Drupal 8, that will be in modules/mathjax.https://www.drupal.org/node/1054616
Comment #10
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedI'm on 7.x, currently. Let me set up an install for 8 beta real quick on my local machine to test.
Comment #11
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedI'm having trouble testing this, I can't install a new module via the Extend interface, it just redirects back to the same page.
I've tried XAMPP, WAMP and XAMPP Drupal module. It simply doesn't work. I've tried taking ownership too.
I apologize. Can someone else test this on their install or help me out?
Comment #12
cilefen CreditAttribution: cilefen commented@hameerabbasi I am pleased to have you helping. We will need continued help so I would like to show you how this is done. There are some things you may not know that will help things make sense:
One of the *amp stacks may provide you a command prompt with access to git or download it. Next, do the following:
It will be a good idea to get the libraries module as well and unzip it to modules/libraries.
Now you can return to the Drupal 8 GUI and enable the MathJax module. You should verify that the module works before applying the patch. Next, you apply the patch:
Clear the site caches and review the changes.
Comment #13
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedThank you for all your help. However, it seems the patch breaks the module. I tested before the patch, and also after, and reversed with
git apply -R
and tested again. Made sure to clear all caches each time.It appears it works for custom URL and local libraries directory. It's just the CDN part that's broken.
Also, just a little suggestion: The default value filled into the text field should be the address of the CDN.
Comment #14
pmagunia@hameerabbasi,
This patch should address the issue you mentioned in comment #13.
A new variable/constant is created for the official MathJax CDN so that it does not depend on the value of the textfield.
Just type this command assuming we left off where we did:
The txt file will need to be added to the MathJax 8 directory. You will also need to be in that directory when you execute the command. You may get a warning about whitespace but it can be ignored at this point.
Since we already applied the first patch, you don't need to worry about ClarifyMathJaxOptionText2.patch attached to this comment.
Comment #15
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedIt works for my Drupal 8 installation.
I have to say, this is a great community. I made a mistake assuming the module problem was on my end and you helped me through it.
I know how to use command lines and I program, too, mainly in C#. But it's nice to see you welcome newcomers this way.
Take care!
Comment #18
cilefen CreditAttribution: cilefen commented@hameerabbasi Thank you for reviewing. I have a few more things to add:
Would "Path to MathJax source" make more sense here?
Custom URL could be path could be "Custom URL".
If "MathJax CDN" is chosen, the text input field should be visible but disabled.
Let's start with those.
Comment #19
pmaguniaAttaching patch with recommendations from comment #18.
Comment #20
hameerabbasi CreditAttribution: hameerabbasi as a volunteer commentedIt seems to work. Great recommendations. I had one more, probably minor. When MaxJax CDN is selected, the text box should show the URL of the default CDN repo. If it's on custom, the URL should be freely editable. If it's on the libraries directory, it should still be visible show the URL of the libraries directory.
I'm marking this Reviewed and tested since it's already pretty good. However, feel free to mark it is "needs work" and submit another patch if it's feasible and practical to implement my suggestions.
Comment #21
cilefen CreditAttribution: cilefen commentedLet's not rush.
Comment #22
pmaguniaAfter retesting, patch in comment #19 still works well.
Comment #23
cilefen CreditAttribution: cilefen commented'"Custom URL" source' should be 'Custom URL'.
When you switch from 'MathJax' CDN to 'Custom URL' and back to 'MathJax CDN', the module does not render equations any more.
There could be other issues but let's start with those.
Comment #24
pmaguniaThe equations are still being rendered when I switch between CDN and Custom the way you mention.
Comment #32
cilefen CreditAttribution: cilefen commented