mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 11:47:28 +01:00
Improve repo and forum topic matching in hints
This commit is contained in:
parent
792488cce1
commit
0f5a97b539
@ -84,10 +84,11 @@ window.addEventListener("load", () => {
|
||||
},
|
||||
"desc_page_topic": (val) => {
|
||||
const topicId = document.getElementById("forums").value;
|
||||
return topicId && val.indexOf(`forum.minetest.net/viewtopic.php?t=${topicId}`) >= 0;
|
||||
const r = new RegExp(`forum\\.minetest\\.net\\/viewtopic\\.php\\?[a-z0-9=&]*t=${topicId}`);
|
||||
return topicId && r.test(val);
|
||||
},
|
||||
"desc_page_repo": (val) => {
|
||||
const repoUrl = document.getElementById("repo").value;
|
||||
const repoUrl = document.getElementById("repo").value.replace(".git", "");
|
||||
return repoUrl && val.indexOf(repoUrl.toLowerCase()) >= 0;
|
||||
},
|
||||
});
|
||||
|
@ -21,7 +21,7 @@
|
||||
<script src="/static/js/polltask.js"></script>
|
||||
<script src="/static/js/package_create.js"></script>
|
||||
{% endif %}
|
||||
<script src="/static/js/package_edit.js?v=2"></script>
|
||||
<script src="/static/js/package_edit.js?v=3"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
Loading…
Reference in New Issue
Block a user