]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/js/textedit.js
Merge pull request #7 from ben-utzer/patch-3
[friendica.git] / view / theme / frio / js / textedit.js
index bbbd8fde860a12832b9518d625a647fae580de0a..2079c20cdc40a12080da8546045253ecf25a42af 100644 (file)
@@ -15,19 +15,11 @@ 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+"]";
-               }
+               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);
-               }
+               textarea.value = textarea.value.substring(0, start) + "[" + BBcode + "]" + textarea.value.substring(start, end) + "[/" + BBcode + "]" + textarea.value.substring(end, textarea.value.length);
        }
 
        $(textarea).trigger('change');