Merge pull request #664 from rauenzi/patch1
patch react, react-dom and layer changes
This commit is contained in:
commit
5344fd2b1e
63
js/main.js
63
js/main.js
|
@ -1043,7 +1043,7 @@ class PublicServers {
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
let self = this;
|
let self = this;
|
||||||
$(".layers").append(self.layer);
|
$(".layers, .layers-20RVFW").append(self.layer);
|
||||||
//self.search("", true);
|
//self.search("", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2032,13 +2032,13 @@ SettingsPanel.prototype.inject = function(mutation) {
|
||||||
|
|
||||||
SettingsPanel.prototype.injectNew = function(mutation) {
|
SettingsPanel.prototype.injectNew = function(mutation) {
|
||||||
let self = this;
|
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) {
|
if($(".guild-settings-base-section").length) {
|
||||||
try {
|
try {
|
||||||
mutation.addedNodes[0].setAttribute('layer-id', 'server-settings');
|
mutation.addedNodes[0].setAttribute('layer-id', 'server-settings');
|
||||||
}catch(err) {}
|
}catch(err) {}
|
||||||
}
|
}
|
||||||
if(!$(".user-settings-account").length) return;
|
if(!$(".socialLinks-1oZoF3").length) return;
|
||||||
try {
|
try {
|
||||||
mutation.addedNodes[0].setAttribute('layer-id', 'user-settings');
|
mutation.addedNodes[0].setAttribute('layer-id', 'user-settings');
|
||||||
}catch(err) {}
|
}catch(err) {}
|
||||||
|
@ -3142,11 +3142,52 @@ window.bdtemp = {
|
||||||
class V2 {
|
class V2 {
|
||||||
|
|
||||||
constructor() {
|
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 = {
|
this.internal = {
|
||||||
'react': require('react'),
|
'react': this.WebpackModules.findByUniqueProperties(['Component', 'PureComponent', 'Children', 'createElement', 'cloneElement']),
|
||||||
'react-dom': require('react-dom')
|
'react-dom': this.WebpackModules.findByUniqueProperties(['findDOMNode'])
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
get reactComponent() {
|
get reactComponent() {
|
||||||
return this.internal['react'].Component;
|
return this.internal['react'].Component;
|
||||||
|
@ -4129,7 +4170,7 @@ class V2C_Layer extends BDV2.reactComponent {
|
||||||
render() {
|
render() {
|
||||||
return BDV2.react.createElement(
|
return BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{ className: "layer", id: this.props.id, ref: "root" },
|
{ className: "layer layer-kosS71", id: this.props.id, ref: "root" },
|
||||||
this.props.children
|
this.props.children
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4763,8 +4804,8 @@ class V2_PublicServers {
|
||||||
}
|
}
|
||||||
|
|
||||||
injectRoot() {
|
injectRoot() {
|
||||||
if (!$(".layers").length) return false;
|
if (!$(".layers, .layers-20RVFW").length) return false;
|
||||||
$(".layers").append($("<span/>", {
|
$(".layers, .layers-20RVFW").append($("<span/>", {
|
||||||
id: 'pubslayerroot'
|
id: 'pubslayerroot'
|
||||||
}));
|
}));
|
||||||
return true;
|
return true;
|
||||||
|
@ -4854,8 +4895,8 @@ class V2_SettingsPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
injectRoot() {
|
injectRoot() {
|
||||||
if (!$(".layer .ui-standard-sidebar-view").length) return false;
|
if (!$(".layer .ui-standard-sidebar-view, .layer-kosS71 .ui-standard-sidebar-view").length) return false;
|
||||||
$(".layer .ui-standard-sidebar-view").append($("<div/>", {
|
$(".layer .ui-standard-sidebar-view, .layer-kosS71 .ui-standard-sidebar-view").append($("<div/>", {
|
||||||
class: 'content-region',
|
class: 'content-region',
|
||||||
id: 'bd-settingspane-container'
|
id: 'bd-settingspane-container'
|
||||||
}));
|
}));
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue