weekly release 2.3.1+
[moodle.git] / mod / scorm / view.js
CommitLineData
d5159fb8
DM
1M.mod_scormform = {};
2M.mod_scormform.init = function(Y) {
3 var scormform = Y.one('#scormviewform');
4 var cwidth = scormplayerdata.cwidth;
5 var cheight = scormplayerdata.cheight;
6 var poptions = scormplayerdata.popupoptions;
7 if ((cwidth==100) && (cheight==100)) {
8 poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
9 } else {
10 if (cwidth<=100) {
11 cwidth = Math.round(screen.availWidth * cwidth / 100);
12 }
13 if (cheight<=100) {
14 cheight = Math.round(screen.availHeight * cheight / 100);
15 }
16 poptions = poptions+',width='+cwidth+',height='+cheight;
17 }
18 scormform.setAttribute('onsubmit', "window.open('','Popup','"+poptions+"'); this.target='Popup';");
19}