Changeset 1951


Ignore:
Timestamp:
Apr 24, 2013, 11:13:27 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Add link to "Case summary" in the context menu in the "Select RNA" wizard and in the "Flagged RNA" dialog.

Add support for showing the "Case summary" as a popup window.

Location:
extensions/net.sf.basedb.reggie/trunk/resources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/select_rna.jsp

    r1947 r1951  
    3636
    3737<script language="JavaScript">
    38 var debug = true;
     38var debug = false;
    3939
    4040var quantitiesAreValid = false;
     
    193193      text += '<div class="name">'+rna.name+'</div>';
    194194     
    195       var warningMsg = null;
     195      var warningMsg = [];
    196196      if (info.bioWell)
    197197      {
     
    201201      else if (!rna.stratagene && !rna.external)
    202202      {
    203         if (!warningMsg) warningMsg = 'No location';
     203        warningMsg[warningMsg.length] = 'No location';
    204204      }
    205205
     
    221221          if (info.remainingQuantity < LOW_QUANTITY_WARNING_LIMIT)
    222222          {
    223             if (!warningMsg) warningMsg = 'Low quantity';
     223            warningMsg[warningMsg.length] = 'Low quantity';
    224224          }
    225225        }
    226226        else
    227227        {
    228           if (!warningMsg) warningMsg = 'No quantity';
     228          warningMsg[warningMsg.length] = 'No quantity';
    229229        }
    230230        if (info.rqs)
    231231        {
    232232          text += '<div class="quality-score">RQS='+Numbers.formatNumber(info.rqs, 1) + '</div>';
    233           if (info.rqs < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RQS value';
     233          if (info.rqs < QUALITY_SCORE_WARNING_LIMIT) warningMsg[warningMsg.length] = 'Low RQS value';
    234234        }
    235235        else if (info.rin)
    236236        {
    237237          text += '<div class="quality-score">RIN='+Numbers.formatNumber(info.rin, 1) + '</div>';
    238           if (info.rin < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RIN value';
     238          if (info.rin < QUALITY_SCORE_WARNING_LIMIT) warningMsg[warningMsg.length] = 'Low RIN value';
    239239        }
    240240        else
    241241        {
    242           if (!warningMsg) warningMsg = 'No RQS/RIN value';
     242          warningMsg[warningMsg.length] = 'No RQS/RIN value';
    243243        }
    244244        if (info.NDConc)
     
    249249        else
    250250        {
    251           if (!warningMsg) warningMsg = 'No NDConc value';
     251          warningMsg[warningMsg.length] = 'No NDConc value';
    252252        }
    253253      }
     
    264264        text += '<div class="comment">'+Main.encodeTags(info.comment)+'</div>';
    265265      }
    266       if (warningMsg)
     266      if (warningMsg.length > 0)
    267267      {
    268         well.setWarning(warningMsg);
     268        well.setWarning(warningMsg.join('; '));
    269269      }
    270270    }
     
    12081208}
    12091209
     1210var contextRNA = null;
    12101211/**
    12111212  Reacts to 'mouseup' and 'contextmenu' events for the bioplate.
     
    12191220  // Can't just check the button since two events are sent ('mouseup' and 'contextmenu')
    12201221  var showContext = event.type == 'contextmenu' && event.button == 2;
    1221  
     1222   
    12221223  if (showContext)
    12231224  {
    12241225    event.preventDefault(); // Prevents the default right-click menu from appearing
     1226   
     1227    // Get the well that is right-clicked and the RNA that is in it
     1228    contextRNA = null;
     1229    var well = event.target;
     1230    while (well && (!well.id || well.id.indexOf('well') != 0))
     1231    {
     1232      well = well.parentNode;
     1233    }
     1234    if (well)
     1235    {
     1236      var c = well.id.split(/\./);
     1237      contextRNA = Plate.getWell(parseInt(c[1]), parseInt(c[2])).extract;
     1238    }
     1239    // Update the context meny
     1240    var caseSummaryMenu = document.getElementById('mnuCaseSummary');
     1241    if (contextRNA)
     1242    {
     1243      caseSummaryMenu.title = 'Show case summary for ' + contextRNA.name;
     1244      Main.show('sepCaseSummary');
     1245      Main.show('mnuCaseSummary');
     1246    }
     1247    else
     1248    {
     1249      Main.hide('sepCaseSummary');
     1250      Main.hide('mnuCaseSummary');
     1251    }
     1252   
    12251253    var menu = document.getElementById('menuContext');
    12261254    // 1 pixel offset to avoid losing well focus outline
     
    12321260    setTimeout(showContextMenu, 100);
    12331261  }
     1262}
     1263
     1264function showCaseSummary()
     1265{
     1266  if (!contextRNA) return;
     1267  var caseName = contextRNA.name.substring(0, 7);
     1268  var url = '../reports/case_summary.jsp?ID=<%=ID%>&caseName='+encodeURIComponent(caseName);
     1269  url += '&pageType=popup';
     1270  Main.openPopup(url, 'CaseSummary'+caseName, 1000, 700);
    12341271}
    12351272
     
    16491686      title="Flag"
    16501687      icon="<%=home+"/images/flag.png"%>"
     1688    />
     1689    <m:menuseparator id="sepCaseSummary" />
     1690    <m:menuitem
     1691      id="mnuCaseSummary"
     1692      icon="<%=home+"/images/case_summary.png"%>"
     1693      onclick="showCaseSummary()"
     1694      tooltip="Show case summary"
     1695      title="Case summary&hellip;"
    16511696    />
    16521697  </m:menu>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/show_flagged_rna.jsp

    r1947 r1951  
    4040  {
    4141    var rna = flagged[i];
    42     document.getElementById('rna.'+i).innerHTML = rna.name;
     42    document.getElementById('rna.'+i).innerHTML = rna.name+'<img class="link case-summary" onclick="showCaseSummary(\''+rna.name+'\')" src="../images/case_summary.png">';
    4343    if (rna.bioWell)
    4444    {
     
    102102  window.close();
    103103}
     104
     105function showCaseSummary(name)
     106{
     107  var caseName = name.substring(0, 7);
     108  var url = '../reports/case_summary.jsp?ID=<%=ID%>&caseName='+encodeURIComponent(caseName);
     109  url += '&pageType=popup';
     110  Main.openPopup(url, 'CaseSummary'+caseName, 1000, 700);
     111}
     112
    104113</script>
    105114
     
    109118  color: #C80000;
    110119  font-weight: bold;
     120}
     121
     122.case-summary
     123{
     124  padding-left: 4px;
    111125}
    112126</style>
  • extensions/net.sf.basedb.reggie/trunk/resources/reports/case_summary.jsp

    r1915 r1951  
    5959  final String caseName = request.getParameter("caseName");
    6060  final String pageType = Values.getString(request.getParameter("pageType"), "default");
    61   boolean fullPage = "default".equals(pageType);
     61 
     62  boolean iframe = "iframe".equals(pageType);
     63  boolean popup = "popup".equals(pageType);
     64  boolean fullPage = !iframe && !popup;
    6265%>
    6366<base:page type="<%=pageType %>" >
     
    579582<base:body onload="init()">
    580583  <div id="all-content">
    581   <p:path style="<%=fullPage ? "" : "display: none;"%>"><p:pathelement id="path-reggie" clazz="noprint"
    582     title="Reggie" href="<%="../index.jsp?ID="+ID%>"
    583     /><p:pathelement id="path-case-summary" title="<%="Case summary - " + HTML.encodeTags(caseName)%>"
    584     /></p:path>
    585 
     584  <%
     585  if (fullPage)
     586  {
     587    %>
     588    <p:path><p:pathelement id="path-reggie" clazz="noprint"
     589      title="Reggie" href="<%="../index.jsp?ID="+ID%>"
     590      /><p:pathelement id="path-case-summary" title="<%="Case summary - " + HTML.encodeTags(caseName)%>"
     591      /></p:path>
     592    <%
     593  }
     594  else if (popup)
     595  {
     596    %>
     597    <h1>Case summary - <%= HTML.encodeTags(caseName)%></h1>
     598    <%
     599  }
     600  %>
    586601  <div class="content">
    587602  <form name="reggie" onsubmit="return false;">
    588603  <%
    589   if (fullPage)
     604  if (fullPage || popup)
    590605  {
    591606    %>
     
    975990  </div>
    976991  </div>
     992  <%
     993  if (popup)
     994  {
     995    %>
     996    <base:buttongroup subclass="dialogbuttons topborder" id="dialogbuttons">
     997      <base:button onclick="window.close()" title="Close" />
     998    </base:buttongroup>
     999    <%
     1000  }
     1001  %>
    9771002</base:body>
    9781003</base:page>
Note: See TracChangeset for help on using the changeset viewer.