Changeset 2031 for extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp
- Timestamp:
- Oct 1, 2013, 2:07:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp
r2020 r2031 34 34 35 35 var dateIsValid = []; 36 var flowCellIsValid = []; 36 37 var commentsIsValid = false; 37 38 … … 49 50 var flowCell = flowCells[i]; 50 51 var option = new Option(flowCell.name, flowCell.id, i < 2); 51 option. comments = flowCell.comments;52 option.flowCell = flowCell; 52 53 frm.flowcells.options[frm.flowcells.length] = option; 53 54 } 54 flowCellIsValid = true;55 55 setInputStatus('flowcells', '', 'valid'); 56 56 outcomeOnChange(); … … 114 114 function gotoStep2() 115 115 { 116 var frm = document.forms['reggie']; 116 var frm = document.forms['reggie']; 117 118 var selectedFlowCells = []; 119 for (var i = 0; i < frm.flowcells.length; i++) 120 { 121 if (frm.flowcells[i].selected) 122 { 123 selectedFlowCells[selectedFlowCells.length] = frm.flowcells[i].flowCell; 124 } 125 } 126 127 if (selectedFlowCells.length == 0) 128 { 129 setInputStatus('flowcells', 'Select at least 1 flow cell', 'invalid'); 130 return; 131 } 132 133 117 134 frm.flowcells.disabled = true; 118 135 frm.outcome[0].disabled = true; 119 136 frm.outcome[1].disabled = true; 120 137 121 122 138 currentStep = 2; 123 139 Main.show('step.2.section'); … … 127 143 Main.show('goregister'); 128 144 145 var html = '<tr valign="top">'; 146 html += '<td class="prompt">Flow cell</td>'; 147 html += '<td style="width: 11em;"><b>ID</b></td>'; 148 html += '<td><b>ReadString</b></td>'; 149 html += '<td class="status"></td>'; 150 html += '<td class="help" rowspan="' + (selectedFlowCells.length+1) +'">'; 151 html += 'ID and ReadString is required for registration. '; 152 html += 'ReadString must be a sequence of letters <b>Y</b>, <b>N</b>, <b>I</b>, <b>J</b> followed by digits.'; 153 html += '</td>'; 154 html += '</tr>'; 155 156 for (var i = 0; i < selectedFlowCells.length; i++) 157 { 158 var fc = selectedFlowCells[i]; 159 var prefix = 'fc.'+fc.id; 160 html += '<tr>'; 161 html += '<td class="subprompt">'+fc.name+'</td>'; 162 html += '<td><input type="text" class="required" name="'+prefix+'.id" onblur="flowCellIdOnBlur('+fc.id+')"></td>'; 163 html += '<td><input type="text" class="required" name="'+prefix+'.readString" onblur="readStringOnBlur('+fc.id+')" value="'+fc.ReadString+'"></td>'; 164 html += '<td class="status" id="'+prefix+'.status">'; 165 html += '</tr>'; 166 } 167 168 setInnerHTML('fc-data', html); 169 129 170 // Load mRNA protocols 130 171 var clusterProtocols = getProtocols('CLUSTER_PROTOCOL'); … … 140 181 } 141 182 142 frm .clusterDate.focus();183 frm['fc.'+selectedFlowCells[0].id+'.id'].focus(); 143 184 } 144 185 … … 228 269 } 229 270 271 function flowCellIdOnBlur(flowCellId) 272 { 273 checkFlowCellData(flowCellId); 274 } 275 276 function readStringOnBlur(flowCellId) 277 { 278 checkFlowCellData(flowCellId); 279 } 280 281 function checkFlowCellData(flowCellId) 282 { 283 var frm = document.forms['reggie']; 284 285 var prefix = 'fc.'+flowCellId; 286 setInputStatus(prefix, '', ''); 287 288 flowCellIsValid[prefix+'.id'] = false; 289 flowCellIsValid[prefix+'.readString'] = false; 290 291 var id = frm[prefix+'.id'].value; 292 if (id == '') 293 { 294 setInputStatus(prefix, 'ID is a required value', 'invalid'); 295 return; 296 } 297 298 flowCellIsValid[prefix+'.id'] = true; 299 300 var readString = frm[prefix+'.readString'].value; 301 if (readString == '') 302 { 303 setInputStatus(prefix, 'ReadString is a required value', 'invalid'); 304 return; 305 } 306 307 if (!readString.match(/^([YNIJ]\d+)+$/)) 308 { 309 setInputStatus(prefix, 'Not a valid ReadString value', 'invalid'); 310 return; 311 } 312 313 flowCellIsValid[prefix+'.readString'] = true; 314 setInputStatus(prefix, '', 'valid'); 315 } 316 230 317 function step2IsValid() 231 318 { … … 233 320 234 321 if (dateIsValid['clusterDate'] == false) return false; 322 if (dateIsValid['sequenceStartDate'] == false) return false; 323 324 var frm = document.forms['reggie']; 325 for (var i = 0; i < frm.flowcells.length; i++) 326 { 327 if (frm.flowcells[i].selected) 328 { 329 var fc = frm.flowcells[i].flowCell; 330 Main.debug(fc.name + ':'+ fc.id + ':' + flowCellIsValid['fc.'+fc.id+'.id'] + ':' + flowCellIsValid['fc.'+fc.id+'.readString']); 331 if (flowCellIsValid['fc.'+fc.id+'.id'] != true) return false; 332 if (flowCellIsValid['fc.'+fc.id+'.readString'] != true) return false; 333 } 334 } 235 335 236 336 return true; … … 240 340 { 241 341 if (!step2IsValid()) return; 242 243 342 var frm = document.forms['reggie']; 244 343 … … 249 348 frm.clusterDate.disabled = true; 250 349 frm.clusterOperator.disabled = true; 350 frm.sequenceStartDate.disabled = true; 351 frm.sequenceOperator.disabled = true; 251 352 frm.clusterProtocol.disabled = true; 252 353 frm.comments.disabled = true; … … 256 357 for (var i = 0; i < frm.flowcells.length; i++) 257 358 { 258 if (frm.flowcells[i].selected) submitInfo.flowCells[submitInfo.flowCells.length] = parseInt(frm.flowcells[i].value); 359 if (frm.flowcells[i].selected) 360 { 361 var fc = frm.flowcells[i].flowCell; 362 fc.externalId = frm['fc.'+fc.id+'.id'].value; 363 fc.ReadString = frm['fc.'+fc.id+'.readString'].value; 364 submitInfo.flowCells[submitInfo.flowCells.length] = fc; 365 } 259 366 } 260 367 … … 263 370 submitInfo.clusterDate = frm.clusterDate.value; 264 371 submitInfo.clusterOperator = frm.clusterOperator.value; 372 submitInfo.sequenceStartDate = frm.sequenceStartDate.value; 373 submitInfo.sequenceOperator = frm.sequenceOperator.value; 265 374 submitInfo.comments = frm.comments.value; 266 375 … … 390 499 <td class="stepfields"> 391 500 <table> 501 <tbody id="fc-data"></tbody> 392 502 <tr valign="top"> 393 503 <td class="prompt">Step</td> … … 395 505 <td><b>Operator</b></td> 396 506 <td class="status"></td> 397 <td class="help" rowspan="2"> 398 <span id="mrnaDate.message" class="message" style="display: none;"></span> 399 Enter date and operator for each step in the clustering. 507 <td class="help" rowspan="3"> 508 Enter date and operator for each step in the clustering and sequencing startup. 400 509 (YYYYMMDD or MMDD) 401 510 </td> … … 415 524 <td> 416 525 <input type="text" name="clusterOperator" value="<%=HTML.encodeTags(user.getName()) %>" 526 style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'sequenceStartDate')"> 527 </td> 528 <td class="status" id="clusterDate.status"></td> 529 </tr> 530 <tr> 531 <td class="subprompt">Sequence start</td> 532 <td> 533 <input type="text" name="sequenceStartDate" maxlength="10" style="width: 8em;" 534 onblur="dateOnChange('sequenceStartDate')" onkeypress="focusOnEnter(event, 'sequenceOperator')"> 535 <base:icon 536 onclick="Dates.selectDate('Sequence start date', 'reggie', 'sequenceStartDate', 'setDate', 'yyyyMMdd')" 537 image="calendar.png" 538 tooltip="Select a date from a calendar" 539 tabindex="-1" 540 /> 541 </td> 542 <td> 543 <input type="text" name="sequenceOperator" value="<%=HTML.encodeTags(user.getName()) %>" 417 544 style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'clusterProtocol')"> 418 545 </td> 419 <td class="status" id=" clusterDate.status"></td>546 <td class="status" id="sequenceStartDate.status"></td> 420 547 </tr> 421 548 <tr valign="top">
Note: See TracChangeset
for help on using the changeset viewer.