diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-11-23 15:18:19 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-11-23 15:18:19 -0800 |
commit | bf5c0e0b0d52e30d188713f47ba1e560008abf66 (patch) | |
tree | 5e5a045eea360e67fba5c063cd6a04cc4ed0f146 | |
parent | 167e754a1b1f4dc64661c7cc3746b36ed5df6e52 (diff) | |
parent | 34b804e9dc5c288d133ea81727a0bf73297ddcbf (diff) | |
download | volse-hubzilla-bf5c0e0b0d52e30d188713f47ba1e560008abf66.tar.gz volse-hubzilla-bf5c0e0b0d52e30d188713f47ba1e560008abf66.tar.bz2 volse-hubzilla-bf5c0e0b0d52e30d188713f47ba1e560008abf66.zip |
Merge https://github.com/redmatrix/hubzilla into pending_merge
-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() { |