Merge branch 'm23_MDL-34755' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE
[moodle.git] / mod / scorm / view.js
1 M.mod_scormform = {};
2 M.mod_scormform.init = function(Y) {
3     var scormform = document.getElementById('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.onsubmit = function() {window.open('', 'Popup', poptions); this.target='Popup';};
19 }