From 5a0cf6ba824f80eb12bfef94fd63c6b0db831524 Mon Sep 17 00:00:00 2001 From: Brenden Tuck Date: Sat, 13 May 2023 17:05:23 -0400 Subject: [PATCH] BugFix: Restore dynamic class kwarg assignment to goldenlayout-enabled clients --- evennia/web/static/webclient/js/plugins/goldenlayout.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/evennia/web/static/webclient/js/plugins/goldenlayout.js b/evennia/web/static/webclient/js/plugins/goldenlayout.js index f1acec6d94..7957cf3cbc 100644 --- a/evennia/web/static/webclient/js/plugins/goldenlayout.js +++ b/evennia/web/static/webclient/js/plugins/goldenlayout.js @@ -635,7 +635,7 @@ let goldenlayout = (function () { // Add new HTML message to an existing Div pane, while // honoring the pane's updateMethod and scroll state, etc. // - var addMessageToPaneDiv = function (textDiv, message) { + var addMessageToPaneDiv = function (textDiv, message, kwargs) { let atBottom = false; let updateMethod = textDiv.attr("updateMethod"); @@ -644,7 +644,8 @@ let goldenlayout = (function () { } else if ( updateMethod === "append" ) { textDiv.append(message); } else { // line feed - textDiv.append("
" + message + "
"); + var cls = (kwargs === undefined) || (kwargs['cls'] === undefined) ? 'out' : kwargs['cls']; + textDiv.append("
" + message + "
"); } // Calculate the scrollback state. @@ -779,7 +780,7 @@ let goldenlayout = (function () { divs.forEach( function (div) { let txt = args[0]; // yes, so add this text message to the target div - addMessageToPaneDiv( div, txt ); + addMessageToPaneDiv( div, txt, kwargs ); msgHandled = true; });