share on fediverse: minimal checks on instance url
This commit is contained in:
parent
8e03f9d453
commit
cc8ade35b9
|
@ -28,11 +28,16 @@
|
||||||
return 'https://' + url;
|
return 'https://' + url;
|
||||||
}
|
}
|
||||||
function shareOnFedi() {
|
function shareOnFedi() {
|
||||||
let instance = fixURL(fediInstanceInput.value);
|
let instance = fediInstanceInput.value.trim();
|
||||||
|
if (!instance) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
instance = fixURL(instance);
|
||||||
window.open(
|
window.open(
|
||||||
`${instance}/share?text=${articleTitle}%20${articleLink}`,
|
`${instance}/share?text=${articleTitle}%20${articleLink}`,
|
||||||
'__blank'
|
'__blank'
|
||||||
);
|
);
|
||||||
|
closeFediInstanceDialog();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue