Permalink
Browse files

MDL-29207 SCORM: Auto-continue doesn't work with Pre-req due to JS er…

…rors
  • Loading branch information...
1 parent 6496979 commit 5f03868a53ae54d71ea95dc701172b459d35fc3f @danmarsden danmarsden committed Feb 3, 2013
Showing with 20 additions and 2 deletions.
  1. +20 −2 mod/scorm/datamodels/callback.js.php
@@ -19,9 +19,27 @@
success: function(o) {
YUI().use('yui2-treeview', 'yui2-layout', function(Y) {
- scorm_tree_node = Y.YUI2.widget.TreeView.getTree('scorm_tree');
+ // MDL-29159 The core version of getContentHtml doesn't escape text properly.
+ Y.YUI2.widget.TextNode.prototype.getContentHtml = function() {
+ var sb = [];
+ sb[sb.length] = this.href ? '<a' : '<span';
+ sb[sb.length] = ' id="' + Y.YUI2.lang.escapeHTML(this.labelElId) + '"';
+ sb[sb.length] = ' class="' + Y.YUI2.lang.escapeHTML(this.labelStyle) + '"';
+ if (this.href) {
+ sb[sb.length] = ' href="' + Y.YUI2.lang.escapeHTML(this.href) + '"';
+ sb[sb.length] = ' target="' + Y.YUI2.lang.escapeHTML(this.target) + '"';
+ }
+ if (this.title) {
+ sb[sb.length] = ' title="' + Y.YUI2.lang.escapeHTML(this.title) + '"';
+ }
+ sb[sb.length] = ' >';
+ sb[sb.length] = this.label;
+ sb[sb.length] = this.href?'</a>':'</span>';
+ return sb.join("");
+ };
+
if (o.responseText !== undefined) {
- //alert('got a response: ' + o.responseText);
+ var tree = new Y.YUI2.widget.TreeView('scorm_tree');
if (scorm_tree_node && o.responseText) {
var hnode = scorm_tree_node.getHighlightedNode();
var hidx = null;

0 comments on commit 5f03868

Please sign in to comment.