]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/templates/bottom.tpl
Merge pull request #4160 from annando/community
[friendica.git] / view / theme / smoothly / templates / bottom.tpl
1
2 <script type="text/javascript" src="{{$baseurl}}/view/theme/smoothly/js/jquery.autogrow.textarea.js"></script>
3 <script type="text/javascript">
4 $(document).ready(function() {
5
6 });
7 function tautogrow(id) {
8         $("textarea#comment-edit-text-" + id).autogrow();
9 };
10
11 function insertFormatting(BBcode, id) {
12         var tmpStr = $("#comment-edit-text-" + id).val();
13         if (tmpStr == "") {
14                 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
15                 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
16                 openMenu("comment-edit-submit-wrapper-" + id);
17         }
18
19         textarea = document.getElementById("comment-edit-text-" + id);
20         if (document.selection) {
21                 textarea.focus();
22                 selected = document.selection.createRange();
23                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
24         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
25                 var start = textarea.selectionStart;
26                 var end = textarea.selectionEnd;
27                 textarea.value = textarea.value.substring(0, start)
28                         + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
29                         + textarea.value.substring(end, textarea.value.length);
30         }
31
32         return true;
33 }
34
35 function cmtBbOpen(id) {
36         $(".comment-edit-bb-" + id).show();
37 }
38 function cmtBbClose(id) {
39     $(".comment-edit-bb-" + id).hide();
40 }
41 </script>