mysterious-toddler-20573
12/12/2020, 7:44 PMmysterious-toddler-20573
12/12/2020, 7:44 PMfuture-boots-43048
12/12/2020, 7:45 PMmysterious-toddler-20573
12/12/2020, 7:45 PMmysterious-toddler-20573
12/12/2020, 7:45 PMfuture-boots-43048
12/12/2020, 7:45 PMmysterious-toddler-20573
12/12/2020, 7:45 PMfuture-boots-43048
12/12/2020, 7:45 PMfuture-boots-43048
12/12/2020, 7:46 PMfuture-boots-43048
12/12/2020, 7:52 PMindex.html:6 GET http://localhost:8000/node_modules/mocha/mocha.css net::ERR_ABORTED 404 (File not found)
index.html:61 GET http://localhost:8000/node_modules/chai/chai.js net::ERR_ABORTED 404 (File not found)
index.html:62 GET http://localhost:8000/node_modules/mocha/mocha.js net::ERR_ABORTED 404 (File not found)
index.html:63 GET http://localhost:8000/node_modules/sinon/pkg/sinon.js net::ERR_ABORTED 404 (File not found)
future-boots-43048
12/12/2020, 7:54 PMfuture-boots-43048
12/12/2020, 8:08 PMmysterious-toddler-20573
12/12/2020, 8:12 PMfuture-boots-43048
12/12/2020, 9:16 PMfuture-boots-43048
12/12/2020, 9:16 PMfuture-boots-43048
12/12/2020, 9:17 PMmysterious-toddler-20573
12/12/2020, 9:50 PMfuture-boots-43048
12/12/2020, 10:00 PMfuture-boots-43048
12/12/2020, 10:01 PMfuture-boots-43048
12/12/2020, 10:02 PMfuture-boots-43048
12/12/2020, 10:47 PMmysterious-toddler-20573
12/12/2020, 11:16 PMmysterious-toddler-20573
12/12/2020, 11:16 PMfuture-boots-43048
12/12/2020, 11:18 PMfuture-boots-43048
12/12/2020, 11:19 PMfuture-boots-43048
12/12/2020, 11:19 PM# -----------------------------------------------------------------------------
def sse_swapping_streamer(list_id_ui, **kwargs):
"""
Return a list of divs that display a 'live view' of the given resources.
Requires the containing branch
in the DOM to be subscribed to
SSE (Server Side Event) updates
for the specified resource.
"""
list_tag = []
for id_ui in list_id_ui:
tag_div = xact.lib.ui.web.markup.html.div(
data_hx_sse = 'swap:{id}'.format(id = id_ui),
data_hx_trigger = 'load',
data_hx_get = '/{id}'.format(id = id_ui),
**kwargs)
list_tag.append(tag_div)
return list_tag
future-boots-43048
12/12/2020, 11:19 PMfuture-boots-43048
12/12/2020, 11:19 PM# -----------------------------------------------------------------------------
def sse_callback_streamer(id_res, js_callback, **kwargs):
"""
Return a divs for scripted display of the given resources.
"""
name_fcn = 'window.xact_{id}'.format(id = id_res)
tag_script = xact.lib.ui.web.markup.html.inline_script(
'{fcn} = {js}'.format(fcn = name_fcn,
js = js_callback))
tag_div = xact.lib.ui.web.markup.html.div(
id = id_res,
data_hx_trigger = 'sse:{id}'.format(id = id_res),
data_hx_sse = 'listen:{id}'.format(id = id_res),
data_script = 'on {evt} call {fcn}({args})'.format(
evt = 'htmx:sseMessage',
fcn = name_fcn,
args = '(event)'))
return (tag_script, tag_div)
future-boots-43048
12/12/2020, 11:20 PMfuture-boots-43048
12/12/2020, 11:20 PM