I don't see how this is a covered or deferred applet. The following, in
$.(document).ready, should immediately replace your image.

$('#viewerViewer').html(Jmol.getAppletHtml('JmolOb',viewerMolec.infoJmol))

Right? So how is that a cover image?

Are you sure you have this in JSmol.min.nojq.js?

  proto._isDeferred = function () {
      return* !this._canvas *&& this._cover && this._isCovered &&
this._deferApplet
  }

It will look something like this:

;f._isDeferred=function(){return!this._canvas&&this._cover&&this._isCovered&&this._deferApplet};

That was the fix for Jonathan, I believe.

OK, let me think about this. You had:

        deferApplet: false,
        deferUncover:true,
        coverImage:'cover.png',

which is requesting that the applet start loading but have a cover image
present until it is finished loading. It has the following effect:

applet._deferApplet = false
applet._coverImage = "cover.png"
applet._isCovered = true
applet._isDeferred() == false

In  combination with  setting  the applet HTML, applet._deferApplet is set
to true, the target div's html is put into the page, and a script tag in
the HTML runs  applet._cover(false) immediately.

What this does is to add to the startup script a javascript call
"applet.displayCoverImage(false)", effectively making a special "ready"
callback to uncover the image (or never uncovers it if there is a Jmol
script error). This then hides the image as soon as the applet is finished
running its start-up script.

Changing that to what you suggest:

        deferApplet: false,
        deferUncover:true,
        coverImage:null,

has the following effect:

        applet._deferApplet = false;
        applet._deferUncover = true;
        applet._coverImage = null;
        applet._isCovered = false

So that has the effect of again setting the javascript callback, but there
is no cover image, so that is ignored. And your code is just immediately
trashing the cover.png, anyway. So, yes, it works, but it is not a solution.

The offending double-call to create a new applet should not be possible.
The only way that can happen is if

applet._getCanvas(false)

is called. This can only happen in three situations:

1) Jmol._document is not null. That is, we are not using getAppletHTML(),
and so this is the standard "make me an applet" call.

2) applet._start is run with applet._deferApplet == true. This occurs only
when applet_cover(false) is called. The applet is starting from behind a
cover image.

3) applet._checkDeferred() is called with applet._isDeferred() == true.
This is supposed to happen

Possibility 3 is the most likely, because applet._checkDeferred() is called
whenever Jmol.script() is called or applet._loadFile() is called from
pressing the search button.

And if you don't have that fix, it could be called twice.

Bob




On Thu, May 8, 2014 at 11:00 AM, Angel Herráez <angel.herr...@uah.es> wrote:

> Hi
>
> Removing the assignment of
>         Info.coverImage
> makes the problem go.
>
>
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Larson-Anderson Professor 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
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to