aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortommy tomson <thomas.bierey@gmx.de>2012-04-10 15:13:34 +0200
committertommy tomson <thomas.bierey@gmx.de>2012-04-10 15:13:34 +0200
commit6db33fc5138e55f5ae95fe7b24b3e93f8e20408c (patch)
treefc94be368cec02ab56be5339e512c5be5717b68f
parentb3f18945ba3c9596295deccd00789813d7702410 (diff)
downloadvolse-hubzilla-6db33fc5138e55f5ae95fe7b24b3e93f8e20408c.tar.gz
volse-hubzilla-6db33fc5138e55f5ae95fe7b24b3e93f8e20408c.tar.bz2
volse-hubzilla-6db33fc5138e55f5ae95fe7b24b3e93f8e20408c.zip
diabook-themes: smal fix in bbcode-js
-rwxr-xr-xview/theme/diabook-aerith/theme.php6
-rwxr-xr-xview/theme/diabook-blue/theme.php6
-rwxr-xr-xview/theme/diabook-red/theme.php8
-rwxr-xr-xview/theme/diabook/theme.php6
4 files changed, 25 insertions, 1 deletions
diff --git a/view/theme/diabook-aerith/theme.php b/view/theme/diabook-aerith/theme.php
index 1b26e47f8..c0537b010 100755
--- a/view/theme/diabook-aerith/theme.php
+++ b/view/theme/diabook-aerith/theme.php
@@ -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;
diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php
index f63f15fd9..435ecaf92 100755
--- a/view/theme/diabook-blue/theme.php
+++ b/view/theme/diabook-blue/theme.php
@@ -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;
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;
diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php
index bf31c08eb..4acb058e5 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;