<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).&nbsp; The following diff
    is better.<br>
    <br>
    Thanks,<br>
    Ryan<br>
    <br>
    <br>
    *** balloon.js.v2.39&nbsp;&nbsp;&nbsp; 2011-11-16 16:02:55.000000000 -0500<br>
    --- balloon.js&nbsp;&nbsp;&nbsp; 2011-11-16 17:24:47.000000000 -0500<br>
    ***************<br>
    *** 1065,1070 ****<br>
    --- 1065,1076 ----<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.loadedFromElement = true;<br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp; <br>
    +&nbsp;&nbsp; // check if the contents are to be generated by javascript<br>
    +&nbsp;&nbsp; if (caption.match(/^<a class="moz-txt-link-freetext" href="javascript:/">javascript:/</a>)) {<br>
    +&nbsp;&nbsp;&nbsp;&nbsp; var jsFunctionCall = caption.substring(11);<br>
    +&nbsp;&nbsp;&nbsp;&nbsp; caption = eval(jsFunctionCall);<br>
    +&nbsp;&nbsp; }<br>
    + <br>
    &nbsp;&nbsp;&nbsp; // check if iframes are allowed<br>
    &nbsp;&nbsp;&nbsp; if (caption.match(/\&lt;\s*iframe/i) &amp;&amp;
    !this.allowIframes) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert('Sorry: iframe elements '+notAllowed);<br>
    ***************<br>
    *** 1087,1093 ****<br>
    &nbsp;&nbsp;&nbsp; this.currentHelpText = this.getContents(caption);<br>
    &nbsp;&nbsp;&nbsp; this.loadedFromElement = false;<br>
    &nbsp;&nbsp;&nbsp; <br>
    !&nbsp;&nbsp; return this.currentHelpText;;<br>
    &nbsp; }<br>
    &nbsp; <br>
    &nbsp; <br>
    --- 1093,1099 ----<br>
    &nbsp;&nbsp;&nbsp; this.currentHelpText = this.getContents(caption);<br>
    &nbsp;&nbsp;&nbsp; this.loadedFromElement = false;<br>
    &nbsp;&nbsp;&nbsp; <br>
    !&nbsp;&nbsp; return this.currentHelpText;<br>
    &nbsp; }<br>
    &nbsp; <br>
    &nbsp; <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">&lt;<a moz-do-not-send="true"
              href="mailto:rdoherty@pcbi.upenn.edu">rdoherty@pcbi.upenn.edu</a>&gt;</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. &nbsp;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. &nbsp;Previously we had been generating the content
            of the popups using a javascript function call (with
            parameters established during the original page load). &nbsp;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. &nbsp;If I could be added as a project
            member on SourceForge, perhaps I could make the change
            myself. &nbsp;If not, please consider making the following
            change:<br>
            <br>
            Add the following lines at line 1067 of balloon.js:<br>
            <br>
            &gt; &nbsp; // check if the contents are to be generated by
            javascript<br>
            &gt; &nbsp; if (caption.match(/^<a class="moz-txt-link-freetext" href="javascript:/">javascript:/</a>)) {<br>
            &gt; &nbsp; &nbsp; var jsFunctionCall = caption.split(':')[1];<br>
            &gt; &nbsp; &nbsp; caption = eval(jsFunctionCall);<br>
            &gt; &nbsp; }<br>
            &gt;<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. &nbsp;The full diff and new file (patched from
            version 2.39) are attached (with an additional minor nit).
            &nbsp;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 &lt;<a moz-do-not-send="true"
          href="mailto:Renata.Musa@oicr.on.ca">Renata.Musa@oicr.on.ca</a>&gt;<br>
      </div>
    </blockquote>
    <br>
  </body>
</html>