Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lute/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
<script type="text/javascript" src="{{ url_for('static', filename='vendor/datatables/datatables.button.download.js') }}" charset="utf-8"></script>
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.hoverIntent.js') }}" charset="utf-8"></script>

<script type="importmap">
{
"imports": {
"jquery": "https://esm.sh/jquery@3.6.3",
"datatables.net": "https://cdn.datatables.net/1.13.3/js/jquery.dataTables.min.mjs"
}
}
</script>
<!-- this calls a route defined in app_factory to never cache this file -->
<script type="text/javascript" src="/static/js/never_cache/lute.js" charset="utf-8"></script>

Expand Down
9 changes: 6 additions & 3 deletions lute/templates/book/tablelisting.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@
<form id="actionposter" method="post" action="">
</form>

<script>
<script type="module">
/** Note: jQuery 4 exports are different from 3.6.0. */
import $ from 'jquery';
import DataTable from 'datatables.net';

/* The book listing. */
var book_listing_table;

let setup_book_datatable = function(initial_search) {
book_listing_table = $('#booktable').DataTable({
book_listing_table = new DataTable('#booktable', {
layout: {
topStart: 'pageLength',
topEnd: [
Expand Down Expand Up @@ -273,7 +276,7 @@
"1": 1, "2": 2, "3": 3, "4": 4, "5": 5,
"99": "Well Known or Ignored"
};
ret = `<div class="status-bar-container">`;
let ret = `<div class="status-bar-container">`;
Object.entries(bar_titles).forEach(([key, title]) => {
ret += make_bar(key, title);
});
Expand Down