]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/diabook/theme.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / view / theme / diabook / theme.php
index 924639625e2e10df67bf7b22605e6313955895ca..4acb058e54113084396910ce5038c1c886b5ec88 100755 (executable)
@@ -3,13 +3,13 @@
 /*
  * Name: Diabook
  * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
- * Version: (Version: 1.015)
+ * Version: (Version: 1.016)
  * Author: 
  */
 
 
 //print diabook-version for debugging
-$diabook_version = "Diabook (Version: 1.015)";
+$diabook_version = "Diabook (Version: 1.016)";
 $a->page['htmlhead'] .= sprintf('<script "%s" ></script>', $diabook_version);
 
 //change css on network and profilepages
@@ -519,4 +519,37 @@ function restore_boxes(){
        $.cookie("close_lastlikes","2", { expires: 365, path: "/" });
        alert("Right-hand column was restored. Please refresh your browser");
   }
-</script>';}
\ No newline at end of file
+</script>';}
+
+$a->page['htmlhead'] .= ' 
+
+<script type="text/javascript">
+function insertFormatting(BBcode,id) {
+       
+               var tmpStr = $("#comment-edit-text-" + id).val();
+               if(tmpStr == "Kommentar") {
+                       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);
+                                                                                       }
+
+       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;
+}
+</script> ';
\ No newline at end of file