Fix the way jquery and jquery-migrate are loaded
Don't use symlinks to include node_modules
This commit is contained in:
committed by
Brian Jacobel
parent
665f983c99
commit
230f252bad
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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'",
|
||||
"}",
|
||||
|
||||
@@ -3,6 +3,7 @@ define([
|
||||
'edx-ui-toolkit/js/utils/html-utils',
|
||||
'domReady!',
|
||||
'jquery',
|
||||
'jquery-migrate',
|
||||
'backbone',
|
||||
'underscore',
|
||||
'gettext'
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../node_modules/jquery-migrate/dist/jquery-migrate.min.js
|
||||
1
common/static/js/vendor/jquery.min.js
vendored
1
common/static/js/vendor/jquery.min.js
vendored
@@ -1 +0,0 @@
|
||||
../../../../node_modules/jquery/dist/jquery.min.js
|
||||
@@ -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',
|
||||
]
|
||||
|
||||
@@ -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: []})
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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:',
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="${static.url('js/vendor/jquery.min.js')}"></script>
|
||||
<script type="text/javascript" src="${static.url('common/js/vendor/jquery.js')}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -45,6 +45,8 @@ SASS_LOAD_PATHS = [
|
||||
# A list of NPM installed libraries that should be copied into the common
|
||||
# static directory.
|
||||
NPM_INSTALLED_LIBRARIES = [
|
||||
'jquery/dist/jquery.js',
|
||||
'jquery-migrate/dist/jquery-migrate.js',
|
||||
'underscore/underscore.js',
|
||||
'underscore.string/dist/underscore.string.js',
|
||||
'picturefill/dist/picturefill.js',
|
||||
|
||||
Reference in New Issue
Block a user