Skip to content

Commit 92a2e01

Browse files
committed
message colapsing
1 parent 1ab9f68 commit 92a2e01

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

src/webpage/localuser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Localuser {
8585
this.userinfo.localuserStore = e;
8686
}
8787
static users = getBulkUsers();
88-
static async showAccountSwitcher(thisUser: Localuser): Promise<Localuser> {
88+
static async showAccountSwitcher(thisUser: Localuser) {
8989
const table = document.createElement("div");
9090
table.classList.add("flexttb", "accountSwitcher");
9191

@@ -281,6 +281,7 @@ class Localuser {
281281
}
282282
async gottenReady(ready: readyjson): Promise<void> {
283283
await I18n.done;
284+
document.body.style.setProperty("--view-rest", I18n.message.viewrest());
284285
this.initialized = true;
285286
this.ready = ready;
286287
this.guilds = [];

src/webpage/message.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,13 @@ class Message extends SnowFlake {
730730
messagedwrap.classList.add("flexttb");
731731
messagedwrap.appendChild(messaged);
732732
}
733+
text.onclick = () => {
734+
if (text.getBoundingClientRect().height > 950) {
735+
const pop = new Dialog(I18n.message.fullMessage());
736+
pop.float.options.addMDText(this.content);
737+
pop.show();
738+
}
739+
};
733740
}
734741
text.appendChild(messagedwrap);
735742
build.appendChild(text);

src/webpage/style.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,24 @@ span.instanceStatus {
17361736
word-break: break-word;
17371737
gap: 4px;
17381738
width: 100%;
1739+
max-height: 1000px;
1740+
overflow: clip;
1741+
position: relative;
1742+
}
1743+
.commentrow::after {
1744+
content: "View rest";
1745+
position: absolute;
1746+
top: 960px;
1747+
left: 50%;
1748+
transform: translate(-50%, -50%);
1749+
background: var(--secondary-bg);
1750+
padding: 10px;
1751+
border-radius: 4px;
1752+
text-align: center;
1753+
cursor: pointer;
1754+
}
1755+
.commentrow:hover::after {
1756+
background: var(--secondary-hover);
17391757
}
17401758
.fileinputdiv > div {
17411759
width: 64px;

translations/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@
468468
"deleted": "Deleted message",
469469
"attached": "Sent an attachment",
470470
"retry": "Resend errored message",
471-
"pin": "$1 has pinned a message"
471+
"pin": "$1 has pinned a message",
472+
"viewrest": "View rest",
473+
"fullMessage": "Full message:"
472474
},
473475
"instanceStats": {
474476
"name": "Instance stats: $1",

0 commit comments

Comments
 (0)