Ignore:
Timestamp:
Dec 3, 2012, 10:50:38 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Added a 'special select' menu that can be used to quickly select wells with a certain condition. For example, all empty wells, wells with Stratagene, wells with an error, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/select_rna.jsp

    r1760 r1761  
    1313%>
    1414<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
     15<%@ taglib prefix="m" uri="/WEB-INF/menu.tld" %>
    1516<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
    1617<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
     
    2728%>
    2829<base:page type="default" >
    29 <base:head scripts="ajax.js,js-draw.js" styles="path.css,toolbar.css">
     30<base:head scripts="ajax.js,js-draw.js,menu.js" styles="path.css,toolbar.css,menu.css">
    3031  <link rel="stylesheet" type="text/css" href="../css/reggie.css">
    3132  <link rel="stylesheet" type="text/css" href="../css/plate.css">
     
    526527  Plate.paint(Plate.getWells());
    527528 
     529  var specialSelect = document.getElementById('iconSpecialSelect');
     530  specialSelect.addEventListener('mouseenter', showSpecialSelect);
     531  specialSelect.addEventListener('mouseleave', hideSpecialSelect);
     532 
    528533  graphics = new jsGraphics(document.getElementById('canvas'));
    529534  pen = new jsPen(new jsColor('#2288AA'), 2);
     
    533538}
    534539
     540// Show the 'special select' menu
     541function showSpecialSelect(event)
     542{
     543  var specialSelect = document.getElementById('iconSpecialSelect');
     544  var pos = Main.getElementPosition(specialSelect);
     545  Menu.showTopMenu(document.getElementById('menuSpecialSelect'), pos.left+pos.width/2, pos.top+pos.height/2);
     546}
     547
     548//Hide the 'special select' menu
     549function hideSpecialSelect(event)
     550{
     551  Menu.hideSubMenus(document.getElementById('menuSpecialSelect'), true);
     552}
    535553
    536554/**
     
    10231041{
    10241042  Plate.toggleSelected(Plate.getPool(pool));
     1043}
     1044
     1045// Some special toogle operations
     1046function specialToggle(what)
     1047{
     1048  var wells = [];
     1049  if (what == 'all' || what == 'empty')
     1050  {
     1051    // All wells or all empty (will be filtered later)
     1052    wells = Plate.getWells();
     1053  }
     1054  else if (what == 'pools' || what == 'empty-pools')
     1055  {
     1056    // All primary pools or all empty in the primary pools (will be filtered later)
     1057    for (var i = 1; i < 5; i++)
     1058    {
     1059      wells = wells.concat(Plate.getPool(i));
     1060    }
     1061  }
     1062  else if (what == 'stratagene')
     1063  {
     1064    // All wells with 'Stratagene'
     1065    var tmp = Plate.getWells();
     1066    for (var i = 0; i < tmp.length; i++)
     1067    {
     1068      var well = tmp[i];
     1069      if (well.rna && well.rna.stratagene) wells[wells.length] = well;
     1070    }
     1071  }
     1072  else if (what == 'replicates')
     1073  {
     1074    // All wells with replicated RNA
     1075    var tmp = Plate.getWells();
     1076    for (var i = 0; i < tmp.length; i++)
     1077    {
     1078      var well = tmp[i];
     1079      if (well.rna && well.rna.replicate) wells[wells.length] = well;
     1080    }
     1081  }
     1082  else if (what == 'error')
     1083  {
     1084    // All wells with an error
     1085    var tmp = Plate.getWells();
     1086    for (var i = 0; i < tmp.length; i++)
     1087    {
     1088      var well = tmp[i];
     1089      if (well.hasError()) wells[wells.length] = well;
     1090    }
     1091  }
     1092  else if (what == 'warning')
     1093  {
     1094    // All wells with a warning
     1095    var tmp = Plate.getWells();
     1096    for (var i = 0; i < tmp.length; i++)
     1097    {
     1098      var well = tmp[i];
     1099      if (well.warning) wells[wells.length] = well;
     1100    }
     1101  }
     1102 
     1103  // Extra filter for empty wells only
     1104  if (what.indexOf('empty') != -1)
     1105  {
     1106    var tmp = wells;
     1107    wells = [];
     1108    for (var i = 0; i < tmp.length; i++)
     1109    {
     1110      if (!tmp[i].rna) wells[wells.length] = tmp[i];
     1111    }
     1112  }
     1113 
     1114  Plate.toggleSelected(wells);
    10251115}
    10261116
     
    12601350  color: #0000C8;
    12611351}
    1262 
     1352#iconSpecialSelect
     1353{
     1354  cursor: pointer;
     1355}
    12631356</style>
    12641357</base:head>
     
    12811374  }
    12821375  %>
     1376 
    12831377  <form name="reggie" onsubmit="return false;">
    12841378 
     
    13821476          <th>
    13831477            <base:icon image="<%=home+"/images/select_all.png"%>"
    1384               onclick="toggleAll()"
    1385               tooltip="Select/deselect all wells on the plate"
    1386             />
    1387           </th>
     1478              id="iconSpecialSelect"
     1479              tooltip="Select/deselect wells on the plate with specific condition"
     1480            >
     1481            <m:menu
     1482              id="menuSpecialSelect"
     1483              style="display: none; font-weight: normal; text-align: left;">
     1484              <m:menuitem
     1485                title="All"
     1486                onclick="specialToggle('all')"
     1487                tooltip="Select/deselect all wells on the plate"
     1488              />
     1489              <m:menuitem
     1490                title="Pools"
     1491                onclick="specialToggle('pools')"
     1492                tooltip="Select/deselect all pooled wells on the plate"
     1493              />
     1494              <m:menuitem
     1495                title="All empty"
     1496                onclick="specialToggle('empty')"
     1497                tooltip="Select/deselect all empty wells on the plate"
     1498              />
     1499              <m:menuitem
     1500                title="Empty in pools"
     1501                onclick="specialToggle('empty-pools')"
     1502                tooltip="Select/deselect all empty pooled wells on the plate"
     1503              />
     1504              <m:menuseparator />
     1505              <m:menuitem
     1506                icon="<%=home+"/images/mrnaqc.png"%>"
     1507                title="Stratagene"
     1508                onclick="specialToggle('stratagene')"
     1509                tooltip="Select/deselect all wells with Stratagene"
     1510              />
     1511              <m:menuitem
     1512                icon="<%=home+"/images/copy.png"%>"
     1513                title="Replicates"
     1514                onclick="specialToggle('replicates')"
     1515                tooltip="Select/deselect all wells with replicated RNA"
     1516              />
     1517              <m:menuitem
     1518                icon="<%=home+"/images/error.png"%>"
     1519                title="Error"
     1520                onclick="specialToggle('error')"
     1521                tooltip="Select/deselect all wells with an error"
     1522              />
     1523              <m:menuitem
     1524                icon="<%=home+"/images/warning.png"%>"
     1525                title="Warning"
     1526                onclick="specialToggle('warning')"
     1527                tooltip="Select/deselect all wells with an error"
     1528              />
     1529            </m:menu>
     1530          </base:icon>
     1531        </th>
    13881532          <%
    13891533          for (int c = 0; c < columns; ++c)
Note: See TracChangeset for help on using the changeset viewer.