Hi folks

I'm attempting to update the Jmol filter for Moodle and Jmol plugin for
Mahara to use JSmol. Things are *almost* working, but I'm getting some
clashes with the built-in JavaScript libraries (YUI for Moodle, MochiKit
and jQuery for Mahara) particularly when in page edit mode for either CMS.
Presumably due to issues with the $ variable/function being used by more
than one JavaScript library, similar to those between JSmol and Prototype
already discussed in these forums

http://www.mail-archive.com/jmol-users@lists.sourceforge.net/msg20021.html

For Mahara, in edit mode, I have reasonable workarounds by either not
loading JSmol.min.js at all (displaying a rectangular div in place of
JSmol) or loading JSmol.min.nojq.js instead. The second option works well
(can even drag-and-drop spinning molecules around the page!) though a right
mouse click on JSmol does not display the menu. Instead, a TypeError:
$(...) is null popup is displayed (on the first right click). My
understanding is the the Mahara jQuery uses $j rather than $ which is used
by the built-in MochiKit

https://mahara.org/interaction/forum/topic.php?id=2515
https://mahara.org/interaction/forum/topic.php?id=3500

For Moodle (2.4.3), the problems are more substantial as adding the JSmol
libraries (JSmol.min.js or JSmol.min.nojq.js) interferes with display mode
(some Moodle YUI controls no longer work) as well as edit mode. I'm
guessing YUI uses $ too. The next version of Moodle 2.5 should have jQuery
libraries alongside YUI, though I have not yet tried this, and don't know
if it will help or hinder.

http://docs.moodle.org/dev/jQuery

Any suggestions as to the best way forward with this? Suspect similar
issues will be encountered trying to integrate JSmol with other systems.
Will using an iframe to contain a JSmol instance work?, or are there
alternatives? As you can guess, I'm pretty new to this JavaScript stuff!

Thanks

Geoff
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to