[Gmod-ajax] Detect when jBrowse has finished loading

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] Detect when jBrowse has finished loading

Tomaz Berisa
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Colin
We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Keiran Raine
Hi,

We're using JBrowse in a frame (and controlling cross domain using document.domain()) so I've asked the developer how he got it working.

FYI, we're really interested to see if we can get JBrowse to work via PhantomJS so that we can script image generation so this may be a useful component.

Regards,

Keiran Raine
Principal Bioinformatician
Cancer Genome Project
Wellcome Trust Sanger Institute

Tel:+44 (0)1223 834244 Ext: 7703
Office: H104

On 27 May 2014, at 23:57, Colin <[hidden email]> wrote:

We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


-- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

matthiasm
Hi all,

I am also looking forward to have a milestone 'completely rendered' for my plugin development project on JBrowse. 

In my code I am using the browser.view.visibleTracks() (or gb.view.visibleTrackNames() ) which return an empty array when called after a chromosome (refSeq) change. This is because the view/stores are flushed by the browser.navigateToLocation() method and the xhr requests, to get those tracks back in the view, are not sent yet when I make the call to the function. 
I am actually trying to get around this problem, I still don't know what is the best option ( if you have a good idea, I am definitely interested to hear about it ) but having a milestone, to check if all tracks that are supposed to be charged actually are, would surely help. 

Regards,

Matthias.


2014-05-28 10:08 GMT+02:00 Keiran Raine <[hidden email]>:
Hi,

We're using JBrowse in a frame (and controlling cross domain using document.domain()) so I've asked the developer how he got it working.

FYI, we're really interested to see if we can get JBrowse to work via PhantomJS so that we can script image generation so this may be a useful component.

Regards,

Keiran Raine
Principal Bioinformatician
Cancer Genome Project
Wellcome Trust Sanger Institute

Tel:<a href="tel:%2B44%20%280%291223%20834244%C2%A0Ext%3A%207703" value="+441223834244" target="_blank">+44 (0)1223 834244 Ext: 7703
Office: H104

On 27 May 2014, at 23:57, Colin <[hidden email]> wrote:

We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


-- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




--
Matthias Monfort.

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Tomaz Berisa
In reply to this post by Colin
Using jQuery's .load() on the iframe from the main document just fires the event right away (same thing for .ready(), but this is not unexpected).
On the other hand, jQuery's .load() *never* fires when plugged into jBrowse's index.html. As if jBrowse (or dojo, ..?) is somehow preventing the page from being detected as fully loaded (or just blocking the event).

When hooking into the JBrowse variable, I sporadically get the following error:
Uncaught TypeError: Cannot read property 'afterMilestone' of undefined
I would say this is due to the fact that sometimes I catch the variable after it's initialized and sometime before (when I get the error). All this seems to be a consequence of jQuery firing the event before the underlying document (iframe) fully loads.
Furthermore, even when I don't get the error - I get the "Finished loading" alert before JBrowse loads and renders tracks. The alert pauses loading of the page before it's confirmed and the JBrowse tracks stay blank until I confirm the alert message. Therefore, I agree this milestone is not what we're looking for.

I currently have the following dirty trick that works:
check = true;
for(a in map_of_required_annotations) {
  find_a = $('#jbrowse_iframe').contents().find('label[title="'+a+'"]');
  if(find_a.length==0) {
    check = false;
    break;
  }
}
...this basically just looks for the tracks in the tracklist and assumes the page is loaded when the tracklist is loaded. It works for now, but this is not a proper solution since there is a possibility of it showing a false positive when the tracklist is loaded, but the tracks are not yet rendered.
This solution could be extended to finding the actual track divs, but is not very practical with many tracks and still doesn't guarantee they are rendered (only that the divs exist).

Cheers,
Tomaz

On Tue, May 27, 2014 at 6:57 PM, Colin <[hidden email]> wrote:
We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Mts Mft
Hi guys, 

Has anyone made/heard any update on the point mentioned earlier in the thread (i.e. a 'completely rendered' milestone )?

Cheers,

M

Matthias.

2014-05-28 18:15 GMT+02:00 Tomaz Berisa <[hidden email]>:
Using jQuery's .load() on the iframe from the main document just fires the event right away (same thing for .ready(), but this is not unexpected).
On the other hand, jQuery's .load() *never* fires when plugged into jBrowse's index.html. As if jBrowse (or dojo, ..?) is somehow preventing the page from being detected as fully loaded (or just blocking the event).

