3154 |
27 Feb 15 |
nicklas |
var Protocol = function() |
3154 |
27 Feb 15 |
nicklas |
2 |
{ |
3154 |
27 Feb 15 |
nicklas |
var protocol = {}; |
3154 |
27 Feb 15 |
nicklas |
var debug = 0; |
3154 |
27 Feb 15 |
nicklas |
5 |
|
3154 |
27 Feb 15 |
nicklas |
// Page initialization |
3154 |
27 Feb 15 |
nicklas |
protocol.initPage = function() |
3154 |
27 Feb 15 |
nicklas |
8 |
{ |
3154 |
27 Feb 15 |
nicklas |
var pageId = Doc.getPageId(); |
3154 |
27 Feb 15 |
nicklas |
if (pageId == 'protocol') |
3154 |
27 Feb 15 |
nicklas |
11 |
{ |
3154 |
27 Feb 15 |
nicklas |
Buttons.addClickHandler('print-button', Wizard.goPrint); |
3154 |
27 Feb 15 |
nicklas |
Doc.show('all-protocol'); |
3154 |
27 Feb 15 |
nicklas |
14 |
} |
3154 |
27 Feb 15 |
nicklas |
else |
3154 |
27 Feb 15 |
nicklas |
16 |
{ |
3154 |
27 Feb 15 |
nicklas |
Buttons.addClickHandler('gocreate', protocol.viewProtocol); |
3154 |
27 Feb 15 |
nicklas |
var url = '../RnaQc.servlet?ID='+App.getSessionId(); |
3154 |
27 Feb 15 |
nicklas |
url += '&cmd=GetActiveRnaQcBioPlates&numFreeWells=0&bioPlateType=BA_RNAQC'; |
3154 |
27 Feb 15 |
nicklas |
Wizard.showLoadingAnimation('Loading RNAQC plates...'); |
3154 |
27 Feb 15 |
nicklas |
Wizard.asyncJsonRequest(url, protocol.qcPlatesLoaded); |
3154 |
27 Feb 15 |
nicklas |
22 |
} |
3154 |
27 Feb 15 |
nicklas |
23 |
} |
3154 |
27 Feb 15 |
nicklas |
24 |
|
3154 |
27 Feb 15 |
nicklas |
protocol.qcPlatesLoaded = function(response) |
3154 |
27 Feb 15 |
nicklas |
26 |
{ |
3154 |
27 Feb 15 |
nicklas |
var frm = document.forms['reggie']; |
3154 |
27 Feb 15 |
nicklas |
var qcPlates = response.plates; |
3742 |
12 Feb 16 |
nicklas |
Doc.element('YellowLabel').value = response.YellowLabel; |
3154 |
27 Feb 15 |
nicklas |
for (var i = 0; i < qcPlates.length; i++) |
3154 |
27 Feb 15 |
nicklas |
31 |
{ |
3154 |
27 Feb 15 |
nicklas |
var plate = qcPlates[i]; |
3154 |
27 Feb 15 |
nicklas |
if (plate.usedWells > 0) |
3154 |
27 Feb 15 |
nicklas |
34 |
{ |
3154 |
27 Feb 15 |
nicklas |
var option = new Option(plate.name + ' -- ' + plate.usedWells + ' used wells', plate.id); |
3154 |
27 Feb 15 |
nicklas |
option.bioPlate = plate; |
3154 |
27 Feb 15 |
nicklas |
frm.bioPlates[frm.bioPlates.length] = option; |
3154 |
27 Feb 15 |
nicklas |
38 |
} |
3154 |
27 Feb 15 |
nicklas |
39 |
} |
3154 |
27 Feb 15 |
nicklas |
40 |
|
3154 |
27 Feb 15 |
nicklas |
if (frm.bioPlates.length == 0) |
3154 |
27 Feb 15 |
nicklas |
42 |
{ |
3154 |
27 Feb 15 |
nicklas |
Wizard.setFatalError('Could not find any BioAnalyzer plates.'); |
3154 |
27 Feb 15 |
nicklas |
return; |
3154 |
27 Feb 15 |
nicklas |
45 |
} |
3154 |
27 Feb 15 |
nicklas |
46 |
|
3154 |
27 Feb 15 |
nicklas |
Doc.show('step-1'); |
3154 |
27 Feb 15 |
nicklas |
Doc.show('gocreate'); |
3154 |
27 Feb 15 |
nicklas |
49 |
} |
3154 |
27 Feb 15 |
nicklas |
50 |
|
3154 |
27 Feb 15 |
nicklas |
51 |
|
3154 |
27 Feb 15 |
nicklas |
protocol.viewProtocol = function() |
3154 |
27 Feb 15 |
nicklas |
53 |
{ |
3154 |
27 Feb 15 |
nicklas |
var frm = document.forms['reggie']; |
3154 |
27 Feb 15 |
nicklas |
frm.submit(); |
3154 |
27 Feb 15 |
nicklas |
56 |
} |
3154 |
27 Feb 15 |
nicklas |
57 |
|
3154 |
27 Feb 15 |
nicklas |
return protocol; |
3154 |
27 Feb 15 |
nicklas |
59 |
}(); |
3154 |
27 Feb 15 |
nicklas |
60 |
|
3154 |
27 Feb 15 |
nicklas |
Doc.onLoad(Protocol.initPage); |
3154 |
27 Feb 15 |
nicklas |
62 |
|