aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/cleanzero
diff options
context:
space:
mode:
authorChristian Vogeley <christian.vogeley@hotmail.de>2012-04-25 21:08:31 +0200
committerChristian Vogeley <christian.vogeley@hotmail.de>2012-04-25 21:08:31 +0200
commitc0d4e39052c476c3e3da4aa4b5644f2aeeb4fdbf (patch)
tree202af95b9504a4098adc66cf5128bf258f6fd690 /view/theme/cleanzero
parent4c1398c6b152b6ca8ee16d90f622dd11273e58a9 (diff)
downloadvolse-hubzilla-c0d4e39052c476c3e3da4aa4b5644f2aeeb4fdbf.tar.gz
volse-hubzilla-c0d4e39052c476c3e3da4aa4b5644f2aeeb4fdbf.tar.bz2
volse-hubzilla-c0d4e39052c476c3e3da4aa4b5644f2aeeb4fdbf.zip
added BBCODE thing in comments
Diffstat (limited to 'view/theme/cleanzero')
-rw-r--r--view/theme/cleanzero/theme.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/view/theme/cleanzero/theme.php b/view/theme/cleanzero/theme.php
index c710473cb..cc924539e 100644
--- a/view/theme/cleanzero/theme.php
+++ b/view/theme/cleanzero/theme.php
@@ -11,6 +11,44 @@ $a->theme_info = array(
function cleanzero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
<script>
+
+function insertFormatting(comment,BBcode,id) {
+
+ var tmpStr = $("#comment-edit-text-" + id).val();
+ if(tmpStr == comment) {
+ tmpStr = "";
+ $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ $("#comment-edit-text-" + id).val(tmpStr);
+ }
+
+ 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;
+}
+
+function cmtBbOpen(id) {
+ $(".comment-edit-bb-" + id).show();
+}
+function cmtBbClose(comment, id) {
+ $(".comment-edit-bb-" + id).hide();
+}
+
$(document).ready(function() {
$('.group-edit-icon').hover(