When hooking into the JBrowse variable, I sporadically get the following error:
Uncaught TypeError: Cannot read property 'afterMilestone' of undefined
I would say this is due to the fact that sometimes I catch the variable after it's initialized and sometime before (when I get the error). All this seems to be a consequence of jQuery firing the event before the underlying document (iframe) fully loads.
Furthermore, even when I don't get the error - I get the "Finished loading" alert before JBrowse loads and renders tracks. The alert pauses loading of the page before it's confirmed and the JBrowse tracks stay blank until I confirm the alert message. Therefore, I agree this milestone is not what we're looking for.

I currently have the following dirty trick that works:
check = true;
for(a in map_of_required_annotations) {
  find_a = $('#jbrowse_iframe').contents().find('label[title="'+a+'"]');
  if(find_a.length==0) {
    check = false;
    break;
  }
}
...this basically just looks for the tracks in the tracklist and assumes the page is loaded when the tracklist is loaded. It works for now, but this is not a proper solution since there is a possibility of it showing a false positive when the tracklist is loaded, but the tracks are not yet rendered.
This solution could be extended to finding the actual track divs, but is not very practical with many tracks and still doesn't guarantee they are rendered (only that the divs exist).

Cheers,
Tomaz

On Tue, May 27, 2014 at 6:57 PM, Colin <[hidden email]> wrote:
We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Eric Yao
Hi M,

There happens to be a milestone "completely initialized" that gets close, but there are still track rendering that occur after.

There is a plugin, DebugEvents, that may be able to help you devise a mechanism to detect "absolute settlement."
To install, add a section in trackList.json, "plugins: ['DebugEvents'],".  Check the console log for results.

Eric



On Fri, Apr 8, 2016 at 5:20 AM, Mts Mft <[hidden email]> wrote:
Hi guys, 

Has anyone made/heard any update on the point mentioned earlier in the thread (i.e. a 'completely rendered' milestone )?

Cheers,

M

Matthias.

2014-05-28 18:15 GMT+02:00 Tomaz Berisa <[hidden email]>:
Using jQuery's .load() on the iframe from the main document just fires the event right away (same thing for .ready(), but this is not unexpected).
On the other hand, jQuery's .load() *never* fires when plugged into jBrowse's index.html. As if jBrowse (or dojo, ..?) is somehow preventing the page from being detected as fully loaded (or just blocking the event).

When hooking into the JBrowse variable, I sporadically get the following error:
Uncaught TypeError: Cannot read property 'afterMilestone' of undefined
I would say this is due to the fact that sometimes I catch the variable after it's initialized and sometime before (when I get the error). All this seems to be a consequence of jQuery firing the event before the underlying document (iframe) fully loads.
Furthermore, even when I don't get the error - I get the "Finished loading" alert before JBrowse loads and renders tracks. The alert pauses loading of the page before it's confirmed and the JBrowse tracks stay blank until I confirm the alert message. Therefore, I agree this milestone is not what we're looking for.

I currently have the following dirty trick that works:
check = true;
for(a in map_of_required_annotations) {
  find_a = $('#jbrowse_iframe').contents().find('label[title="'+a+'"]');
  if(find_a.length==0) {
    check = false;
    break;
  }
}
...this basically just looks for the tracks in the tracklist and assumes the page is loaded when the tracklist is loaded. It works for now, but this is not a proper solution since there is a possibility of it showing a false positive when the tracklist is loaded, but the tracks are not yet rendered.
This solution could be extended to finding the actual track divs, but is not very practical with many tracks and still doesn't guarantee they are rendered (only that the divs exist).

Cheers,
Tomaz

On Tue, May 27, 2014 at 6:57 PM, Colin <[hidden email]> wrote:
We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Detect when jBrowse has finished loading

Mts Mft
Thanks Eric. The DebugPlugin is helpful, I wish I heard of it before :). Anyway I was already debugging the events I hooked to, but it helps to have a better overview of the setup and navigation processes. 

About the "finish rendering" milestone, tell me if I am wrong, but until such implementation by JBrowse itself, I could achieve the same result (or close: i.e. not "done with rendering of tracks" but "done with added tracks to view") making use of javascript setTimeout (or setInterval). 

I'd like to start my logic when JBrowse is done with its own, that is when it has finish added "known" tracks to the view.

So in the current state, after the 'completely initialized' I can not rely on any JBrowse variables (e.g. this.browser.view.tracks) or function (e.g. this.browser.view.visibleTracks()) to be sure to have the list of all the tracks JBrowse is gonna automatically load, since adding tracks is asynchronous. I should make use of the piece of code below to get what gonna be loaded, and with setTimeout call a function that compares what's loaded to what's "expected to be" loaded:

piece of code:

