Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -N -r1.54.2.37 -r1.54.2.38 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 20 Mar 2024 11:25:49 -0000 1.54.2.37 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 22 Mar 2024 15:06:32 -0000 1.54.2.38 @@ -583,18 +583,6 @@ }] - # - # A chat may be embedded later in the page's lifecycle, e.g. when - # it is extracted from a template. This event will be triggered - # only when the chat became an actual part of the DOM. This means - # we can actually subscribe to the chat. - # - append html [subst { - - }] - set conf [dict create] foreach var {force_login_p login_messages_p logout_messages_p timewindow} { if {[info exists $var]} { @@ -638,13 +626,14 @@ }] # - # This handler will wait for the chat to be appended to the DOM to - # trigger the relevant javascript. + # A chat may be embedded later in the page's lifecycle, e.g. when + # it is extracted from a template. The javascript to subscribe + # should trigger when the markup becomes part of the DOM. # - ::template::head::add_javascript -script [subst -nocommands { - window.addEventListener('xowikichatloaded', () => { - $js - }); + append html [subst { + }] template::add_refresh_on_history_handler