mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 09:33:44 +01:00
Allow pasting of forum URLs in input box
This commit is contained in:
parent
692628653c
commit
a25f77ce3c
@ -8,4 +8,17 @@ $(function() {
|
||||
})
|
||||
$(".not_mod, .not_game, .not_txp").show()
|
||||
$(".not_" + $("#type").val().toLowerCase()).hide()
|
||||
|
||||
$("#forums").on('paste', function(e) {
|
||||
try {
|
||||
var pasteData = e.originalEvent.clipboardData.getData('text')
|
||||
var url = new URL(pasteData);
|
||||
if (url.hostname == "forum.minetest.net") {
|
||||
$(this).val(url.searchParams.get("t"));
|
||||
e.preventDefault();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Not a URL");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user