Upgrade jQuery to 1.12.1 and fetch from node_modules.

Fixes: #1196.
This commit is contained in:
Brock Whittaker 2016-08-24 12:49:53 -07:00 committed by Tim Abbott
parent 3ba604cb47
commit 8f73701b96
8 changed files with 17 additions and 9412 deletions

View File

@ -23,7 +23,9 @@ i18n.init({
} }
}); });
global.$ = require('jQuery'); var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
var _ = global._; var _ = global._;
// When writing these tests, the following command might be helpful: // When writing these tests, the following command might be helpful:

View File

@ -2,7 +2,7 @@ var _ = require('third/underscore/underscore.js');
var MessageListView = require('js/message_list_view.js'); var MessageListView = require('js/message_list_view.js');
add_dependencies({ add_dependencies({
$: 'jQuery', $: 'jquery',
XDate: 'third/xdate/xdate.dev.js', XDate: 'third/xdate/xdate.dev.js',
util: 'js/util.js' util: 'js/util.js'
}); });

View File

@ -27,7 +27,9 @@ compose_fade.update_faded_users = function () {
return; return;
}; };
global.$ = require('jQuery'); var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
$.fn.expectOne = function () { $.fn.expectOne = function () {
assert(this.length === 1); assert(this.length === 1);
return this; return this;

View File

@ -20,7 +20,9 @@ set_global('message_store', {
var stream_list = require('js/stream_list.js'); var stream_list = require('js/stream_list.js');
global.$ = require('jQuery'); var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
$.fn.expectOne = function () { $.fn.expectOne = function () {
assert(this.length === 1); assert(this.length === 1);
return this; return this;
@ -107,7 +109,7 @@ global.use_template('stream_privacy');
var li = stream_list.get_stream_li('social'); var li = stream_list.get_stream_li('social');
assert.equal(li.attr('data-name'), 'social'); assert.equal(li.attr('data-name'), 'social');
assert.equal(li.find('.streamlist_swatch').css('background-color'), 'green'); assert.equal(li.find('.streamlist_swatch').attr('style'), 'background-color: green');
assert.equal(li.find('a.subscription_name').text().trim(), 'social'); assert.equal(li.find('a.subscription_name').text().trim(), 'social');
assert(li.find('.arrow').find("i").hasClass("icon-vector-chevron-down")); assert(li.find('.arrow').find("i").hasClass("icon-vector-chevron-down"));

View File

@ -15,7 +15,9 @@ i18n.init({
lng: 'en' lng: 'en'
}); });
global.$ = require('jQuery'); var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
var _ = global._; var _ = global._;
// When writing these tests, the following command might be helpful: // When writing these tests, the following command might be helpful:
@ -455,6 +457,7 @@ function render(template_name, args) {
var html = render('message_info_popover_title', args); var html = render('message_info_popover_title', args);
global.write_handlebars_output("message_info_popover_title", html); global.write_handlebars_output("message_info_popover_title", html);
html = '<div>' + html + '</div>';
assert($(html).text().trim(), "Message to stream devel"); assert($(html).text().trim(), "Message to stream devel");
}()); }());

View File

@ -11,12 +11,12 @@
"i18next-xhr-backend": "0.5.4", "i18next-xhr-backend": "0.5.4",
"i18next-browser-languagedetector": "0.3.0", "i18next-browser-languagedetector": "0.3.0",
"i18next-localstorage-cache": "0.3.0", "i18next-localstorage-cache": "0.3.0",
"jquery": "1.12.1",
"jquery-validation": "1.15.1", "jquery-validation": "1.15.1",
"webpack": "1.12.2" "webpack": "1.12.2"
}, },
"devDependencies": { "devDependencies": {
"istanbul": "0.4.0", "istanbul": "0.4.0",
"jQuery": "1.7.4",
"jsdom": "0.5.7", "jsdom": "0.5.7",
"xmlhttprequest": "1.5.0", "xmlhttprequest": "1.5.0",
"nwmatcher": "1.3.6", "nwmatcher": "1.3.6",

File diff suppressed because it is too large Load Diff

View File

@ -669,7 +669,7 @@ PIPELINE = {
JS_SPECS = { JS_SPECS = {
'common': { 'common': {
'source_filenames': ( 'source_filenames': (
'third/jquery/jquery-1.7.2.js', 'node_modules/jquery/dist/jquery.js',
'third/underscore/underscore.js', 'third/underscore/underscore.js',
'js/blueslip.js', 'js/blueslip.js',
'third/bootstrap/js/bootstrap.js', 'third/bootstrap/js/bootstrap.js',