mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-24 18:31:26 +01:00
feat: add actions
This commit is contained in:
16
app/templates/includes/scripts/hyperscript/sounds.html
Normal file
16
app/templates/includes/scripts/hyperscript/sounds.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<script type="text/hyperscript">
|
||||
on paid if body do not include #settings-mute-sound
|
||||
js
|
||||
paidSound.pause()
|
||||
paidSound.currentTime = 0
|
||||
paidSound.play()
|
||||
end
|
||||
end
|
||||
on unpaid if body do not include #settings-mute-sound
|
||||
js
|
||||
unpaidSound.pause()
|
||||
unpaidSound.currentTime = 0
|
||||
unpaidSound.play()
|
||||
end
|
||||
end
|
||||
</script>
|
||||
@@ -1,6 +1,18 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior tooltip
|
||||
on mouseenter call bootstrap.Tooltip.getOrCreateInstance(me).show() end
|
||||
on mouseleave call bootstrap.Tooltip.getOrCreateInstance(me).dispose() end
|
||||
def initTooltips
|
||||
-- Destroy existing tooltips
|
||||
for tooltipTriggerEl in <[data-bs-toggle="tooltip"]/>
|
||||
call bootstrap.Tooltip.getOrCreateInstance(tooltipTriggerEl).dispose()
|
||||
end
|
||||
|
||||
-- Initialize new tooltips
|
||||
for tooltipTriggerEl in <[data-bs-toggle="tooltip"]/>
|
||||
call bootstrap.Tooltip.getOrCreateInstance(tooltipTriggerEl)
|
||||
end
|
||||
end
|
||||
|
||||
-- Initialize tooltips on page load
|
||||
on load or htmx:afterSettle
|
||||
call initTooltips()
|
||||
end
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user