Commit 9380b6b5 by Simon Chen Committed by GitHub

Merge pull request #15151 from edx/schen/learner-490

LEARNER-490 Disable script auto-eval on lms
parents a39dfbb2 9135e728
......@@ -4,7 +4,7 @@
(function(require, define) {
'use strict';
var defineDependency;
var defineDependency, librarySetup;
// We do not wish to bundle common libraries (that may also be used by non-RequireJS code on the page
// into the optimized files. Therefore load these libraries through script tags and explicitly define them.
......@@ -31,15 +31,27 @@
console.error('Expected library to be included on page, but not found on window object: ' + name);
}
};
librarySetup = function() {
// This is the function to setup all the vendor libraries
// Underscore.string no longer installs itself directly on '_'. For compatibility with existing
// code, add it to '_' with its previous name.
if (window._ && window.s) {
window._.str = window.s;
}
window.$.ajaxSetup({
contents: {
script: false
}
});
};
defineDependency('jQuery', 'jquery');
defineDependency('jQuery', 'jquery-migrate');
defineDependency('_', 'underscore');
defineDependency('s', 'underscore.string');
// Underscore.string no longer installs itself directly on '_'. For compatibility with existing
// code, add it to '_' with its previous name.
if (window._ && window.s) {
window._.str = window.s;
}
defineDependency('gettext', 'gettext');
defineDependency('Logger', 'logger');
defineDependency('URI', 'URI');
......@@ -52,6 +64,8 @@
// utility.js adds two functions to the window object, but does not return anything
defineDependency('isExternal', 'utility', true);
librarySetup();
}
require.config({
......
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