Adrià Vilanova Martínez | 5af8651 | 2023-12-02 20:44:16 +0100 | [diff] [blame] | 1 | /* (license-header) |
| 2 | * hores |
| 3 | * Copyright (c) 2023 Adrià Vilanova Martínez |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU Affero General Public License as |
| 7 | * published by the Free Software Foundation, either version 3 of the |
| 8 | * License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU Affero General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Affero General Public |
| 16 | * License along with this program. |
| 17 | * If not, see http://www.gnu.org/licenses/. |
| 18 | */ |
Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 19 | window.addEventListener("load", function() { |
| 20 | var datatable = $('.datatable').DataTable({ |
| 21 | paging: false, |
| 22 | ordering: false, |
| 23 | info: false, |
| 24 | searching:true |
| 25 | }); |
| 26 | |
| 27 | document.querySelector("#usuario").addEventListener("input", function(evt) { |
| 28 | this.search(evt.target.value); |
| 29 | this.draw(true); |
| 30 | }.bind(datatable)); |
| 31 | |
| 32 | document.querySelector(".adduser").addEventListener("click", function() { |
| 33 | document.querySelector("#adduser").showModal(); |
| 34 | /* Or dialog.show(); to show the dialog without a backdrop. */ |
| 35 | }); |
| 36 | |
| 37 | document.querySelector(".importcsv").addEventListener("click", function() { |
| 38 | document.querySelector("#importcsv").showModal(); |
| 39 | /* Or dialog.show(); to show the dialog without a backdrop. */ |
| 40 | }); |
| 41 | |
| 42 | document.querySelector(".filter").addEventListener("click", function() { |
| 43 | document.querySelector("#filter").showModal(); |
| 44 | /* Or dialog.show(); to show the dialog without a backdrop. */ |
| 45 | }); |
| 46 | }); |