Add: htmx debug extension
This commit is contained in:
parent
aa7bb0b2b0
commit
787ba6d50f
2 changed files with 18 additions and 0 deletions
|
@ -4,4 +4,11 @@
|
||||||
<!-- Core JS Files -->
|
<!-- Core JS Files -->
|
||||||
|
|
||||||
<script src="{% static 'libs/bootstrap/bootstrap.bundle.min.js' %}" type="text/javascript"></script>
|
<script src="{% static 'libs/bootstrap/bootstrap.bundle.min.js' %}" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<!-- Htmx JS & Extentions -->
|
||||||
<script src="{% static 'libs/htmx/htmx.min.js' %}" type="text/javascript"></script>
|
<script src="{% static 'libs/htmx/htmx.min.js' %}" type="text/javascript"></script>
|
||||||
|
|
||||||
|
{% if DEBUG %}
|
||||||
|
<!-- Htmx Debug JS -->
|
||||||
|
<script src="{% static 'libs/htmx/debug.js' %}" type="text/javascript"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
11
archivist/static/libs/htmx/debug.js
Normal file
11
archivist/static/libs/htmx/debug.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
htmx.defineExtension('debug', {
|
||||||
|
onEvent: function (name, evt) {
|
||||||
|
if (console.debug) {
|
||||||
|
console.debug(name, evt);
|
||||||
|
} else if (console) {
|
||||||
|
console.log("DEBUG:", name, evt);
|
||||||
|
} else {
|
||||||
|
throw "NO CONSOLE SUPPORTED"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in a new issue