X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fdiabook-blue%2Ftheme.php;h=435ecaf92613f7d34e72f4e3471c3a0ffce2578f;hb=a1d5026abf129fc520327881a293d17c1ab21eff;hp=f63f15fd9756017c57799fa7a26a9fed5f11a4fe;hpb=0fd05171d00449d81d060c293dfa0fc7ce814515;p=friendica.git diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index f63f15fd97..435ecaf926 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -527,10 +527,16 @@ function insertFormatting(BBcode,id) { if (document.selection) { textarea.focus(); selected = document.selection.createRange(); + if (BBcode == "url"){ + selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; + } else selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; } else if (textarea.selectionStart || textarea.selectionStart == "0") { var start = textarea.selectionStart; var end = textarea.selectionEnd; + if (BBcode == "url"){ + textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); + } else textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); } return true;