Files
packager/js/app.js

20 lines
557 B
JavaScript
Raw Permalink Normal View History

2023-08-29 21:33:59 +02:00
window.onload = function() {
document.body.addEventListener('htmx:responseError', function(evt) {
2023-08-29 21:33:59 +02:00
console.log(evt.detail);
2023-08-29 21:33:59 +02:00
});
2023-08-29 21:33:59 +02:00
document.dispatchEvent(new Event("loaded"));
2023-08-29 21:33:59 +02:00
};
2023-08-29 21:33:59 +02:00
function is_positive_integer(val) {
return /^\d+$/.test(val);
}
2023-08-29 21:34:00 +02:00
function inventory_new_item_check_input() {
return document.getElementById('new-item-name').value.length != 0
&& is_positive_integer(document.getElementById('new-item-weight').value)
}
function check_weight() {
return document.getElementById('new-item-weight').validity.valid;
}