3 $(document).ready(function() {
4 linkPreview = $('#profile-jot-text').linkPreview();
9 * Insert a link into friendica jot.
13 function jotGetLink() {
14 var currentText = $("#profile-jot-text").val();
15 var noAttachment = '';
16 reply = prompt(aStr.linkurl);
17 if(reply && reply.length) {
18 // There should be only one attachment per post.
19 // So we need to remove the old one.
20 $('#jot-attachment-preview').empty();
21 $('#profile-rotator').show();
22 if (currentText.includes("[attachment") && currentText.includes("[/attachment]")) {
23 noAttachment = '&noAttachment=1';
26 // We use the linkPreview library to have a preview
27 // of the attachments.
28 linkPreview.crawlText(reply + noAttachment);
29 autosize.update($("#profile-jot-text"));