~ubuntu-branches/ubuntu/trusty/moodle/trusty

« back to all changes in this revision

Viewing changes to mod/scorm/module.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-01-21 13:40:52 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140121134052-ym2qvsp2cd9vq0p6
Tags: 2.5.4-1
* New upstream release, fixing security issues:
  - MSA-14-0001 Config passwords visibility issue [CVE-2014-0008]
  - MSA-14-0002 Group constraints lacking in "login as" [CVE-2014-0009]
  - MSA-14-0003 CSRF vulnerability in profile fields [CVE-2014-0010]
* Move /var/lib/moodle directory into package.
* Revert back to bundled yui3. Unfortunately, version in Debian and
  of upstream are not compatible (closes: #735312).

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
            }
101
101
 
102
102
            var content = new Y.YUI2.util.Element('scorm_content');
103
 
            try {
104
 
                // first try IE way - it can not set name attribute later
105
 
                // and also it has some restrictions on DOM access from object tag
106
 
                if (window_name || node.title == null) {
107
 
                    var obj = document.createElement('<iframe id="scorm_object" src="">');
108
 
                    if (window_name) {
109
 
                        var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
110
 
                        if(! mine) {
111
 
                             alert(M.str.scorm.popupsblocked);
112
 
                        }
113
 
                        mine.close()
114
 
                    }
115
 
                }
116
 
                else {
117
 
                    var obj = document.createElement('<iframe id="scorm_object" src="'+url_prefix + node.title+'">');
118
 
                }
119
 
                // fudge IE7 to redraw the screen
120
 
                if (Y.YUI2.env.ua.ie > 5 && Y.YUI2.env.ua.ie < 8) {
121
 
                    obj.attachEvent("onload", scorm_resize_parent);
122
 
                }
123
 
            } catch (e) {
124
 
                var obj = document.createElement('object');
125
 
                obj.setAttribute('id', 'scorm_object');
126
 
                obj.setAttribute('type', 'text/html');
127
 
                if (!window_name && node.title != null) {
128
 
                    obj.setAttribute('data', url_prefix + node.title);
129
 
                }
130
 
                if (window_name) {
131
 
                    var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
132
 
                    if(! mine) {
133
 
                         alert(M.str.scorm.popupsblocked);
134
 
                    }
135
 
                    mine.close()
136
 
                }
137
 
            }
 
103
            var obj = document.createElement('iframe');
 
104
            obj.setAttribute('id', 'scorm_object');
 
105
            obj.setAttribute('type', 'text/html');
 
106
            if (!window_name && node.title != null) {
 
107
                obj.setAttribute('src', url_prefix + node.title);
 
108
            }
 
109
            if (window_name) {
 
110
                var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
 
111
                if(! mine) {
 
112
                    alert(M.str.scorm.popupsblocked);
 
113
                }
 
114
                mine.close()
 
115
            }
 
116
 
138
117
            var old = Y.YUI2.util.Dom.get('scorm_object');
139
118
            if (old) {
140
119
                if(window_name) {
178
157
                        scoes_nav[launch_sco].hidecontinue == 1));
179
158
        };
180
159
 
181
 
        var scorm_resize_parent = function() {
182
 
            // fudge  IE7 to redraw the screen
183
 
            parent.resizeBy(-10, -10);
184
 
            parent.resizeBy(10, 10);
185
 
            var ifr = Y.YUI2.util.Dom.get('scorm_object');
186
 
            if (ifr) {
187
 
                ifr.detachEvent("onload", scorm_resize_parent);
188
 
            }
189
 
        };
190
 
 
191
160
        var scorm_resize_layout = function(alsowidth) {
192
161
            if (window_name) {
193
162
                return;