aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/diabook-red/theme.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-10 16:07:05 -0700
committerfriendica <info@friendica.com>2012-04-10 16:07:05 -0700
commit703bfcb6d4bd21e68aaabd5f1b256106c505f0e9 (patch)
treec4fc85a1c8cdacaed03fb358a11a714f4e556e18 /view/theme/diabook-red/theme.php
parent14d68a0dc031b271d26e735160651da52b55d562 (diff)
parent0e97e2338a697141965e74ed3c68f7cd1aff4f7f (diff)
downloadvolse-hubzilla-703bfcb6d4bd21e68aaabd5f1b256106c505f0e9.tar.gz
volse-hubzilla-703bfcb6d4bd21e68aaabd5f1b256106c505f0e9.tar.bz2
volse-hubzilla-703bfcb6d4bd21e68aaabd5f1b256106c505f0e9.zip
Merge https://github.com/friendica/friendica into pull
Diffstat (limited to 'view/theme/diabook-red/theme.php')
-rwxr-xr-xview/theme/diabook-red/theme.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/view/theme/diabook-red/theme.php b/view/theme/diabook-red/theme.php
index aec3ab95d..d1b932f1c 100755
--- a/view/theme/diabook-red/theme.php
+++ b/view/theme/diabook-red/theme.php
@@ -523,15 +523,21 @@ function insertFormatting(BBcode,id) {
$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
openMenu("comment-edit-submit-wrapper-" + id);
}
-
+
textarea = document.getElementById("comment-edit-text-" +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;