]> git.mxchange.org Git - friendica.git/blob - view/theme/dispy/bottom.tpl
update jquery to 1.7.2; fix some dispy templates to be more in sync with view/
[friendica.git] / view / theme / dispy / bottom.tpl
1 <script type="text/javascript" src="$baseurl/view/theme/dispy/js/jquery.autogrow.textarea.js"></script>
2 <script type="text/javascript">
3 $(document).ready(function() {
4
5 });
6 function tautogrow(id) {
7         $("textarea#comment-edit-text-" + id).autogrow();
8 };
9
10 function insertFormatting(comment, BBcode, id) {
11         var tmpStr = $("#comment-edit-text-" + id).val();
12         if(tmpStr == comment) {
13                 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         textarea = document.getElementById("comment-edit-text-" + id);
19         if (document.selection) {
20                 textarea.focus();
21                 selected = document.selection.createRange();
22                 if (BBcode == "url") {
23                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
24                 } else {
25                         selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
26                 }
27         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
28                 var start = textarea.selectionStart;
29                 var end = textarea.selectionEnd;
30                 if (BBcode == "url") {
31                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
32                         + "http://" + textarea.value.substring(start, end)
33                         + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
34                 } else {
35                         textarea.value = textarea.value.substring(0, start)
36                         + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
37                         + textarea.value.substring(end, textarea.value.length);
38                 }
39         }
40         return true;
41 }
42
43 function cmtBbOpen(id) {
44         $(".comment-edit-bb-" + id).show();
45 }
46 </script>