diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-24 07:23:43 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-24 07:23:43 +0100 |
commit | 2b2723cb74dd74fc449d76f29edd7797b16c7e84 (patch) | |
tree | 23e002e6e22211e3dba7742a4ea50ffc14653f95 /view/tpl | |
parent | 7338649fa54a109122deecc743079eab6b9c1251 (diff) | |
parent | e485ecb3b453a50a1974992b5ccf5122e154a5dc (diff) | |
download | volse-hubzilla-2b2723cb74dd74fc449d76f29edd7797b16c7e84.tar.gz volse-hubzilla-2b2723cb74dd74fc449d76f29edd7797b16c7e84.tar.bz2 volse-hubzilla-2b2723cb74dd74fc449d76f29edd7797b16c7e84.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'view/tpl')
-rwxr-xr-x | view/tpl/jot-header.tpl | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index b405e4ac8..84fccc105 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -190,15 +190,27 @@ function enableOnUser(){ } function jotGetLink() { - reply = prompt("{{$linkurl}}"); - if(reply && reply.length) { - reply = bin2hex(reply); - $('#profile-rotator').spin('tiny'); - $.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) { - addeditortext(data); - $('#profile-rotator').spin(false); - }); - } + textarea = document.getElementById('profile-jot-text'); + if (textarea.selectionStart || textarea.selectionStart == "0") { + var start = textarea.selectionStart; + var end = textarea.selectionEnd; + if (end > start) { + reply = prompt("{{$linkurl}}"); + if(reply && reply.length) { + textarea.value = textarea.value.substring(0, start) + "[url=" + reply + "]" + textarea.value.substring(start, end) + "[/url]" + textarea.value.substring(end, textarea.value.length); + } + } else { + reply = prompt("{{$linkurl}}"); + if(reply && reply.length) { + reply = bin2hex(reply); + $('#profile-rotator').spin('tiny'); + $.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) { + addeditortext(data); + $('#profile-rotator').spin(false); + }); + } + } + } } function jotVideoURL() { |