var tracksToShow = [];
// always add alwaysOnTracks, regardless of any other track params
if (thisB.config.alwaysOnTracks) { tracksToShow = tracksToShow.concat(thisB.config.alwaysOnTracks.split(",")); }
// add tracks specified in URL track param,
//    if no URL track param then add last viewed tracks via tracks cookie
//    if no URL param and no tracks cookie, then use defaultTracks
if (thisB.config.forceTracks)   { tracksToShow = tracksToShow.concat(thisB.config.forceTracks.split(",")); }
else if (thisB.cookie("tracks")) { tracksToShow = tracksToShow.concat(thisB.cookie("tracks").split(",")); }
else if (thisB.config.defaultTracks) { tracksToShow = tracksToShow.concat(thisB.config.defaultTracks.split(",")); }
// currently, force "DNA" _only_ if no other guides as to what to show?
//    or should this be changed to always force DNA to show?
if (tracksToShow.length == 0) { tracksToShow.push("DNA"); }
// eliminate track duplicates (may have specified in both alwaysOnTracks and defaultTracks)
tracksToShow = Util.uniq(tracksToShow);
thisB.showTracks( tracksToShow );

Once expected tracks == loaded tracks, I fire my stuff.

I can expected this "solution" to work right ?
Any better idea not relying on setTimeout is welcome :)

Cheers,

Matthias.

2016-04-08 19:36 GMT+02:00 Eric Yao <[hidden email]>:
Hi M,

There happens to be a milestone "completely initialized" that gets close, but there are still track rendering that occur after.

There is a plugin, DebugEvents, that may be able to help you devise a mechanism to detect "absolute settlement."
To install, add a section in trackList.json, "plugins: ['DebugEvents'],".  Check the console log for results.

Eric



On Fri, Apr 8, 2016 at 5:20 AM, Mts Mft <[hidden email]> wrote:
Hi guys, 

Has anyone made/heard any update on the point mentioned earlier in the thread (i.e. a 'completely rendered' milestone )?

Cheers,

M

Matthias.

2014-05-28 18:15 GMT+02:00 Tomaz Berisa <[hidden email]>:
Using jQuery's .load() on the iframe from the main document just fires the event right away (same thing for .ready(), but this is not unexpected).
On the other hand, jQuery's .load() *never* fires when plugged into jBrowse's index.html. As if jBrowse (or dojo, ..?) is somehow preventing the page from being detected as fully loaded (or just blocking the event).

When hooking into the JBrowse variable, I sporadically get the following error:
Uncaught TypeError: Cannot read property 'afterMilestone' of undefined
I would say this is due to the fact that sometimes I catch the variable after it's initialized and sometime before (when I get the error). All this seems to be a consequence of jQuery firing the event before the underlying document (iframe) fully loads.
Furthermore, even when I don't get the error - I get the "Finished loading" alert before JBrowse loads and renders tracks. The alert pauses loading of the page before it's confirmed and the JBrowse tracks stay blank until I confirm the alert message. Therefore, I agree this milestone is not what we're looking for.

I currently have the following dirty trick that works:
check = true;
for(a in map_of_required_annotations) {
  find_a = $('#jbrowse_iframe').contents().find('label[title="'+a+'"]');
  if(find_a.length==0) {
    check = false;
    break;
  }
}
...this basically just looks for the tracks in the tracklist and assumes the page is loaded when the tracklist is loaded. It works for now, but this is not a proper solution since there is a possibility of it showing a false positive when the tracklist is loaded, but the tracks are not yet rendered.
This solution could be extended to finding the actual track divs, but is not very practical with many tracks and still doesn't guarantee they are rendered (only that the divs exist).

Cheers,
Tomaz

On Tue, May 27, 2014 at 6:57 PM, Colin <[hidden email]> wrote:
We have started solving this on the irc. We used something similar to the following code, but we might need to add some additional code because even at the milestone "completely initialized", the browser does not appear to be "completely rendered"

// use jquery load handler to make sure jbrowse iframe is loaded
$("#myiframe").load(function(){
    // hook into browser to get variables
    var browser=document.getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() { alert('Finished loading'); });
});


-Colin


On Tue, May 27, 2014 at 4:23 PM, Tomaz Berisa <[hidden email]> wrote:
Hi,

First of all, thanks for the awesome browser. 

I was wondering if there is a consistent way of detecting jBrowse has loaded completely and is "idle" (waiting for input, ...)?

Is there an event I can subscribe to or some other mechanism to achieve this?

I currently have jBrowse embedded in an iframe and would like to detect that it loaded completely in order to be able to control it externally. As a side note, I have not been able to solve this with the jQuery .load() and .ready() functions.

Thanks,
Tomaz


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax