|
18 | 18 |
|
19 | 19 |
|
20 | 20 | <xsl:template name="footer"> |
21 | | - <footer class="text-center"> |
22 | | - <br/><br/> |
23 | | - <p> This document is generated automatically by the <a |
24 | | - href="https://github.com/costezki/model2owl" target="_blank">model2owl tool</a> |
| 21 | + <footer class="text-center mt-5 py-4 border-top"> |
| 22 | + <p class="mb-2"> This document is generated automatically by the <a |
| 23 | + href="https://github.com/costezki/model2owl" target="_blank" class="text-decoration-none">model2owl tool</a> |
25 | 24 | developed in the context of <a |
26 | 25 | href="https://interoperable-europe.ec.europa.eu/collection/eprocurement/solution/eprocurement-ontology">the |
27 | 26 | eProcurement Ontology initiative</a>.</p> |
28 | | - <p>The template of this report is based on the <a |
29 | | - href="https://github.com/thomaspark/pubcss">PubCSS library</a>.</p> |
30 | | - <p>© <xsl:value-of select="f:getMetadataValue('conventionReportCopyrightText')"/></p> |
| 27 | + <p class="mb-2">The template of this report is based on the <a |
| 28 | + href="https://github.com/thomaspark/pubcss" class="text-decoration-none">PubCSS library</a>.</p> |
| 29 | + <p class="mb-0 text-muted">© <xsl:value-of select="f:getMetadataValue('conventionReportCopyrightText')"/></p> |
31 | 30 | </footer> |
32 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> |
33 | 31 |
|
34 | | - <script src="static/js/jquery-3.4.1.min.js"></script> |
35 | | - <script src="static/js/jquery-ui.min.js"></script> |
36 | | - <script src="static/js/bootstrap.min.js"></script> |
37 | | - <script src="static/js/jquery.tocify.min.js"></script> |
38 | | - <script type="text/javascript" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script> |
39 | | - <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.4/js/dataTables.buttons.min.js"></script> |
40 | | - <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.4/js/buttons.print.min.js"></script> |
| 32 | + <!-- Go to top button --> |
| 33 | + <button id="goToTop" class="go-to-top" aria-label="Go to top" title="Go to top"> |
| 34 | + <span>↑</span> |
| 35 | + </button> |
| 36 | + |
| 37 | + <!-- jQuery 3.7.1 --> |
| 38 | + <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> |
| 39 | + |
| 40 | + <!-- Bootstrap 5 JS Bundle --> |
| 41 | + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> |
| 42 | + |
| 43 | + <!-- Tocbot --> |
| 44 | + <script src="https://cdn.jsdelivr.net/npm/tocbot@4.12.3/dist/tocbot.min.js"></script> |
| 45 | + |
| 46 | + <!-- DataTables --> |
| 47 | + <script type="text/javascript" src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script> |
| 48 | + <script type="text/javascript" src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script> |
41 | 49 |
|
42 | 50 | <script> |
43 | | - $(function () { |
44 | | - //Calls the tocify method on your HTML div. |
45 | | - $("#toc").tocify({ |
46 | | - selectors: "h2", |
47 | | - theme: "bootstrap", |
48 | | - hashGenerator: "pretty", |
49 | | - ignoreSelector: ".skip-toc" |
50 | | - }); |
51 | | - }); |
52 | | - |
53 | | - </script> |
54 | | - <script> |
55 | | - $(document).ready(function () { |
56 | | - |
57 | | - $("table.display").DataTable({ |
58 | | - buttons: [], |
59 | | - "lengthMenu": [[-1], ["All"]], |
60 | | - responsive: { |
61 | | - details: true |
62 | | - } |
63 | | - }); |
64 | | - |
| 51 | + <![CDATA[ |
| 52 | + document.addEventListener('DOMContentLoaded', function() { |
| 53 | + // Initialize Tocbot |
| 54 | + if (document.querySelector('.toc')) { |
| 55 | + // Ensure headings have IDs for proper scrolling |
| 56 | + document.querySelectorAll('.content h1, .content h2').forEach(function(heading, index) { |
| 57 | + if (!heading.id) { |
| 58 | + var id = heading.textContent.toLowerCase() |
| 59 | + .replace(/[^\w\s-]/g, '') |
| 60 | + .replace(/\s+/g, '-') |
| 61 | + .replace(/-+/g, '-') |
| 62 | + .trim(); |
| 63 | + if (!id) { |
| 64 | + id = 'heading-' + index; |
| 65 | + } |
| 66 | + heading.id = id; |
| 67 | + } |
| 68 | + }); |
| 69 | + |
| 70 | + tocbot.init({ |
| 71 | + tocSelector: '.toc', |
| 72 | + contentSelector: '.content', |
| 73 | + headingSelector: 'h1, h2', |
| 74 | + smoothScroll: true, |
| 75 | + scrollSmooth: true, |
| 76 | + scrollSmoothDuration: 420, |
| 77 | + scrollSmoothOffset: 20, |
| 78 | + headingsOffset: 20, |
| 79 | + collapseDepth: 0, |
| 80 | + orderedList: false |
| 81 | + }); |
| 82 | + } |
| 83 | + |
| 84 | + // Initialize DataTables |
| 85 | + if (typeof jQuery !== 'undefined' && jQuery.fn.DataTable) { |
| 86 | + jQuery('table.display').each(function() { |
| 87 | + var table = jQuery(this).DataTable({ |
| 88 | + lengthMenu: [[-1], ["All"]], |
| 89 | + pageLength: -1, |
| 90 | + responsive: true, |
| 91 | + order: [], |
| 92 | + language: { |
| 93 | + search: "Search:", |
| 94 | + lengthMenu: "Show _MENU_ entries", |
| 95 | + info: "Showing _START_ to _END_ of _TOTAL_ entries", |
| 96 | + infoEmpty: "No entries to show", |
| 97 | + infoFiltered: "(filtered from _MAX_ total entries)" |
| 98 | + }, |
| 99 | + dom: '<"row"<"col-sm-12 col-md-6"l><"col-sm-12 col-md-6"f>>rt<"row"<"col-sm-12 col-md-5"i><"col-sm-12 col-md-7"p>>' |
| 100 | + }); |
| 101 | + |
| 102 | + // Ensure search input is type="search" for native clear button |
| 103 | + var searchInput = jQuery(this).closest('.dataTables_wrapper').find('.dataTables_filter input'); |
| 104 | + var searchLabel = jQuery(this).closest('.dataTables_wrapper').find('.dataTables_filter label'); |
| 105 | + |
| 106 | + if (searchInput.length) { |
| 107 | + // Force type="search" for all browsers |
| 108 | + searchInput.attr('type', 'search'); |
| 109 | + // For Firefox, ensure the input has the search type attribute |
| 110 | + if (searchInput[0]) { |
| 111 | + searchInput[0].type = 'search'; |
| 112 | + } |
| 113 | + |
| 114 | + // Add custom clear button for Firefox (and as fallback for other browsers) |
| 115 | + var clearButton = jQuery('<span class="custom-clear-button" style="display: none; cursor: pointer; margin-left: 4px; padding: 2px 6px; color: #666; font-size: 16px; line-height: 1; opacity: 0.6;">×</span>'); |
| 116 | + searchInput.after(clearButton); |
| 117 | + |
| 118 | + // Show/hide clear button based on input value |
| 119 | + function toggleClearButton() { |
| 120 | + if (searchInput.val() && searchInput.val().length > 0) { |
| 121 | + clearButton.show(); |
| 122 | + } else { |
| 123 | + clearButton.hide(); |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | + // Initial state |
| 128 | + toggleClearButton(); |
| 129 | + |
| 130 | + // Update on input |
| 131 | + searchInput.on('input keyup', function() { |
| 132 | + toggleClearButton(); |
| 133 | + }); |
| 134 | + |
| 135 | + // Clear button click handler |
| 136 | + clearButton.on('click', function(e) { |
| 137 | + e.preventDefault(); |
| 138 | + e.stopPropagation(); |
| 139 | + searchInput.val(''); |
| 140 | + table.search('').draw(); |
| 141 | + searchInput.focus(); |
| 142 | + clearButton.hide(); |
| 143 | + }); |
| 144 | + |
| 145 | + // Make the entire label clickable to focus the input |
| 146 | + searchLabel.on('click', function(e) { |
| 147 | + // Only focus if clicking on the label, not the input itself |
| 148 | + if (e.target === this || jQuery(e.target).is('label')) { |
| 149 | + searchInput.focus(); |
| 150 | + } |
| 151 | + }); |
| 152 | + |
| 153 | + // Handle clear button click for better browser compatibility |
| 154 | + searchInput.on('search', function() { |
| 155 | + if (this.value === '') { |
| 156 | + table.search('').draw(); |
| 157 | + toggleClearButton(); |
| 158 | + } |
| 159 | + }); |
| 160 | + |
| 161 | + // Also handle input event for immediate clearing |
| 162 | + searchInput.on('input', function() { |
| 163 | + if (this.value === '') { |
| 164 | + table.search('').draw(); |
| 165 | + } |
| 166 | + }); |
| 167 | + } |
| 168 | + }); |
| 169 | + } |
| 170 | + |
| 171 | + // Go to top button functionality |
| 172 | + var goToTopButton = document.getElementById('goToTop'); |
| 173 | + if (goToTopButton) { |
| 174 | + // Show/hide button based on scroll position |
| 175 | + window.addEventListener('scroll', function() { |
| 176 | + if (window.pageYOffset > 300) { |
| 177 | + goToTopButton.style.display = 'flex'; |
| 178 | + } else { |
| 179 | + goToTopButton.style.display = 'none'; |
| 180 | + } |
| 181 | + }); |
| 182 | + |
| 183 | + // Smooth scroll to top on click |
| 184 | + goToTopButton.addEventListener('click', function() { |
| 185 | + window.scrollTo({ |
| 186 | + top: 0, |
| 187 | + behavior: 'smooth' |
| 188 | + }); |
| 189 | + }); |
| 190 | + } |
65 | 191 | }); |
| 192 | + ]]> |
66 | 193 | </script> |
67 | 194 | </xsl:template> |
68 | 195 |
|
|
0 commit comments