Changeset 4065
- Timestamp:
- Dec 14, 2007, 2:34:36 PM (16 years ago)
- Location:
- branches/2.5-stable/www
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5-stable/www/views/experiments/bioassaysets/view_bioassayset.jsp
r3679 r4065 174 174 } 175 175 } 176 function changeImage(imageId, url) 177 { 176 function runItemPlugin(cmd) 177 { 178 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); 179 } 180 var imageQueue = new Array(); 181 var nextImage = 0; 182 function addImage(imageId, url) 183 { 184 imageQueue[imageQueue.length] = imageId; 178 185 var img = document.getElementById(imageId); 179 img.src = url; 180 } 181 function runItemPlugin(cmd) 182 { 183 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); 186 img.realSrc = url; 187 } 188 function imageLoaded() 189 { 190 nextImage++; 191 prepareNextImage(); 192 } 193 function prepareNextImage() 194 { 195 if (imageQueue.length > nextImage) 196 { 197 var imageId = imageQueue[nextImage]; 198 var img = document.getElementById(imageId); 199 img.src = '../../../images/plot_generating_400x300.gif'; 200 setTimeout('loadNextImage()', 100); 201 } 202 } 203 function loadNextImage() 204 { 205 if (imageQueue.length > nextImage) 206 { 207 var imageId = imageQueue[nextImage]; 208 var img = document.getElementById(imageId); 209 img.onload = imageLoaded; 210 img.src = img.realSrc; 211 } 184 212 } 185 213 </script> 214 <style> 215 .plot { 216 border: 1px solid #666666; 217 background-image: url('../../../images/plot_empty_400x300.png'); 218 } 219 </style> 186 220 </base:head> 187 <base:body >221 <base:body onload="loadNextImage()"> 188 222 <p> 189 223 <p:path> … … 481 515 ItemQuery<BioAssay> bioAssayQuery = bioAssaySet.getBioAssays(); 482 516 bioAssayQuery.order(Orders.asc(Hql.property("name"))); 517 StringBuilder script = new StringBuilder(); 483 518 for (BioAssay bioAssay : bioAssayQuery.list(dc)) 484 519 { … … 488 523 url += "&filter="+filter; 489 524 url += "&title="+HTML.urlEncode(bioAssay.getName()); 525 script.append("addImage('MA").append(bioAssay.getId()).append("','"). 526 append(url).append("');\n"); 490 527 %> 491 528 <img id="MA<%=bioAssay.getId()%>" 492 src="../../../images/ plot_generating_400x300.gif"493 width="400" height="300" 529 src="../../../images/transparent_pixel.gif" 530 width="400" height="300" 494 531 alt="MA-plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>" 495 style="border: 1px solid #666666;"> 496 <script language="JavaScript"> 497 setTimeout("changeImage('MA<%=bioAssay.getId()%>', '<%=url%>')", 100); 498 </script> 532 class="plot" 533 > 499 534 <% 500 535 } 536 %> 537 <script language="JavaScript"> 538 <%=script%> 539 </script> 540 <% 501 541 } 502 542 %> … … 513 553 String xLabel = HTML.urlEncode("A, log10(ch1 * ch2) / 2"); 514 554 String yLabel = HTML.urlEncode("M, log2(ch1 / ch2)"); 555 StringBuilder script = new StringBuilder(); 515 556 for (BioAssay bioAssay : bioAssayQuery.list(dc)) 516 557 { … … 519 560 url += "&xLabel="+xLabel+"&yLabel="+yLabel; 520 561 url += "&title="+HTML.urlEncode(bioAssay.getName()); 562 script.append("addImage('CF").append(bioAssay.getId()).append("','"). 563 append(url).append("');\n"); 521 564 %> 522 565 <img id="CF<%=bioAssay.getId()%>" 523 src="../../../images/ plot_generating_400x300.gif"524 width="400" height="300" 566 src="../../../images/transparent_pixel.gif" 567 width="400" height="300" 525 568 alt="Correction factor plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>" 526 style="border: 1px solid #666666;"> 527 <script language="JavaScript"> 528 setTimeout("changeImage('CF<%=bioAssay.getId()%>', '<%=url%>')", 100); 529 </script> 569 class="plot" 570 > 530 571 <% 531 572 } 573 %> 574 <script language="JavaScript"> 575 <%=script%> 576 </script> 577 <% 532 578 } 533 579 %>
Note: See TracChangeset
for help on using the changeset viewer.