Merge pull request #664 from rauenzi/patch1

patch react, react-dom and layer changes
This commit is contained in:
Alexei Stukov 2018-01-10 16:49:18 +02:00 committed by GitHub
commit 5344fd2b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 180 additions and 356 deletions

View File

@ -1043,7 +1043,7 @@ class PublicServers {
show() {
let self = this;
$(".layers").append(self.layer);
$(".layers, .layers-20RVFW").append(self.layer);
//self.search("", true);
}
@ -2032,13 +2032,13 @@ SettingsPanel.prototype.inject = function(mutation) {
SettingsPanel.prototype.injectNew = function(mutation) {
let self = this;
if(!mutation.target.classList.contains("layers")) return;
if(!mutation.target.classList.contains("layers") && !mutation.target.classList.contains("layers-20RVFW")) return;
if($(".guild-settings-base-section").length) {
try {
mutation.addedNodes[0].setAttribute('layer-id', 'server-settings');
}catch(err) {}
}
if(!$(".user-settings-account").length) return;
if(!$(".socialLinks-1oZoF3").length) return;
try {
mutation.addedNodes[0].setAttribute('layer-id', 'user-settings');
}catch(err) {}
@ -3142,11 +3142,52 @@ window.bdtemp = {
class V2 {
constructor() {
// Webpack modules from Samogot
this.WebpackModules = (() => {
const req = webpackJsonp([], {
'__extra_id__': (module, exports, req) => exports.default = req
}, ['__extra_id__']).default;
delete req.m['__extra_id__'];
delete req.c['__extra_id__'];
const find = (filter, options = {}) => {
const {cacheOnly = true} = options;
for (let i in req.c) {
if (req.c.hasOwnProperty(i)) {
let m = req.c[i].exports;
if (m && m.__esModule && m.default && filter(m.default)) return m.default;
if (m && filter(m)) return m;
}
}
if (cacheOnly) {
console.warn('Cannot find loaded module in cache');
return null;
}
console.warn('Cannot find loaded module in cache. Loading all modules may have unexpected side effects');
for (let i = 0; i < req.m.length; ++i) {
try {
let m = req(i);
if (m && m.__esModule && m.default && filter(m.default)) return m.default;
if (m && filter(m)) return m;
}
catch (e) {
console.error(e);
}
}
console.warn('Cannot find module');
return null;
};
const findByUniqueProperties = (propNames, options) => find(module => propNames.every(prop => module[prop] !== undefined), options);
const findByDisplayName = (displayName, options) => find(module => module.displayName === displayName, options);
return {find, findByUniqueProperties, findByDisplayName};
})();
this.internal = {
'react': require('react'),
'react-dom': require('react-dom')
'react': this.WebpackModules.findByUniqueProperties(['Component', 'PureComponent', 'Children', 'createElement', 'cloneElement']),
'react-dom': this.WebpackModules.findByUniqueProperties(['findDOMNode'])
};
}
}
get reactComponent() {
return this.internal['react'].Component;
@ -4129,7 +4170,7 @@ class V2C_Layer extends BDV2.reactComponent {
render() {
return BDV2.react.createElement(
"div",
{ className: "layer", id: this.props.id, ref: "root" },
{ className: "layer layer-kosS71", id: this.props.id, ref: "root" },
this.props.children
);
}
@ -4763,8 +4804,8 @@ class V2_PublicServers {
}
injectRoot() {
if (!$(".layers").length) return false;
$(".layers").append($("<span/>", {
if (!$(".layers, .layers-20RVFW").length) return false;
$(".layers, .layers-20RVFW").append($("<span/>", {
id: 'pubslayerroot'
}));
return true;
@ -4854,8 +4895,8 @@ class V2_SettingsPanel {
}
injectRoot() {
if (!$(".layer .ui-standard-sidebar-view").length) return false;
$(".layer .ui-standard-sidebar-view").append($("<div/>", {
if (!$(".layer .ui-standard-sidebar-view, .layer-kosS71 .ui-standard-sidebar-view").length) return false;
$(".layer .ui-standard-sidebar-view, .layer-kosS71 .ui-standard-sidebar-view").append($("<div/>", {
class: 'content-region',
id: 'bd-settingspane-container'
}));

473
js/main.min.js vendored

File diff suppressed because one or more lines are too long