]> nmode's Git Repositories - Rnaught/blob - inst/web/www/script.js
Update web app entry point
[Rnaught] / inst / web / www / script.js
1 $(document).ready(() => {
2 // Enable tooltips.
3 $('[data-bs-toggle="tooltip"]').tooltip();
4
5 // Toggle the text in the bulk data help button.
6 $('#data-format-toggle').on('click', event => {
7 btn = $(event.target);
8 show_format = 'Show required format';
9 btn.text(btn.text() === show_format ? 'Hide required format' : show_format);
10 });
11
12 // Trigger the file selector via a custom button.
13 $('#data-upload-select').on('click', () => {
14 $('#data_upload').trigger('click');
15 });
16
17 // Display the name of the uploaded file.
18 $('#data_upload').on('change', event => {
19 $('#data-upload-name').attr('placeholder', event.target.files[0].name);
20 });
21 });