2209 |
03 Feb 14 |
nicklas |
1 |
|
2209 |
03 Feb 14 |
nicklas |
var MeV = function() |
666 |
18 Apr 08 |
nicklas |
3 |
{ |
2209 |
03 Feb 14 |
nicklas |
var mev = {}; |
2209 |
03 Feb 14 |
nicklas |
5 |
|
2209 |
03 Feb 14 |
nicklas |
mev.initPage = function() |
666 |
18 Apr 08 |
nicklas |
7 |
{ |
2209 |
03 Feb 14 |
nicklas |
var pageId = Doc.getPageId(); |
2209 |
03 Feb 14 |
nicklas |
if (pageId == 'mev-options') |
2209 |
03 Feb 14 |
nicklas |
10 |
{ |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler('btnSave', mev.saveOptions); |
2209 |
03 Feb 14 |
nicklas |
Events.addEventHandler('maxMemory', 'keypress', Events.integerOnly); |
2209 |
03 Feb 14 |
nicklas |
14 |
} |
2209 |
03 Feb 14 |
nicklas |
else if (pageId == 'mev-launch') |
2209 |
03 Feb 14 |
nicklas |
16 |
{ |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler('export-tdms', mev.exportTdms); |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler('export-cgh', mev.exportCgh); |
2209 |
03 Feb 14 |
nicklas |
20 |
} |
2209 |
03 Feb 14 |
nicklas |
21 |
} |
2209 |
03 Feb 14 |
nicklas |
22 |
|
2209 |
03 Feb 14 |
nicklas |
mev.initElement = function(element, autoInit) |
2209 |
03 Feb 14 |
nicklas |
24 |
{ |
2209 |
03 Feb 14 |
nicklas |
if (autoInit == 'launch-mev') |
2209 |
03 Feb 14 |
nicklas |
26 |
{ |
2209 |
03 Feb 14 |
nicklas |
Events.addEventHandler(element, 'click', mev.launchDialog); |
2209 |
03 Feb 14 |
nicklas |
28 |
} |
2209 |
03 Feb 14 |
nicklas |
else if (autoInit == 'start-mev') |
2209 |
03 Feb 14 |
nicklas |
30 |
{ |
2209 |
03 Feb 14 |
nicklas |
Buttons.addClickHandler(element, mev.startMev); |
2209 |
03 Feb 14 |
nicklas |
32 |
} |
2209 |
03 Feb 14 |
nicklas |
33 |
} |
2209 |
03 Feb 14 |
nicklas |
34 |
|
2209 |
03 Feb 14 |
nicklas |
mev.launchDialog = function(event) |
2209 |
03 Feb 14 |
nicklas |
36 |
{ |
2209 |
03 Feb 14 |
nicklas |
var bioAssaySetId = Data.int(event.currentTarget, 'item-id'); |
2209 |
03 Feb 14 |
nicklas |
var homeUrl = Data.get(event.currentTarget, 'home'); |
2209 |
03 Feb 14 |
nicklas |
var url = homeUrl+'/launch_mev.jsp?ID='+App.getSessionId(); |
666 |
18 Apr 08 |
nicklas |
url += '&bioassayset_id=' + bioAssaySetId; |
2209 |
03 Feb 14 |
nicklas |
Dialogs.openPopup(url, 'LaunchMev', 600, 400); |
666 |
18 Apr 08 |
nicklas |
42 |
} |
1061 |
11 May 09 |
nicklas |
43 |
|
2209 |
03 Feb 14 |
nicklas |
mev.startMev = function(event) |
2209 |
03 Feb 14 |
nicklas |
45 |
{ |
2209 |
03 Feb 14 |
nicklas |
var fileType = Data.get(event.currentTarget, 'mev-file-type'); |
2209 |
03 Feb 14 |
nicklas |
var bioAssaySetId = Data.int('page-data', 'bioassayset-id'); |
2209 |
03 Feb 14 |
nicklas |
48 |
|
2209 |
03 Feb 14 |
nicklas |
var url = 'mev_jnlp.jsp?ID='+App.getSessionId(); |
2209 |
03 Feb 14 |
nicklas |
url += '&bioassayset_id='+bioAssaySetId; |
2209 |
03 Feb 14 |
nicklas |
url += '&filetype=' + fileType; |
2209 |
03 Feb 14 |
nicklas |
window.opener.location.href = url; |
2209 |
03 Feb 14 |
nicklas |
setTimeout(App.closeWindow, 500); |
2209 |
03 Feb 14 |
nicklas |
54 |
} |
2209 |
03 Feb 14 |
nicklas |
55 |
|
2209 |
03 Feb 14 |
nicklas |
mev.exportTdms = function(event) |
2209 |
03 Feb 14 |
nicklas |
57 |
{ |
2209 |
03 Feb 14 |
nicklas |
var url = App.getRoot()+'common/plugin/index.jsp?ID='+App.getSessionId(); |
2209 |
03 Feb 14 |
nicklas |
url += '&cmd=NewJob&plugin_class=net.sf.basedb.mev.plugin.TdmsExporterPlugin'; |
2209 |
03 Feb 14 |
nicklas |
url += '&item_type=BIOASSAYSET&context_type=ITEM'; |
2209 |
03 Feb 14 |
nicklas |
url += '&job_name=' + encodeURIComponent(Data.get(event.currentTarget, 'job-name')); |
2209 |
03 Feb 14 |
nicklas |
url += '¶meter:saveAs='+encodeURIComponent(Data.get(event.currentTarget, 'save-as')); |
2209 |
03 Feb 14 |
nicklas |
url += '¶meter:attachToBioAssaySet=true'; |
2209 |
03 Feb 14 |
nicklas |
Dialogs.openPopup(url, 'CreateTDMSFile', 750, 500); |
2209 |
03 Feb 14 |
nicklas |
window.close(); |
2209 |
03 Feb 14 |
nicklas |
66 |
} |
2209 |
03 Feb 14 |
nicklas |
67 |
|
2209 |
03 Feb 14 |
nicklas |
mev.exportCgh = function(event) |
2209 |
03 Feb 14 |
nicklas |
69 |
{ |
2209 |
03 Feb 14 |
nicklas |
var frm = document.forms['mev']; |
2209 |
03 Feb 14 |
nicklas |
var url = App.getRoot()+'common/plugin/index.jsp?ID='+App.getSessionId(); |
2209 |
03 Feb 14 |
nicklas |
url += '&cmd=NewJob&plugin_class=net.sf.basedb.mev.plugin.CghExporterPlugin'; |
2209 |
03 Feb 14 |
nicklas |
url += '&pluginconfiguration_id=' + frm.cgh_configuration[frm.cgh_configuration.selectedIndex].value; |
2209 |
03 Feb 14 |
nicklas |
url += '&item_type=BIOASSAYSET&context_type=ITEM'; |
2209 |
03 Feb 14 |
nicklas |
url += '&job_name=' + encodeURIComponent(Data.get(event.currentTarget, 'job-name')); |
2209 |
03 Feb 14 |
nicklas |
url += '¶meter:saveAs='+encodeURIComponent(Data.get(event.currentTarget, 'save-as')); |
2209 |
03 Feb 14 |
nicklas |
url += '¶meter:attachToBioAssaySet=true'; |
2209 |
03 Feb 14 |
nicklas |
Dialogs.openPopup(url, 'CreateCGHFile', 750, 500); |
2209 |
03 Feb 14 |
nicklas |
window.close(); |
2209 |
03 Feb 14 |
nicklas |
80 |
} |
2209 |
03 Feb 14 |
nicklas |
81 |
|
2209 |
03 Feb 14 |
nicklas |
mev.saveOptions = function() |
2209 |
03 Feb 14 |
nicklas |
83 |
{ |
2209 |
03 Feb 14 |
nicklas |
document.forms['mevoptions'].submit(); |
2209 |
03 Feb 14 |
nicklas |
85 |
} |
2209 |
03 Feb 14 |
nicklas |
86 |
|
2209 |
03 Feb 14 |
nicklas |
return mev; |
2209 |
03 Feb 14 |
nicklas |
88 |
}(); |
2209 |
03 Feb 14 |
nicklas |
89 |
|
2209 |
03 Feb 14 |
nicklas |
Doc.onLoad(MeV.initPage); |
2209 |
03 Feb 14 |
nicklas |
Doc.addElementInitializer(MeV.initElement); |