Skip to content

Commit

Permalink
Merge pull request openedx#19484 from edx/release-mergeback-to-master
Browse files Browse the repository at this point in the history
Merge release back to master
  • Loading branch information
feanil authored Dec 20, 2018
2 parents cc5b1ce + a33bd63 commit e90ce3a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 49 deletions.
2 changes: 1 addition & 1 deletion cms/djangoapps/pipeline_js/js/xmodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ define(
window._ = _;

$script(
'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js' +
'//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js' +
'?config=TeX-MML-AM_SVG&delayStartupUntil=configured',
'mathjax',
function() {
Expand Down
7 changes: 2 additions & 5 deletions cms/static/cms/js/require-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@
// the option as displayed in the context menu to false.
// When upgrading to 2.6, check if this variable name changed.
window.MathJax = {
menuSettings: {
CHTMLpreview: false
}
menuSettings: {CHTMLpreview: false}
};

};

defineDependency('jQuery', 'jquery');
Expand Down Expand Up @@ -134,7 +131,7 @@
'lang_edx': 'js/src/lang_edx',

// externally hosted files
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
mathjax: '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': [
// youtube URL does not end in '.js'. We add '?noext' to the path so
// that require.js adds the '.js' to the query component of the URL,
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/spec/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
'domReady': 'xmodule_js/common_static/js/vendor/domReady',
'URI': 'xmodule_js/common_static/js/vendor/URI.min',
'mock-ajax': 'xmodule_js/common_static/js/vendor/mock-ajax',
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
mathjax: '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': '//www.youtube.com/player_api?noext',
'js/src/ajax_prefix': 'xmodule_js/common_static/js/src/ajax_prefix',
'js/spec/test_utils': 'js/spec/test_utils'
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/spec/main_squire.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'draggabilly': 'xmodule_js/common_static/js/vendor/draggabilly',
'domReady': 'xmodule_js/common_static/js/vendor/domReady',
'URI': 'xmodule_js/common_static/js/vendor/URI.min',
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
mathjax: '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': '//www.youtube.com/player_api?noext',
'js/src/ajax_prefix': 'xmodule_js/common_static/js/src/ajax_prefix'
},
Expand Down
11 changes: 1 addition & 10 deletions common/static/common/js/discussion/mathjax_include.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ if (typeof MathJax === 'undefined') {
});
};
};

// Automatic loading of Mathjax accessibility files
window.MathJax = {
menuSettings: {
collapsible: true,
autocollapse: true,
explorer: true
}
};
vendorScript.src = 'https://cdn.jsdelivr.net/npm/[email protected]/MathJax.js?config=TeX-MML-AM_SVG';
vendorScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG';
document.body.appendChild(vendorScript);
}
2 changes: 1 addition & 1 deletion common/static/common/js/discussion/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,10 @@
this.postMathJaxProcessor(this.markdownWithHighlight(element.text()))
);

this.typesetMathJax(element);
};

DiscussionUtil.typesetMathJax = function(element) {

if (typeof MathJax !== 'undefined' && MathJax !== null) {
MathJax.Hub.Queue(['Typeset', MathJax.Hub, element[0]]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@
this.renderAttrs();
this.$('span.timeago').timeago();
this.convertMath();
this.$('.post-body');
this.$('h1,h3');
return this;
};

DiscussionThreadShowView.prototype.convertMath = function() {
DiscussionUtil.convertMath(this.$('.post-body'));
DiscussionUtil.typesetMathJax(this.$('.post-body'));
};

DiscussionThreadShowView.prototype.edit = function(event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@
if (options.focusAddedResponse) {
this.focusToTheAddedResponse(view.el);
}

// Typeset the response when initially loaded for any forum
DiscussionUtil.typesetMathJax(view.$el);
return view;
DiscussionUtil.typesetMathJax(view.$el.find('.js-response-list'));
};

DiscussionThreadView.prototype.renderAddResponseButton = function() {
Expand Down Expand Up @@ -348,7 +345,7 @@
};

DiscussionThreadView.prototype.submitComment = function(event) {
var body, comment, url, view;
var body, comment, url;
event.preventDefault();
url = this.model.urlFor('reply');
body = this.getWmdContent('reply-body');
Expand All @@ -368,7 +365,7 @@
user_id: window.user.get('id')
});
comment.set('thread', this.model.get('thread'));
view = this.renderResponseToList(comment, '.js-response-list', {
this.renderResponseToList(comment, '.js-response-list', {
focusAddedResponse: true
});
this.model.addComment();
Expand All @@ -382,9 +379,8 @@
body: body
},
success: function(data) {
comment.updateInfo(data.annotated_content_info);
comment.set(data.content);
DiscussionUtil.typesetMathJax(view.$el.find('.response-body'));
comment.updateInfo(data.annotated_content_info);
return comment.set(data.content);
}
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@

ResponseCommentShowView.prototype.convertMath = function() {
DiscussionUtil.convertMath(this.$el.find('.response-body'));
DiscussionUtil.typesetMathJax(this.$el.find('.response-body'));

};

ResponseCommentShowView.prototype._delete = function(event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@

ThreadResponseView.prototype.render = function() {
this.$el.addClass('response_' + this.model.get('id'));

// Setting the HTML through utils to cope for tag-less text
edx.HtmlUtils.setHtml(this.$el, edx.HtmlUtils.HTML(this.renderTemplate()));
this.$el.html(this.renderTemplate());
this.delegateEvents();
this.renderShowView();
this.renderAttrs();
Expand Down Expand Up @@ -311,7 +309,6 @@
event.preventDefault();
this.createShowView();
this.renderShowView();
DiscussionUtil.typesetMathJax(this.$el.find('.response-body'));
return this.showCommentForm();
};

Expand Down Expand Up @@ -345,7 +342,6 @@
});
self.createShowView();
self.renderShowView();
DiscussionUtil.typesetMathJax(self.$el.find('.response-body'));
return self.showCommentForm();
}
});
Expand Down
13 changes: 1 addition & 12 deletions common/templates/mathjax_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,9 @@
}
</script>

<script type="text/javascript">
// Activating Mathjax accessibility files
window.MathJax = {
menuSettings: {
collapsible: true,
autocollapse: true,
explorer: true
}
};
</script>


<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
MathJax extension libraries -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG"></script>
%endif
2 changes: 1 addition & 1 deletion lms/static/lms/js/spec/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
'squire': 'common/js/vendor/Squire',
'jasmine-imagediff': 'xmodule_js/common_static/js/vendor/jasmine-imagediff',
'domReady': 'xmodule_js/common_static/js/vendor/domReady',
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
mathjax: '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': '//www.youtube.com/player_api?noext',
'js/src/ajax_prefix': 'xmodule_js/common_static/js/src/ajax_prefix',
'js/instructor_dashboard/student_admin': 'js/instructor_dashboard/student_admin',
Expand Down

0 comments on commit e90ce3a

Please sign in to comment.