]> git.mxchange.org Git - friendica.git/commitdiff
diabook-themes: smal fix in bbcode-js
authortommy tomson <thomas.bierey@gmx.de>
Tue, 10 Apr 2012 13:13:34 +0000 (15:13 +0200)
committertommy tomson <thomas.bierey@gmx.de>
Tue, 10 Apr 2012 13:13:34 +0000 (15:13 +0200)
view/theme/diabook-aerith/theme.php
view/theme/diabook-blue/theme.php
view/theme/diabook-red/theme.php
view/theme/diabook/theme.php

index 1b26e47f834bf07ab861c6f19e02aa96017cc313..c0537b010ce0b5167039ed256c72cd50bd5325fa 100755 (executable)
@@ -526,10 +526,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;
index f63f15fd9756017c57799fa7a26a9fed5f11a4fe..435ecaf92613f7d34e72f4e3471c3a0ffce2578f 100755 (executable)
@@ -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;
index aec3ab95dae5abbf264af7e72a44c0550ddbcdc8..d1b932f1cda0a76e33488d6963f27341c5a51ff8 100755 (executable)
@@ -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;
index bf31c08ebbd56a1f67ec88970b7714693e8e9778..4acb058e54113084396910ce5038c1c886b5ec88 100755 (executable)
@@ -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;