mysterious-toddler-20573
04/26/2022, 10:46 PMgorgeous-airport-54386
04/26/2022, 10:47 PMmysterious-toddler-20573
04/26/2022, 10:56 PMgreen-flower-49070
04/27/2022, 1:58 PMstocky-dentist-80693
04/27/2022, 2:14 PMjs
htmx.onLoad(() => {
let markupGoogleMapsElts = htmx.findAll('.MarkupGoogleMap');
markupGoogleMapsElts.forEach((elt) => {
// Call a custom function here to initialise a map on `elt` with custom options (e.g. from data-* attrs)
// Function contains this to prevent multiple initialisations:
if (elt.getAttribute('loaded')) return;
// And when the map loads:
elt.setAttribute('loaded', true);
});
});green-flower-49070
04/27/2022, 2:19 PMstocky-dentist-80693
04/27/2022, 2:39 PMhtmx.onLoad() is a good place to do that.stocky-dentist-80693
04/27/2022, 2:40 PMlet markupGoogleMapsElts = htmx.findAll('.MarkupGoogleMap'); = look for all elements that have the class "MarkupGoogleMap" on them - these are the elements where maps will be. Put these elements in the list markupGoogleMapsEltsstocky-dentist-80693
04/27/2022, 2:41 PMmarkupGoogleMapsElts.forEach((elt) => { = function process each map element that was foundstocky-dentist-80693
04/27/2022, 2:42 PMnew google.maps.Map(elt, { zoom: 10, center: {} });stocky-dentist-80693
04/27/2022, 2:43 PMgreen-flower-49070
04/27/2022, 2:44 PMgreen-flower-49070
04/27/2022, 2:44 PMstocky-dentist-80693
04/27/2022, 2:48 PMbland-coat-6833
04/27/2022, 5:37 PMhtml
<div hx-sse="connect:get-logs/?logs={{queryId}}">LOGS ARE STARTED
<table>
<thead>
<tr>
<th>Time</th>
<th>Message</th>
</tr>
</thead>
<tbody hx-sse="swap:log" hx-swap="afterbegin">
<tr>
<td>Â </td>
<td>Â </td>
</tr>
</tbody>
</table>
</div>
The SSE events look like this:
html
<tr>
<td>2022-04-26 19:27:18.309</td>
<td>Message</td>
</tr>
It feels like it should work...bland-coat-6833
04/27/2022, 5:39 PMeager-tiger-27508
04/27/2022, 5:40 PMbland-coat-6833
04/27/2022, 5:45 PMbland-coat-6833
04/27/2022, 10:22 PMhx-swap isn't supported though? https://github.com/bigskysoftware/htmx/issues/844icy-analyst-57034
04/27/2022, 11:24 PMsilly-soccer-20915
04/27/2022, 11:28 PMicy-analyst-57034
04/27/2022, 11:32 PMjs
function checkAll() {
var categories = document.getElementsByClassName('category');
for(var i=0; i < categories.length; i++) {
categories[i].checked = true;
}
}mysterious-toddler-20573
04/27/2022, 11:33 PMmysterious-toddler-20573
04/27/2022, 11:34 PMjs
function checkAll() {
var categories = document.getElementsByClassName('category');
for(var i=0; i < categories.length; i++) {
categories[i].checked = true;
}
htmx.trigger("#whateverTheTargetIdIs", "change");
}icy-analyst-57034
04/27/2022, 11:36 PMhtmx.trigger("#whateverTheTargetIdIs") but was missing the change.powerful-eye-47205
04/28/2022, 12:00 AMhx-boost, my title tag gets updated even though only the body is being replace (which is great!). My question is, why does this happen?mysterious-toddler-20573
04/28/2022, 1:32 AMpowerful-eye-47205
04/28/2022, 2:40 AMhx-boost but also cares about SEO and a11y. Please tell me I'm wrong about this. 😬mysterious-toddler-20573
04/28/2022, 2:46 AMpowerful-eye-47205
04/28/2022, 3:10 AM