Have DiscussionXBlock take care of loading JS and CSS files it depends on.

* Add openedx.core.lib.xblock_builtin.get_css_dependencies and get_js_dependencies,
  which respect PIPELINE_ENABLED setting when determining dependencies.
* Move new discussion-related Sass files into discussion subdirectory.
* Use "load_unicode" instead of "render_template" to load JS to add to fragment for DiscussionXBlock.
* Remove unused "course" parameter from context for DiscussionXBlock.student_view.
* Add RTL stylesheet for DiscussionXBlock, and enable the block to load correct stylesheet.
* Load MathJax only once, and include code for configuring MathJax in discussion bundle.
* Make sure username renders correctly in DiscussionXBlock response header.
* Move WYSIWYIG Markdown editor styles to _build-discussion.scss.
* Remove unnecessary import of discussion/utilities/v1-compatibility from _build-discussion.scss.
* Keep courseware-chromeless.html in sync with courseware.html.
* Load CSS for discussions on Teams tab.  This makes it possible to remove CSS for discussions from Sass files for "Course" tab.
* Load js/src/tooltip_manager.js, jquery.autocomplete.js and jquery.autocomplete.css on "Course" tab.
This commit is contained in:
Tim Krones
2016-09-15 15:10:07 +02:00
committed by Jillian Vogel
parent 5573690af6
commit baa9d06e97
19 changed files with 262 additions and 58 deletions

View File

@@ -0,0 +1,36 @@
var vendorScript;
if (typeof MathJax === 'undefined') {
vendorScript = document.createElement('script');
vendorScript.onload = function() {
'use strict';
var MathJax = window.MathJax,
setMathJaxDisplayDivSettings;
MathJax.Hub.Config({
tex2jax: {
inlineMath: [
['\\(', '\\)'],
['[mathjaxinline]', '[/mathjaxinline]']
],
displayMath: [
['\\[', '\\]'],
['[mathjax]', '[/mathjax]']
]
}
});
MathJax.Hub.signal.Interest(function(message) {
if (message[0] === 'End Math') {
setMathJaxDisplayDivSettings();
}
});
setMathJaxDisplayDivSettings = function() {
$('.MathJax_Display').each(function() {
this.setAttribute('tabindex', '0');
this.setAttribute('aria-live', 'off');
this.removeAttribute('role');
this.removeAttribute('aria-readonly');
});
};
};
vendorScript.src = 'https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG';
document.body.appendChild(vendorScript);
}

View File

@@ -18,12 +18,6 @@
created_at: '2014-09-09T20:11:08Z'
};
this.imageTag = '<img src="https://www.google.com.pk/images/srpr/logo11w.png">';
window.MathJax = {
Hub: {
Queue: function() {
}
}
};
});
makeView = function(thread) {
var view;