5877 |
24 Mar 20 |
nicklas |
var VCall = function() |
5877 |
24 Mar 20 |
nicklas |
2 |
{ |
5877 |
24 Mar 20 |
nicklas |
var vcall = {}; |
5877 |
24 Mar 20 |
nicklas |
var debug = 0; |
5877 |
24 Mar 20 |
nicklas |
5 |
|
5877 |
24 Mar 20 |
nicklas |
// Page initialization |
5877 |
24 Mar 20 |
nicklas |
vcall.initPage = function() |
5877 |
24 Mar 20 |
nicklas |
8 |
{ |
5877 |
24 Mar 20 |
nicklas |
// Navigation |
5877 |
24 Mar 20 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
5877 |
24 Mar 20 |
nicklas |
11 |
|
5877 |
24 Mar 20 |
nicklas |
// Final registration |
5877 |
24 Mar 20 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', vcall.submit); |
5877 |
24 Mar 20 |
nicklas |
14 |
|
5877 |
24 Mar 20 |
nicklas |
var url = '../VariantCalling.servlet?ID='+App.getSessionId(); |
5877 |
24 Mar 20 |
nicklas |
url += '&cmd=GetVariantCallsNeedingImport'; |
5877 |
24 Mar 20 |
nicklas |
Wizard.showLoadingAnimation('Checking for variant calls...'); |
5877 |
24 Mar 20 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.countDone); |
5877 |
24 Mar 20 |
nicklas |
19 |
} |
5877 |
24 Mar 20 |
nicklas |
20 |
|
5877 |
24 Mar 20 |
nicklas |
// --- Step 1 ----------------------------------- |
5877 |
24 Mar 20 |
nicklas |
22 |
|
5877 |
24 Mar 20 |
nicklas |
vcall.countDone = function(response) |
5877 |
24 Mar 20 |
nicklas |
24 |
{ |
5877 |
24 Mar 20 |
nicklas |
var countRawBioAssays = response.countRawBioAssays; |
5877 |
24 Mar 20 |
nicklas |
Doc.element('countRawBioAssays').innerHTML = countRawBioAssays; |
5877 |
24 Mar 20 |
nicklas |
Doc.show('step-1'); |
5877 |
24 Mar 20 |
nicklas |
28 |
|
5877 |
24 Mar 20 |
nicklas |
if (countRawBioAssays > 0) |
5877 |
24 Mar 20 |
nicklas |
30 |
{ |
5877 |
24 Mar 20 |
nicklas |
Doc.show('goregister'); |
5878 |
24 Mar 20 |
nicklas |
if (response.disabled) |
5878 |
24 Mar 20 |
nicklas |
33 |
{ |
5878 |
24 Mar 20 |
nicklas |
Wizard.showGoNextConfirmation(true, 'This wizard has been disabled. Override by marking the checkbox!'); |
5878 |
24 Mar 20 |
nicklas |
35 |
} |
5877 |
24 Mar 20 |
nicklas |
36 |
} |
5877 |
24 Mar 20 |
nicklas |
37 |
} |
5877 |
24 Mar 20 |
nicklas |
38 |
|
5877 |
24 Mar 20 |
nicklas |
vcall.submit = function() |
5877 |
24 Mar 20 |
nicklas |
40 |
{ |
5877 |
24 Mar 20 |
nicklas |
var url = '../VariantCalling.servlet?ID='+App.getSessionId(); |
5877 |
24 Mar 20 |
nicklas |
url += '&cmd=ImportToExistingVariantCalls'; |
5877 |
24 Mar 20 |
nicklas |
43 |
|
5877 |
24 Mar 20 |
nicklas |
Wizard.showLoadingAnimation('Importing...', 'variant-import-progress'); |
5877 |
24 Mar 20 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.submissionResults, 'POST'); |
5877 |
24 Mar 20 |
nicklas |
46 |
} |
5877 |
24 Mar 20 |
nicklas |
47 |
|
5877 |
24 Mar 20 |
nicklas |
vcall.submissionResults = function(response) |
5877 |
24 Mar 20 |
nicklas |
49 |
{ |
5877 |
24 Mar 20 |
nicklas |
Wizard.showFinalMessage(response.messages); |
5877 |
24 Mar 20 |
nicklas |
Doc.show('gorestart'); |
5877 |
24 Mar 20 |
nicklas |
52 |
} |
5877 |
24 Mar 20 |
nicklas |
53 |
|
5877 |
24 Mar 20 |
nicklas |
return vcall; |
5877 |
24 Mar 20 |
nicklas |
55 |
}(); |
5877 |
24 Mar 20 |
nicklas |
56 |
|
5877 |
24 Mar 20 |
nicklas |
Doc.onLoad(VCall.initPage); |
5877 |
24 Mar 20 |
nicklas |
58 |
|