X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fdiabook%2Ftheme.php;h=4acb058e54113084396910ce5038c1c886b5ec88;hb=d52dad3826ebed717dc7a9d24ac670cdd33e16f8;hp=bf31c08ebbd56a1f67ec88970b7714693e8e9778;hpb=16c48b220070edc84c4e27bb680498f31066f3ba;p=friendica.git diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index bf31c08ebb..4acb058e54 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -538,10 +538,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;