Merge branch 'm20_MDL-26176_cleanup' of github.com:danmarsden/moodle
[moodle.git] / mod / scorm / player.js
1 function scorm_openpopup(url,name,options,width,height) {
2     fullurl = M.cfg.wwwroot + '/mod/scorm/' + url;
3     windowobj = window.open(fullurl,name,options);
4     if (!windowobj) {
5         return;
6     }
7     if ((width==100) && (height==100)) {
8         // Fullscreen
9         windowobj.moveTo(0,0);
10     }
11     if (width<=100) {
12         width = Math.round(screen.availWidth * width / 100);
13     }
14     if (height<=100) {
15         height = Math.round(screen.availHeight * height / 100);
16     }
17     windowobj.resizeTo(width,height);
18     windowobj.focus();
19     return windowobj;
20 }