Hmm. That surprises me. I don't see that at my test site. I added a line that assigns
Jmol._jQuery = $ and created a page that first loads a different version of jQuery. All is working and I see this: $.fn.jquery *"1.10.2"* Jmol._jQuery.fn.jquery *"1.11.0"* So JSmol is working and it is using a different version of jQuery. I don't think it is a problem with my code. Unfortunately, the solution you sent breaks the standard JSmol implementation and also is about a year behind in JSmol development. That has to be my first priority. But I see your issue: "Drupal 7 includes jQuery 1.4.4" Really. jQuery 1.4.4. That is unfortunate. Why would they not upgrade that in the last 5 years? But you have what you have. And we cannot use it. The demonstration links at eduSpec are just sending me around in circles. Can you provide me a link to your test site that is using JSmol 14.3 so I can see what the issues are? I suggest: 1) Bring a Drupal test site up to date with JSmol 14.3 [ http://chemapps.stolaf.edu/jmol/zip/jmol-14.3.16_2015.09.28.zip (Version 14.3 will be released as 14.4 very soon, so you might as well have it right up to date.) This way we are both moving forward. 2) Make sure whatever solution you arrange for Drupal at the test site you send me a link to is consistent with a standard JSmol local implementation. Bob On Tue, Sep 29, 2015 at 5:14 AM, Eelco van Dam <eelco.van....@peacs.nl> wrote: > Hi Robert, > > > > You suggestion is the same as our adjustments to the JSmol JavaScript > code, except for the, still, global registration of the JQuery object. The > major change is in the call to > > > > ‘var JSmoljQuery = $.noConflict(true);’ > > > > This function call prevents the global registration by releasing the $ > identifier and instead enable the use of own JQuery object through the > JSmoljQuery object. > > > > When I tried you suggestion the jQuery conflict still remained. > > > > Kind Regards, > > Eelco > > > > *Van:* Robert Hanson [mailto:hans...@stolaf.edu] > *Verzonden:* donderdag 24 september 2015 14:56 > *Aan:* Eelco van Dam <eelco.van....@peacs.nl> > *CC:* jmol-users@lists.sourceforge.net > *Onderwerp:* Re: Re: [Jmol-users] Prolem with JQuery in JSmol and Drupal > > > > Could you please try this JSmol.min.js? It is much simpler. Just a few > lines, all in the jQuery part. > > (function() { // bh added wrapper > var jQuery = (function( global, factory ) { // bh added var jQuery > return factory( global ); // bh added missing "return" > if (!window.jQuery) // bh do not allow overwriting of window.jQuery > })(); // bh added wrapper > > 1) wrapped entire package with > > > (function() { > ... > > ... > })(); > > 2) create a truly local variable jQuery to this wrapped function > > 3) only create window.jQuery if it does not already exist. > > > > Note that you will need to use Jmol 14.2 or 14.3 for this if you use this > exact file. Or you could replicate those few changes in yours and see how > that works with 14.0. > > I think this is better than removing the old jQuery and replacing it with > a new one. > > Yes? > > Bob > > > > > -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Department of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
_______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users