accept urls without scheme
This commit is contained in:
@@ -159,8 +159,11 @@
|
|||||||
});
|
});
|
||||||
document.getElementById('inputForm').addEventListener('submit', function (e) {
|
document.getElementById('inputForm').addEventListener('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const inputValue = document.getElementById('inputField').value;
|
let url = document.getElementById('inputField').value;
|
||||||
window.location.href = '/' + inputValue;
|
if (url.indexOf('http') === -1) {
|
||||||
|
url = 'https://' + url;
|
||||||
|
}
|
||||||
|
window.location.href = '/' + url;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -179,8 +179,11 @@ const html = `
|
|||||||
});
|
});
|
||||||
document.getElementById('inputForm').addEventListener('submit', function (e) {
|
document.getElementById('inputForm').addEventListener('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const inputValue = document.getElementById('inputField').value;
|
let url = document.getElementById('inputField').value;
|
||||||
window.location.href = '/' + inputValue;
|
if (url.indexOf('http') === -1) {
|
||||||
|
url = 'https://' + url;
|
||||||
|
}
|
||||||
|
window.location.href = '/' + url;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user