]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/templates/jot-header.tpl
Merge pull request #5966 from JeroenED/theme/frio/oembed/view-active-class
[friendica.git] / view / theme / frio / templates / jot-header.tpl
index 81921598ab30fa40f4a6e26174411b9003c7b270..73c7690f6e6e5595290d4f86ceda09c682efa810 100644 (file)
        }
 
        function jotGetLink() {
+               var currentText = $("#profile-jot-text").val();
+               var noAttachment = '';
                reply = prompt("{{$linkurl}}");
                if(reply && reply.length) {
                        reply = bin2hex(reply);
                        $('#profile-rotator').show();
-                       $.get('parse_url?binurl=' + reply, function(data) {
+                       if (currentText.includes("[attachment") && currentText.includes("[/attachment]")) {
+                               noAttachment = '&noAttachment=1';
+                       }
+                       $.get('parse_url?binurl=' + reply + noAttachment, function(data) {
                                addeditortext(data);
                                $('#profile-rotator').hide();
                        });
+                       autosize.update($("#profile-jot-text"));
                }
        }
 
                $("#jot-popup").show();
        }
 
-       function linkdropper(event) {
+       function linkDropper(event) {
                var linkFound = event.dataTransfer.types.contains("text/uri-list");
                if(linkFound)
                        event.preventDefault();
        }
 
-       function linkdrop(event) {
+       function linkDrop(event) {
                var reply = event.dataTransfer.getData("text/uri-list");
+               var noAttachment = '';
                event.target.textContent = reply;
                event.preventDefault();
                if(reply && reply.length) {
                        reply = bin2hex(reply);
                        $('#profile-rotator').show();
-                       $.get('parse_url?binurl=' + reply, function(data) {
+                       if (currentText.includes("[attachment") && currentText.includes("[/attachment]")) {
+                               noAttachment = '&noAttachment=1';
+                       }
+                       $.get('parse_url?binurl=' + reply + noAttachment, function(data) {
                                if (!editor) $("#profile-jot-text").val("");
                                initEditor(function(){
                                        addeditortext(data);
                                        $('#profile-rotator').hide();
                                });
                        });
+                       autosize.update($("#profile-jot-text"));
                }
        }
 
                var currentText = $("#profile-jot-text").val();
                //insert the data as new value
                textfield.value = currentText + data;
+               autosize.update($("#profile-jot-text"));
        }
 
        {{$geotag}}