Question about hgTrackUi

8 views
Skip to first unread message

Audrey Michel

unread,
Jun 14, 2017, 2:02:08 PM6/14/17
to genome...@soe.ucsc.edu, Claes Matthias
Hi there,

With a previous version of the kent source code (version 320), we added our own entry in the hgTrackUi script to display a button that on click opened a plot in a new tab.

printf("<INPUT TYPE=\"button\" ONCLICK=\"window.open('%s'); return false;\" VALUE=\"View plots\">\n<BR><BR>\n", fullPath_toPlots);

With the more recent kent source code version 347,  we added the above command to the hgTrackUi and compiled, but while the button displays correctly, nothing happens when we click on the button.

Would you have any ideas as to why it worked before, but not now? Or if you have an alternative solution that would be helpful. 

Thanks,
Audrey


Christopher Lee

unread,
Jun 15, 2017, 3:04:00 PM6/15/17
to Audrey Michel, genome-mirror, Claes Matthias

Hi Audrey,

Thank you for your question about modifying hgTrackUi to point to your custom plots. We recently updated our code to reflect Content Security Policy (https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) security upgrades. Now if you would like to add a button, you will need to do it like so:

char viewPlotsJs[1024];
safef(viewPlotsJs, sizeof(viewPlotsJs), "window.open('%s'); return false;", fullPath_toPlots);
cgiMakeOnClickButton("viewPlotsButton", viewPlotsJs, "View plots");

instead of:
printf(...onclick...)

Please let us know if you have any further questions!

Thank you again for your inquiry and using the UCSC Genome Browser. If
you have any further questions, please reply to gen...@soe.ucsc.edu.
All messages sent to that address are archived on a
publicly-accessible forum. If your question includes sensitive data,
you may send it instead to genom...@soe.ucsc.edu.

Christopher Lee
UCSC Genomics Institute


--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirror+unsubscribe@soe.ucsc.edu.
To post to this group, send email to genome...@soe.ucsc.edu.
Visit this group at https://groups.google.com/a/soe.ucsc.edu/group/genome-mirror/.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/CAO32qw4myDzEO6CCfGLCTf92rFnVzbbX8W-D0ZdRMMSM9Ecauw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/soe.ucsc.edu/d/optout.

Audrey Michel

unread,
Jun 16, 2017, 11:30:24 AM6/16/17
to Christopher Lee, genome-mirror, Claes Matthias
Hi Christopher,

Thank you very much for providing the explanation as to why our previous code no longer works.

We have since used your cgiMakeOnClickButton approach which works.

Kind regards,
Audrey
Reply all
Reply to author
Forward
0 new messages