Upgrade jQuery 1.7.2 to 2.2.0
FEDX-25
This commit is contained in:
committed by
Brian Jacobel
parent
025f74c870
commit
15f148141f
@@ -27,7 +27,12 @@
|
||||
"mustache": "js/vendor/mustache",
|
||||
"codemirror": "js/vendor/codemirror-compressed",
|
||||
"codemirror/stex": "js/vendor/CodeMirror/stex",
|
||||
"jquery": "js/vendor/jquery.min",
|
||||
// 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.ui": "js/vendor/jquery-ui.min",
|
||||
"jquery.form": "js/vendor/jquery.form",
|
||||
"jquery.markitup": "js/vendor/markitup/jquery.markitup",
|
||||
@@ -37,7 +42,7 @@
|
||||
"jquery.timepicker": "js/vendor/timepicker/jquery.timepicker",
|
||||
"jquery.cookie": "js/vendor/jquery.cookie",
|
||||
"jquery.qtip": "js/vendor/jquery.qtip.min",
|
||||
"jquery.scrollTo": "js/vendor/jquery.scrollTo-1.4.2-min",
|
||||
"jquery.scrollTo": "js/vendor/jquery.scrollTo.min",
|
||||
"jquery.flot": "js/vendor/flot/jquery.flot.min",
|
||||
"jquery.fileupload": "js/vendor/jQuery-File-Upload/js/jquery.fileupload",
|
||||
"jquery.fileupload-process": "js/vendor/jQuery-File-Upload/js/jquery.fileupload-process",
|
||||
@@ -112,6 +117,10 @@
|
||||
"date": {
|
||||
exports: "Date"
|
||||
},
|
||||
"jquery": {
|
||||
deps: ["_jquery"],
|
||||
exports: "jQuery"
|
||||
},
|
||||
"jquery.ui": {
|
||||
deps: ["jquery"],
|
||||
exports: "jQuery.ui"
|
||||
@@ -146,7 +155,7 @@
|
||||
},
|
||||
"jquery.scrollTo": {
|
||||
deps: ["jquery"],
|
||||
exports: "jQuery.fn.scrollTo",
|
||||
exports: "jQuery.fn.scrollTo"
|
||||
},
|
||||
"jquery.flot": {
|
||||
deps: ["jquery"],
|
||||
|
||||
@@ -4,14 +4,18 @@ 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",
|
||||
# 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.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",
|
||||
"jquery.leanModal": "xmodule_js/common_static/js/vendor/jquery.leanModal",
|
||||
"jquery.ajaxQueue": "xmodule_js/common_static/js/vendor/jquery.ajaxQueue",
|
||||
"jquery.smoothScroll": "xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min",
|
||||
"jquery.scrollTo": "xmodule_js/common_static/js/vendor/jquery.scrollTo-1.4.2-min",
|
||||
"jquery.scrollTo": "xmodule_js/common_static/js/vendor/jquery.scrollTo.min",
|
||||
"jquery.timepicker": "xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker",
|
||||
"jquery.cookie": "xmodule_js/common_static/js/vendor/jquery.cookie",
|
||||
"jquery.qtip": "xmodule_js/common_static/js/vendor/jquery.qtip.min",
|
||||
@@ -65,6 +69,10 @@ requirejs.config({
|
||||
"date": {
|
||||
exports: "Date"
|
||||
},
|
||||
"jquery": {
|
||||
deps: ["_jquery"],
|
||||
exports: "jQuery"
|
||||
},
|
||||
"jquery.ui": {
|
||||
deps: ["jquery"],
|
||||
exports: "jQuery.ui"
|
||||
|
||||
@@ -11,7 +11,7 @@ requirejs.config({
|
||||
"jquery.markitup": "xmodule_js/common_static/js/vendor/markitup/jquery.markitup",
|
||||
"jquery.leanModal": "xmodule_js/common_static/js/vendor/jquery.leanModal",
|
||||
"jquery.smoothScroll": "xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min",
|
||||
"jquery.scrollTo": "xmodule_js/common_static/js/vendor/jquery.scrollTo-1.4.2-min",
|
||||
"jquery.scrollTo": "xmodule_js/common_static/js/vendor/jquery.scrollTo.min",
|
||||
"jquery.timepicker": "xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker",
|
||||
"jquery.cookie": "xmodule_js/common_static/js/vendor/jquery.cookie",
|
||||
"jquery.qtip": "xmodule_js/common_static/js/vendor/jquery.qtip.min",
|
||||
|
||||
@@ -58,6 +58,20 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
window.course = new Course({
|
||||
id: '5',
|
||||
name: 'Course Name',
|
||||
url_name: 'course_name',
|
||||
org: 'course_org',
|
||||
num: 'course_num',
|
||||
revision: 'course_rev'
|
||||
});
|
||||
window.certWebPreview = new CertificatePreview({
|
||||
course_modes: ['honor', 'test'],
|
||||
certificate_web_view_url: '/users/1/courses/orgX/009/2016'
|
||||
});
|
||||
window.CMS.User = {isGlobalStaff: true};
|
||||
|
||||
TemplateHelpers.installTemplates(['certificate-details', 'signatory-details', 'signatory-editor', 'signatory-actions'], true);
|
||||
|
||||
window.course = new Course({
|
||||
@@ -99,6 +113,12 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
|
||||
delete window.CMS.User;
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
delete window.course;
|
||||
delete window.CMS.User;
|
||||
});
|
||||
|
||||
|
||||
describe('The Certificate Details view', function() {
|
||||
|
||||
it('should parse a JSON string collection into a Backbone model collection', function () {
|
||||
|
||||
@@ -90,6 +90,16 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
|
||||
uploadDialogTpl = readFixtures('upload-dialog.underscore');
|
||||
|
||||
beforeEach(function() {
|
||||
window.course = new Course({
|
||||
id: '5',
|
||||
name: 'Course Name',
|
||||
url_name: 'course_name',
|
||||
org: 'course_org',
|
||||
num: 'course_num',
|
||||
revision: 'course_rev'
|
||||
});
|
||||
window.CMS.User = {isGlobalStaff: true};
|
||||
|
||||
TemplateHelpers.installTemplates(['certificate-editor', 'signatory-editor'], true);
|
||||
|
||||
window.course = new Course({
|
||||
@@ -127,6 +137,11 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
|
||||
delete window.CMS.User;
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
delete window.course;
|
||||
delete window.CMS.User;
|
||||
});
|
||||
|
||||
describe('Basic', function () {
|
||||
beforeEach(function(){
|
||||
appendSetFixtures(
|
||||
|
||||
@@ -28,8 +28,6 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
appendSetFixtures('<div class="preview-certificate nav-actions"></div>');
|
||||
|
||||
window.course = new Course({
|
||||
id: '5',
|
||||
name: 'Course Name',
|
||||
@@ -40,6 +38,8 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
|
||||
});
|
||||
window.CMS.User = {isGlobalStaff: true};
|
||||
|
||||
TemplateHelpers.installTemplate('certificate-web-preview', true);
|
||||
appendSetFixtures('<div class="preview-certificate nav-actions"></div>');
|
||||
this.view = new CertificatePreview({
|
||||
el: $('.preview-certificate'),
|
||||
course_modes: ['test1', 'test2', 'test3'],
|
||||
|
||||
@@ -31,6 +31,19 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
|
||||
var emptyMessage = 'You have not created any certificates yet.';
|
||||
|
||||
beforeEach(function() {
|
||||
window.course = new Course({
|
||||
id: '5',
|
||||
name: 'Course Name',
|
||||
url_name: 'course_name',
|
||||
org: 'course_org',
|
||||
num: 'course_num',
|
||||
revision: 'course_rev'
|
||||
});
|
||||
window.certWebPreview = new CertificatePreview({
|
||||
course_modes: ['honor', 'test'],
|
||||
certificate_web_view_url: '/users/1/courses/orgX/009/2016'
|
||||
});
|
||||
|
||||
TemplateHelpers.installTemplates(
|
||||
['certificate-editor', 'list']
|
||||
);
|
||||
@@ -70,6 +83,10 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
|
||||
delete window.CMS.User;
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
delete window.course;
|
||||
});
|
||||
|
||||
describe('empty template', function () {
|
||||
it('should be rendered if no certificates', function() {
|
||||
expect(this.view.$(SELECTORS.noContent)).toExist();
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function ($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
|
||||
"use strict";
|
||||
describe("Library Instructor Access Page", function () {
|
||||
const changeRoleUrl = "dummy_change_role_url/@@EMAIL@@";
|
||||
var changeRoleUrl = "dummy_change_role_url/@@EMAIL@@";
|
||||
var team_member_fixture = readFixtures("team-member.underscore");
|
||||
|
||||
function setRole(email, role){
|
||||
@@ -48,7 +48,7 @@ function ($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
|
||||
});
|
||||
|
||||
it("can give a user permission to use the library", function () {
|
||||
const email = 'other@example.com';
|
||||
var email = 'other@example.com';
|
||||
var requests = AjaxHelpers.requests(this);
|
||||
var reloadSpy = spyOn(ViewUtils, 'reload');
|
||||
$('.create-user-button').click();
|
||||
@@ -61,7 +61,7 @@ function ($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
|
||||
});
|
||||
|
||||
it("can promote user", function() {
|
||||
const email = "staff@example.com";
|
||||
var email = "staff@example.com";
|
||||
var requests = AjaxHelpers.requests(this);
|
||||
var reloadSpy = spyOn(ViewUtils, 'reload');
|
||||
setRole("staff@example.com", 'staff');
|
||||
|
||||
@@ -215,7 +215,6 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
AbstractEditor = BaseView.extend({
|
||||
tagName: 'section',
|
||||
templateName: null,
|
||||
@@ -328,6 +327,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
TimedExaminationPreferenceEditor = AbstractEditor.extend({
|
||||
templateName: 'timed-examination-preference-editor',
|
||||
className: 'edit-settings-timed-examination',
|
||||
@@ -496,6 +496,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
AccessEditor = AbstractEditor.extend({
|
||||
templateName: 'access-editor',
|
||||
className: 'edit-settings-access',
|
||||
@@ -548,13 +549,14 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
GradingEditor = AbstractEditor.extend({
|
||||
templateName: 'grading-editor',
|
||||
className: 'edit-settings-grading',
|
||||
|
||||
afterRender: function () {
|
||||
AbstractEditor.prototype.afterRender.call(this);
|
||||
this.setValue(this.model.get('format'));
|
||||
this.setValue(this.model.get('format') || 'notgraded');
|
||||
},
|
||||
|
||||
setValue: function (value) {
|
||||
|
||||
@@ -89,7 +89,7 @@ function($, _, AbstractEditor, FileUpload, UploadDialog) {
|
||||
items = this.$el.find('ol').find('.list-settings-item');
|
||||
|
||||
_.each(items, function(element, index) {
|
||||
var key = $(element).find('select').val(),
|
||||
var key = $(element).find('select option:selected').val(),
|
||||
value = $(element).find('.input').val();
|
||||
|
||||
// Keys should be unique, so if our keys are duplicated and
|
||||
|
||||
Reference in New Issue
Block a user