mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-27 03:41:21 +01:00
changes
This commit is contained in:
23
app/templates/includes/scripts/hyperscript/hide_amount.html
Normal file
23
app/templates/includes/scripts/hyperscript/hide_amount.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior hide_amounts
|
||||
on load or htmx:afterSwap if I include #settings-hide-amounts
|
||||
set elements to <.amount/> in me
|
||||
for el in elements
|
||||
set el.textContent to '•••••••••••'
|
||||
end
|
||||
end
|
||||
|
||||
on load or htmx:afterSwap if I do not include #settings-hide-amounts
|
||||
set elements to <.amount/> in me
|
||||
for el in elements
|
||||
set el.textContent to el.dataset.originalValue
|
||||
end
|
||||
end
|
||||
|
||||
on click[target matches .amount] if I include #settings-hide-amounts
|
||||
if event.target do not matches .revealed then set event.target.textContent to event.target.dataset.originalValue
|
||||
else set event.target.textContent to '•••••••••••' end
|
||||
then toggle .revealed on event.target
|
||||
end
|
||||
end
|
||||
</script>
|
||||
@@ -0,0 +1,8 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior htmx_error_handler
|
||||
on htmx:responseError or htmx:afterRequest[detail.failed] remove .invisible .visually-hidden .swing-in-top-fwd from
|
||||
#loading-error then log event
|
||||
on htmx:afterRequest[detail.successful] add .invisible .visually-hidden .swing-in-top-fwd to #loading-error then
|
||||
log 'oi'
|
||||
end
|
||||
</script>
|
||||
@@ -1,24 +0,0 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior initTomSelect
|
||||
init
|
||||
set selectmultiple to .selectmultiple in me
|
||||
set select to .select in me
|
||||
set selectcsv to .csvselect in me
|
||||
for x in selectmultiple
|
||||
js(it)
|
||||
new TomSelect(it, tomselect_multiple)
|
||||
end
|
||||
end
|
||||
for x in select
|
||||
js(it)
|
||||
new TomSelect(it, tomselect_single)
|
||||
end
|
||||
end
|
||||
for x in selectcsv
|
||||
js(it)
|
||||
new TomSelect(it, tomselect_single)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior init_tom_select
|
||||
init
|
||||
set selects to <select/> in me
|
||||
for x in selects
|
||||
js(it)
|
||||
TomSelect(it)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
</script>
|
||||
6
app/templates/includes/scripts/hyperscript/toast.html
Normal file
6
app/templates/includes/scripts/hyperscript/toast.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior toast
|
||||
on mouseenter call bootstrap.Tooltip.getOrCreateInstance(me).show() end
|
||||
on mouseleave or click call bootstrap.Tooltip.getOrCreateInstance(me).dispose() end
|
||||
end
|
||||
</script>
|
||||
Reference in New Issue
Block a user