I am hoping someone can shed some light on this:
I have been able to get this module working with mimetex almost perfectly on our production site, however the popup created by amcharmap.js is not displaying any symbols. On further inspection I discovered that the image srcs for each symbol were of this form:
null?%5Cdisplaystyle%5Cfrac%7B%7B%7Bx%7D%2B%7B1%7D%7D%7D%7B%7B%7Bx%7D-%7B1%7D%7D%7D
The module is enabled, mimetex.cgi works, the path in the modules settings page is correct, the tinymce "Add new math" button works, and on viewing the saved page the equation is properly replaced by a gif generated by mimetex.cgi.
I had a look inside amcharmap.js and I am hazarding a guess that tinyMCEPopup.getWindowArg('AMTcgiloc') is not properly returning this variable.
I will update if I have more details.
Comments
Comment #1
iva2k commented@sfyn
Thanks for the report. I did a quick look into the code, and had a thought about one possibility:
ASCIIMathMLwFallback.js sets var AMTcgiloc to null AND ASCIIMathMLwFallback.js is loaded after amcharmap.js in amcharmap.htm:
Can you try commenting out the line "var AMTcgiloc = null;" in ASCIIMathMLwFallback.js and see if it helps?
Comment #2
sfyn commentedI tried this quickly,
With this line commented out, the pop-up chart is no longer empty - now the table contains unprocessed latex expressions instead of images generated by mimetex...
I didn't have a chance to look deeper into the code. I will try and do a more thorough investigation this weekend and will send my results back.
Comment #3
iva2k commentedThanks for the test. Based on your result I think it is not the root cause. The test result suggests that JS is kicking in in the right order, and you are probably right about "a guess that tinyMCEPopup.getWindowArg('AMTcgiloc') is not properly returning this variable". Given that this has to do with passing variables into iframe or separate window, more data isneeded:
- Browser type & version? Does it behave the same in other browsers?
- What TinyMCE version are you using?
- Do you have wysiwyg inline popup enabled?
- Is JavaScript optimization enabled in /admin/settings/performance?
- One more simple test I can think of: Is var AMTcgiloc set in the page source?
- Is it set before or after amcharmap.js and ASCIIMathMLwFallback.js are included?
Comment #4
sfyn commented- Browser type & version?
Firefox 3.0.14 - Moz Ff for Ubuntu canonical 1.0
The popup behaves normally on local dev sites via this browser
Does it behave the same in other browsers?
Not yet tested, will get back to you
- What TinyMCE version are you using?
3.2.7 in all cases
- Do you have wysiwyg inline popup enabled?
I am not sure what this means, in the sense of where to enable it. I am using wysiwyg module 2.0, btw.
- Is JavaScript optimization enabled in /admin/settings/performance?
No
- One more simple test I can think of: Is var AMTcgiloc set in the page source?
Yes, and it is set after amcharmap.js and ASCIIMathMLwFallback.js are included
Comment #5
iva2k commentedThanks for the info.
Inline popups in wysiwig/TinyMCE is a plugin that you can enable in wysiwyg profile. If enabled, the math palette window pops up inside the same browser window, if not - in a new browser window.
I will try with newer TinyMCE, but all other items seem not being out of line.
I forgot to ask - what version / date of wysiwyg api do you have?
Did you check if all files are completely uploaded (could be an incomplete FTP upload / corrupted file)?
Comment #6
sfyn commentedHey
I did check hashes, and the wysiwyg version is still 2.0. I tried the inline popup solution and again had an empty table with null paths for img srcs. If I have any progress with this, I will let you know.
(sfyn wanders off to read up on the tinymce api)
Comment #7
GodwinC commentedI find the math symbol doesn't display correctly if mimetex is set differently from default mimetex directory. The workaround is to copy into module's mimetex directly but it is a bit kludgy.
Comment #8
iva2k commented@sfyn - does solution in #7 work for you?
Comment #9
sfyn commentedNo, actually, this was something we were already doing. I sadly no longer have access to the problem site. You can probably go ahead and close this.
Comment #10
iva2k commented