Static Page JS Protocol: Difference between revisions

From genomewiki
Jump to navigationJump to search
(Changed "push to beta" to "do a make on beta")
(Replacing page with 'This page is no longer maintained.')
 
Line 1: Line 1:
[[Category:Browser QA]][[Category:Browser Development]]
This page is no longer maintained.
 
 
To solve some testing issues, there is a new procedure for hard coded links that go from hgwdev --> hgwbeta --> RR and for those that go from hgdownload-test --> hgdownload.
 
Starting with the first scenario:
 
'''hgwdev --> hgwbeta --> RR'''
 
There are cases where it is necessary to have the RR hardcoded in the link like the link below:
 
http://genome.ucsc.edu/cgi-bin/hgTracks?org=human&position=chr22&hgt.customText=http://genome.ucsc.edu/goldenPath/help/examples/ct_example1.txt
 
If you look at the second part of the url, you will see that this becomes problematic especially when you are testing on hgwdev because the files that this links to is referring to a file that isn't on the RR at the time of testing.
 
To solve this problem there is some jquery code (/js/staticDoc.js) that will find hard coded "http://genome.ucsc.edu" links and rewrite them to be whatever their current host name is for easy testing.
 
To see this code in action, under example one, hover over the "'''here'''" in the line that says "Click '''here''' to view this track in the Genome Browser." for each of these:
 
  http://hgwdev.cse.ucsc.edu/goldenPath/help/customTrack.html
  http://hgwbeta.cse.ucsc.edu/goldenPath/help/customTrack.html
  http://genome.ucsc.edu/goldenPath/help/customTrack.html
 
The html code for this is:
 
<P>
Click <a class="insideLink" href="../../cgi-bin/hgTracks?org=human&amp;position=chr22&amp;hgt.customText=http://genome.ucsc.edu/goldenPath/help/examples/ct_example1.txt"
TARGET=_blank>here</a> to view this track in the Genome Browser.</P>
 
For this to work you there are a few things you need to do:
 
1) You need to refer for the jquery code by placing the code below between the <head></head> tags at the top of the page or the page that the file is included in.
 
Ex:
  <head>
        <script type="text/javascript" src="/js/jquery.js"></script>
        <script type="text/javascript" src="/js/staticDoc.js"></script>
  </head>
 
 
2) If the hard coded link is after an "=" sign then you will need to add class="insideLink" to the to link (see below)
 
  <a class="insideLink" href="../../cgi-bin/hgTracks?org=human&amp;position=chr22&amp;hgt.customText=http://genome.ucsc.edu/goldenPath/help/examples/ct_example4.txt"
 
With this class added the link on hgwdev is now:
 
  http://hgwdev.cse.ucsc.edu/cgi-bin/hgTracks?org=human&position=chr22&hgt.customText=http://hgwdev.cse.ucsc.edu/goldenPath/help/examples/ct_example4.txt
 
Please note: the <a href=""></a> must be in lower case for this to work.
 
When you do a make on hgwbeta, the url after the "=" sign will reflect the current host name.
 
 
3) If there is a rare case where you have to have a hard coded link instead of a relative link, then you will need to add class="change" (see below)
 
  <a class="change" TARGET=_BLANK href="http://genome.ucsc.edu/goldenPath/help/ct_description.txt">
 
On hgwdev this link looks like this:
 
  http://hgwdev.cse.ucsc.edu/goldenPath/help/ct_description.txt
 
 
Please note: the <a href=""></a> must be in lower case for this to work.
 
The javaScript file is located in the kent source tree:
  /cluster/home/$usr/kent/src/hg/js/staticDoc.js
 
 
 
'''hgdownload-test --> hgdownload'''
 
 
1) If the link can't be relative and has to be hard coded to point to hgdownload, you will need to add a class="changeHg"
 
Ex:
  <a class="changeHg" href="http://hgdownload.cse.ucsc.edu/admin/hgcentral.sql">hgcentral database download</a>
 
Please note: the <a href=""></a> must be in lower case for this to work.
 
2) You need to refer for the jquery code by placing the code below between the <head></head> tags at the top of the page or the page that the file is included in.
 
Ex:
  <head>
        <script type="text/javascript" src="/js/jquery.js"></script>
        <script type="text/javascript" src="/js/staticDoc.js"></script>
  </head>
 
The javaScript file is located in the kent source tree:
  /cluster/home/$usr/kent/src/hg/js/staticDoc.js
 
If you make changes to the file, you will need to do a "make" in the hgdownload source tree to bring the changes in.

Latest revision as of 19:24, 10 March 2011

This page is no longer maintained.