Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-43019 SCORM: always use iframe instead of object - backported fro…

…m 2.6 - fixes issue with IE 11 SCORM packages not loading
  • Loading branch information...
commit f2858a669a1dc3e83592e99f5b6f83169ffee4fd 1 parent 828aff6
@danmarsden danmarsden authored
Showing with 13 additions and 49 deletions.
  1. +12 −43 mod/scorm/module.js
  2. +0 −5 mod/scorm/player.php
  3. +1 −1  mod/scorm/version.php
View
55 mod/scorm/module.js
@@ -100,41 +100,20 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
}
var content = new Y.YUI2.util.Element('scorm_content');
- try {
- // first try IE way - it can not set name attribute later
- // and also it has some restrictions on DOM access from object tag
- if (window_name || node.title == null) {
- var obj = document.createElement('<iframe id="scorm_object" src="">');
- if (window_name) {
- var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
- if(! mine) {
- alert(M.str.scorm.popupsblocked);
- }
- mine.close()
- }
- }
- else {
- var obj = document.createElement('<iframe id="scorm_object" src="'+url_prefix + node.title+'">');
- }
- // fudge IE7 to redraw the screen
- if (Y.YUI2.env.ua.ie > 5 && Y.YUI2.env.ua.ie < 8) {
- obj.attachEvent("onload", scorm_resize_parent);
- }
- } catch (e) {
- var obj = document.createElement('object');
- obj.setAttribute('id', 'scorm_object');
- obj.setAttribute('type', 'text/html');
- if (!window_name && node.title != null) {
- obj.setAttribute('data', url_prefix + node.title);
- }
- if (window_name) {
- var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
- if(! mine) {
- alert(M.str.scorm.popupsblocked);
- }
- mine.close()
+ var obj = document.createElement('iframe');
+ obj.setAttribute('id', 'scorm_object');
+ obj.setAttribute('type', 'text/html');
+ if (!window_name && node.title != null) {
+ obj.setAttribute('src', url_prefix + node.title);
+ }
+ if (window_name) {
+ var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
+ if(! mine) {
+ alert(M.str.scorm.popupsblocked);
}
+ mine.close()
}
+
var old = Y.YUI2.util.Dom.get('scorm_object');
if (old) {
if(window_name) {
@@ -178,16 +157,6 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
scoes_nav[launch_sco].hidecontinue == 1));
};
- var scorm_resize_parent = function() {
- // fudge IE7 to redraw the screen
- parent.resizeBy(-10, -10);
- parent.resizeBy(10, 10);
- var ifr = Y.YUI2.util.Dom.get('scorm_object');
- if (ifr) {
- ifr.detachEvent("onload", scorm_resize_parent);
- }
- };
-
var scorm_resize_layout = function(alsowidth) {
if (window_name) {
return;
View
5 mod/scorm/player.php
@@ -235,12 +235,7 @@
$scorm->width, $scorm->height)));
?>
<noscript>
- <!--[if IE]>
<iframe id="main" class="scoframe" name="main" src="loadSCO.php?id=<?php echo $cm->id.$scoidstr.$modestr; ?>"></iframe>
- <![endif]-->
- <!--[if !IE]>
- <object id="main" class="scoframe" type="text/html" data="loadSCO.php?id=<?php echo $cm->id.$scoidstr.$modestr; ?>"></object>
- <![endif]-->
</noscript>
<?php
}
View
2  mod/scorm/version.php
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
-$module->version = 2012112902; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2012112903; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012112900; // Requires this Moodle version
$module->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics)
$module->cron = 300;
Please sign in to comment.
Something went wrong with that request. Please try again.