]> git.mxchange.org Git - friendica.git/blob - view/theme/dispy/smarty3/bottom.tpl
Implement Smarty3
[friendica.git] / view / theme / dispy / smarty3 / 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 function cmtBbClose(id) {
47     $(".comment-edit-bb-" + id).hide();
48 }
49
50 var doctitle = document.title;
51 function checkNotify() {
52         if(document.getElementById("notify-update").innerHTML != "") {
53                 document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
54         } else {
55                 document.title = doctitle;
56     };
57     setInterval(function () {checkNotify();}, 10 * 1000);
58 }
59
60 $(document).ready(function(){
61 var doctitle = document.title;
62 function checkNotify() {
63 if(document.getElementById("notify-update").innerHTML != "")
64 document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
65 else
66 document.title = doctitle;
67 };
68 setInterval(function () {checkNotify();}, 10 * 1000);
69 })
70
71 </script>