]> git.mxchange.org Git - friendica.git/blob - view/theme/diabook/bottom.tpl
diabook-theme: fix in earthlayers
[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
4 $(document).ready(function() {
5     $("iframe").each(function(){
6         var ifr_source = $(this).attr("src");
7         var wmode = "wmode=transparent";
8         if(ifr_source.indexOf("?") != -1) {
9             var getQString = ifr_source.split("?");
10             var oldString = getQString[1];
11             var newString = getQString[0];
12             $(this).attr("src",newString+"?"+wmode+"&"+oldString);
13         }
14         else $(this).attr("src",ifr_source+"?"+wmode);
15        
16     });
17     
18     $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
19     $(".autocomplete").attr("style", "width: 350px;color: black;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
20
21         });
22         
23         $(document).ready(function(){
24                 $("#sortable_boxes").sortable({
25                         update: function(event, ui) {
26                                 var BoxOrder = $(this).sortable("toArray").toString();
27                                 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
28                         }
29                 });
30
31         var cookie = $.cookie("Boxorder");              
32         if (!cookie) return;
33         var SavedID = cookie.split(",");
34            for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
35            $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
36                }
37              
38         });
39         
40         function tautogrow(id){
41                 $("textarea#comment-edit-text-" +id).autogrow();        
42         };
43         
44         function open_boxsettings() {
45                 $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
46                 $("label").attr("style","width: 150px;");
47                 };
48         
49         function yt_iframe() {
50         $("iframe").load(function() { 
51         var ifr_src = $(this).contents().find("body iframe").attr("src");
52         $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
53     });
54
55         };
56
57         function scrolldown(){
58                         $("html, body").animate({scrollTop:$(document).height()}, "slow");
59                         return false;
60                 };
61                 
62         function scrolltop(){
63                         $("html, body").animate({scrollTop:0}, "slow");
64                         return false;
65                 };
66                 
67         $(window).scroll(function () { 
68                 
69                 var footer_top = $(document).height() - 30;
70                 $("div#footerbox").css("top", footer_top);
71         
72                 var scrollInfo = $(window).scrollTop();      
73                 
74                 if (scrollInfo <= "900"){
75       $("a#top").attr("id","down");
76       $("a#down").attr("onclick","scrolldown()");
77                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
78                 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
79                 } 
80                     
81       if (scrollInfo > "900"){
82       $("a#down").attr("id","top");
83       $("a#top").attr("onclick","scrolltop()");
84                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
85                 $("img#scroll_top_bottom").attr("title","Back to top");
86                 }
87                 
88     });
89   
90
91         function insertFormatting(comment,BBcode,id) {
92         
93                 var tmpStr = $("#comment-edit-text-" + id).val();
94                 if(tmpStr == comment) {
95                         tmpStr = "";
96                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
97                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
98                         openMenu("comment-edit-submit-wrapper-" + id);
99                                                                 }
100
101         textarea = document.getElementById("comment-edit-text-" +id);
102         if (document.selection) {
103                 textarea.focus();
104                 selected = document.selection.createRange();
105                 if (BBcode == "url"){
106                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
107                         } else                  
108                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
109         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
110                 var start = textarea.selectionStart;
111                 var end = textarea.selectionEnd;
112                 if (BBcode == "url"){
113                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
114                         } else
115                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
116         }
117         return true;
118         }
119
120         function cmtBbOpen(id) {
121         $(".comment-edit-bb-" + id).show();
122         }
123         function cmtBbClose(id) {
124         $(".comment-edit-bb-" + id).hide();
125         }
126 </script>