]> git.mxchange.org Git - friendica.git/blob - view/theme/diabook/bottom.tpl
8eb71b7dd13990d0066b324adadd47a39693135b
[friendica.git] / view / theme / diabook / bottom.tpl
1 <script type="text/javascript" src="$baseurl/view/theme/diabook/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 $(document).ready(function() {
10     $("iframe").each(function(){
11         var ifr_source = $(this).attr("src");
12         var wmode = "wmode=transparent";
13         if(ifr_source.indexOf("?") != -1) {
14             var getQString = ifr_source.split("?");
15             var oldString = getQString[1];
16             var newString = getQString[0];
17             $(this).attr("src",newString+"?"+wmode+"&"+oldString);
18         }
19         else $(this).attr("src",ifr_source+"?"+wmode);
20        
21     });
22       
23         });
24
25         function yt_iframe() {
26
27         $("iframe").load(function() { 
28         var ifr_src = $(this).contents().find("body iframe").attr("src");
29         $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
30     });
31
32         };
33
34         function scrolldown(){
35                         $("html, body").animate({scrollTop:$(document).height()}, "slow");
36                         return false;
37                 };
38                 
39         function scrolltop(){
40                         $("html, body").animate({scrollTop:0}, "slow");
41                         return false;
42                 };
43                 
44         $(window).scroll(function () { 
45                 
46                 var footer_top = $(document).height() - 30;
47                 $("div#footerbox").css("top", footer_top);
48         
49                 var scrollInfo = $(window).scrollTop();      
50                 
51                 if (scrollInfo <= "900"){
52       $("a#top").attr("id","down");
53       $("a#down").attr("onclick","scrolldown()");
54                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
55                 } 
56                     
57       if (scrollInfo > "900"){
58       $("a#down").attr("id","top");
59       $("a#top").attr("onclick","scrolltop()");
60                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
61                 }
62                 
63     });
64   
65
66         function insertFormatting(comment,BBcode,id) {
67         
68                 var tmpStr = $("#comment-edit-text-" + id).val();
69                 if(tmpStr == comment) {
70                         tmpStr = "";
71                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
72                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
73                         openMenu("comment-edit-submit-wrapper-" + id);
74                                                                 }
75
76         textarea = document.getElementById("comment-edit-text-" +id);
77         if (document.selection) {
78                 textarea.focus();
79                 selected = document.selection.createRange();
80                 if (BBcode == "url"){
81                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
82                         } else                  
83                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
84         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
85                 var start = textarea.selectionStart;
86                 var end = textarea.selectionEnd;
87                 if (BBcode == "url"){
88                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
89                         } else
90                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
91         }
92         return true;
93         }
94
95         function cmtBbOpen(id) {
96         $(".comment-edit-bb-" + id).show();
97         }
98         function cmtBbClose(id) {
99         $(".comment-edit-bb-" + id).hide();
100         }
101 </script>