TLDs as a list, use replaceState instead of pushState

parent 5bd6bf59
$(document).ready(function () {
$('#tldTable').DataTable({
"columnDefs": [{
"orderable": false,
"targets": 'no-sort',
}],
// Disable automatic sorting
"sort": false,
// Disable paging
"paging": false,
// Disable search
// https://www.datatables.net/forums/discussion/comment/8369/#Comment_8369
"bFilter": false,
// Disable "showing X to Y of Z entries"
// https://stackoverflow.com/a/19440782
"info": false,
});
});
\ No newline at end of file
......@@ -10,6 +10,6 @@
// console.log(x);
// FIXME: Doesn't work on http (localhost)
history.pushState(x, x.title, x.url)
// FIXME: Doesn't work on plaintext HTTP (localhost)
history.replaceState(x, x.title, x.url)
})();
\ No newline at end of file
......@@ -4,7 +4,6 @@ import isDomainName from "is-domain-name";
import punycode from "punycode";
const { Resolver } = require('dns').promises;
const resolver = new Resolver();
const router: Router = Router();
......
......@@ -5,22 +5,40 @@
<p>The list of domains is provided by the <a href="https://publicsuffix.org/list/">Public Suffix List</a>.</p>
<ul>
{% for domain in domains %}
{% if '.' in domain %}
{# <li><a href="/tld/{{ domain}}">{{ domain }}</a></li></li> #}
{% else %}
<li>
<table class="table" id="tldTable">
<thead>
<tr>
<th scope="col">Domain</th>
<th scope="col">Country code</th>
</tr>
</thead>
<tbody>
{% for domain in domains %}
{% if '.' in domain %}
{% else %}
<tr>
<td data-order="{{ domain|e }}">
<a href="/tld/{{ punycodeToASCII(domain|e) }}">
{{ domain|e }}
</a>
</td>
<td>
{% if domain|length == 2 %}
{{ countryCode(domain, "no", "no") }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% endblock %}
<a href="/tld/{{ punycodeToASCII(domain) }}">
{{ domain }}
</a>
{% if domain|length == 2 %}
{{ countryCode(domain, "no", "yes") }}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% block javascripts %}
{# Datatables #}
<script src="/assets/js/pages/tld/list.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css"/>
<script type="text/javascript" src="/assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment