mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 15:14:27 +01:00
Add scrolling messages
This commit is contained in:
@@ -308,16 +308,25 @@
|
||||
dat += "<a class='[class]' href='?src=[UID()];newtitle=[title]'>[label]</a>"
|
||||
|
||||
var/datum/pm_convo/convo = pms[current_title]
|
||||
var/datum/browser/popup = new(user, window_id, "Messages", 1000, 600, src)
|
||||
if(convo)
|
||||
popup.add_head_content(@{"<script type='text/javascript'>
|
||||
window.onload = function () {
|
||||
var msgs = document.getElementById('msgs');
|
||||
msgs.scrollTop = msgs.scrollHeight;
|
||||
}
|
||||
</script>"})
|
||||
convo.read = TRUE
|
||||
dat += "<h2>[check_rights(R_ADMIN, FALSE, user) ? fancy_title(current_title) : current_title]</h2>"
|
||||
dat += "<h4>"
|
||||
dat += "<table style='width:950px; border: 3px solid;'>"
|
||||
dat += "<div id='msgs' style='width:950px; border: 3px solid; overflow-y: scroll; height: 350px;'>"
|
||||
dat += "<table>"
|
||||
|
||||
for(var/message in convo.messages)
|
||||
dat += "<tr><td>[message]</td></tr>"
|
||||
|
||||
dat += "</table>"
|
||||
dat += "</div>"
|
||||
if(convo.typing)
|
||||
dat += "<i><span class='typing'>[current_title] is typing</span></i>"
|
||||
dat += "<br>"
|
||||
@@ -327,7 +336,6 @@
|
||||
if(check_rights(R_ADMIN, FALSE, user))
|
||||
dat += "<a href='?src=[UID()];ping=[current_title]'>Ping</a>"
|
||||
|
||||
var/datum/browser/popup = new(user, window_id, "Messages", 1000, 600, src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
open = TRUE
|
||||
|
||||
Reference in New Issue
Block a user