]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/smarty3/bottom.tpl
0c6aa29040fef5d2068f7721c69d17f438a76e26
[friendica.git] / view / theme / smoothly / smarty3 / bottom.tpl
1 {{*
2  *      AUTOMATICALLY GENERATED TEMPLATE
3  *      DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
4  *
5  *}}
6 <script type="text/javascript" src="{{$baseurl}}/view/theme/smoothly/js/jquery.autogrow.textarea.js"></script>
7 <script type="text/javascript">
8 $(document).ready(function() {
9
10 });
11 function tautogrow(id) {
12 $("textarea#comment-edit-text-" + id).autogrow();
13 };
14
15 function insertFormatting(comment, BBcode, id) {
16 var tmpStr = $("#comment-edit-text-" + id).val();
17 if(tmpStr == comment) {
18 tmpStr = "";
19 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
20 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
21 openMenu("comment-edit-submit-wrapper-" + id);
22 }
23 textarea = document.getElementById("comment-edit-text-" + id);
24 if (document.selection) {
25 textarea.focus();
26 selected = document.selection.createRange();
27 if (BBcode == "url") {
28 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
29 } else {
30 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
31 }
32 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
33 var start = textarea.selectionStart;
34 var end = textarea.selectionEnd;
35 if (BBcode == "url") {
36 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
37 + "http://" + textarea.value.substring(start, end)
38 + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
39 } else {
40 textarea.value = textarea.value.substring(0, start)
41 + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
42 + textarea.value.substring(end, textarea.value.length);
43 }
44 }
45 return true;
46 }
47
48 function cmtBbOpen(id) {
49 $(".comment-edit-bb-" + id).show();
50 }
51 function cmtBbClose(id) {
52     $(".comment-edit-bb-" + id).hide();
53 }
54
55
56
57 </script>