Remove jQuery from non-tests config

This commit is contained in:
JC Brand 2018-01-04 11:41:03 +00:00
parent 7cf9c9ef8f
commit 4652385bb4
18 changed files with 25 additions and 29 deletions

View File

@ -1,6 +1,6 @@
(function (root, factory) {
define([
"jquery.noconflict",
"jquery",
"jasmine",
"utils",
"converse-core",

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils", "utils" ], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils", "utils" ], factory);
} (this, function ($, jasmine, mock, converse, test_utils, utils) {
var _ = converse.env._;
var $pres = converse.env.$pres;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
var _ = converse.env._;
var $pres = converse.env.$pres;

View File

@ -1,6 +1,6 @@
(function (root, factory) {
define([
"jquery.noconflict",
"jquery",
"jasmine",
"converse-core",
"mock",

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
"use strict";
var _ = converse.env._;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
var _ = converse.env._;
var $msg = converse.env.$msg;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils", "utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils", "utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils, utils) {
"use strict";
var _ = converse.env._;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
var Strophe = converse.env.Strophe;
var b64_sha1 = converse.env.b64_sha1;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
var Strophe = converse.env.Strophe;
var $iq = converse.env.$iq;

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
var _ = converse.env._;
var $pres = converse.env.$pres;

View File

@ -1,6 +1,6 @@
(function (root, factory) {
define([
"jquery.noconflict",
"jquery",
"converse-core",
"mock",
"test_utils",

View File

@ -1,5 +1,5 @@
(function (root, factory) {
define(["jquery.noconflict", "jasmine", "mock", "converse-core", "test-utils"], factory);
define(["jquery", "jasmine", "mock", "converse-core", "test-utils"], factory);
} (this, function ($, jasmine, mock, converse, test_utils) {
return describe("The XMPPStatus model", function() {

View File

@ -5,8 +5,6 @@
include: ["converse"],
exclude: [
"awesomplete",
"jquery",
"jquery.noconflict",
"backbone.browserStorage",
"backbone.overview",
"moment",

View File

@ -31,9 +31,7 @@ require.config({
"form-utils": "src/form-utils",
"i18n": "src/i18n",
"jed": "node_modules/jed/jed",
"jquery": "node_modules/jquery/dist/jquery",
"jquery.browser": "node_modules/jquery.browser/dist/jquery.browser",
"jquery.noconflict": "src/jquery.noconflict",
"lodash": "node_modules/lodash/lodash",
"lodash.converter": "3rdparty/lodash.fp",
"lodash.fp": "src/lodash.fp",
@ -106,7 +104,6 @@ require.config({
// '*' means all modules will get the '*.noconflict' version
// as their dependency.
'*': {
'jquery': 'jquery.noconflict',
'backbone': 'backbone.noconflict',
'lodash': 'lodash.noconflict'
},
@ -114,7 +111,6 @@ require.config({
// If this line was not here, there would
// be an unresolvable cyclic dependency.
'backbone.noconflict': { 'backbone': 'backbone' },
'jquery.noconflict': { 'jquery': 'jquery' },
'lodash.noconflict': { 'lodash': 'lodash' }
},

4
src/jquery-stub.js vendored Normal file
View File

@ -0,0 +1,4 @@
/*global define */
define([], function () {
return Object;
});

View File

@ -1,6 +1,6 @@
(function (root, factory) {
define("mock", ['jquery.noconflict', 'converse'], factory);
}(this, function ($, converse) {
define("mock", ['converse'], factory);
}(this, function (converse) {
var _ = converse.env._;
var Promise = converse.env.Promise;
var Strophe = converse.env.Strophe;
@ -115,7 +115,6 @@
}, settings || {}));
_converse.ChatBoxViews.prototype.trimChat = function () {};
window.converse_disable_effects = true;
$.fx.off = true;
return _converse;
}

View File

@ -1,6 +1,7 @@
/*global config */
// Extra test dependencies
config.paths.jquery = "node_modules/jquery/dist/jquery";
config.paths.mock = "tests/mock";
config.paths['wait-until-promise'] = "node_modules/wait-until-promise/index";
config.paths['test-utils'] = "tests/utils";
@ -57,7 +58,7 @@ var specs = [
require(['console-reporter', 'mock', 'sinon', 'wait-until-promise', 'pluggable'],
function(ConsoleReporter, mock, sinon, waitUntilPromise, pluggable) {
window.sinon = sinon;
window.waitUntilPromise = waitUntilPromise['default'];
window.waitUntilPromise = waitUntilPromise.default;
window.localStorage.clear();
window.sessionStorage.clear();
// Load the specs

View File

@ -1,6 +1,6 @@
(function (root, factory) {
define(['jquery.noconflict', 'converse', 'es6-promise', 'mock', 'wait-until-promise'], factory);
}(this, function ($, converse_api, Promise, mock, waitUntilPromise) {
define(['converse', 'es6-promise', 'mock', 'wait-until-promise'], factory);
}(this, function (converse_api, Promise, mock, waitUntilPromise) {
var _ = converse_api.env._;
var $msg = converse_api.env.$msg;
var $pres = converse_api.env.$pres;
@ -76,15 +76,13 @@
utils.openContactsPanel = function (converse) {
this.openControlBox(converse);
var cbview = converse.chatboxviews.get('controlbox');
var $tabs = $(cbview.el).find('#controlbox-tabs');
$tabs.find('li').first().find('a')[0].click();
cbview.el.querySelector('#controlbox-tabs li:first-child a').click();
};
utils.openRoomsPanel = function (converse) {
utils.openControlBox();
var cbview = converse.chatboxviews.get('controlbox');
var $tabs = $(cbview.el).find('#controlbox-tabs');
$tabs.find('li').last().find('a')[0].click();
cbview.el.querySelector('#controlbox-tabs li:last-child a').click();
};
utils.openChatBoxes = function (converse, amount) {
@ -170,7 +168,7 @@
utils.clearChatBoxMessages = function (converse, jid) {
var view = converse.chatboxviews.get(jid);
$(view.el).find('.chat-content').empty();
view.el.querySelector('.chat-content').innerHTML = '';
view.model.messages.reset();
view.model.messages.browserStorage._clear();
};