Merge pull request #2079 from jitsi/update_strophe
ref(strophe): Remove and cleanup all strophe related code.
This commit is contained in:
commit
f1cc057bde
2
app.js
2
app.js
|
@ -3,8 +3,6 @@
|
|||
import 'jquery';
|
||||
import 'jquery-contextmenu';
|
||||
import 'jquery-ui';
|
||||
import 'strophe';
|
||||
import 'strophe-disco';
|
||||
import 'jQuery-Impromptu';
|
||||
import 'autosize';
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
"jwt-decode": "2.2.0",
|
||||
"lib-jitsi-meet": "jitsi/lib-jitsi-meet",
|
||||
"lodash": "4.17.4",
|
||||
"js-md5": "0.6.1",
|
||||
"nuclear-js": "1.4.0",
|
||||
"postis": "2.2.0",
|
||||
"prop-types": "15.6.0",
|
||||
|
@ -69,8 +70,6 @@
|
|||
"react-redux": "5.0.6",
|
||||
"redux": "3.7.2",
|
||||
"redux-thunk": "2.2.0",
|
||||
"strophe": "1.2.4",
|
||||
"strophejs-plugins": "0.0.7",
|
||||
"styled-components": "1.3.0",
|
||||
"url-polyfill": "github:github/url-polyfill",
|
||||
"uuid": "3.1.0",
|
||||
|
@ -120,7 +119,6 @@
|
|||
"aui-experimental": "@atlassian/aui/lib/js/aui-experimental.js",
|
||||
"aui-experimental-css": "./node_modules/@atlassian/aui/dist/aui/css/aui-experimental.min.css",
|
||||
"autosize": "./node_modules/autosize/build/jquery.autosize.js",
|
||||
"jQuery-Impromptu": "jQuery-Impromptu/src/jquery-impromptu.js",
|
||||
"strophe-disco": "./node_modules/strophejs-plugins/disco/strophe.disco.js"
|
||||
"jQuery-Impromptu": "jQuery-Impromptu/src/jquery-impromptu.js"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import './native';
|
||||
|
||||
// The library lib-jitsi-meet (externally) depends on the libraries jQuery and
|
||||
// Strophe
|
||||
// The library lib-jitsi-meet (externally) depends on the libraries jQuery
|
||||
(global => {
|
||||
// jQuery
|
||||
if (typeof global.$ === 'undefined') {
|
||||
|
@ -10,13 +9,6 @@ import './native';
|
|||
jQuery(global);
|
||||
global.$ = jQuery;
|
||||
}
|
||||
|
||||
// Strophe
|
||||
if (typeof global.Strophe === 'undefined') {
|
||||
require('strophe');
|
||||
require('strophejs-plugins/disco/strophe.disco');
|
||||
require('strophejs-plugins/caps/strophe.caps.jsonly');
|
||||
}
|
||||
})(global || window || this); // eslint-disable-line no-invalid-this
|
||||
|
||||
// Re-export JitsiMeetJS from the library lib-jitsi-meet to (the other features
|
||||
|
|
|
@ -143,24 +143,10 @@ function _visitNode(node, callback) {
|
|||
document.cookie = '';
|
||||
}
|
||||
|
||||
// Document.querySelector
|
||||
//
|
||||
// Required by:
|
||||
// - strophejs-plugins/caps/strophe.caps.jsonly.js
|
||||
const documentPrototype = Object.getPrototypeOf(document);
|
||||
|
||||
if (documentPrototype) {
|
||||
if (typeof documentPrototype.querySelector === 'undefined') {
|
||||
documentPrototype.querySelector = function(selectors) {
|
||||
return _querySelector(this.elementNode, selectors);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Element.querySelector
|
||||
//
|
||||
// Required by:
|
||||
// - strophejs-plugins/caps/strophe.caps.jsonly.js
|
||||
// - lib-jitsi-meet/modules/xmpp
|
||||
const elementPrototype
|
||||
= Object.getPrototypeOf(document.documentElement);
|
||||
|
||||
|
@ -212,6 +198,7 @@ function _visitNode(node, callback) {
|
|||
// FIXME There is a weird infinite loop related to console.log and
|
||||
// Document and/or Element at the time of this writing. Work around it
|
||||
// by patching Node and/or overriding console.log.
|
||||
const documentPrototype = Object.getPrototypeOf(document);
|
||||
const nodePrototype
|
||||
= _getCommonPrototype(documentPrototype, elementPrototype);
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// @flow
|
||||
import md5 from 'js-md5';
|
||||
|
||||
import { toState } from '../redux';
|
||||
|
||||
|
@ -6,7 +7,6 @@ import { DEFAULT_AVATAR_RELATIVE_PATH } from './constants';
|
|||
|
||||
declare var config: Object;
|
||||
declare var interfaceConfig: Object;
|
||||
declare var MD5: Object;
|
||||
|
||||
/**
|
||||
* Returns the URL of the image for the avatar of a specific participant.
|
||||
|
@ -71,7 +71,7 @@ export function getAvatarURL({ avatarID, avatarURL, email, id }: {
|
|||
}
|
||||
}
|
||||
|
||||
return urlPrefix + MD5.hexdigest(key.trim().toLowerCase()) + urlSuffix;
|
||||
return urlPrefix + md5.hex(key.trim().toLowerCase()) + urlSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,6 @@ const plugins = [
|
|||
minimize
|
||||
})
|
||||
];
|
||||
const strophe = /\/node_modules\/strophe(js-plugins)?\/.*\.js$/;
|
||||
|
||||
if (minimize) {
|
||||
// XXX Webpack's command line argument -p is not enough. Further
|
||||
|
@ -92,12 +91,6 @@ const config = {
|
|||
|
||||
loader: 'expose-loader?$!expose-loader?jQuery',
|
||||
test: /\/node_modules\/jquery\/.*\.js$/
|
||||
}, {
|
||||
// Disable AMD for the Strophe.js library or its imports will fail
|
||||
// at runtime.
|
||||
|
||||
loader: 'imports-loader?define=>false&this=>window',
|
||||
test: strophe
|
||||
}, {
|
||||
// Set scope to window for URL polyfill.
|
||||
|
||||
|
@ -122,14 +115,7 @@ const config = {
|
|||
name: '[path][name].[ext]'
|
||||
},
|
||||
test: /\.(gif|png|svg)$/
|
||||
} ],
|
||||
noParse: [
|
||||
|
||||
// Do not parse the files of the Strophe.js library or at least
|
||||
// parts of the properties of the Strophe global variable will be
|
||||
// missing and strophejs-plugins will fail at runtime.
|
||||
strophe
|
||||
]
|
||||
} ]
|
||||
},
|
||||
node: {
|
||||
// Allow the use of the real filename of the module being executed. By
|
||||
|
|
Loading…
Reference in New Issue