mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
Merge branch 'chat-css' into 'master'
BETA: Fix the chat logs black border being absent when "preserve chat logs between rooms" is disabled See merge request BondageProjects/Bondage-College!5534
This commit is contained in:
commit
4f86b75eb5
2 changed files with 26 additions and 24 deletions
BondageClub
|
@ -31,7 +31,7 @@
|
|||
}
|
||||
|
||||
.chat-room-sep-header {
|
||||
user-select: all !important;
|
||||
user-select: text !important;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
|
@ -47,6 +47,10 @@
|
|||
margin-block: 0.1em;
|
||||
}
|
||||
|
||||
.chat-room-sep-image > span {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.chat-room-no-copy {
|
||||
user-select: none;
|
||||
}
|
||||
|
@ -362,6 +366,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
#TextAreaChatLog[data-colortheme="dark"] .chat-room-sep-header[data-active] > .chat-room-sep-image,
|
||||
#TextAreaChatLog[data-colortheme="dark2"] .chat-room-sep-header[data-active] > .chat-room-sep-image {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#TextAreaChatLog[data-colortheme="light"] .chat-room-sep-header[data-active] > .chat-room-sep-image,
|
||||
#TextAreaChatLog[data-colortheme="light2"] .chat-room-sep-header[data-active] > .chat-room-sep-image {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#TextAreaChatLog[data-colortheme="dark"] .chat-room-sep-div>.button:active,
|
||||
#TextAreaChatLog[data-colortheme="dark2"] .chat-room-sep-div>.button:active,
|
||||
#TextAreaChatLog[data-colortheme="dark"] .chat-room-sep-div>.button[data-active],
|
||||
|
|
|
@ -90,7 +90,7 @@ var ChatRoomChatLengthLabelRect = /** @type {never} */([1764, 970, 120, 82]);
|
|||
* Default position of the entire chat panel
|
||||
* @type {RectTuple}
|
||||
*/
|
||||
var ChatRoomDivRect = [1005, 60, 988, 940];
|
||||
var ChatRoomDivRect = [1005, 62, 988, 938];
|
||||
|
||||
/**
|
||||
* The last approximate height (_i.e._ {@link HTMLElement.clientHeight} as opposed to {@link DOMRect.height}) of the `InputChat` element.
|
||||
|
@ -913,25 +913,6 @@ var ChatRoomSep = {
|
|||
*/
|
||||
ActiveElem: null,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {(this: HTMLDivElement, event: ClipboardEvent) => void}
|
||||
*/
|
||||
_CopyHeader: function _CopyHeader(ev) {
|
||||
let txt = "";
|
||||
for (const el of this.childNodes) {
|
||||
if (!(el instanceof Element)) {
|
||||
txt += el.textContent;
|
||||
continue;
|
||||
} else if (el.classList.contains("chat-room-no-copy")) {
|
||||
continue;
|
||||
}
|
||||
txt += el.textContent || (el.getAttribute("aria-label") ?? "");
|
||||
}
|
||||
ev.clipboardData.setData("text/plain", txt);
|
||||
ev.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Click event listener for collapsing one or more chat room separators
|
||||
* @private
|
||||
|
@ -979,7 +960,7 @@ var ChatRoomSep = {
|
|||
attributes: { role: "img", "aria-label": InterfaceTextGet(`ChatRoomSpace${button.dataset.space || "F"}`) },
|
||||
classList: ["chat-room-sep-image"],
|
||||
style: { mask: `url(${namespace.src}) center/contain` },
|
||||
eventListeners: { copy: ChatRoomSep._CopyImage },
|
||||
children: [{ tag: "span", children: [InterfaceTextGet(`ChatRoomSpace${button.dataset.space || "F"}`)] }],
|
||||
}),
|
||||
" - ",
|
||||
] : undefined,
|
||||
|
@ -989,7 +970,7 @@ var ChatRoomSep = {
|
|||
attributes: { role: "img", "aria-label": InterfaceTextGet("Private") },
|
||||
classList: ["chat-room-sep-image"],
|
||||
style: { mask: `url(${FriendListIconMapping.Private.src}) center/contain` },
|
||||
eventListeners: { copy: ChatRoomSep._CopyImage },
|
||||
children: [{ tag: "span", children: [InterfaceTextGet("Private")] }],
|
||||
}),
|
||||
" - ",
|
||||
] : undefined,
|
||||
|
@ -1814,7 +1795,14 @@ function ChatRoomStimulationMessage(Action) {
|
|||
function ChatRoomResize(load) {
|
||||
const chatInput = document.getElementById("InputChat");
|
||||
if (chatInput) {
|
||||
ElementPositionFix("chat-room-div", ChatRoomFontSize, ...ChatRoomDivRect);
|
||||
/** @type {RectTuple} */
|
||||
const shape = Player.ChatSettings.PreserveChat ? ChatRoomDivRect : [
|
||||
ChatRoomDivRect[0],
|
||||
ChatRoomDivRect[1] + 3,
|
||||
ChatRoomDivRect[2],
|
||||
ChatRoomDivRect[3] - 3,
|
||||
];
|
||||
ElementPositionFix("chat-room-div", ChatRoomFontSize, ...shape);
|
||||
chatInput.dispatchEvent(new InputEvent("input"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue