Commit 9135e728 by Simon Chen

Disable script auto-eval on lms

parent 73c41388
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
(function(require, define) { (function(require, define) {
'use strict'; '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 // 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. // into the optimized files. Therefore load these libraries through script tags and explicitly define them.
...@@ -31,15 +31,27 @@ ...@@ -31,15 +31,27 @@
console.error('Expected library to be included on page, but not found on window object: ' + name); 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');
defineDependency('jQuery', 'jquery-migrate'); defineDependency('jQuery', 'jquery-migrate');
defineDependency('_', 'underscore'); defineDependency('_', 'underscore');
defineDependency('s', 'underscore.string'); 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('gettext', 'gettext');
defineDependency('Logger', 'logger'); defineDependency('Logger', 'logger');
defineDependency('URI', 'URI'); defineDependency('URI', 'URI');
...@@ -52,6 +64,8 @@ ...@@ -52,6 +64,8 @@
// utility.js adds two functions to the window object, but does not return anything // utility.js adds two functions to the window object, but does not return anything
defineDependency('isExternal', 'utility', true); defineDependency('isExternal', 'utility', true);
librarySetup();
} }
require.config({ 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