[Gmod-help] code contribution

Ryan Doherty rdoherty at pcbi.upenn.edu
Wed Nov 16 17:40:13 EST 2011


Hello,

I am part of the eupathdb.org 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).

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:

Add the following lines at line 1067 of balloon.js:

 >   // check if the contents are to be generated by javascript
 >   if (caption.match(/^javascript:/)) {
 >     var jsFunctionCall = caption.split(':')[1];
 >     caption = eval(jsFunctionCall);
 >   }
 >

Doing this would allow users to customize the contents of a popup using 
a string like "javascript:getMyPopupContent()" 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.

Thank you,
Ryan Doherty
EuPathDb Team, University of Pennsylvania

-------------- next part --------------
A non-text attachment was scrubbed...
Name: balloon.zip
Type: application/zip
Size: 21005 bytes
Desc: not available
URL: <http://brie4.cshl.edu/pipermail/gmod-help/attachments/20111116/44437d39/attachment.zip>


More information about the Gmod-help mailing list