From f7604b2e750bab3d8ccdd8b241c0cba05a6ac490 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 19 Apr 2020 18:31:54 +0200 Subject: add text centering --- webAO/client.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 54458e5..1913d71 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1667,6 +1667,14 @@ async changeBackground(position) { this.blipChannels.forEach(channel => channel.src = `${AO_HOST}sounds/general/sfx-blip${encodeURI(this.chatmsg.blips.toLowerCase())}.wav`); + // process markup + if(this.chatmsg.content.startsWith("~~")) { + chatBoxInner.style.textAlign = "center"; + this.chatmsg.content = this.chatmsg.content.substring(2, this.chatmsg.content.length); + } else { + chatBoxInner.style.textAlign = "initial"; + } + this.tick(); } -- cgit