Fixing build, custom css theme, minfied files
This commit is contained in:
parent
2dd4315b39
commit
1ac66bf493
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -353,7 +353,7 @@
|
||||||
|
|
||||||
#bda-qem {
|
#bda-qem {
|
||||||
border-radius: 5px 5px 0 0;
|
border-radius: 5px 5px 0 0;
|
||||||
background: #2f3136;
|
background: var(--background-secondary);
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -367,7 +367,7 @@
|
||||||
|
|
||||||
#bda-qem button {
|
#bda-qem button {
|
||||||
border-left: 1px solid #202225;
|
border-left: 1px solid #202225;
|
||||||
background: #2f3136;
|
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: #FFF;
|
||||||
|
@ -420,7 +420,7 @@
|
||||||
#bda-qem-favourite-container {
|
#bda-qem-favourite-container {
|
||||||
width: 384px;
|
width: 384px;
|
||||||
height: 424px;
|
height: 424px;
|
||||||
background-color: #2f3136;
|
background-color: var(--background-secondary);
|
||||||
border-radius: 0 0 5px 5px;
|
border-radius: 0 0 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,13 +615,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer h2.ui-form-title {
|
#pubslayer h2.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer h5.ui-form-title {
|
#pubslayer h5.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer button {
|
#pubslayer button {
|
||||||
|
@ -641,7 +641,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer input {
|
#pubslayer input {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background-color: rgba(0, 0, 0, .1);
|
background-color: rgba(0, 0, 0, .1);
|
||||||
border-color: rgba(0, 0, 0, .3);
|
border-color: rgba(0, 0, 0, .3);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -666,8 +666,8 @@
|
||||||
.bd-detached-css-editor #bd-customcss-attach-controls button {
|
.bd-detached-css-editor #bd-customcss-attach-controls button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
background: #31332b;
|
background: var(--background-primary);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
height: 26px;
|
height: 26px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
@ -676,15 +676,16 @@
|
||||||
|
|
||||||
.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,
|
.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,
|
||||||
.bd-detached-css-editor #bd-customcss-attach-controls button:hover {
|
.bd-detached-css-editor #bd-customcss-attach-controls button:hover {
|
||||||
background: #3b3e44;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentRegion-3nDuYy #bd-customcss-attach-controls,
|
.contentRegion-3nDuYy #bd-customcss-attach-controls,
|
||||||
#bd-customcss-detach-container #bd-customcss-attach-controls {
|
#bd-customcss-detach-container #bd-customcss-attach-controls {
|
||||||
background: #272822;
|
background: var(--background-secondary-alt);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
border: none;
|
box-shadow: 0px 1px 0px 0px var(--background-secondary-alt) inset;
|
||||||
box-shadow: 0px 1px 0px 0px #2F3129 inset;
|
border: 1px solid var(--background-floating);
|
||||||
|
border-top: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -696,7 +697,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.standardSidebarView-3F1I7i #editor-detached h3 {
|
.standardSidebarView-3F1I7i #editor-detached h3 {
|
||||||
color: #87909c;
|
color: var(--header-secondary);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
@ -706,7 +707,7 @@
|
||||||
margin-left: calc(50% - 100px);
|
margin-left: calc(50% - 100px);
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
background: var(--bd-blue);
|
background: var(--bd-blue);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -727,15 +728,15 @@
|
||||||
|
|
||||||
.line-numbers {
|
.line-numbers {
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
color: gray;
|
color: var(--text-normal);
|
||||||
padding: 10px 5px 0 5px;
|
padding: 10px 5px 0 5px;
|
||||||
background: #24262a;
|
background: var(--background-secondary-alt);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_editor {
|
.ace_editor {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #292B2F;
|
background: var(--background-secondary);
|
||||||
outline: none;
|
outline: none;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -763,7 +764,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: #36393e;
|
background-color: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-detach-editor {
|
#bd-customcss-detach-editor {
|
||||||
|
@ -776,8 +777,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-detach-controls {
|
#bd-customcss-detach-controls {
|
||||||
background: #E8E8E8;
|
background: var(--text-normal);
|
||||||
border-top: 1px solid #ADADAD;
|
|
||||||
box-shadow: inset 0px 1px 0px 0px white;
|
box-shadow: inset 0px 1px 0px 0px white;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -792,8 +792,8 @@
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
background-color: #738bd7;
|
background-color: var(--blurple);
|
||||||
color: #fff;
|
color: var(--header-primary);
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,9 +819,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-attach-controls {
|
#bd-customcss-attach-controls {
|
||||||
background: #E8E8E8;
|
background: var(--text-normal);
|
||||||
border: 1px solid #FFF;
|
border: 1px solid var(--header-primary);
|
||||||
border-top: 1px solid #ADADAD;
|
border-top: 1px solid var(--text-normal);
|
||||||
box-shadow: inset 0px 1px 0px 0px white;
|
box-shadow: inset 0px 1px 0px 0px white;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -845,8 +845,8 @@
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
background-color: #738bd7;
|
background-color: var(--blurple);
|
||||||
color: #fff;
|
color: var(--header-primary);
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,7 +872,7 @@
|
||||||
|
|
||||||
body .ace_closeButton::before {
|
body .ace_closeButton::before {
|
||||||
content: "✖";
|
content: "✖";
|
||||||
color: #36393f;
|
color: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
body .ace_closeButton:active {
|
body .ace_closeButton:active {
|
||||||
|
@ -880,20 +880,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div #ace_settingsmenu {
|
.theme-dark div #ace_settingsmenu {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div #ace_settingsmenu select,
|
.theme-dark div #ace_settingsmenu select,
|
||||||
.theme-dark div #ace_settingsmenu input[type="text"] {
|
.theme-dark div #ace_settingsmenu input[type="text"] {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border: 1px solid #484B52;
|
border: 1px solid #484B52;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div .ace_closeButton::before {
|
.theme-dark div .ace_closeButton::before {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* editor help text */
|
/* editor help text */
|
||||||
|
@ -904,7 +904,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-attach-controls .help-text .inline {
|
#bd-customcss-attach-controls .help-text .inline {
|
||||||
background: #31332B;
|
background: var(--background-secondary);
|
||||||
padding: .2em;
|
padding: .2em;
|
||||||
margin: -.2em 0;
|
margin: -.2em 0;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@ -1050,7 +1050,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark h2.ui-form-title {
|
.theme-dark h2.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light h2.ui-form-title {
|
.theme-light h2.ui-form-title {
|
||||||
|
@ -1070,7 +1070,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .ui-switch-item h3 {
|
.theme-dark .ui-switch-item h3 {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .ui-switch-item h3 {
|
.theme-light .ui-switch-item h3 {
|
||||||
|
@ -1136,7 +1136,7 @@
|
||||||
top: 3px;
|
top: 3px;
|
||||||
left: 3px;
|
left: 3px;
|
||||||
bottom: 3px;
|
bottom: 3px;
|
||||||
background: #f6f6f7;
|
background: var(--header-primary);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
transition: all .15s ease;
|
transition: all .15s ease;
|
||||||
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
|
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
|
||||||
|
@ -1208,7 +1208,7 @@
|
||||||
|
|
||||||
.theme-dark .bd-addon-list .bd-addon-card {
|
.theme-dark .bd-addon-list .bd-addon-card {
|
||||||
background-color: rgba(32, 34, 37, .6);
|
background-color: rgba(32, 34, 37, .6);
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
border-color: #202225;
|
border-color: #202225;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1235,7 +1235,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .bd-addon-list .bda-header {
|
.theme-dark .bd-addon-list .bda-header {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
border-bottom-color: rgba(114, 118, 125, .3);
|
border-bottom-color: rgba(114, 118, 125, .3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1428,7 +1428,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-modal-wrapper .bd-modal-body {
|
.bd-modal-wrapper .bd-modal-body {
|
||||||
background-color: #36393f;
|
background-color: var(--background-primary);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -1595,7 +1595,7 @@
|
||||||
.bd-toast {
|
.bd-toast {
|
||||||
animation: bd-toast-up 300ms ease;
|
animation: bd-toast-up 300ms ease;
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
background: #36393F;
|
background: var(--background-primary);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
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);
|
||||||
|
@ -1970,7 +1970,7 @@
|
||||||
/* add/create server */
|
/* add/create server */
|
||||||
.bda-dark .theme-dark .root-1gCeng,
|
.bda-dark .theme-dark .root-1gCeng,
|
||||||
.bda-dark .slide-2pHaq5 {
|
.bda-dark .slide-2pHaq5 {
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .root-1gCeng .input-1mgnkM {
|
.bda-dark .root-1gCeng .input-1mgnkM {
|
||||||
|
@ -1980,18 +1980,18 @@
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-dark .action-1lSjCi,
|
.bda-dark .theme-dark .theme-dark .action-1lSjCi,
|
||||||
.bda-dark .theme-dark .theme-light .action-1lSjCi {
|
.bda-dark .theme-dark .theme-light .action-1lSjCi {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-light .footer-3rDWdC {
|
.bda-dark .theme-dark .theme-light .footer-3rDWdC {
|
||||||
background: #2f3136;
|
background: var(--background-secondary);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* centered or */
|
/* centered or */
|
||||||
.bda-dark .theme-dark .theme-dark .or-3THJsp,
|
.bda-dark .theme-dark .theme-dark .or-3THJsp,
|
||||||
.bda-dark .theme-dark .theme-light .or-3THJsp {
|
.bda-dark .theme-dark .theme-light .or-3THJsp {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
order: 2;
|
order: 2;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
width: 56px;
|
width: 56px;
|
||||||
|
@ -2016,16 +2016,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-light .footer-2yfCgX {
|
.bda-dark .theme-dark .theme-light .footer-2yfCgX {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Region Select */
|
/* Region Select */
|
||||||
.bda-dark .theme-dark .regionSelectModal-12e-57 {
|
.bda-dark .theme-dark .regionSelectModal-12e-57 {
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 {
|
.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border: 2px solid #484B52;
|
border: 2px solid #484B52;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2143,7 +2143,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-select-wrapper {
|
.bd-select-wrapper {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -2157,7 +2157,7 @@
|
||||||
.bd-select {
|
.bd-select {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -2184,7 +2184,7 @@
|
||||||
|
|
||||||
.bd-select .bd-select-options {
|
.bd-select .bd-select-options {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border-radius: 0 0 3px 3px;
|
border-radius: 0 0 3px 3px;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
min-width: calc(100% + 2px);
|
min-width: calc(100% + 2px);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -263,8 +263,9 @@ export default new class ContentManager {
|
||||||
try {window.require(path.resolve(baseFolder, filename));}
|
try {window.require(path.resolve(baseFolder, filename));}
|
||||||
catch (error) {return {name: filename, file: filename, message: "Could not be compiled.", error: {message: error.message, stack: error.stack}};}
|
catch (error) {return {name: filename, file: filename, message: "Could not be compiled.", error: {message: error.message, stack: error.stack}};}
|
||||||
const content = window.require(path.resolve(baseFolder, filename));
|
const content = window.require(path.resolve(baseFolder, filename));
|
||||||
if(!content.name)return {name: filename, file: filename, message: "Cannot escape the ID.", error: {message: "Cannot read property 'replace' of undefined", stack: "Cannot read property 'replace' of undefined"}}
|
if(!content.name)return {name: filename, file: filename, message: "Cannot escape the ID.", error: new Error("Cannot read property 'replace' of undefined")}
|
||||||
content.id = Utils.escapeID(content.name);
|
content.id = Utils.escapeID(content.name);
|
||||||
|
//if(!id)return {name: filename, file: filename, message: "Invalid ID", error: new Error("Please fix the name of "+filename+". BetterDiscord can't escape an ID.")}
|
||||||
if (isPlugin) {
|
if (isPlugin) {
|
||||||
if (!content.type) return;
|
if (!content.type) return;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import {bbdVersion} from "../0globals";
|
||||||
import WebpackModules from "./webpackModules";
|
import WebpackModules from "./webpackModules";
|
||||||
import BDV2 from "./v2";
|
import BDV2 from "./v2";
|
||||||
import DOM from "./domtools";
|
import DOM from "./domtools";
|
||||||
|
|
||||||
export default class Utils {
|
export default class Utils {
|
||||||
/** Document/window width */
|
/** Document/window width */
|
||||||
static get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); }
|
static get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); }
|
||||||
|
@ -40,7 +39,7 @@ export default class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static getTextArea() {
|
static getTextArea() {
|
||||||
return DOM.query("."+this.removeDa(BDModules.get(e => e.channelTextArea && e.titleWrapper)[0].channelTextArea)+" textarea");
|
return DOM.query("."+removeDa(BDModules.get(e => e.channelTextArea && e.titleWrapper)[0].channelTextArea)+" textarea");
|
||||||
}
|
}
|
||||||
|
|
||||||
static insertText(textarea, text) {
|
static insertText(textarea, text) {
|
||||||
|
@ -201,8 +200,8 @@ 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("."+this.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("."+this.removeDa(BDModules.get(e => e.membersWrap)[0].membersWrap)) : 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 left = container ? container.getBoundingClientRect().left : 310;
|
||||||
const right = memberlist ? memberlist.getBoundingClientRect().left : 0;
|
const right = memberlist ? memberlist.getBoundingClientRect().left : 0;
|
||||||
|
@ -482,12 +481,16 @@ export default class Utils {
|
||||||
}, {modalKey: key});
|
}, {modalKey: key});
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeDa(className){
|
static get removeDa(){
|
||||||
if(!className)return className
|
return removeDa
|
||||||
return className.split(" ").filter(e => !e.startsWith("da-")).join(" ")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeDa(className){
|
||||||
|
if(!className)return className
|
||||||
|
return className.split(" ").filter(e => !e.startsWith("da-")).join(" ")
|
||||||
|
}
|
||||||
|
|
||||||
Utils.showToast = Utils.suppressErrors(Utils.showToast, "Could not show toast.");
|
Utils.showToast = Utils.suppressErrors(Utils.showToast, "Could not show toast.");
|
||||||
|
|
||||||
window.Lightcord.BetterDiscord.Utils = Utils
|
window.Lightcord.BetterDiscord.Utils = Utils
|
|
@ -353,7 +353,7 @@
|
||||||
|
|
||||||
#bda-qem {
|
#bda-qem {
|
||||||
border-radius: 5px 5px 0 0;
|
border-radius: 5px 5px 0 0;
|
||||||
background: #2f3136;
|
background: var(--background-secondary);
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -367,7 +367,7 @@
|
||||||
|
|
||||||
#bda-qem button {
|
#bda-qem button {
|
||||||
border-left: 1px solid #202225;
|
border-left: 1px solid #202225;
|
||||||
background: #2f3136;
|
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: #FFF;
|
||||||
|
@ -420,7 +420,7 @@
|
||||||
#bda-qem-favourite-container {
|
#bda-qem-favourite-container {
|
||||||
width: 384px;
|
width: 384px;
|
||||||
height: 424px;
|
height: 424px;
|
||||||
background-color: #2f3136;
|
background-color: var(--background-secondary);
|
||||||
border-radius: 0 0 5px 5px;
|
border-radius: 0 0 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,13 +615,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer h2.ui-form-title {
|
#pubslayer h2.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer h5.ui-form-title {
|
#pubslayer h5.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer button {
|
#pubslayer button {
|
||||||
|
@ -641,7 +641,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#pubslayer input {
|
#pubslayer input {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background-color: rgba(0, 0, 0, .1);
|
background-color: rgba(0, 0, 0, .1);
|
||||||
border-color: rgba(0, 0, 0, .3);
|
border-color: rgba(0, 0, 0, .3);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -666,8 +666,8 @@
|
||||||
.bd-detached-css-editor #bd-customcss-attach-controls button {
|
.bd-detached-css-editor #bd-customcss-attach-controls button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
background: #31332b;
|
background: var(--background-primary);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
height: 26px;
|
height: 26px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
@ -676,15 +676,16 @@
|
||||||
|
|
||||||
.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,
|
.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,
|
||||||
.bd-detached-css-editor #bd-customcss-attach-controls button:hover {
|
.bd-detached-css-editor #bd-customcss-attach-controls button:hover {
|
||||||
background: #3b3e44;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentRegion-3nDuYy #bd-customcss-attach-controls,
|
.contentRegion-3nDuYy #bd-customcss-attach-controls,
|
||||||
#bd-customcss-detach-container #bd-customcss-attach-controls {
|
#bd-customcss-detach-container #bd-customcss-attach-controls {
|
||||||
background: #272822;
|
background: var(--background-secondary-alt);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
border: none;
|
box-shadow: 0px 1px 0px 0px var(--background-secondary-alt) inset;
|
||||||
box-shadow: 0px 1px 0px 0px #2F3129 inset;
|
border: 1px solid var(--background-floating);
|
||||||
|
border-top: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -696,7 +697,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.standardSidebarView-3F1I7i #editor-detached h3 {
|
.standardSidebarView-3F1I7i #editor-detached h3 {
|
||||||
color: #87909c;
|
color: var(--header-secondary);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
@ -706,7 +707,7 @@
|
||||||
margin-left: calc(50% - 100px);
|
margin-left: calc(50% - 100px);
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
background: var(--bd-blue);
|
background: var(--bd-blue);
|
||||||
color: #FFF;
|
color: var(--header-primary);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -727,15 +728,15 @@
|
||||||
|
|
||||||
.line-numbers {
|
.line-numbers {
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
color: gray;
|
color: var(--text-normal);
|
||||||
padding: 10px 5px 0 5px;
|
padding: 10px 5px 0 5px;
|
||||||
background: #24262a;
|
background: var(--background-secondary-alt);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_editor {
|
.ace_editor {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #292B2F;
|
background: var(--background-secondary);
|
||||||
outline: none;
|
outline: none;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -763,7 +764,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: #36393e;
|
background-color: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-detach-editor {
|
#bd-customcss-detach-editor {
|
||||||
|
@ -776,8 +777,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-detach-controls {
|
#bd-customcss-detach-controls {
|
||||||
background: #E8E8E8;
|
background: var(--text-normal);
|
||||||
border-top: 1px solid #ADADAD;
|
|
||||||
box-shadow: inset 0px 1px 0px 0px white;
|
box-shadow: inset 0px 1px 0px 0px white;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -792,8 +792,8 @@
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
background-color: #738bd7;
|
background-color: var(--blurple);
|
||||||
color: #fff;
|
color: var(--header-primary);
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,9 +819,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-attach-controls {
|
#bd-customcss-attach-controls {
|
||||||
background: #E8E8E8;
|
background: var(--text-normal);
|
||||||
border: 1px solid #FFF;
|
border: 1px solid var(--header-primary);
|
||||||
border-top: 1px solid #ADADAD;
|
border-top: 1px solid var(--text-normal);
|
||||||
box-shadow: inset 0px 1px 0px 0px white;
|
box-shadow: inset 0px 1px 0px 0px white;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -845,8 +845,8 @@
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
background-color: #738bd7;
|
background-color: var(--blurple);
|
||||||
color: #fff;
|
color: var(--header-primary);
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,7 +872,7 @@
|
||||||
|
|
||||||
body .ace_closeButton::before {
|
body .ace_closeButton::before {
|
||||||
content: "✖";
|
content: "✖";
|
||||||
color: #36393f;
|
color: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
body .ace_closeButton:active {
|
body .ace_closeButton:active {
|
||||||
|
@ -880,20 +880,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div #ace_settingsmenu {
|
.theme-dark div #ace_settingsmenu {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div #ace_settingsmenu select,
|
.theme-dark div #ace_settingsmenu select,
|
||||||
.theme-dark div #ace_settingsmenu input[type="text"] {
|
.theme-dark div #ace_settingsmenu input[type="text"] {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border: 1px solid #484B52;
|
border: 1px solid #484B52;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark div .ace_closeButton::before {
|
.theme-dark div .ace_closeButton::before {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* editor help text */
|
/* editor help text */
|
||||||
|
@ -904,7 +904,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#bd-customcss-attach-controls .help-text .inline {
|
#bd-customcss-attach-controls .help-text .inline {
|
||||||
background: #31332B;
|
background: var(--background-secondary);
|
||||||
padding: .2em;
|
padding: .2em;
|
||||||
margin: -.2em 0;
|
margin: -.2em 0;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@ -1050,7 +1050,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark h2.ui-form-title {
|
.theme-dark h2.ui-form-title {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light h2.ui-form-title {
|
.theme-light h2.ui-form-title {
|
||||||
|
@ -1070,7 +1070,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .ui-switch-item h3 {
|
.theme-dark .ui-switch-item h3 {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .ui-switch-item h3 {
|
.theme-light .ui-switch-item h3 {
|
||||||
|
@ -1136,7 +1136,7 @@
|
||||||
top: 3px;
|
top: 3px;
|
||||||
left: 3px;
|
left: 3px;
|
||||||
bottom: 3px;
|
bottom: 3px;
|
||||||
background: #f6f6f7;
|
background: var(--header-primary);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
transition: all .15s ease;
|
transition: all .15s ease;
|
||||||
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
|
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
|
||||||
|
@ -1208,7 +1208,7 @@
|
||||||
|
|
||||||
.theme-dark .bd-addon-list .bd-addon-card {
|
.theme-dark .bd-addon-list .bd-addon-card {
|
||||||
background-color: rgba(32, 34, 37, .6);
|
background-color: rgba(32, 34, 37, .6);
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
border-color: #202225;
|
border-color: #202225;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1235,7 +1235,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .bd-addon-list .bda-header {
|
.theme-dark .bd-addon-list .bda-header {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
border-bottom-color: rgba(114, 118, 125, .3);
|
border-bottom-color: rgba(114, 118, 125, .3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1428,7 +1428,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-modal-wrapper .bd-modal-body {
|
.bd-modal-wrapper .bd-modal-body {
|
||||||
background-color: #36393f;
|
background-color: var(--background-primary);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -1595,7 +1595,7 @@
|
||||||
.bd-toast {
|
.bd-toast {
|
||||||
animation: bd-toast-up 300ms ease;
|
animation: bd-toast-up 300ms ease;
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
background: #36393F;
|
background: var(--background-primary);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
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);
|
||||||
|
@ -1970,7 +1970,7 @@
|
||||||
/* add/create server */
|
/* add/create server */
|
||||||
.bda-dark .theme-dark .root-1gCeng,
|
.bda-dark .theme-dark .root-1gCeng,
|
||||||
.bda-dark .slide-2pHaq5 {
|
.bda-dark .slide-2pHaq5 {
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .root-1gCeng .input-1mgnkM {
|
.bda-dark .root-1gCeng .input-1mgnkM {
|
||||||
|
@ -1980,18 +1980,18 @@
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-dark .action-1lSjCi,
|
.bda-dark .theme-dark .theme-dark .action-1lSjCi,
|
||||||
.bda-dark .theme-dark .theme-light .action-1lSjCi {
|
.bda-dark .theme-dark .theme-light .action-1lSjCi {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-light .footer-3rDWdC {
|
.bda-dark .theme-dark .theme-light .footer-3rDWdC {
|
||||||
background: #2f3136;
|
background: var(--background-secondary);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* centered or */
|
/* centered or */
|
||||||
.bda-dark .theme-dark .theme-dark .or-3THJsp,
|
.bda-dark .theme-dark .theme-dark .or-3THJsp,
|
||||||
.bda-dark .theme-dark .theme-light .or-3THJsp {
|
.bda-dark .theme-dark .theme-light .or-3THJsp {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
order: 2;
|
order: 2;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
width: 56px;
|
width: 56px;
|
||||||
|
@ -2016,16 +2016,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .theme-light .footer-2yfCgX {
|
.bda-dark .theme-dark .theme-light .footer-2yfCgX {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Region Select */
|
/* Region Select */
|
||||||
.bda-dark .theme-dark .regionSelectModal-12e-57 {
|
.bda-dark .theme-dark .regionSelectModal-12e-57 {
|
||||||
background: #36393f;
|
background: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 {
|
.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 {
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border: 2px solid #484B52;
|
border: 2px solid #484B52;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2143,7 +2143,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-select-wrapper {
|
.bd-select-wrapper {
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -2157,7 +2157,7 @@
|
||||||
.bd-select {
|
.bd-select {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #f6f6f7;
|
color: var(--header-primary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -2184,7 +2184,7 @@
|
||||||
|
|
||||||
.bd-select .bd-select-options {
|
.bd-select .bd-select-options {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: #2F3136;
|
background: var(--background-secondary);
|
||||||
border-radius: 0 0 3px 3px;
|
border-radius: 0 0 3px 3px;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
min-width: calc(100% + 2px);
|
min-width: calc(100% + 2px);
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default class V2C_CssEditor extends BDV2.reactComponent {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// this.updateLineCount();
|
// this.updateLineCount();
|
||||||
this.editor = ace.edit("bd-customcss-editor");
|
this.editor = ace.edit("bd-customcss-editor");
|
||||||
this.editor.setTheme("ace/theme/monokai");
|
this.editor.setTheme("ace/theme/discord");
|
||||||
this.editor.session.setMode("ace/mode/css");
|
this.editor.session.setMode("ace/mode/css");
|
||||||
this.editor.setShowPrintMargin(false);
|
this.editor.setShowPrintMargin(false);
|
||||||
this.editor.setFontSize(14);
|
this.editor.setFontSize(14);
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default class V2C_CssEditorDetached extends BDV2.reactComponent {
|
||||||
BDV2.editorDetached = true;
|
BDV2.editorDetached = true;
|
||||||
// this.updateLineCount();
|
// this.updateLineCount();
|
||||||
this.editor = ace.edit("bd-customcss-editor-detached");
|
this.editor = ace.edit("bd-customcss-editor-detached");
|
||||||
this.editor.setTheme("ace/theme/monokai");
|
this.editor.setTheme("ace/theme/discord");
|
||||||
this.editor.session.setMode("ace/mode/css");
|
this.editor.session.setMode("ace/mode/css");
|
||||||
this.editor.setShowPrintMargin(false);
|
this.editor.setShowPrintMargin(false);
|
||||||
this.editor.setFontSize(14);
|
this.editor.setFontSize(14);
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
"author": "jeanouina",
|
"author": "jeanouina",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/collection": "^0.1.5",
|
"@discordjs/collection": "0.1.5"
|
||||||
"ts-loader": "^7.0.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^3.9.5"
|
"typescript": "^3.9.5",
|
||||||
|
"ts-loader": "^7.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,35 +0,0 @@
|
||||||
/**
|
|
||||||
* @name LightcordApiExemple
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = class LightcordApiExemple {
|
|
||||||
getName() {return "LightcordApiExemple";} // Name of your plugin to show on the plugins page
|
|
||||||
getDescription() {return "Describe the basic functions. Maybe a support server link.";} // Description to show on the plugins page
|
|
||||||
getVersion() {return "0.0.1";} // Current version. I recommend following semantic versioning <http://semver.org/> (e.g. 0.0.1)
|
|
||||||
getAuthor() {return "Not Thomiz";} // Your name
|
|
||||||
|
|
||||||
load() {} // Called when the plugin is loaded in to memory
|
|
||||||
|
|
||||||
start() {
|
|
||||||
if(!("Lightcord" in window) || !("Api" in window.Lightcord)){
|
|
||||||
bdApi.showToast("This plugin only works in Lightcord.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`LightcordAPI is availaible !`)
|
|
||||||
} // Called when the plugin is activated (including after reloads)
|
|
||||||
stop() {} // Called when the plugin is deactivated
|
|
||||||
|
|
||||||
observer(changes) {} // Observer for the `document`. Better documentation than I can provide is found here: <https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver>
|
|
||||||
|
|
||||||
getSettingsPanel(){
|
|
||||||
const Markdown = BDModules.get(e => e.default && e.default.displayName === "Markdown")[0].default
|
|
||||||
let settings = Markdown.prototype.render.call({
|
|
||||||
props: Object.assign({
|
|
||||||
className: "",
|
|
||||||
children: "> warn\n> sltsv"
|
|
||||||
}, Markdown.defaultProps)
|
|
||||||
})
|
|
||||||
return window.Lightcord.Api.Utils.ReactToHTML(settings)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
import Utils from "./Utils"
|
import Utils from "./Utils"
|
||||||
import Notices, { notices } from "../components/private/Notices"
|
import Notices, { notices } from "../components/private/Notices"
|
||||||
import { isNative } from "./environnement";
|
import { isNative } from "./environnement";
|
||||||
|
import WebpackLoader from "./WebpackLoader";
|
||||||
|
|
||||||
export function patch(){
|
export function patch(){
|
||||||
/** START NOTICE */
|
/** START NOTICE */
|
||||||
|
@ -101,6 +102,96 @@ export function patch(){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/** END USERPROFILE PATCH */
|
/** END USERPROFILE PATCH */
|
||||||
|
|
||||||
|
/** START WEBHOOK PATCH */
|
||||||
|
/*
|
||||||
|
let usedWebhooks = {}
|
||||||
|
|
||||||
|
getModule(e => e && e.Request && e.Request.prototype && e.Request.prototype.end)
|
||||||
|
.then(RequestModule => {
|
||||||
|
const end = RequestModule.Request.prototype.end
|
||||||
|
RequestModule.Request.prototype.end = function(){
|
||||||
|
if(this.url.endsWith("/messages") && /\/channels\/\d+\/messages/g.test(this.url) && this.method === "POST"){ // sending message
|
||||||
|
let channelId = this.url.split("/channels/")[1].split("/messages")[0]
|
||||||
|
|
||||||
|
if(usedWebhooks[channelId]){ // webhook is availlable
|
||||||
|
let webhook = usedWebhooks[channelId]
|
||||||
|
let url = `/webhooks/${webhook.id}/${webhook.token}?wait=true`
|
||||||
|
this.url = url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return end.call(this, ...arguments)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getModule(e => e.default && e.default.displayName === "Webhook")
|
||||||
|
.then(webhookComponent => {
|
||||||
|
const renderEdit = webhookComponent.default.prototype.renderEdit
|
||||||
|
webhookComponent.default.prototype.renderEdit = function(){
|
||||||
|
const webhook = this.props.webhook
|
||||||
|
let returnValue = renderEdit.call(this, ...arguments)
|
||||||
|
returnValue.props.children = [returnValue.props.children]
|
||||||
|
let message = usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id ? "Stop talking with this webhook" : "Talk with this webhook"
|
||||||
|
|
||||||
|
returnValue.props.children.push(React.createElement(window.Lightcord.Api.Components.inputs.Button, {color: "green", wrapper: false, onClick(){
|
||||||
|
if(usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id){
|
||||||
|
delete usedWebhooks[webhook.channel_id]
|
||||||
|
}else{
|
||||||
|
usedWebhooks[webhook.channel_id] = {
|
||||||
|
id: webhook.id,
|
||||||
|
token: webhook.token
|
||||||
|
}
|
||||||
|
}
|
||||||
|
webhookPanels.forEach(e => e())
|
||||||
|
}}, message))
|
||||||
|
|
||||||
|
return returnValue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let webhookPanels = []
|
||||||
|
let getComp = (comp) => {
|
||||||
|
class SettingsWebhooks extends React.PureComponent {
|
||||||
|
constructor(props){
|
||||||
|
super(props)
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount(){
|
||||||
|
this.id = uuid()
|
||||||
|
this.component = new comp(this.props)
|
||||||
|
let func = () => {
|
||||||
|
this.component.forceUpdate()
|
||||||
|
}
|
||||||
|
func.id = this.id
|
||||||
|
webhookPanels.push(func)
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount(){
|
||||||
|
this.component = null
|
||||||
|
webhookPanels = webhookPanels.filter(e => e.id !== this.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
render(){
|
||||||
|
return this.component.render()
|
||||||
|
}
|
||||||
|
|
||||||
|
static displayName = "SettingsWebhooks"
|
||||||
|
}
|
||||||
|
|
||||||
|
return SettingsWebhooks
|
||||||
|
}
|
||||||
|
getModule(e => e.default && e.default.displayName === "FluxContainer(SettingsWebhooks)")
|
||||||
|
.then(webhooksComponents => {
|
||||||
|
let comp = webhooksComponents.default
|
||||||
|
|
||||||
|
webhooksComponents.default = getComp(comp)
|
||||||
|
|
||||||
|
WebpackLoader.find(e => e.default && e.default.displayName === "FluxContainer(FluxContainer(SettingsWebhooks))")
|
||||||
|
.forEach(mod => {
|
||||||
|
mod.default = getComp(mod.default)
|
||||||
|
})
|
||||||
|
})*/
|
||||||
|
/** END WEBHOOK PATCH */
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add in app-notifications / confirmations.
|
// TODO: Add in app-notifications / confirmations.
|
||||||
|
|
14
README.md
14
README.md
|
@ -16,31 +16,33 @@ A simple - customizable - Discord Client
|
||||||
|
|
||||||
## What's this ?
|
## What's this ?
|
||||||
[Lightcord](https://lightcord.github.io) is a simple and customizable client for Discord.
|
[Lightcord](https://lightcord.github.io) is a simple and customizable client for Discord.
|
||||||
It includes [BandagedBD](https://github.com/rauenzi/BetterDiscordApp), [Glasstron](https://github.com/AryToNeX/Glasstron) and a discord.js like api.
|
It includes [BandagedBD](https://github.com/rauenzi/BetterDiscordApp), [Glasstron](https://github.com/AryToNeX/Glasstron) and a [discord.js-like api](https://github.com/Lightcord/Lightcord/tree/master/DiscordJS).
|
||||||
|
|
||||||
## Informations
|
## Informations
|
||||||
Lightcord doesn't *patch* Discord with it's content. If it was, Discord would update itself and break the patch. That's why Lightcord is a standalone Discord client. Just grab the latest release version you need, and launch it !
|
Lightcord doesn't *patch* Discord with it's content. If it was, Discord could update itself and break the patch. That's why Lightcord is a standalone Discord client. Just grab the latest release version you need, and launch it !
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
You can download a release from the [releases tab](https://github.com/Lightcord/Lightcord/releases).
|
You can download a release from the [releases tab](https://github.com/Lightcord/Lightcord/releases).
|
||||||
|
|
||||||
If you want to run it from source, follow these instructions:
|
## Running from source
|
||||||
|
Prequeresites: Node.js, NPM
|
||||||
|
To run from source, follow these instructions:
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/Lightcord/Lightcord
|
git clone https://github.com/Lightcord/Lightcord
|
||||||
cd Lightcord
|
cd Lightcord
|
||||||
npm i
|
|
||||||
npm run devInstall
|
npm run devInstall
|
||||||
npm run test
|
npm test
|
||||||
```
|
```
|
||||||
*You will have to do that everytime you pull/clone*
|
*You will have to do that everytime you pull/clone*
|
||||||
<br/>
|
<br/>
|
||||||
Discord will launch next. You can see you have done it right by looking at the icon.
|
Lightcord will launch next. You can see you have done it right by looking at the icon.
|
||||||
![icon](https://github.com/Lightcord/Lightcord/blob/master/imagery/68747470733a2f2f692e696d6775722e636f6d2f72486e73504e4f2e706e67.png?raw=true)
|
![icon](https://github.com/Lightcord/Lightcord/blob/master/imagery/68747470733a2f2f692e696d6775722e636f6d2f72486e73504e4f2e706e67.png?raw=true)
|
||||||
<br />
|
<br />
|
||||||
Then everytime you want to launch it just type in
|
Then everytime you want to launch it just type in
|
||||||
```sh
|
```sh
|
||||||
npm run run
|
npm run run
|
||||||
```
|
```
|
||||||
|
|
||||||
*You can find an experimental linux tutorial in our Discord, or use the AUR*
|
*You can find an experimental linux tutorial in our Discord, or use the AUR*
|
||||||
|
|
||||||
## AUR (unofficial)
|
## AUR (unofficial)
|
||||||
|
|
99
build.js
99
build.js
|
@ -31,16 +31,47 @@ async function main(){
|
||||||
|
|
||||||
async function processNextDir(folder, folders, predicate, compile, ignoreModules){
|
async function processNextDir(folder, folders, predicate, compile, ignoreModules){
|
||||||
if(typeof ignoreModules === "undefined")ignoreModules = false
|
if(typeof ignoreModules === "undefined")ignoreModules = false
|
||||||
for(let file of fs.readdirSync(folder, {withFileTypes: true})){
|
let files = fs.readdirSync(folder, {withFileTypes: true})
|
||||||
|
for(let file of files){
|
||||||
if(file.isFile()){
|
if(file.isFile()){
|
||||||
|
let isMinified = file.name.endsWith(".min.js") || file.name.endsWith(".min.css")
|
||||||
let filepath = path.join(folder, file.name)
|
let filepath = path.join(folder, file.name)
|
||||||
if(predicate(filepath) && filepath.split(/[\\/]+/).reverse()[1] !== "js"){
|
let type = file.name.split(".").pop().toLowerCase()
|
||||||
|
if(type === file.name)type = ""
|
||||||
|
if([
|
||||||
|
"ts",
|
||||||
|
"md",
|
||||||
|
"gitignore"
|
||||||
|
].includes(type)){
|
||||||
|
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because of type ${type}\x1b[0m`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if([
|
||||||
|
"tsconfig.json",
|
||||||
|
"webpack.config.js"
|
||||||
|
].includes(file.name)){
|
||||||
|
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because of name ${file.name}\x1b[0m`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if(folders.exclude && folders.exclude.test(filepath)){
|
||||||
|
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because regex\x1b[0m`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
let hasMinifiedVersion = (type === "js" || type === "css") && !isMinified && files.find(f => {
|
||||||
|
return f.name === file.name.split(".").slice(0, -1).join(".")+".min."+type
|
||||||
|
})
|
||||||
|
if(hasMinifiedVersion){
|
||||||
|
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because it has a minified version.\x1b[0m`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if(!isMinified && predicate(filepath) && filepath.split(/[\\/]+/).reverse()[1] !== "js"){
|
||||||
await compile(filepath, path.join(filepath.replace(folders.startDir, folders.newDir)), "..")
|
await compile(filepath, path.join(filepath.replace(folders.startDir, folders.newDir)), "..")
|
||||||
}else{
|
}else{
|
||||||
await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
|
await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
|
||||||
}
|
}
|
||||||
}else if(file.isDirectory()){
|
}else if(file.isDirectory()){
|
||||||
if(ignoreModules && file.name === "node_modules")continue
|
if(ignoreModules && file.name === "node_modules")continue
|
||||||
|
if(folders.exclude && folders.exclude.test(path.join(folder, file.name)))continue
|
||||||
await fs.promises.mkdir(path.join(folder, file.name).replace(folders.startDir, folders.newDir), {recursive: true})
|
await fs.promises.mkdir(path.join(folder, file.name).replace(folders.startDir, folders.newDir), {recursive: true})
|
||||||
await processNextDir(path.join(folder, file.name), ...Array.from(arguments).slice(1))
|
await processNextDir(path.join(folder, file.name), ...Array.from(arguments).slice(1))
|
||||||
}
|
}
|
||||||
|
@ -61,7 +92,7 @@ async function main(){
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.info(`Copied files and minified them from ${startDir}.`)
|
console.info(`Copied files and minified them from ${startDir}.`)
|
||||||
}).catch(console.error)
|
})
|
||||||
|
|
||||||
await processNextDir(path.join(__dirname, "modules"), {
|
await processNextDir(path.join(__dirname, "modules"), {
|
||||||
startDir: path.join(__dirname, "modules"),
|
startDir: path.join(__dirname, "modules"),
|
||||||
|
@ -94,53 +125,51 @@ async function main(){
|
||||||
|
|
||||||
await processNextDir(path.join(__dirname, "LightcordApi"), {
|
await processNextDir(path.join(__dirname, "LightcordApi"), {
|
||||||
startDir: path.join(__dirname, "LightcordApi"),
|
startDir: path.join(__dirname, "LightcordApi"),
|
||||||
newDir: path.join(__dirname, "distApp", "LightcordApi")
|
newDir: path.join(__dirname, "distApp", "LightcordApi"),
|
||||||
|
exclude: /(src|webpack\.config\.js|tsconfig\.json|dist)/g
|
||||||
}, ((filepath) => filepath.endsWith(".js") && (!production ? !filepath.includes("node_modules") : true)), async (filepath, newpath) => {
|
}, ((filepath) => filepath.endsWith(".js") && (!production ? !filepath.includes("node_modules") : true)), async (filepath, newpath) => {
|
||||||
if(filepath.includes("node_modules"))return // don't minify node_modules, and don't include them at all. Installing later
|
if(filepath.includes("node_modules"))return // don't minify node_modules, and don't include them at all. Installing later
|
||||||
console.info(`Minifying ${filepath} to ${newpath}`)
|
console.info(`Minifying ${filepath} to ${newpath}`)
|
||||||
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
|
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
|
||||||
}).then(() => {
|
}, true).then(() => {
|
||||||
console.info(`Copied files and minified them from ${path.join(__dirname, "LightcordApi")}.`)
|
console.info(`Copied files and minified them from ${path.join(__dirname, "LightcordApi")}.`)
|
||||||
})
|
})
|
||||||
|
|
||||||
await fs.promises.rmdir(path.join(__dirname, "distApp", "LightcordApi", "src"), {"recursive": true})
|
|
||||||
await fs.promises.rmdir(path.join(__dirname, "distApp", "LightcordApi", "dist"), {"recursive": true})
|
|
||||||
await fs.promises.unlink(path.join(__dirname, "distApp", "LightcordApi", "webpack.config.js"))
|
|
||||||
await fs.promises.unlink(path.join(__dirname, "distApp", "LightcordApi", "tsconfig.json"))
|
|
||||||
|
|
||||||
console.log(child_process.execSync("npm install --only=prod", {
|
console.log(child_process.execSync("npm install --only=prod", {
|
||||||
encoding: "binary",
|
encoding: "binary",
|
||||||
cwd: path.join(__dirname, "distApp", "LightcordApi")
|
cwd: path.join(__dirname, "distApp", "LightcordApi")
|
||||||
}))
|
}))
|
||||||
|
|
||||||
await processNextDir(path.join(__dirname, "DiscordJS"), {
|
function processDJS(dir){
|
||||||
startDir: path.join(__dirname, "DiscordJS"),
|
fs.mkdirSync(path.join(__dirname, "distApp", "DiscordJS", dir), {recursive: true})
|
||||||
newDir: path.join(__dirname, "distApp", "DiscordJS")
|
return processNextDir(path.join(__dirname, "DiscordJS", dir), {
|
||||||
}, ((filepath) => filepath.endsWith(".js") && (!production ? !filepath.includes("node_modules") : true)), async (filepath, newpath) => {
|
startDir: path.join(__dirname, "DiscordJS", dir),
|
||||||
if(filepath.includes("node_modules"))return // don't minify node_modules, and don't include them at all
|
newDir: path.join(__dirname, "distApp", "DiscordJS", dir)
|
||||||
console.info(`Minifying ${filepath} to ${newpath}`)
|
}, ((filepath) => filepath.endsWith(".js") && (!production ? !filepath.includes("node_modules") : true)), async (filepath, newpath) => {
|
||||||
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
|
if(filepath.includes("node_modules"))return // don't minify node_modules, and don't include them at all
|
||||||
}).then(() => {
|
console.info(`Minifying ${filepath} to ${newpath}`)
|
||||||
console.info(`Copied files and minified them from ${path.join(__dirname, "DiscordJS")}.`)
|
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
|
||||||
})
|
}).then(() => {
|
||||||
|
console.info(`Copied files and minified them from ${path.join(__dirname, "DiscordJS", dir)}.`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
async function copyFileDJS(file){
|
||||||
|
await fs.promises.writeFile(path.join(__dirname, "distApp", "DiscordJS", file), await fs.promises.readFile(path.join(__dirname, "DiscordJS", file)))
|
||||||
|
}
|
||||||
|
|
||||||
await fs.promises.rmdir(path.join(__dirname, "distApp", "DiscordJS", "src"), {"recursive": true})
|
await processDJS("dist")
|
||||||
await fs.promises.unlink(path.join(__dirname, "distApp", "DiscordJS", "webpack.config.js"))
|
await copyFileDJS("package.json")
|
||||||
await fs.promises.unlink(path.join(__dirname, "distApp", "DiscordJS", "tsconfig.json"))
|
|
||||||
|
|
||||||
console.log(child_process.execSync("npm install --only=prod", {
|
console.log(child_process.execSync("npm install --only=prod", {
|
||||||
encoding: "binary",
|
encoding: "binary",
|
||||||
cwd: path.join(__dirname, "distApp", "LightcordApi")
|
cwd: path.join(__dirname, "distApp", "DiscordJS")
|
||||||
}))
|
}))
|
||||||
|
|
||||||
fs.mkdirSync(path.join(__dirname, "distApp", "BetterDiscordApp", "js"), {recursive: true})
|
fs.mkdirSync(path.join(__dirname, "distApp", "BetterDiscordApp", "dist"), {recursive: true})
|
||||||
fs.mkdirSync(path.join(__dirname, "distApp", "BetterDiscordApp", "css"), {recursive: true})
|
|
||||||
const BDPackageJSON = require("./BetterDiscordApp/package.json")
|
const BDPackageJSON = require("./BetterDiscordApp/package.json")
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "package.json"), JSON.stringify(BDPackageJSON), "utf8")
|
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "package.json"), JSON.stringify(BDPackageJSON), "utf8")
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "css", "main.css"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "css", "main.css")))
|
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "dist", "style.min.css"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "dist", "style.min.css")))
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "css", "main.min.css"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "css", "main.min.css")))
|
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "dist", "index.min.js"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "dist", "index.min.js")))
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "js", "main.js"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "js", "main.js")))
|
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "BetterDiscordApp", "js", "main.min.js"), fs.readFileSync(path.join(__dirname, "BetterDiscordApp", "js", "main.min.js")))
|
|
||||||
|
|
||||||
await fs.promises.mkdir(path.join(__dirname, "distApp", "splash", "videos"), {recursive: true})
|
await fs.promises.mkdir(path.join(__dirname, "distApp", "splash", "videos"), {recursive: true})
|
||||||
await processNextDir(path.join(__dirname, "splash"), {
|
await processNextDir(path.join(__dirname, "splash"), {
|
||||||
|
@ -155,9 +184,11 @@ async function main(){
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.info(`Copied files and minified them from ${path.join(__dirname, "splash")}.`)
|
console.info(`Copied files and minified them from ${path.join(__dirname, "splash")}.`)
|
||||||
})
|
})
|
||||||
|
fs.writeFileSync(path.join(__dirname, "distApp", "LICENSE"), fs.readFileSync(path.join(__dirname, "LICENSE")))
|
||||||
|
|
||||||
let packageJSON = require("./package.json")
|
let packageJSON = require("./package.json")
|
||||||
packageJSON.scripts.build = packageJSON.scripts.build.replace("./distApp", ".")
|
packageJSON.scripts["build:electron_linux"] = packageJSON.scripts["build:electron_linux"].replace("./distApp", ".")
|
||||||
|
packageJSON.scripts["build:electron_win"] = packageJSON.scripts["build:electron_win"].replace("./distApp", ".")
|
||||||
|
|
||||||
fs.writeFileSync(path.join(__dirname, "distApp", "package.json"), JSON.stringify(packageJSON), "utf8")
|
fs.writeFileSync(path.join(__dirname, "distApp", "package.json"), JSON.stringify(packageJSON), "utf8")
|
||||||
|
|
||||||
|
@ -167,4 +198,8 @@ async function main(){
|
||||||
cwd: path.join(__dirname, "distApp")
|
cwd: path.join(__dirname, "distApp")
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
main()
|
main()
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
|
@ -10782,8 +10782,135 @@
|
||||||
var n = new o(e, t);
|
var n = new o(e, t);
|
||||||
return n.setUndoManager(new u), n
|
return n.setUndoManager(new u), n
|
||||||
}, t.EditSession = o, t.UndoManager = u, t.version = "1.2.9"
|
}, t.EditSession = o, t.UndoManager = u, t.version = "1.2.9"
|
||||||
}), define("ace/theme/monokai", ["require", "exports", "module", "ace/lib/dom"], function(e, t, n) {
|
}), define("ace/theme/discord", ["require", "exports", "module", "ace/lib/dom"], function(e, t, n) {
|
||||||
t.isDark = !0, t.cssClass = "ace-monokai", t.cssText = ".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";
|
//TODO: Finish discord theme for custom css.
|
||||||
|
t.isDark = !0, t.cssClass = "ace-discord", t.cssText = `
|
||||||
|
.ace-discord {
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
color: var(--text-normal);
|
||||||
|
border: 1px solid var(--background-floating);
|
||||||
|
border-bottom: none
|
||||||
|
}
|
||||||
|
.ace-discord .ace_gutter {
|
||||||
|
background: var(--background-secondary-alt);
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_print-margin {
|
||||||
|
width: 1px;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_marker-layer .ace_active-line {
|
||||||
|
background: var(--background-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_gutter-active-line {
|
||||||
|
background-color: var(--background-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_text-layer {
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_cursor {
|
||||||
|
color: var(--text-normal)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_marker-layer .ace_selection {
|
||||||
|
background: var(--background-accent)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord.ace_multiselect .ace_selection.ace_start {
|
||||||
|
box-shadow: 0 0 3px 0px var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_marker-layer .ace_step {
|
||||||
|
background: rgb(102, 82, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_marker-layer .ace_bracket {
|
||||||
|
margin: -1px 0 0 -1px;
|
||||||
|
border: 1px solid var(--background-primary)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_marker-layer .ace_selected-word {
|
||||||
|
border: 1px solid var(--background-primary)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_invisible {
|
||||||
|
color: var(--text-muted)
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_entity.ace_name.ace_tag,
|
||||||
|
.ace-discord .ace_keyword,
|
||||||
|
.ace-discord .ace_meta.ace_tag,
|
||||||
|
.ace-discord .ace_storage {
|
||||||
|
color: #F92672
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_punctuation,
|
||||||
|
.ace-discord .ace_punctuation.ace_tag {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_constant.ace_character,
|
||||||
|
.ace-discord .ace_constant.ace_language,
|
||||||
|
.ace-discord .ace_constant.ace_numeric,
|
||||||
|
.ace-discord .ace_constant.ace_other {
|
||||||
|
color: #AE81FF
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_invalid {
|
||||||
|
color: #F8F8F0;
|
||||||
|
background-color: #F92672
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_invalid.ace_deprecated {
|
||||||
|
color: #F8F8F0;
|
||||||
|
background-color: #AE81FF
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_support.ace_constant,
|
||||||
|
.ace-discord .ace_support.ace_function {
|
||||||
|
color: #66D9EF
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_fold {
|
||||||
|
background-color: #A6E22E;
|
||||||
|
border-color: #F8F8F2
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_storage.ace_type,
|
||||||
|
.ace-discord .ace_support.ace_class,
|
||||||
|
.ace-discord .ace_support.ace_type {
|
||||||
|
font-style: italic;
|
||||||
|
color: #66D9EF
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_entity.ace_name.ace_function,
|
||||||
|
.ace-discord .ace_entity.ace_other,
|
||||||
|
.ace-discord .ace_entity.ace_other.ace_attribute-name,
|
||||||
|
.ace-discord .ace_variable {
|
||||||
|
color: #A6E22E
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_variable.ace_parameter {
|
||||||
|
font-style: italic;
|
||||||
|
color: #FD971F
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_string {
|
||||||
|
color: #E6DB74
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_comment {
|
||||||
|
color: #75715E
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace-discord .ace_indent-guide {
|
||||||
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y
|
||||||
|
}`;
|
||||||
var r = e("../lib/dom");
|
var r = e("../lib/dom");
|
||||||
r.importCssString(t.cssText, t.cssClass)
|
r.importCssString(t.cssText, t.cssClass)
|
||||||
}), define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function(e, t, n) {
|
}), define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function(e, t, n) {
|
||||||
|
|
|
@ -7,6 +7,8 @@ const electron = require("electron")
|
||||||
const fetch = require("node-fetch").default
|
const fetch = require("node-fetch").default
|
||||||
const uuid = require("uuid/v4")
|
const uuid = require("uuid/v4")
|
||||||
|
|
||||||
|
const isPackaged = __filename.includes("app.asar")
|
||||||
|
|
||||||
const events = exports.events = new EventEmitter()
|
const events = exports.events = new EventEmitter()
|
||||||
const logger = exports.logger = new Logger("Lightcord")
|
const logger = exports.logger = new Logger("Lightcord")
|
||||||
const appSettings = electron.remote.getGlobal("appSettings")
|
const appSettings = electron.remote.getGlobal("appSettings")
|
||||||
|
@ -157,7 +159,7 @@ async function privateInit(){
|
||||||
|
|
||||||
let constants = ModuleLoader.get(m=>m.API_HOST)[0]
|
let constants = ModuleLoader.get(m=>m.API_HOST)[0]
|
||||||
let dispatcher = ModuleLoader.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default
|
let dispatcher = ModuleLoader.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default
|
||||||
require("../../../../../BetterDiscordApp/dist/style.css")
|
require(formatMinified(path.join(__dirname, "../../../../../BetterDiscordApp/dist/style{min}.css")))
|
||||||
require("./lightcord.css")
|
require("./lightcord.css")
|
||||||
|
|
||||||
function getCurrentHypesquad(){
|
function getCurrentHypesquad(){
|
||||||
|
@ -278,7 +280,7 @@ async function privateInit(){
|
||||||
DiscordNative.ipc.send("UPDATE_THEME", data.settings.theme)
|
DiscordNative.ipc.send("UPDATE_THEME", data.settings.theme)
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lightcordapi/js/main.min.js")
|
require(formatMinified("lightcordapi/js/main{min}.js"))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(shouldShowPrompt){
|
if(shouldShowPrompt){
|
||||||
|
@ -351,7 +353,7 @@ async function privateInit(){
|
||||||
dispatcher.subscribe(constants.ActionTypes.CONNECTION_OPEN || "CONNECTION_OPEN", onConn)
|
dispatcher.subscribe(constants.ActionTypes.CONNECTION_OPEN || "CONNECTION_OPEN", onConn)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
const BetterDiscord = window.BetterDiscord = window.mainCore = new(require("../../../../../BetterDiscordApp/dist/index.js").default)(BetterDiscordConfig, require("./betterdiscord"))
|
const BetterDiscord = window.BetterDiscord = window.mainCore = new(require(formatMinified("../../../../../BetterDiscordApp/dist/index{min}.js")).default)(BetterDiscordConfig, require("./betterdiscord"))
|
||||||
|
|
||||||
const Utils = window.Lightcord.BetterDiscord.Utils
|
const Utils = window.Lightcord.BetterDiscord.Utils
|
||||||
const DOMTools = window.Lightcord.BetterDiscord.DOM
|
const DOMTools = window.Lightcord.BetterDiscord.DOM
|
||||||
|
@ -1069,96 +1071,6 @@ async function privateInit(){
|
||||||
}
|
}
|
||||||
})().catch(console.error.bind(console, `%c[Error Bot shit]`, "color:red"))
|
})().catch(console.error.bind(console, `%c[Error Bot shit]`, "color:red"))
|
||||||
|
|
||||||
|
|
||||||
let usedWebhooks = {}
|
|
||||||
|
|
||||||
ensureExported(e => e && e.Request && e.Request.prototype && e.Request.prototype.end)
|
|
||||||
.then(RequestModule => {
|
|
||||||
console.log("RequestModule", RequestModule)
|
|
||||||
|
|
||||||
const end = RequestModule.Request.prototype.end
|
|
||||||
RequestModule.Request.prototype.end = function(){
|
|
||||||
if(this.url.endsWith("/messages") && /\/channels\/\d+\/messages/g.test(this.url) && this.method === "POST"){ // sending message
|
|
||||||
let channelId = this.url.split("/channels/")[1].split("/messages")[0]
|
|
||||||
|
|
||||||
if(usedWebhooks[channelId]){ // webhook is availlable
|
|
||||||
let webhook = usedWebhooks[channelId]
|
|
||||||
let url = `/webhooks/${webhook.id}/${webhook.token}?wait=true`
|
|
||||||
this.url = url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return end.call(this, ...arguments)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
ensureExported(e => e.default && e.default.displayName === "Webhook")
|
|
||||||
.then(webhookComponent => {
|
|
||||||
const renderEdit = webhookComponent.default.prototype.renderEdit
|
|
||||||
webhookComponent.default.prototype.renderEdit = function(){
|
|
||||||
const webhook = this.props.webhook
|
|
||||||
let returnValue = renderEdit.call(this, ...arguments)
|
|
||||||
returnValue.props.children = [returnValue.props.children]
|
|
||||||
let message = usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id ? "Stop talking with this webhook" : "Talk with this webhook"
|
|
||||||
|
|
||||||
returnValue.props.children.push(React.createElement(window.Lightcord.Api.Components.inputs.Button, {color: "green", wrapper: false, onClick(){
|
|
||||||
if(usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id){
|
|
||||||
delete usedWebhooks[webhook.channel_id]
|
|
||||||
}else{
|
|
||||||
usedWebhooks[webhook.channel_id] = {
|
|
||||||
id: webhook.id,
|
|
||||||
token: webhook.token
|
|
||||||
}
|
|
||||||
}
|
|
||||||
webhookPanels.forEach(e => e())
|
|
||||||
}}, message))
|
|
||||||
|
|
||||||
return returnValue
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
let webhookPanels = []
|
|
||||||
let getComp = (comp) => {
|
|
||||||
class SettingsWebhooks extends React.PureComponent {
|
|
||||||
constructor(props){
|
|
||||||
super(props)
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillMount(){
|
|
||||||
this.id = uuid()
|
|
||||||
this.component = new comp(this.props)
|
|
||||||
let func = () => {
|
|
||||||
this.component.forceUpdate()
|
|
||||||
}
|
|
||||||
func.id = this.id
|
|
||||||
webhookPanels.push(func)
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount(){
|
|
||||||
this.component = null
|
|
||||||
webhookPanels = webhookPanels.filter(e => e.id !== this.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
render(){
|
|
||||||
return this.component.render()
|
|
||||||
}
|
|
||||||
|
|
||||||
static displayName = "SettingsWebhooks"
|
|
||||||
}
|
|
||||||
|
|
||||||
return SettingsWebhooks
|
|
||||||
}
|
|
||||||
ensureExported(e => e.default && e.default.displayName === "FluxContainer(SettingsWebhooks)")
|
|
||||||
.then(webhooksComponents => {
|
|
||||||
let comp = webhooksComponents.default
|
|
||||||
|
|
||||||
webhooksComponents.default = getComp(comp)
|
|
||||||
|
|
||||||
ModuleLoader.get(e => e.default && e.default.displayName === "FluxContainer(FluxContainer(SettingsWebhooks))")
|
|
||||||
.forEach(mod => {
|
|
||||||
mod.default = getComp(mod.default)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Utils.monkeyPatch(await ensureExported(e => e.default && e.default.displayName == "AuthBox"), "default", {after: (data) => {
|
Utils.monkeyPatch(await ensureExported(e => e.default && e.default.displayName == "AuthBox"), "default", {after: (data) => {
|
||||||
const children = Utils.getNestedProp(data.returnValue, "props.children.props.children.props.children")
|
const children = Utils.getNestedProp(data.returnValue, "props.children.props.children.props.children")
|
||||||
children.push(React.createElement(require("./tokenLogin").default, {}))
|
children.push(React.createElement(require("./tokenLogin").default, {}))
|
||||||
|
@ -1347,24 +1259,13 @@ function isBlacklisted(id){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formatLogger = new Logger("RequireFormat")
|
||||||
|
formatLogger.log("The app is", isPackaged ? "packaged." : "not packaged.")
|
||||||
|
function formatMinified(path){
|
||||||
|
let result = path.replace("{min}", isPackaged ? ".min": "")
|
||||||
|
formatLogger.log(`Formatting ${path} into ${result}.`)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.ohgodohfuck = function(){
|
window.ohgodohfuck = function(){
|
||||||
|
|
|
@ -34,7 +34,7 @@ function getSanitizedModulePaths() {
|
||||||
const { mainAppDirname, browserModulePaths } = electron.ipcRenderer.sendSync(NATIVE_MODULES_GET_PATHS);
|
const { mainAppDirname, browserModulePaths } = electron.ipcRenderer.sendSync(NATIVE_MODULES_GET_PATHS);
|
||||||
|
|
||||||
browserModulePaths.forEach(modulePath => {
|
browserModulePaths.forEach(modulePath => {
|
||||||
if (!modulePath.includes('electron.asar')) {
|
if (!modulePath.includes('app.asar')) {
|
||||||
sanitizedModulePaths.push(modulePath);
|
sanitizedModulePaths.push(modulePath);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue