From e4d95eb794f278b18ffb6353e194e2fe4b18a2e2 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 15 Aug 2017 16:36:43 +0200 Subject: [PATCH] Don't load `lodash.fp` in converse-core. It's not being used there. --- src/converse-controlbox.js | 5 ++++- src/converse-core.js | 7 +------ src/converse-muc.js | 5 ++++- src/utils.js | 9 ++++++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/converse-controlbox.js b/src/converse-controlbox.js index 97eb09989..4671c8a89 100644 --- a/src/converse-controlbox.js +++ b/src/converse-controlbox.js @@ -9,6 +9,7 @@ (function (root, factory) { define(["jquery.noconflict", "converse-core", + "lodash.converter", "tpl!add_contact_dropdown", "tpl!add_contact_form", "tpl!change_status_message", @@ -28,6 +29,7 @@ }(this, function ( $, converse, + lodashConverter, tpl_add_contact_dropdown, tpl_add_contact_form, tpl_change_status_message, @@ -46,7 +48,8 @@ const USERS_PANEL_ID = 'users'; const CHATBOX_TYPE = 'chatbox'; - const { Strophe, Backbone, utils, _, fp, moment } = converse.env; + const { Strophe, Backbone, utils, _, moment } = converse.env; + const fp = lodashConverter(_.runInContext()); converse.plugins.add('converse-controlbox', { diff --git a/src/converse-core.js b/src/converse-core.js index acc3fb2ce..97421a2ba 100755 --- a/src/converse-core.js +++ b/src/converse-core.js @@ -9,7 +9,6 @@ define(["sizzle", "es6-promise", "lodash.noconflict", - "lodash.converter", "polyfill", "utils", "moment_with_locales", @@ -20,7 +19,7 @@ "backbone.overview", ], factory); }(this, function ( - sizzle, Promise, _, lodashConverter, polyfill, + sizzle, Promise, _, polyfill, utils, moment, Strophe, pluggable, Backbone) { /* Cannot use this due to Safari bug. @@ -28,9 +27,6 @@ */ // "use strict"; - // Create the FP (functional programming) version of lodash - const fp = lodashConverter(_.runInContext()); - // Strophe globals const { $build, $iq, $msg, $pres } = Strophe; const b64_sha1 = Strophe.SHA1.b64_sha1; @@ -2357,7 +2353,6 @@ 'Strophe': Strophe, '_': _, 'b64_sha1': b64_sha1, - 'fp': fp, 'moment': moment, 'sizzle': sizzle, 'utils': utils diff --git a/src/converse-muc.js b/src/converse-muc.js index 6027e39e7..f309b5a98 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -13,6 +13,7 @@ define([ "jquery.noconflict", "converse-core", + "lodash.converter", "tpl!chatarea", "tpl!chatroom", "tpl!chatroom_disconnect", @@ -38,6 +39,7 @@ }(this, function ( $, converse, + lodashConverter, tpl_chatarea, tpl_chatroom, tpl_chatroom_disconnect, @@ -63,7 +65,8 @@ const ROOMS_PANEL_ID = 'chatrooms'; const CHATROOMS_TYPE = 'chatroom'; - const { Strophe, Backbone, Promise, $iq, $build, $msg, $pres, b64_sha1, sizzle, utils, _, fp, moment } = converse.env; + const { Strophe, Backbone, Promise, $iq, $build, $msg, $pres, b64_sha1, sizzle, utils, _, moment } = converse.env; + const fp = lodashConverter(_.runInContext()); // Add Strophe Namespaces Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + "#admin"); diff --git a/src/utils.js b/src/utils.js index 8cf318d3f..61b349428 100755 --- a/src/utils.js +++ b/src/utils.js @@ -19,9 +19,11 @@ "tpl!form_captcha" ], factory); }(this, function ( - $, sizzle, + $, + sizzle, Promise, - dummy, _, + jQBrowser, + _, locales, moment, Strophe, @@ -34,6 +36,7 @@ tpl_form_input, tpl_form_captcha ) { + "use strict"; locales = locales || {}; const b64_sha1 = Strophe.SHA1.b64_sha1; @@ -399,7 +402,7 @@ /* This works around a webkit bug. Refreshes the browser's viewport, * otherwise chatboxes are not moved along when one is closed. */ - if ($.browser.webkit && window.requestAnimationFrame) { + if (jQBrowser.webkit && window.requestAnimationFrame) { window.requestAnimationFrame(function () { var conversejs = document.getElementById('conversejs'); conversejs.style.display = 'none';