Small changes, fixing linux build

This commit is contained in:
Jean Ouina 2020-08-01 11:05:17 +02:00
parent 80b2b93b51
commit 0ca1af9b74
21 changed files with 560 additions and 438 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -289,13 +289,13 @@
left: 25px; left: 25px;
display: block !important; display: block !important;
cursor: pointer; cursor: pointer;
color: #FFF; color: var(--header-primary);
position: fixed; position: fixed;
} }
#removemenu ul a { #removemenu ul a {
text-decoration: none; text-decoration: none;
color: #FFF; color: var(--header-primary);
padding: 3px; padding: 3px;
} }
@ -370,7 +370,7 @@
background: var(--background-secondary); background: var(--background-secondary);
box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0; box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0;
flex-grow: 1; flex-grow: 1;
color: #FFF; color: var(--header-primary);
} }
.theme-light #bda-qem button { .theme-light #bda-qem button {
@ -413,7 +413,7 @@
.theme-light #bda-qem button.active, .theme-light #bda-qem button.active,
.theme-light #bda-qem button.active:hover { .theme-light #bda-qem button.active:hover {
color: #ffffff; color: var(--header-primary);
} }
#bda-qem-twitch-container, #bda-qem-twitch-container,
@ -459,8 +459,8 @@
#bd-pub-button { #bd-pub-button {
border-radius: 4px; border-radius: 4px;
background-color: rgb(47, 49, 54); background-color: var(--background-secondary);
color: #b9bbbe; color: var(--header-secondary);
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
@ -475,7 +475,7 @@
width: 0; width: 0;
line-height: 24px; line-height: 24px;
font-size: 12px; font-size: 12px;
color: #b9bbbe; color: var(--header-secondary);
font-weight: 700; font-weight: 700;
margin-right: 10px; margin-right: 10px;
} }
@ -588,7 +588,7 @@
} }
#pubslayer .ui-tab-bar-item.selected { #pubslayer .ui-tab-bar-item.selected {
color: #fff; color: var(--header-primary);
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
} }
@ -626,7 +626,7 @@
#pubslayer button { #pubslayer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: var(--header-primary);
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
line-height: 16px; line-height: 16px;
@ -949,7 +949,7 @@
.bd-pfbtn { .bd-pfbtn {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
margin-left: 10px; margin-left: 10px;
} }
@ -983,7 +983,7 @@
.theme-dark .ui-tab-bar-item.selected { .theme-dark .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.theme-light .ui-tab-bar-item { .theme-light .ui-tab-bar-item {
@ -997,7 +997,7 @@
.theme-light .ui-tab-bar-item.selected { .theme-light .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.ui-tab-bar-header { .ui-tab-bar-header {
@ -1287,7 +1287,7 @@
.bd-addon-list .bd-card-footer button { .bd-addon-list .bd-card-footer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
display: block; display: block;
margin-left: auto; margin-left: auto;
@ -1421,7 +1421,7 @@
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2); box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2);
padding: 12px 20px; padding: 12px 20px;
z-index: 1; z-index: 1;
color: #fff; color: var(--header-primary);
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
line-height: 19px; line-height: 19px;
@ -1429,7 +1429,7 @@
.bd-modal-wrapper .bd-modal-body { .bd-modal-wrapper .bd-modal-body {
background-color: var(--background-primary); background-color: var(--background-primary);
color: #fff; color: var(--header-primary);
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -1459,7 +1459,7 @@
.bd-modal-wrapper .footer button { .bd-modal-wrapper .footer button {
background-color: var(--bd-blue); background-color: var(--bd-blue);
color: #fff; color: var(--header-primary);
min-height: 32px; min-height: 32px;
min-width: 60px; min-width: 60px;
align-items: center; align-items: center;
@ -1504,20 +1504,20 @@
.bd-modal-wrapper .tab-bar-container .tab-bar-item { .bd-modal-wrapper .tab-bar-container .tab-bar-item {
margin: 0 15px; margin: 0 15px;
padding: 15px 0; padding: 15px 0;
color: #fff !important; color: var(--header-primary) !important;
opacity: 0.5; opacity: 0.5;
transition: opacity 200ms ease; transition: opacity 200ms ease;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover { .bd-modal-wrapper .tab-bar-container .tab-bar-item:hover {
border-color: #fff; border-color: var(--header-primary);
cursor: pointer; cursor: pointer;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected { .bd-modal-wrapper .tab-bar-container .tab-bar-item.selected {
opacity: 1; opacity: 1;
border-color: #fff; border-color: var(--header-primary);
} }
.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item { .bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item {
@ -1527,7 +1527,7 @@
.bd-modal-wrapper .table-header { .bd-modal-wrapper .table-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
color: #fff; color: var(--header-primary);
font-weight: 700; font-weight: 700;
padding-bottom: 10px; padding-bottom: 10px;
margin: 3px 15px 0 15px; margin: 3px 15px 0 15px;
@ -1557,7 +1557,7 @@
.bd-modal-wrapper .error { .bd-modal-wrapper .error {
display: flex; display: flex;
color: #fff; color: var(--header-primary);
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding: 15px 0; padding: 15px 0;
align-items: center; align-items: center;
@ -1600,7 +1600,7 @@
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2);
font-weight: 500; font-weight: 500;
color: #fff; color: var(--header-primary);
user-select: text; user-select: text;
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
@ -1608,6 +1608,18 @@
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
.theme-light .bd-toast.toast-error,
.theme-light .bd-toast.toast-danger,
.theme-light .bd-toast.toast-warning,
.theme-light .bd-toast.toast-warn,
.theme-light .bd-toast.toast-success,
.theme-light .bd-toast.toast-info {
color: #fff;
}
.theme-light .bd-toast {
box-shadow: 0 0 0 1px rgba(223, 221, 218, .6), 0 2px 10px 0 rgba(255, 255, 255, .2);
}
@keyframes bd-toast-down { @keyframes bd-toast-down {
to { to {
@ -2068,7 +2080,7 @@
content: ""; content: "";
display: block; display: block;
position: absolute; position: absolute;
background-color: #fff; background-color: var(--header-primary);
z-index: 1; z-index: 1;
width: 18px; width: 18px;
margin: 3px; margin: 3px;
@ -2210,9 +2222,15 @@
white-space: pre; white-space: pre;
} }
.bd-select .bd-select-option:hover, .bd-select .bd-select-option:hover {
background: var(--background-modifier-hover);
}
.bd-select .bd-select-option:active {
background: var(--background-modifier-active);
}
.bd-select .bd-select-option.selected { .bd-select .bd-select-option.selected {
background: #26272B; background: var(--background-modifier-selected);
} }
@ -2223,17 +2241,20 @@
border-radius: 3px; border-radius: 3px;
outline: none; outline: none;
border: 0; border: 0;
background-color: #202225; background-color: var(--background-secondary);
color: #fff; color: var(--text-normal);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bd-search-wrapper.focused {
background-color: var(--background-modifier-selected)
}
.bd-search { .bd-search {
padding: 2px 3px; padding: 2px 3px;
background: none; background: none;
border: 0; border: 0;
color: #fff; color: var(--header-primary);
flex: 1; flex: 1;
} }

File diff suppressed because one or more lines are too long

View File

@ -3702,7 +3702,8 @@
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
}, },
"jsesc": { "jsesc": {
"version": "2.5.2", "version": "2.5.2",
@ -3886,6 +3887,7 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true,
"requires": { "requires": {
"js-tokens": "^3.0.0 || ^4.0.0" "js-tokens": "^3.0.0 || ^4.0.0"
} }
@ -4278,7 +4280,8 @@
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true
}, },
"object-copy": { "object-copy": {
"version": "0.1.0", "version": "0.1.0",
@ -4676,16 +4679,6 @@
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
"dev": true "dev": true
}, },
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"prr": { "prr": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@ -4772,21 +4765,6 @@
"safe-buffer": "^5.1.0" "safe-buffer": "^5.1.0"
} }
}, },
"react": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz",
"integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"read-pkg": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",

View File

@ -145,6 +145,7 @@ Core.prototype.patchPopoutWindow = async function() {
.then(popoutModule => { .then(popoutModule => {
if(canceled)return if(canceled)return
/*
// Not a good idea to do it like that. // Not a good idea to do it like that.
const interceptor = window.Lightcord.DiscordModules.dispatcher._interceptor const interceptor = window.Lightcord.DiscordModules.dispatcher._interceptor
window.Lightcord.DiscordModules.dispatcher.setInterceptor(function(action){ window.Lightcord.DiscordModules.dispatcher.setInterceptor(function(action){
@ -173,7 +174,7 @@ Core.prototype.patchPopoutWindow = async function() {
const window = popoutModule.default.getWindow(ev.key) const window = popoutModule.default.getWindow(ev.key)
console.log(window) console.log(window)
}) })
}) })*/
}) })
}; };

View File

@ -201,26 +201,22 @@ export default class Utils {
static showToast(content, options = {}) { static showToast(content, options = {}) {
if (!document.querySelector(".bd-toasts")) { if (!document.querySelector(".bd-toasts")) {
const container = document.querySelector("."+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+" + div") || null; const container = document.querySelector("."+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+" + div") || null;
const memberlist = container ? container.querySelector("."+removeDa(BDModules.get(e => e.membersWrap)[0].membersWrap)) : null;
const form = container ? container.querySelector("form") : null; const form = container ? container.querySelector("form") : null;
const left = container ? container.getBoundingClientRect().left : 310;
const right = memberlist ? memberlist.getBoundingClientRect().left : 0;
const width = right ? right - container.getBoundingClientRect().left : Utils.screenWidth - left - 240;
const bottom = form ? form.offsetHeight : 80; const bottom = form ? form.offsetHeight : 80;
const toastWrapper = document.createElement("div"); const toastWrapper = document.createElement("div");
toastWrapper.classList.add("bd-toasts"); toastWrapper.classList.add("bd-toasts");
toastWrapper.style.setProperty("left", left + "px"); toastWrapper.style.setProperty("bottom", bottom+"px");
toastWrapper.style.setProperty("width", width + "px");
toastWrapper.style.setProperty("bottom", bottom + "px");
document.querySelector("#app-mount").appendChild(toastWrapper); document.querySelector("#app-mount").appendChild(toastWrapper);
} }
const toastWrapper = document.querySelector(".bd-toasts")
const {type = "", icon = true, timeout = 3000} = options; const {type = "", icon = true, timeout = 3000} = options;
const toastElem = document.createElement("div"); const toastElem = document.createElement("div");
toastElem.classList.add("bd-toast"); toastElem.classList.add("bd-toast");
if (type) toastElem.classList.add("toast-" + type); if (type) toastElem.classList.add("toast-" + type);
if (type && icon) toastElem.classList.add("icon"); if (type && icon) toastElem.classList.add("icon");
toastElem.innerText = content; toastElem.innerText = content;
document.querySelector(".bd-toasts").appendChild(toastElem); toastWrapper.appendChild(toastElem);
toastWrapper.style.setProperty("left", `calc(50% - ${toastWrapper.offsetWidth / 2}px)`);
setTimeout(() => { setTimeout(() => {
toastElem.classList.add("closing"); toastElem.classList.add("closing");
setTimeout(() => { setTimeout(() => {

View File

@ -289,13 +289,13 @@
left: 25px; left: 25px;
display: block !important; display: block !important;
cursor: pointer; cursor: pointer;
color: #FFF; color: var(--header-primary);
position: fixed; position: fixed;
} }
#removemenu ul a { #removemenu ul a {
text-decoration: none; text-decoration: none;
color: #FFF; color: var(--header-primary);
padding: 3px; padding: 3px;
} }
@ -370,7 +370,7 @@
background: var(--background-secondary); background: var(--background-secondary);
box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0; box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0;
flex-grow: 1; flex-grow: 1;
color: #FFF; color: var(--header-primary);
} }
.theme-light #bda-qem button { .theme-light #bda-qem button {
@ -413,7 +413,7 @@
.theme-light #bda-qem button.active, .theme-light #bda-qem button.active,
.theme-light #bda-qem button.active:hover { .theme-light #bda-qem button.active:hover {
color: #ffffff; color: var(--header-primary);
} }
#bda-qem-twitch-container, #bda-qem-twitch-container,
@ -459,8 +459,8 @@
#bd-pub-button { #bd-pub-button {
border-radius: 4px; border-radius: 4px;
background-color: rgb(47, 49, 54); background-color: var(--background-secondary);
color: #b9bbbe; color: var(--header-secondary);
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
@ -475,7 +475,7 @@
width: 0; width: 0;
line-height: 24px; line-height: 24px;
font-size: 12px; font-size: 12px;
color: #b9bbbe; color: var(--header-secondary);
font-weight: 700; font-weight: 700;
margin-right: 10px; margin-right: 10px;
} }
@ -588,7 +588,7 @@
} }
#pubslayer .ui-tab-bar-item.selected { #pubslayer .ui-tab-bar-item.selected {
color: #fff; color: var(--header-primary);
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
} }
@ -626,7 +626,7 @@
#pubslayer button { #pubslayer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: var(--header-primary);
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
line-height: 16px; line-height: 16px;
@ -949,7 +949,7 @@
.bd-pfbtn { .bd-pfbtn {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
margin-left: 10px; margin-left: 10px;
} }
@ -983,7 +983,7 @@
.theme-dark .ui-tab-bar-item.selected { .theme-dark .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.theme-light .ui-tab-bar-item { .theme-light .ui-tab-bar-item {
@ -997,7 +997,7 @@
.theme-light .ui-tab-bar-item.selected { .theme-light .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.ui-tab-bar-header { .ui-tab-bar-header {
@ -1287,7 +1287,7 @@
.bd-addon-list .bd-card-footer button { .bd-addon-list .bd-card-footer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
display: block; display: block;
margin-left: auto; margin-left: auto;
@ -1421,7 +1421,7 @@
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2); box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2);
padding: 12px 20px; padding: 12px 20px;
z-index: 1; z-index: 1;
color: #fff; color: var(--header-primary);
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
line-height: 19px; line-height: 19px;
@ -1429,7 +1429,7 @@
.bd-modal-wrapper .bd-modal-body { .bd-modal-wrapper .bd-modal-body {
background-color: var(--background-primary); background-color: var(--background-primary);
color: #fff; color: var(--header-primary);
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -1459,7 +1459,7 @@
.bd-modal-wrapper .footer button { .bd-modal-wrapper .footer button {
background-color: var(--bd-blue); background-color: var(--bd-blue);
color: #fff; color: var(--header-primary);
min-height: 32px; min-height: 32px;
min-width: 60px; min-width: 60px;
align-items: center; align-items: center;
@ -1504,20 +1504,20 @@
.bd-modal-wrapper .tab-bar-container .tab-bar-item { .bd-modal-wrapper .tab-bar-container .tab-bar-item {
margin: 0 15px; margin: 0 15px;
padding: 15px 0; padding: 15px 0;
color: #fff !important; color: var(--header-primary) !important;
opacity: 0.5; opacity: 0.5;
transition: opacity 200ms ease; transition: opacity 200ms ease;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover { .bd-modal-wrapper .tab-bar-container .tab-bar-item:hover {
border-color: #fff; border-color: var(--header-primary);
cursor: pointer; cursor: pointer;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected { .bd-modal-wrapper .tab-bar-container .tab-bar-item.selected {
opacity: 1; opacity: 1;
border-color: #fff; border-color: var(--header-primary);
} }
.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item { .bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item {
@ -1527,7 +1527,7 @@
.bd-modal-wrapper .table-header { .bd-modal-wrapper .table-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
color: #fff; color: var(--header-primary);
font-weight: 700; font-weight: 700;
padding-bottom: 10px; padding-bottom: 10px;
margin: 3px 15px 0 15px; margin: 3px 15px 0 15px;
@ -1557,7 +1557,7 @@
.bd-modal-wrapper .error { .bd-modal-wrapper .error {
display: flex; display: flex;
color: #fff; color: var(--header-primary);
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding: 15px 0; padding: 15px 0;
align-items: center; align-items: center;
@ -1600,7 +1600,7 @@
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2);
font-weight: 500; font-weight: 500;
color: #fff; color: var(--header-primary);
user-select: text; user-select: text;
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
@ -1608,6 +1608,18 @@
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
.theme-light .bd-toast.toast-error,
.theme-light .bd-toast.toast-danger,
.theme-light .bd-toast.toast-warning,
.theme-light .bd-toast.toast-warn,
.theme-light .bd-toast.toast-success,
.theme-light .bd-toast.toast-info {
color: #fff;
}
.theme-light .bd-toast {
box-shadow: 0 0 0 1px rgba(223, 221, 218, .6), 0 2px 10px 0 rgba(255, 255, 255, .2);
}
@keyframes bd-toast-down { @keyframes bd-toast-down {
to { to {
@ -2068,7 +2080,7 @@
content: ""; content: "";
display: block; display: block;
position: absolute; position: absolute;
background-color: #fff; background-color: var(--header-primary);
z-index: 1; z-index: 1;
width: 18px; width: 18px;
margin: 3px; margin: 3px;
@ -2210,9 +2222,15 @@
white-space: pre; white-space: pre;
} }
.bd-select .bd-select-option:hover, .bd-select .bd-select-option:hover {
background: var(--background-modifier-hover);
}
.bd-select .bd-select-option:active {
background: var(--background-modifier-active);
}
.bd-select .bd-select-option.selected { .bd-select .bd-select-option.selected {
background: #26272B; background: var(--background-modifier-selected);
} }
@ -2223,17 +2241,20 @@
border-radius: 3px; border-radius: 3px;
outline: none; outline: none;
border: 0; border: 0;
background-color: #202225; background-color: var(--background-secondary);
color: #fff; color: var(--text-normal);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bd-search-wrapper.focused {
background-color: var(--background-modifier-selected)
}
.bd-search { .bd-search {
padding: 2px 3px; padding: 2px 3px;
background: none; background: none;
border: 0; border: 0;
color: #fff; color: var(--header-primary);
flex: 1; flex: 1;
} }

View File

@ -15,6 +15,7 @@ import BdApi from "../modules/bdApi";
import Utils from "../modules/utils"; import Utils from "../modules/utils";
import TooltipWrap from "./tooltipWrap"; import TooltipWrap from "./tooltipWrap";
import bdEvents from "../modules/bdEvents"; import bdEvents from "../modules/bdEvents";
import EmulatedTooltip from "./tooltip";
const Tooltip = WebpackModules.findByDisplayName("Tooltip"); const Tooltip = WebpackModules.findByDisplayName("Tooltip");
@ -174,9 +175,14 @@ export default class CardList extends BDV2.reactComponent {
if(typeof window.PluginUpdates.checkAll !== "function")return null if(typeof window.PluginUpdates.checkAll !== "function")return null
if(!this.isPlugins)return null if(!this.isPlugins)return null
let tooltipIsShowing = false
let tooltip
return <TooltipWrap text="Checks for updates of plugins that support this feature. Right-click for a list."> return <TooltipWrap text="Checks for updates of plugins that support this feature. Right-click for a list.">
<span style={{marginLeft: "10px"}}> <span style={{marginLeft: "10px"}} onMouseLeave={() => {
<Lightcord.Api.Components.inputs.Button color="brand" look="filled" size="min" hoverColor="default" onClick={() => { tooltipIsShowing = false
tooltip.hide()
}}>
<Lightcord.Api.Components.inputs.Button ref="checkUpdateButton" color="brand" look="filled" size="min" hoverColor="default" onClick={() => {
try{ try{
Utils.showToast("Plugin update check in progress.", {type: "info"}) Utils.showToast("Plugin update check in progress.", {type: "info"})
window.PluginUpdates.checkAll() window.PluginUpdates.checkAll()
@ -190,7 +196,17 @@ export default class CardList extends BDV2.reactComponent {
console.error(e) console.error(e)
Utils.showToast("An error occured while checking update.", {type: "error"}) Utils.showToast("An error occured while checking update.", {type: "error"})
} }
}} wrapper={false} disabled={false}> }} wrapper={false} disabled={false} onRightClick={() => {
if(!this.refs.checkUpdateButton)return
if (!window.PluginUpdates || !window.PluginUpdates.plugins) return;
if(tooltipIsShowing)return
tooltip = new EmulatedTooltip(this.refs.checkUpdateButton.refs.original.refs.button, Object.values(window.PluginUpdates.plugins).map(p => p.name).join(", "), {
side: "bottom",
attachEvents: false
})
tooltip.show()
tooltipIsShowing = true
}}>
Check for Updates Check for Updates
</Lightcord.Api.Components.inputs.Button> </Lightcord.Api.Components.inputs.Button>
</span> </span>
@ -209,7 +225,13 @@ export default class CardList extends BDV2.reactComponent {
const addonCards = this.getAddons(); const addonCards = this.getAddons();
return <ContentColumn title={`${this.props.type.toUpperCase()}${addonCards.length}`}> return <ContentColumn title={`${this.props.type.toUpperCase()}${addonCards.length}`}>
<button key="folder-button" className="bd-button bd-pfbtn" onClick={this.openFolder.bind(this)}>Open {this.isPlugins ? "Plugin" : "Theme"} Folder</button> <Lightcord.Api.Components.inputs.Button key="folder-button" color="brand"
look="filled" size="min" hoverColor="default" onClick={this.openFolder.bind(this)} wrapper={false}
style={{
marginLeft: "10px"
}}>
Open {this.isPlugins ? "Plugin" : "Theme"} Folder
</Lightcord.Api.Components.inputs.Button>
{this.renderCheckUpdates()} {this.renderCheckUpdates()}
{!settingsCookie["fork-ps-5"] && refreshIcon} {!settingsCookie["fork-ps-5"] && refreshIcon}
<div className="bd-controls bd-addon-controls"> <div className="bd-controls bd-addon-controls">

View File

@ -1,13 +1,27 @@
import BDV2 from "../../modules/v2"; import BDV2 from "../../modules/v2";
import SearchIcon from "../icons/search"; import SearchIcon from "../icons/search";
const React = BDV2.React; const React = BDV2.React;
export default class Search extends React.Component { export default class Search extends React.Component {
render() { constructor(props){
return <div className="bd-search-wrapper"> super(props)
<input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type="text" className="bd-search" placeholder={this.props.placeholder} maxLength="50" /> this.state = {
<SearchIcon /> focused: false
</div>; }
} }
render() {
const className = ["bd-search-wrapper"]
if(this.state.focused)className.push("focused")
return <div className={className.join(" ")}>
<input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type="text"
className="bd-search" placeholder={this.props.placeholder} maxLength="50"
onFocus={() => {
this.setState({focused: true})
}} onBlur={() => {
this.setState({focused: false})
}}/>
<SearchIcon />
</div>;
}
} }

View File

@ -1,21 +1,22 @@
import BDV2 from "../../modules/v2"; import BDV2 from "../../modules/v2";
const React = BDV2.React; const React = BDV2.React;
export default class Switch extends React.Component { export default class Switch extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {checked: this.props.checked}; this.state = {checked: this.props.checked};
this.onChange = this.onChange.bind(this); this.onChange = this.onChange.bind(this);
} this.switch = <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} />
}
onChange(value) {
if (this.props.disabled) return; onChange(value) {
this.props.onChange(value); if (this.props.disabled) return;
this.setState({checked: value}); this.props.onChange(value);
} this.setState({checked: value});
}
render() {
return <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} /> render() {
} return this.switch
}
} }

View File

@ -35,8 +35,8 @@ export default class SwitchItem extends BDV2.reactComponent {
} }
return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"}, return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"},
BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"}, BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"},
BDV2.react.createElement("h3", {className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text), BDV2.react.createElement("h3", {key: "title", className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text),
BDV2.react.createElement(Switch, {onChange: this.onChange, checked: this.props.checked}) BDV2.react.createElement(Switch, {key: "switch", onChange: this.onChange, checked: this.props.checked})
), ),
BDV2.react.createElement("div", {className: "ui-form-text style-description margin-top-4", style: {flex: "1 1 auto"}}, info) BDV2.react.createElement("div", {className: "ui-form-text style-description margin-top-4", style: {flex: "1 1 auto"}}, info)
); );

View File

@ -38,13 +38,6 @@ const toPx = function(value) {
return `${value}px`; return `${value}px`;
}; };
/* <div class="layer-v9HyYc da-layer" style="left: 234.5px; bottom: 51px;">
<div class="tooltip-2QfLtc da-tooltip tooltipTop-XDDSxx tooltipBlack-PPG47z">
<div class="tooltipPointer-3ZfirK da-tooltipPointer"></div>
User Settings
</div>
</div> */
export default class EmulatedTooltip { export default class EmulatedTooltip {
/** /**
* *
@ -56,9 +49,10 @@ export default class EmulatedTooltip {
* @param {string} [options.side=top] - can be any of top, right, bottom, left * @param {string} [options.side=top] - can be any of top, right, bottom, left
* @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen
* @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover
* @param {boolean} [options.attachEvents=true] - whether the tooltip should listen to mouseenter and mouseleave events.
*/ */
constructor(node, text, options = {}) { constructor(node, text, options = {}) {
const {style = "black", side = "top", preventFlip = false, disabled = false} = options; const {style = "black", side = "top", preventFlip = false, disabled = false, attachEvents = true} = options;
this.node = node instanceof jQuery ? node[0] : node; this.node = node instanceof jQuery ? node[0] : node;
this.label = text; this.label = text;
this.style = style.toLowerCase(); this.style = style.toLowerCase();
@ -85,28 +79,30 @@ export default class EmulatedTooltip {
this.tooltipElement.append(this.labelElement); this.tooltipElement.append(this.labelElement);
this.element.append(this.tooltipElement); this.element.append(this.tooltipElement);
this.node.addEventListener("mouseenter", () => { if(attachEvents){
if (this.disabled) return; this.node.addEventListener("mouseenter", () => {
this.show(); if (this.disabled) return;
this.show();
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => { const observer = new MutationObserver((mutations) => {
const nodes = Array.from(mutation.removedNodes); mutations.forEach((mutation) => {
const directMatch = nodes.indexOf(this.node) > -1; const nodes = Array.from(mutation.removedNodes);
const parentMatch = nodes.some(parent => parent.contains(this.node)); const directMatch = nodes.indexOf(this.node) > -1;
if (directMatch || parentMatch) { const parentMatch = nodes.some(parent => parent.contains(this.node));
this.hide(); if (directMatch || parentMatch) {
observer.disconnect(); this.hide();
} observer.disconnect();
}
});
}); });
observer.observe(document.body, {subtree: true, childList: true});
}); });
observer.observe(document.body, {subtree: true, childList: true}); this.node.addEventListener("mouseleave", () => {
}); this.hide();
});
this.node.addEventListener("mouseleave", () => { }
this.hide();
});
} }
/** Container where the tooltip will be appended. */ /** Container where the tooltip will be appended. */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,190 +1,203 @@
import WebpackLoader from "../../modules/WebpackLoader" import WebpackLoader from "../../modules/WebpackLoader"
import { MouseEventHandler, ReactNode } from "react" import { ReactNode, CSSProperties } from "react"
import NOOP from "../../modules/noop"
let ButtonModules
let ButtonModules
type ButtonProps = {
children?: ReactNode, type ButtonProps = {
onClick?: MouseEventHandler, children?: ReactNode,
color?: ButtonColor, onClick?: () => void,
wrapper?: boolean, color?: ButtonColor,
look?: ButtonLook, wrapper?: boolean,
size?: ButtonSize, look?: ButtonLook,
hoverColor?: ButtonHovers, size?: ButtonSize,
disabled?: boolean hoverColor?: ButtonHovers,
} disabled?: boolean,
export default class Button extends React.Component<ButtonProps, {hover: boolean}> { style?: CSSProperties,
constructor(props:ButtonProps){ onRightClick?: () => void
super(props) }
export default class Button extends React.Component<ButtonProps, {hover: boolean}> {
this.state = { constructor(props:ButtonProps){
hover: false super(props)
}
} this.state = {
hover: false
static Colors:ButtonColor[] = ["brand", "grey", "red", "green", "yellow", "primary", "link", "white", "black", "transparent"] }
static Looks:ButtonLook[] = ["filled", "inverted", "outlined", "ghost", "link", "blank"] }
static Sizes:ButtonSize[] = ["small", "medium", "large", "xlarge", "min", "max", "icon", "none"]
static HoverColors: ButtonHovers[] = ["default", ...Button.Colors] static Colors:ButtonColor[] = ["brand", "grey", "red", "green", "yellow", "primary", "link", "white", "black", "transparent"]
static Looks:ButtonLook[] = ["filled", "inverted", "outlined", "ghost", "link", "blank"]
get modules(){ // caching modules static Sizes:ButtonSize[] = ["small", "medium", "large", "xlarge", "min", "max", "icon", "none"]
return ButtonModules || (ButtonModules = [ static HoverColors: ButtonHovers[] = ["default", ...Button.Colors]
WebpackLoader.findByUniqueProperties(["_horizontal"]),
WebpackLoader.findByUniqueProperties(["colorTransparent"]), get modules(){ // caching modules
WebpackLoader.findByUniqueProperties(["buttonWrapper"]), return ButtonModules || (ButtonModules = [
WebpackLoader.findByUniqueProperties(["ButtonColors"]), WebpackLoader.findByUniqueProperties(["_horizontal"]),
]) WebpackLoader.findByUniqueProperties(["colorTransparent"]),
} WebpackLoader.findByUniqueProperties(["buttonWrapper"]),
WebpackLoader.findByUniqueProperties(["ButtonColors"]),
render(){ ])
let [ }
flexModule,
euhModule1, render(){
buttonModule, let [
colorsModule, flexModule,
] = this.modules euhModule1,
buttonModule,
let props:ButtonProps = {} colorsModule,
if(this.props){ ] = this.modules
if("color" in this.props){
props.color = this.props.color let props:ButtonProps = {}
} if(this.props){
if("children" in this.props){ if("color" in this.props){
props.children = this.props.children props.color = this.props.color
} }
if("onClick" in this.props){ if("children" in this.props){
props.onClick = this.props.onClick props.children = this.props.children
} }
if("wrapper" in this.props){ if("onClick" in this.props){
props.wrapper = !!this.props.wrapper props.onClick = this.props.onClick
} }
if("look" in this.props){ if("wrapper" in this.props){
props.look = this.props.look props.wrapper = !!this.props.wrapper
} }
if("size" in this.props){ if("look" in this.props){
props.size = this.props.size props.look = this.props.look
} }
if("hoverColor" in this.props){ if("size" in this.props){
props.hoverColor = this.props.hoverColor props.size = this.props.size
} }
if("disabled" in this.props){ if("hoverColor" in this.props){
props.disabled = this.props.disabled props.hoverColor = this.props.hoverColor
}else{ }
props.disabled = false if("disabled" in this.props){
} props.disabled = this.props.disabled
} }else{
props.disabled = false
if(props.color){ }
props.color = props.color.toLowerCase() as ButtonColor if("style" in this.props){
if(!Button.Colors.includes(props.color)){ props.style = this.props.style
props.color = Button.Colors[0] }else{
} props.style = {}
}else{ }
props.color = Button.Colors[0] if("onRightClick" in this.props){
} props.onRightClick = this.props.onRightClick
}else{
if(props.look){ props.onRightClick = NOOP
props.look = props.look.toLowerCase() as ButtonLook }
if(!Button.Looks.includes(props.look)){ }
props.look = Button.Looks[0]
} if(props.color){
}else{ props.color = props.color.toLowerCase() as ButtonColor
props.look = Button.Looks[0] if(!Button.Colors.includes(props.color)){
} props.color = Button.Colors[0]
}
if(props.size){ }else{
props.size = props.size.toLowerCase() as ButtonSize props.color = Button.Colors[0]
if(!Button.Sizes.includes(props.size)){ }
props.size = Button.Sizes[0]
} if(props.look){
}else{ props.look = props.look.toLowerCase() as ButtonLook
props.size = Button.Sizes[0] if(!Button.Looks.includes(props.look)){
} props.look = Button.Looks[0]
}
if(props.hoverColor){ }else{
props.hoverColor = props.hoverColor.toLowerCase() as ButtonHovers props.look = Button.Looks[0]
if(!Button.HoverColors.includes(props.hoverColor)){ }
props.hoverColor = Button.HoverColors[0]
} if(props.size){
}else{ props.size = props.size.toLowerCase() as ButtonSize
props.hoverColor = Button.HoverColors[0] if(!Button.Sizes.includes(props.size)){
} props.size = Button.Sizes[0]
}
let buttonSize = props.size ? colorsModule.ButtonSizes[props.size.toUpperCase()] || "" : "" }else{
if(buttonSize)buttonSize = " " + buttonSize props.size = Button.Sizes[0]
}
let hoverColor = props.hoverColor ? colorsModule.ButtonHovers[props.hoverColor.toUpperCase()] || "" : ""
if(hoverColor)hoverColor = " " + hoverColor if(props.hoverColor){
props.hoverColor = props.hoverColor.toLowerCase() as ButtonHovers
props.onClick = typeof props.onClick === "function" ? props.onClick : () => {} if(!Button.HoverColors.includes(props.hoverColor)){
if(typeof props.wrapper !== "boolean")props.wrapper = true props.hoverColor = Button.HoverColors[0]
}
let hover = this.state.hover ? euhModule1.hasHover : "" }else{
if(hover)hover = " " + hover props.hoverColor = Button.HoverColors[0]
}
let button = <button type="button"
className={`${flexModule.flexChild} ${euhModule1.button} ${colorsModule.ButtonLooks[props.look.toUpperCase()]} ${colorsModule.ButtonColors[props.color.toUpperCase()]}${buttonSize}${hoverColor}${hover} ${euhModule1.grow}`} let buttonSize = props.size ? colorsModule.ButtonSizes[props.size.toUpperCase()] || "" : ""
style={{flex: "0 1 auto"}} onClick={this.props.onClick} onMouseEnter={(ev) => { if(buttonSize)buttonSize = " " + buttonSize
if(!hoverColor)return
this.setState({hover: true}) let hoverColor = props.hoverColor ? colorsModule.ButtonHovers[props.hoverColor.toUpperCase()] || "" : ""
}} onMouseLeave={(ev) => { if(hoverColor)hoverColor = " " + hoverColor
if(!hoverColor)return
this.setState({hover: false}) props.onClick = typeof props.onClick === "function" ? props.onClick : () => {}
}} disabled={props.disabled}> if(typeof props.wrapper !== "boolean")props.wrapper = true
<div className={euhModule1.contents}>{props.children}</div>
</button> let hover = this.state.hover ? euhModule1.hasHover : ""
if(hover)hover = " " + hover
if(props.wrapper){
return <div className={buttonModule.buttonWrapper}> let button = <button type="button"
{button} ref="button" className={`${flexModule.flexChild} ${euhModule1.button} ${colorsModule.ButtonLooks[props.look.toUpperCase()]} ${colorsModule.ButtonColors[props.color.toUpperCase()]}${buttonSize}${hoverColor}${hover} ${euhModule1.grow}`}
</div> style={{flex: "0 1 auto", ...props.style}} onClick={() => props.onClick()} onMouseEnter={(ev) => {
} if(!hoverColor)return
return button this.setState({hover: true})
} }} onMouseLeave={(ev) => {
if(!hoverColor)return
static get AllPreviews(){ this.setState({hover: false})
return AllPreviews || (() => { }} disabled={props.disabled} onContextMenu={() => props.onRightClick()}>
AllPreviews = [] <div className={euhModule1.contents}>{props.children}</div>
let colors = [] </button>
for(let color of Button.Colors){
colors.push({ if(props.wrapper){
color: color return <div ref="wrapper" className={buttonModule.buttonWrapper}>
}) {button}
} </div>
AllPreviews.push(colors) }
let looks = [] return button
for(let look of Button.Looks){ }
looks.push({
look: look static get AllPreviews(){
}) return AllPreviews || (() => {
} AllPreviews = []
AllPreviews.push(looks) let colors = []
let sizes = [] for(let color of Button.Colors){
for(let size of Button.Sizes){ colors.push({
sizes.push({ color: color
size: size })
}) }
} AllPreviews.push(colors)
AllPreviews.push(sizes) let looks = []
let hovers = [] for(let look of Button.Looks){
for(let hover of Button.HoverColors){ looks.push({
hovers.push({ look: look
hoverColor: hover })
}) }
} AllPreviews.push(looks)
AllPreviews.push(hovers) let sizes = []
AllPreviews.push([{children: "Test Button"}]) for(let size of Button.Sizes){
AllPreviews.push([{onClick: () => {}}]) sizes.push({
AllPreviews.push([{wrapper: false}]) size: size
AllPreviews.push([{disabled: false}, {disabled: true}]) })
return AllPreviews }
})() AllPreviews.push(sizes)
} let hovers = []
} for(let hover of Button.HoverColors){
let AllPreviews hovers.push({
hoverColor: hover
})
export type ButtonColor = "brand" | "grey" | "red" | "green" | "yellow" | "primary" | "link" | "white" | "black" | "transparent" }
export type ButtonLook = "filled" | "inverted" | "outlined" | "ghost" | "link" | "blank" AllPreviews.push(hovers)
export type ButtonSize = "none" | "small" | "medium" | "large" | "xlarge" | "min" | "max" | "icon" AllPreviews.push([{children: "Test Button"}])
AllPreviews.push([{onClick: () => {}}])
AllPreviews.push([{wrapper: false}])
AllPreviews.push([{disabled: false}, {disabled: true}])
return AllPreviews
})()
}
}
let AllPreviews
export type ButtonColor = "brand" | "grey" | "red" | "green" | "yellow" | "primary" | "link" | "white" | "black" | "transparent"
export type ButtonLook = "filled" | "inverted" | "outlined" | "ghost" | "link" | "blank"
export type ButtonSize = "none" | "small" | "medium" | "large" | "xlarge" | "min" | "max" | "icon"
export type ButtonHovers = "default" | ButtonColor export type ButtonHovers = "default" | ButtonColor

View File

@ -79,7 +79,7 @@ export function createProxyErrorCatcherClass<base = Function>(Class:base):base &
const ClassCopy = (class Proxied extends React.Component { const ClassCopy = (class Proxied extends React.Component {
render(){ render(){
return <ErrorCatcher key={uuid()}> return <ErrorCatcher key={uuid()}>
{React.createElement(Class as any, {...this.props, key: uuid()})} {React.createElement(Class as any, {ref: "original", ...this.props, key: uuid()})}
</ErrorCatcher> </ErrorCatcher>
} }

View File

@ -442,7 +442,7 @@ async function privateInit(){
data.friend_suggestion_count = data.friend_suggestion_count || 0 data.friend_suggestion_count = data.friend_suggestion_count || 0
data.presences = data.presences || [] data.presences = data.presences || []
}else{ }else{
logger.log(`Logged in as an user. Skipping`) logger.log(`Logged in as an user. Skipping user spoofing.`)
} }
} }
let returnValue = _handleDispatch.call(this, ...arguments) let returnValue = _handleDispatch.call(this, ...arguments)

View File

@ -15,6 +15,7 @@ function forwardToCurrentWebview(event){
}] }]
} }
/** discord_desktop_core Stable */
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_FOCUS")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_FOCUS"))
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_BLUR")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_BLUR"))
ipc.on(...forwardToCurrentWebview("SYSTEM_TRAY_OPEN_VOICE_SETTINGS")) ipc.on(...forwardToCurrentWebview("SYSTEM_TRAY_OPEN_VOICE_SETTINGS"))
@ -37,6 +38,10 @@ ipc.on(...forwardToCurrentWebview("ACCESSIBILITY_SUPPORT_CHANGED"))
ipc.on(...forwardToCurrentWebview("HELP_OPEN")) ipc.on(...forwardToCurrentWebview("HELP_OPEN"))
ipc.on(...forwardToCurrentWebview("USER_SETTINGS_OPEN")) ipc.on(...forwardToCurrentWebview("USER_SETTINGS_OPEN"))
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_PATH")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_PATH"))
/** discord_desktop_core Development */
ipc.on(...forwardToCurrentWebview("NAVIGATE_BACK"))
ipc.on(...forwardToCurrentWebview("NAVIGATE_FORWARD"))
ipc.on("RELOAD", () => { ipc.on("RELOAD", () => {
let webview = webviews.get(document.querySelector(".chrome-tab[active]")) let webview = webviews.get(document.querySelector(".chrome-tab[active]"))
if(!webview)return if(!webview)return

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "lightcord", "name": "lightcord",
"version": "0.1.3", "version": "0.1.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -14,7 +14,8 @@
"build:minify": "node build.js", "build:minify": "node build.js",
"build:after": "node afterbuild.js", "build:after": "node afterbuild.js",
"devInstall": "npm i --save-dev --arch=ia32 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"", "devInstall": "npm i --save-dev --arch=ia32 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"",
"devInstall:64": "npm i --save-dev --arch=x64 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"" "devInstall:64": "npm i --save-dev --arch=x64 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"",
"versions": "echo Electron: && electron -v && echo Typescript: && tsc -v"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",