aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
committermarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
commit419e3b5024efec40c98e48c3bf213c4e60d39fae (patch)
treed3754aa1d251308eb6178fe4ab138463ceaaf135 /view/js/main.js
parentd7d2fff24b05bcb3ff3acc215e99f8f7d33d058d (diff)
parent0844110f7b154a0fb5102362fe732c2b091222d7 (diff)
downloadvolse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.gz
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.bz2
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.zip
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js
index c8e9fc9a2..44cb79949 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -55,6 +55,8 @@
if(typeof(insertFormatting) != 'undefined')
return(insertFormatting(comment,BBcode,id));
+ var urlprefix = ((BBcode == 'url') ? '#^' : '');
+
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == comment) {
tmpStr = "";
@@ -68,11 +70,11 @@
if (document.selection) {
textarea.focus();
selected = document.selection.createRange();
- selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+ selected.text = urlprefix+"["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
} else if (textarea.selectionStart || textarea.selectionStart == "0") {
var start = textarea.selectionStart;
var end = textarea.selectionEnd;
- textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ textarea.value = textarea.value.substring(0, start) + urlprefix+"["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
}
return true;
}