mirror of
https://github.com/moodle/moodle.git
synced 2025-03-06 16:59:56 +01:00
This reverts commit ed3d1ee60d1e48ade21438fd98fef2deb63ecb5f. This reverts commit ed8eebeecefa98e17c96084b72fe2cd923cc051d. This reverts commit f664a9387818b5b359df4696040da0aea07b926a. This reverts commit 9d2276572372f5d249cde8c61d0976e25f0fa4a8.
35 lines
1.4 KiB
JavaScript
35 lines
1.4 KiB
JavaScript
M.mod_scormform = {};
|
|
M.mod_scormform.init = function(Y) {
|
|
var scormform = document.getElementById('scormviewform');
|
|
var cwidth = scormplayerdata.cwidth;
|
|
var cheight = scormplayerdata.cheight;
|
|
var poptions = scormplayerdata.popupoptions;
|
|
var launch = scormplayerdata.launch;
|
|
var currentorg = scormplayerdata.currentorg;
|
|
var sco = scormplayerdata.sco;
|
|
var scorm = scormplayerdata.scorm;
|
|
var launch_url = M.cfg.wwwroot+"/mod/scorm/player.php?a="+scorm+"¤torg="+currentorg+"&scoid="+sco+"&sesskey="+M.cfg.sesskey;
|
|
var course_url = scormplayerdata.courseurl;
|
|
|
|
poptions = poptions + ',resizable=yes'; // Added for IE (MDL-32506).
|
|
|
|
if ((cwidth==100) && (cheight==100)) {
|
|
poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
|
|
} else {
|
|
if (cwidth<=100) {
|
|
cwidth = Math.round(screen.availWidth * cwidth / 100);
|
|
}
|
|
if (cheight<=100) {
|
|
cheight = Math.round(screen.availHeight * cheight / 100);
|
|
}
|
|
poptions = poptions+',width='+cwidth+',height='+cheight;
|
|
}
|
|
|
|
if (launch == true) {
|
|
launch_url = launch_url+"&display=popup";
|
|
window.open(launch_url,'Popup', poptions);
|
|
parent.window.location = course_url;
|
|
}
|
|
scormform.onsubmit = function() {window.open('', 'Popup', poptions); this.target='Popup'; parent.window.location = course_url;};
|
|
}
|