more
This commit is contained in:
parent
4ae08d2c11
commit
d051ac77f7
@ -43,25 +43,26 @@
|
|||||||
<br /><br />
|
<br /><br />
|
||||||
<span id="post_body_{{post.PostHash}}" class="message_span">{{{post.RenderBody}}}</span>
|
<span id="post_body_{{post.PostHash}}" class="message_span">{{{post.RenderBody}}}</span>
|
||||||
{{#post.OP}}
|
{{#post.OP}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var j = fetch("/api/find?hash={{post.PostHash}}").then(function(resp) {
|
var j = fetch("/api/find?hash={{post.PostHash}}").then(function(resp) {
|
||||||
return resp.json();
|
return resp.json();
|
||||||
}).catch(function(resp) {
|
}).catch(function(resp) {
|
||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
if (j.legnth) {
|
console.log(j);
|
||||||
var e = document.getElementById("post_body_{{post.PostHash}}");
|
if (j.legnth) {
|
||||||
if(e) {
|
var e = document.getElementById("post_body_{{post.PostHash}}");
|
||||||
var link = document.createElement("a");
|
if(e) {
|
||||||
var u = new URL(j[0].ReferencedURI);
|
var u = new URL(j[0].ReferencedURI);
|
||||||
if(u.protocol === "https" || u.protocol === "http") {
|
if(u.protocol === "https" || u.protocol === "http") {
|
||||||
link.href = u.toString();
|
var link = document.createElement("a");
|
||||||
link.innerText = "[Link]";
|
link.href = u.toString();
|
||||||
e.appendChild(txt);
|
link.innerText = "[Link]";
|
||||||
|
e.appendChild(txt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</script>
|
||||||
</script>
|
|
||||||
{{/post.OP}}
|
{{/post.OP}}
|
||||||
<br style="clear: both;" />
|
<br style="clear: both;" />
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user