diff --git a/cms/static/cms/js/require-config.js b/cms/static/cms/js/require-config.js index 80a07e68ce..7404ef2b69 100644 --- a/cms/static/cms/js/require-config.js +++ b/cms/static/cms/js/require-config.js @@ -27,12 +27,8 @@ "mustache": "js/vendor/mustache", "codemirror": "js/vendor/codemirror-compressed", "codemirror/stex": "js/vendor/CodeMirror/stex", - // The jquery-migrate library was added in upgrading from - // jQuery 1.7.x to 2.2.x. This config allows developers - // to depend on "jquery" which opaquely requires both - // libraries. - "_jquery": "js/vendor/jquery.min", - "jquery": "js/vendor/jquery-migrate.min", + "jquery": "common/js/vendor/jquery", + "jquery-migrate": "common/js/vendor/jquery-migrate", "jquery.ui": "js/vendor/jquery-ui.min", "jquery.form": "js/vendor/jquery.form", "jquery.markitup": "js/vendor/markitup/jquery.markitup", @@ -117,10 +113,7 @@ "date": { exports: "Date" }, - "jquery": { - deps: ["_jquery"], - exports: "jQuery" - }, + "jquery-migrate": ['jquery'], "jquery.ui": { deps: ["jquery"], exports: "jQuery.ui" diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index d3c1fd468f..b96ce21fe6 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -4,11 +4,8 @@ requirejs.config({ "gettext": "xmodule_js/common_static/js/test/i18n", "mustache": "xmodule_js/common_static/js/vendor/mustache", "codemirror": "xmodule_js/common_static/js/vendor/CodeMirror/codemirror", - # The jquery-migrate library was added in upgrading from - # jQuery 1.7.x to 2.2.x. This config allows developers to - # depend on "jquery" which opaquely requires both libraries. - "_jquery": "xmodule_js/common_static/js/vendor/jquery.min", - "jquery": "xmodule_js/common_static/js/vendor/jquery-migrate.min", + "jquery": "xmodule_js/common_static/common/js/vendor/jquery", + "jquery-migrate": "xmodule_js/common_static/common/js/vendor/jquery-migrate", "jquery.ui": "xmodule_js/common_static/js/vendor/jquery-ui.min", "jquery.form": "xmodule_js/common_static/js/vendor/jquery.form", "jquery.markitup": "xmodule_js/common_static/js/vendor/markitup/jquery.markitup", @@ -69,10 +66,7 @@ requirejs.config({ "date": { exports: "Date" }, - "jquery": { - deps: ["_jquery"], - exports: "jQuery" - }, + "jquery-migrate": ['jquery'], "jquery.ui": { deps: ["jquery"], exports: "jQuery.ui" diff --git a/cms/static/coffee/spec/main_squire.coffee b/cms/static/coffee/spec/main_squire.coffee index 83f7d95d98..240d58a8a0 100644 --- a/cms/static/coffee/spec/main_squire.coffee +++ b/cms/static/coffee/spec/main_squire.coffee @@ -5,7 +5,8 @@ requirejs.config({ "gettext": "xmodule_js/common_static/js/test/i18n", "mustache": "xmodule_js/common_static/js/vendor/mustache", "codemirror": "xmodule_js/common_static/js/vendor/CodeMirror/codemirror", - "jquery": "xmodule_js/common_static/js/vendor/jquery.min", + "jquery": "xmodule_js/common_static/common/js/vendor/jquery", + "jquery-migrate": "xmodule_js/common_static/common/js/vendor/jquery-migrate", "jquery.ui": "xmodule_js/common_static/js/vendor/jquery-ui.min", "jquery.form": "xmodule_js/common_static/js/vendor/jquery.form", "jquery.markitup": "xmodule_js/common_static/js/vendor/markitup/jquery.markitup", diff --git a/common/djangoapps/pipeline_mako/tests/test_render.py b/common/djangoapps/pipeline_mako/tests/test_render.py index 4c072075c5..1cef001594 100644 --- a/common/djangoapps/pipeline_mako/tests/test_render.py +++ b/common/djangoapps/pipeline_mako/tests/test_render.py @@ -14,7 +14,7 @@ class RequireJSPathOverridesTest(TestCase): """Test RequireJS path overrides. """ OVERRIDES = { - 'jquery': 'js/vendor/jquery.min.js', + 'jquery': 'common/js/vendor/jquery.js', 'backbone': 'common/js/vendor/backbone.js', 'text': 'js/vendor/text.js' } @@ -24,7 +24,7 @@ class RequireJSPathOverridesTest(TestCase): "(function (require) {", "require.config({", "paths: {", - "'jquery': 'js/vendor/jquery.min',", + "'jquery': 'common/js/vendor/jquery',", "'text': 'js/vendor/text',", "'backbone': 'common/js/vendor/backbone'", "}", diff --git a/common/static/common/js/common_libraries.js b/common/static/common/js/common_libraries.js index 57ffa5ce1e..dbbe380811 100644 --- a/common/static/common/js/common_libraries.js +++ b/common/static/common/js/common_libraries.js @@ -3,6 +3,7 @@ define([ 'edx-ui-toolkit/js/utils/html-utils', 'domReady!', 'jquery', + 'jquery-migrate', 'backbone', 'underscore', 'gettext' diff --git a/common/static/common/js/spec/main_requirejs.js b/common/static/common/js/spec/main_requirejs.js index ea539c7f77..7004b93c58 100644 --- a/common/static/common/js/spec/main_requirejs.js +++ b/common/static/common/js/spec/main_requirejs.js @@ -1,9 +1,12 @@ (function(requirejs, define) { + 'use strict'; + requirejs.config({ baseUrl: '/base/', paths: { 'gettext': 'js/test/i18n', - 'jquery': 'js/vendor/jquery.min', + 'jquery': 'common/js/vendor/jquery', + 'jquery-migrate': 'common/js/vendor/jquery-migrate', 'jquery.ui': 'js/vendor/jquery-ui.min', 'jquery.flot': 'js/vendor/flot/jquery.flot.min', 'jquery.form': 'js/vendor/jquery.form', diff --git a/common/static/js/vendor/jquery-migrate.min.js b/common/static/js/vendor/jquery-migrate.min.js deleted file mode 120000 index 9baf8c3b59..0000000000 --- a/common/static/js/vendor/jquery-migrate.min.js +++ /dev/null @@ -1 +0,0 @@ -../../../../node_modules/jquery-migrate/dist/jquery-migrate.min.js \ No newline at end of file diff --git a/common/static/js/vendor/jquery.min.js b/common/static/js/vendor/jquery.min.js deleted file mode 120000 index f0c4795a02..0000000000 --- a/common/static/js/vendor/jquery.min.js +++ /dev/null @@ -1 +0,0 @@ -../../../../node_modules/jquery/dist/jquery.min.js \ No newline at end of file diff --git a/lms/envs/common.py b/lms/envs/common.py index 40e8e49b29..c12fa134dd 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1240,8 +1240,8 @@ proctoring_js = ( # In the future, we will likely refactor this to use # RequireJS and an optimizer. base_vendor_js = [ - 'js/vendor/jquery.min.js', - 'js/vendor/jquery-migrate.min.js', + 'common/js/vendor/jquery.js', + 'common/js/vendor/jquery-migrate.js', 'js/vendor/jquery.cookie.js', 'js/vendor/url.min.js', 'common/js/vendor/underscore.js', @@ -1353,16 +1353,16 @@ incourse_reverify_js = [ ccx_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/ccx/**/*.js')) certificates_web_view_js = [ - 'js/vendor/jquery.min.js', - 'js/vendor/jquery-migrate.min.js', + 'common/js/vendor/jquery.js', + 'common/js/vendor/jquery-migrate.js', 'js/vendor/jquery.cookie.js', 'js/src/logger.js', 'js/utils/facebook.js', ] credit_web_view_js = [ - 'js/vendor/jquery.min.js', - 'js/vendor/jquery-migrate.min.js', + 'common/js/vendor/jquery.js', + 'common/js/vendor/jquery-migrate.js', 'js/vendor/jquery.cookie.js', 'js/src/logger.js', ] diff --git a/lms/static/coffee/spec/instructor_dashboard/membership_spec.coffee b/lms/static/coffee/spec/instructor_dashboard/membership_spec.coffee index 185f371855..bb2ba81a11 100644 --- a/lms/static/coffee/spec/instructor_dashboard/membership_spec.coffee +++ b/lms/static/coffee/spec/instructor_dashboard/membership_spec.coffee @@ -3,12 +3,6 @@ describe 'AutoEnrollment', -> loadFixtures 'coffee/fixtures/autoenrollment.html' @autoenrollment = new AutoEnrollmentViaCsv $('.auto_enroll_csv') - it 'binds to the enrollment_signup_button on click event', -> - expect(@autoenrollment.$enrollment_signup_button).toHandle 'click' - - it 'binds to the browse button on change event', -> - expect(@autoenrollment.$browse_button).toHandle 'change' - it 'binds the ajax call and the result will be success', -> spyOn($, "ajax").and.callFake((params) => params.success({row_errors: [], general_errors: [], warnings: []}) diff --git a/lms/static/js/spec/main.js b/lms/static/js/spec/main.js index 2f4f16261a..3a135e7cc3 100644 --- a/lms/static/js/spec/main.js +++ b/lms/static/js/spec/main.js @@ -8,12 +8,8 @@ paths: { 'gettext': 'xmodule_js/common_static/js/test/i18n', 'codemirror': 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror', - // The jquery-migrate library was added in upgrading from - // jQuery 1.7.x to 2.2.x. This config allows developers - // to depend on "jquery" which opaquely requires both - // libraries. - '_jquery': 'xmodule_js/common_static/js/vendor/jquery.min', - 'jquery': 'xmodule_js/common_static/js/vendor/jquery-migrate.min', + 'jquery': 'xmodule_js/common_static/common/js/vendor/jquery', + 'jquery-migrate': 'xmodule_js/common_static/common/js/vendor/jquery-migrate', 'jquery.ui': 'xmodule_js/common_static/js/vendor/jquery-ui.min', 'jquery.eventDrag': 'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2', 'jquery.flot': 'xmodule_js/common_static/js/vendor/flot/jquery.flot.min', @@ -124,10 +120,7 @@ 'date': { exports: 'Date' }, - "jquery": { - deps: ["_jquery"], - exports: "jQuery" - }, + "jquery-migrate": ['jquery'], 'jquery.ui': { deps: ['jquery'], exports: 'jQuery.ui' diff --git a/lms/static/lms/js/build.js b/lms/static/lms/js/build.js index b1e4b1ecb6..c75ec18585 100644 --- a/lms/static/lms/js/build.js +++ b/lms/static/lms/js/build.js @@ -65,10 +65,8 @@ paths: { 'gettext': 'empty:', 'coffee/src/ajax_prefix': 'empty:', - // '_jquery' is the name of the current jQuery in the - // platform, and 'jquery' refers to jquery-migrate. - '_jquery': 'empty:', 'jquery': 'empty:', + 'jquery-migrate': 'empty:', 'jquery.cookie': 'empty:', 'jquery.url': 'empty:', 'backbone': 'empty:', diff --git a/lms/static/lms/js/require-config.js b/lms/static/lms/js/require-config.js index 5709fc7d72..0d2a3a4475 100644 --- a/lms/static/lms/js/require-config.js +++ b/lms/static/lms/js/require-config.js @@ -28,6 +28,7 @@ } }; 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 @@ -68,8 +69,8 @@ // jQuery 1.7.x to 2.2.x. This config allows developers // to depend on "jquery" which opaquely requires both // libraries. - "_jquery": "js/vendor/jquery.min", - "jquery": "js/vendor/jquery-migrate.min", + "jquery": "common/js/vendor/jquery", + "jquery-migrate": "common/js/vendor/jquery-migrate", "jquery.cookie": "js/vendor/jquery.cookie", 'jquery.timeago': 'js/vendor/jquery.timeago', "jquery.url": "js/vendor/url.min", @@ -116,13 +117,11 @@ "date": { exports: "Date" }, -<<<<<<< HEAD -======= "jquery": { deps: ["_jquery"], exports: "jQuery" }, ->>>>>>> Upgrade jQuery 1.7.2 to 2.2.0 + "jquery-migrate": ['jquery'], "jquery.cookie": { deps: ["jquery"], exports: "jQuery.fn.cookie" diff --git a/lms/templates/verify_student/test/fake_softwaresecure_response.html b/lms/templates/verify_student/test/fake_softwaresecure_response.html index c4be837bee..d32a9a0d40 100644 --- a/lms/templates/verify_student/test/fake_softwaresecure_response.html +++ b/lms/templates/verify_student/test/fake_softwaresecure_response.html @@ -21,7 +21,7 @@ - +