Commit 709012e3 by Don Mitchell

Merge pull request #4965 from edx/split/lms_bugs

Split/lms bugs
parents f5f4326b 49ed7328
...@@ -35,8 +35,9 @@ window.rewriteStaticLinks = function(content, from, to) { ...@@ -35,8 +35,9 @@ window.rewriteStaticLinks = function(content, from, to) {
} }
// change all relative urls only which may be embedded inside other tags in content. // change all relative urls only which may be embedded inside other tags in content.
// handle http and https // handle http and https
// note: add other protocols here // escape all regex interpretable chars
var regex = new RegExp("(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*))?"+from, 'g'); fromRe = from.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
var regex = new RegExp("(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*))?"+fromRe, 'g');
return content.replace(regex, replacer); return content.replace(regex, replacer);
}; };
......
...@@ -16,15 +16,7 @@ function setup_debug(element_id, edit_link, staff_context){ ...@@ -16,15 +16,7 @@ function setup_debug(element_id, edit_link, staff_context){
var username = $("#" + element_id + "_history_student_username").val(); var username = $("#" + element_id + "_history_student_username").val();
var location = $("#" + element_id + "_history_location").val(); var location = $("#" + element_id + "_history_location").val();
// This is a ridiculous way to get the course_id, but I'm not sure $("#" + element_id + "_history_text").load('/courses/' + "${unicode(course.id)}" +
// how to do it sensibly from within the staff debug code.
// staff_problem_info.html is rendered through a wrapper to get_html
// that's injected by the code that adds the histogram -- it's all
// kinda bizarre, and it remains awkward to simply ask "what course
// is this problem being shown in the context of."
var path_parts = window.location.pathname.split('/');
var course_id = path_parts[2] + "/" + path_parts[3] + "/" + path_parts[4];
$("#" + element_id + "_history_text").load('/courses/' + course_id +
"/submission_history/" + username + "/" + location); "/submission_history/" + username + "/" + location);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment