Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SCORM MDL-29159 - override getContentHtml function in treeview so tha…

…t it doesn't escape text incorrectly
  • Loading branch information...
commit 7320f48b987729fabc6907684995164765cf7e15 1 parent 735de1c
@danmarsden danmarsden authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 mod/scorm/module.js
View
18 mod/scorm/module.js
@@ -48,6 +48,24 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
Y.use('yui2-resize', 'yui2-dragdrop', 'yui2-container', 'yui2-button', 'yui2-layout', 'yui2-treeview', 'yui2-json', 'yui2-event', function(Y) {
+ YAHOO.widget.TextNode.prototype.getContentHtml = function() {
+ var sb = [];
+ sb[sb.length] = this.href ? '<a' : '<span';
+ sb[sb.length] = ' id="' + YAHOO.lang.escapeHTML(this.labelElId) + '"';
+ sb[sb.length] = ' class="' + YAHOO.lang.escapeHTML(this.labelStyle) + '"';
+ if (this.href) {
+ sb[sb.length] = ' href="' + YAHOO.lang.escapeHTML(this.href) + '"';
+ sb[sb.length] = ' target="' + YAHOO.lang.escapeHTML(this.target) + '"';
+ }
+ if (this.title) {
+ sb[sb.length] = ' title="' + YAHOO.lang.escapeHTML(this.title) + '"';
+ }
+ sb[sb.length] = ' >';
+ sb[sb.length] = this.label;
+ sb[sb.length] = this.href?'</a>':'</span>';
+ return sb.join("");
+ };
+
var scorm_activate_item = function(node) {
if (!node) {
return;
Please sign in to comment.
Something went wrong with that request. Please try again.