<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Lincoln,<br>
<br>
Sorry to do this but I already found a bug in my own code (in cases
where the javascript contains a ':' character). The following diff
is better.<br>
<br>
Thanks,<br>
Ryan<br>
<br>
<br>
*** balloon.js.v2.39 2011-11-16 16:02:55.000000000 -0500<br>
--- balloon.js 2011-11-16 17:24:47.000000000 -0500<br>
***************<br>
*** 1065,1070 ****<br>
--- 1065,1076 ----<br>
this.loadedFromElement = true;<br>
}<br>
<br>
+ // check if the contents are to be generated by javascript<br>
+ if (caption.match(/^<a class="moz-txt-link-freetext" href="javascript:/">javascript:/</a>)) {<br>
+ var jsFunctionCall = caption.substring(11);<br>
+ caption = eval(jsFunctionCall);<br>
+ }<br>
+ <br>
// check if iframes are allowed<br>
if (caption.match(/\<\s*iframe/i) &&
!this.allowIframes) {<br>
alert('Sorry: iframe elements '+notAllowed);<br>
***************<br>
*** 1087,1093 ****<br>
this.currentHelpText = this.getContents(caption);<br>
this.loadedFromElement = false;<br>
<br>
! return this.currentHelpText;;<br>
}<br>
<br>
<br>
--- 1093,1099 ----<br>
this.currentHelpText = this.getContents(caption);<br>
this.loadedFromElement = false;<br>
<br>
! return this.currentHelpText;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
On 11/16/11 7:32 PM, Lincoln Stein wrote:
<blockquote
cite="mid:CAOS1dzxQtC3PatwNpEzAHmS2em64JUkMMAE=+z=v_B5x_wJ+mg@mail.gmail.com"
type="cite">Hi Ryan,
<div><br>
</div>
<div>Sorry that gbrowse2 broke your loading code. I will be happy
to incorporate your patch into the distribution.</div>
<div><br>
</div>
<div>If you think you'll be making other improvements, Scott and I
would be happy to add you to the developer list at github.</div>
<div><br>
</div>
<div>Lincoln<br>
<br>
<div class="gmail_quote">On Thu, Nov 17, 2011 at 6:40 AM, Ryan
Doherty <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:rdoherty@pcbi.upenn.edu">rdoherty@pcbi.upenn.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
I am part of the <a moz-do-not-send="true"
href="http://eupathdb.org" target="_blank">eupathdb.org</a>
project at the University of Pennsylvania. We are in the
process of upgrading to GBrowse 2 and I have been tasked
with ensuring the popups continue to work the way they
always have. Previously we had been generating the content
of the popups using a javascript function call (with
parameters established during the original page load). I
would like to continue to do it this way, but found that
loading popup content via a javascript function was not
supported in GBrowse 2 (if this is incorrect, please let me
know).<br>
<br>
I patched our local code to enable this functionality and
would love to pass it on so that it may be added to the next
version of GBrowse 2.x. If I could be added as a project
member on SourceForge, perhaps I could make the change
myself. If not, please consider making the following
change:<br>
<br>
Add the following lines at line 1067 of balloon.js:<br>
<br>
> // check if the contents are to be generated by
javascript<br>
> if (caption.match(/^<a class="moz-txt-link-freetext" href="javascript:/">javascript:/</a>)) {<br>
> var jsFunctionCall = caption.split(':')[1];<br>
> caption = eval(jsFunctionCall);<br>
> }<br>
><br>
<br>
Doing this would allow users to customize the contents of a
popup using a string like <a class="moz-txt-link-rfc2396E" href="javascript:getMyPopupContent()">"javascript:getMyPopupContent()"</a>
when preferred. The full diff and new file (patched from
version 2.39) are attached (with an additional minor nit).
Please feel free to contact me with any questions.<br>
<br>
Thank you,<span class="HOEnZb"><font color="#888888"><br>
Ryan Doherty<br>
EuPathDb Team, University of Pennsylvania<br>
<br>
</font></span></blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Lincoln D. Stein<br>
Director, Informatics and Biocomputing Platform<br>
Ontario Institute for Cancer Research<br>
101 College St., Suite 800<br>
Toronto, ON, Canada M5G0A3<br>
416 673-8514<br>
Assistant: Renata Musa <<a moz-do-not-send="true"
href="mailto:Renata.Musa@oicr.on.ca">Renata.Musa@oicr.on.ca</a>><br>
</div>
</blockquote>
<br>
</body>
</html>