6523 |
20 Dec 21 |
nicklas |
var RbaHits = function() |
6523 |
20 Dec 21 |
nicklas |
2 |
{ |
6523 |
20 Dec 21 |
nicklas |
var rbahits = {}; |
6523 |
20 Dec 21 |
nicklas |
4 |
|
6523 |
20 Dec 21 |
nicklas |
// Page initialization |
6523 |
20 Dec 21 |
nicklas |
rbahits.initPage = function() |
6523 |
20 Dec 21 |
nicklas |
7 |
{ |
6523 |
20 Dec 21 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
6523 |
20 Dec 21 |
nicklas |
var url = 'Hit.servlet?ID='+App.getSessionId(); |
6523 |
20 Dec 21 |
nicklas |
url += '&cmd=GetAllRbaHits'; |
6523 |
20 Dec 21 |
nicklas |
url += '&rbaId='+Data.int('page-data', 'rba'); |
6526 |
20 Dec 21 |
nicklas |
url += '&fileId='+Data.int('page-data', 'file'); |
6523 |
20 Dec 21 |
nicklas |
url += '&idx='+encodeURIComponent(Data.get('page-data', 'idx')); |
6523 |
20 Dec 21 |
nicklas |
Wizard.showLoadingAnimation('Loading variant data...'); |
6523 |
20 Dec 21 |
nicklas |
Wizard.asyncJsonRequest(url, rbahits.detailsLoaded); |
6523 |
20 Dec 21 |
nicklas |
16 |
} |
6523 |
20 Dec 21 |
nicklas |
17 |
|
6523 |
20 Dec 21 |
nicklas |
rbahits.detailsLoaded = function(response) |
6523 |
20 Dec 21 |
nicklas |
19 |
{ |
6526 |
20 Dec 21 |
nicklas |
var title = response.rbaName; |
6526 |
20 Dec 21 |
nicklas |
if (response.fileName) |
6526 |
20 Dec 21 |
nicklas |
22 |
{ |
6526 |
20 Dec 21 |
nicklas |
title += ' - ' + response.fileName; |
6526 |
20 Dec 21 |
nicklas |
24 |
} |
6526 |
20 Dec 21 |
nicklas |
else if (response.indexName) |
6526 |
20 Dec 21 |
nicklas |
26 |
{ |
6526 |
20 Dec 21 |
nicklas |
title += ' - ' + response.indexName |
6526 |
20 Dec 21 |
nicklas |
28 |
} |
6526 |
20 Dec 21 |
nicklas |
Doc.element('doc-title').innerHTML = Strings.encodeTags(title); |
6523 |
20 Dec 21 |
nicklas |
30 |
|
6523 |
20 Dec 21 |
nicklas |
Doc.element('headers').innerHTML = response.header; |
6523 |
20 Dec 21 |
nicklas |
Doc.element('results').innerHTML = response.results; |
6523 |
20 Dec 21 |
nicklas |
Doc.autoInitElements('snp-table'); |
6523 |
20 Dec 21 |
nicklas |
34 |
} |
6523 |
20 Dec 21 |
nicklas |
35 |
|
6523 |
20 Dec 21 |
nicklas |
rbahits.refAlt = function(ref, alt, maxLength) |
6523 |
20 Dec 21 |
nicklas |
37 |
{ |
6523 |
20 Dec 21 |
nicklas |
if (!maxLength) maxLength = 15; |
6523 |
20 Dec 21 |
nicklas |
if (ref.length > maxLength) |
6523 |
20 Dec 21 |
nicklas |
40 |
{ |
6523 |
20 Dec 21 |
nicklas |
ref = "<span title=\""+ref+"\">"+ref.substring(0, maxLength)+"...</span>"; |
6523 |
20 Dec 21 |
nicklas |
42 |
} |
6523 |
20 Dec 21 |
nicklas |
if (alt.length > maxLength) |
6523 |
20 Dec 21 |
nicklas |
44 |
{ |
6523 |
20 Dec 21 |
nicklas |
alt = "<span title=\""+alt+"\">"+alt.substring(0, maxLength)+"...</span>"; |
6523 |
20 Dec 21 |
nicklas |
46 |
} |
6523 |
20 Dec 21 |
nicklas |
return ref + " › " + alt; //   is a narrow non-breaking space |
6523 |
20 Dec 21 |
nicklas |
48 |
} |
6523 |
20 Dec 21 |
nicklas |
49 |
|
6523 |
20 Dec 21 |
nicklas |
50 |
|
6523 |
20 Dec 21 |
nicklas |
return rbahits; |
6523 |
20 Dec 21 |
nicklas |
52 |
}(); |
6523 |
20 Dec 21 |
nicklas |
53 |
|
6523 |
20 Dec 21 |
nicklas |
Doc.onLoad(RbaHits.initPage); |
6523 |
20 Dec 21 |
nicklas |
55 |
|