fixes
This commit is contained in:
parent
00431693ac
commit
c4fa2e86c3
|
@ -394,10 +394,12 @@
|
|||
"Thin": {"props": ["AdvancedScrollerThin", "AdvancedScrollerAuto"], "value": "AdvancedScrollerThin"}
|
||||
}
|
||||
},
|
||||
"SliderMarkerPositions": {"props": ["MarkerPositions"], "value": "MarkerPositions"},
|
||||
"Spinner": {"name": "Spinner"},
|
||||
"Status": {"name": "Status"},
|
||||
"StatusPickerPopout": {"strings": ["\"StatusPickerPopout\""], "value": "default"},
|
||||
"TextElement": {"name": "Text"},
|
||||
"UserBadgeKeys": {"props": ["BadgeKeys"], "value": "BadgeKeys"},
|
||||
"UserBadges": {"props": ["BadgeSizes"]},
|
||||
"UserPopout": {"name": "UserPopoutContainer"},
|
||||
"UserSummaryItem": {"name": "UserSummaryItem"},
|
||||
|
@ -2872,6 +2874,7 @@
|
|||
"searchpopoutselected": ["SearchPopout", "selected"],
|
||||
"searchpopoutuser": ["SearchPopout", "user"],
|
||||
"searchresultschannelname": ["SearchResultsGroup", "channelName"],
|
||||
"searchresultsblocked": ["SearchResultsGroup", "resultsBlocked"],
|
||||
"searchresultsgroup": ["SearchResultsGroup", "searchResultGroup"],
|
||||
"searchresultsmessage": ["SearchResultsMessage", "message"],
|
||||
"searchresultspagination": ["NotFound", "searchResultsPagination"],
|
||||
|
@ -2948,6 +2951,8 @@
|
|||
"slidergrabber": ["Slider", "grabber"],
|
||||
"sliderinput": ["Slider", "input"],
|
||||
"slidermark": ["Slider", "mark"],
|
||||
"slidermarkabove": ["Slider", "markAbove"],
|
||||
"slidermarkbelow": ["Slider", "markBelow"],
|
||||
"slidermarkdash": ["Slider", "markDash"],
|
||||
"slidermarkdashsimple": ["Slider", "markDashSimple"],
|
||||
"slidermarkvalue": ["Slider", "markValue"],
|
||||
|
|
|
@ -91,10 +91,10 @@ module.exports = (_ => {
|
|||
}
|
||||
};
|
||||
|
||||
for (let key of Object.keys(BDFDB.LibraryModules.UserBadgeKeys).filter(n => isNaN(parseInt(n)))) {
|
||||
for (let key of Object.keys(BDFDB.LibraryComponents.UserBadgeKeys).filter(n => isNaN(parseInt(n)))) {
|
||||
let basicKey = key.replace(/_LEVEL_\d+/g, "");
|
||||
if (!this.defaults.badges[basicKey]) this.defaults.badges[basicKey] = {value: true, keys: []};
|
||||
this.defaults.badges[basicKey].keys.push(BDFDB.LibraryModules.UserBadgeKeys[key]);
|
||||
this.defaults.badges[basicKey].keys.push(BDFDB.LibraryComponents.UserBadgeKeys[key]);
|
||||
}
|
||||
|
||||
this.css = `
|
||||
|
@ -397,7 +397,7 @@ module.exports = (_ => {
|
|||
}
|
||||
else for (let key of this.defaults.badges[flag].keys) {
|
||||
let userFlag = flag == "PREMIUM" || flag == "GUILD_BOOSTER" ? 0 : BDFDB.DiscordConstants.UserFlags[flag];
|
||||
let keyName = BDFDB.LibraryModules.UserBadgeKeys[key];
|
||||
let keyName = BDFDB.LibraryComponents.UserBadgeKeys[key];
|
||||
if (userFlag == null && keyName) userFlag = BDFDB.DiscordConstants.UserFlags[keyName] != null ? BDFDB.DiscordConstants.UserFlags[keyName] : BDFDB.DiscordConstants.UserFlags[Object.keys(BDFDB.DiscordConstants.UserFlags).find(f => f.indexOf(keyName) > -1 || keyName.indexOf(f) > -1)];
|
||||
if (userFlag != null) {
|
||||
let id;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @name TimedLightDarkMode
|
||||
* @author DevilBro
|
||||
* @authorId 278543574059057154
|
||||
* @version 1.1.1
|
||||
* @version 1.1.2
|
||||
* @description Adds a Time Slider to the Appearance Settings
|
||||
* @invite Jx3TjNS
|
||||
* @donate https://www.paypal.me/MircoWittrien
|
||||
|
@ -17,7 +17,7 @@ module.exports = (_ => {
|
|||
"info": {
|
||||
"name": "TimedLightDarkMode",
|
||||
"author": "DevilBro",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"description": "Adds a Time Slider to the Appearance Settings"
|
||||
}
|
||||
};
|
||||
|
@ -128,15 +128,17 @@ module.exports = (_ => {
|
|||
if (slider) BDFDB.DOMUtils.toggleClass(slider, BDFDB.disCN.sliderdisabled, !value);
|
||||
}
|
||||
}),
|
||||
BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.slider + BDFDB.disCN.margintop20}${!settings.running ? (" " + BDFDB.disCN.sliderdisabled): ""}"><input type="number" timer="timer1" class="${BDFDB.disCN.sliderinput}" value="${values.timer1}" readonly=""><input type="number" timer="timer2" class="${BDFDB.disCN.sliderinput}" value="${values.timer2}" readonly=""><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCN.slidermark}" style="left:0%;"><div class="${BDFDB.disCN.slidermarkvalue}">00:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 12.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">03:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 25%;"><div class="${BDFDB.disCN.slidermarkvalue}">06:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 37.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">09:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 50%;"><div class="${BDFDB.disCN.slidermarkvalue}">12:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 62.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">15:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 75%;"><div class="${BDFDB.disCN.slidermarkvalue}">18:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 87.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">21:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 100%;"><div class="${BDFDB.disCN.slidermarkvalue}">24:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div></div><div class="${BDFDB.disCN.sliderbar}"><div class="${BDFDB.disCN.sliderbarfill}"></div></div><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer1" style="left: ${values.timer1}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer2" style="left: ${values.timer2}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodedategrabber}" timer="current" style="left: ${this.getPercent(new Date())}%; cursor: help !important; height: 12px; margin-top: -7px;"></div></div></div>`), node => {
|
||||
if (Node.prototype.isPrototypeOf(node)) {
|
||||
slider = node;
|
||||
this.updateSlider(slider, values);
|
||||
BDFDB.ListenerUtils.addToChildren(slider, "mousedown", BDFDB.dotCN._timedlightdarkmodetimergrabber, event => {this.dragSlider(event.currentTarget);});
|
||||
BDFDB.ListenerUtils.addToChildren(slider, "mouseenter", BDFDB.dotCN._timedlightdarkmodedategrabber, event => {this.showCurrentTime(event.currentTarget);});
|
||||
}
|
||||
BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.slider + BDFDB.disCN.margintop20}${!settings.running ? (" " + BDFDB.disCN.sliderdisabled): ""}"><div class="${BDFDB.disCN.slidertrack}">${[["0%", "00:00"], ["12.5%", "03:00"], ["25%", "06:00"], ["37.5%", "09:00"], ["50%", "12:00"], ["62.5%", "15:00"], ["75%", "18:00"], ["87.5%", "21:00"], ["100%", "24:00"]].map(n => `<div class="${BDFDB.disCNS.slidermark + BDFDB.disCN.slidermarkabove}" style="left:${n[0]};"><div class="${BDFDB.disCN.slidermarkvalue}">${n[1]}</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div>`).join("")}</div><div class="${BDFDB.disCN.sliderbar}"><div class="${BDFDB.disCN.sliderbarfill}"></div></div><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer1" style="left: ${values.timer1}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer2" style="left: ${values.timer2}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodedategrabber}" timer="current" style="left: ${this.getPercent(new Date())}%; cursor: help !important; height: 12px; margin-top: -7px;"></div></div></div>`), node => {
|
||||
if (!Node.prototype.isPrototypeOf(node)) return;
|
||||
slider = node;
|
||||
this.updateSlider(slider, values);
|
||||
BDFDB.ListenerUtils.addToChildren(slider, "mousedown", BDFDB.dotCN._timedlightdarkmodetimergrabber, event => this.dragSlider(event.currentTarget));
|
||||
BDFDB.ListenerUtils.addToChildren(slider, "mouseenter", BDFDB.dotCN._timedlightdarkmodedategrabber, event => this.showCurrentTime(event.currentTarget));
|
||||
})
|
||||
]
|
||||
}),
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
|
||||
className: BDFDB.disCNS.margintop20 + BDFDB.disCN.marginbottom8
|
||||
})
|
||||
].flat(10).filter(n => n);
|
||||
}
|
||||
|
@ -186,7 +188,6 @@ module.exports = (_ => {
|
|||
let track = grabber.parentNode;
|
||||
if (BDFDB.DOMUtils.containsClass(track.parentNode, BDFDB.disCN.sliderdisabled)) return;
|
||||
let timer = grabber.getAttribute("timer");
|
||||
let input = track.parentNode.querySelector(`${BDFDB.dotCN.sliderinput}[timer="${timer}"]`);
|
||||
|
||||
BDFDB.DOMUtils.appendLocalStyle("disableTextSelection", `*{user-select: none !important;}`);
|
||||
|
||||
|
@ -208,7 +209,6 @@ module.exports = (_ => {
|
|||
let mouseMove = e => {
|
||||
sY = e.clientX > sMaxX ? sMaxX - sHalfW : (e.clientX < sMinX ? sMinX - sHalfW : e.clientX - sHalfW);
|
||||
value = BDFDB.NumberUtils.mapRange([sMinX - sHalfW, sMaxX - sHalfW], [0, 100], sY);
|
||||
input.value = value;
|
||||
grabber.style.setProperty("left", value + "%");
|
||||
tooltipContent.innerText = this.getTime(value, true);
|
||||
tooltip.update();
|
||||
|
|
Loading…
Reference in New Issue