]> git.mxchange.org Git - friendica.git/blob - view/theme/diabook/templates/bottom.tpl
Merge pull request #769 from tomtom84/master
[friendica.git] / view / theme / diabook / templates / 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/diabook/js/jquery.autogrow.textarea.js"></script>
7 <script type="text/javascript">
8
9 $(document).ready(function() {
10     
11     
12     $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
13     $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
14     $(document).keydown(function(event) {
15     if (!$("div#pause").html()){
16     $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
17                 }});  
18     $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
19          
20         });
21         
22         $(document).ready(function(){
23                 $("#sortable_boxes").sortable({
24                         update: function(event, ui) {
25                                 var BoxOrder = $(this).sortable("toArray").toString();
26                                 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
27                         }
28                 });
29
30         var cookie = $.cookie("Boxorder");              
31         if (!cookie) return;
32         var SavedID = cookie.split(",");
33            for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
34            $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
35                }
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         
127         /*$(document).ready(function(){
128         var doctitle = document.title;
129         function checkNotify() {
130         if(document.getElementById("notify-update").innerHTML != "")
131         document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
132         else
133         document.title = doctitle;
134         };
135         setInterval(function () {checkNotify();}, 10 * 1000);
136         })*/
137 </script>
138 <script>
139 var pagetitle = null;
140 $("nav").bind('nav-update',  function(e,data){
141   if (pagetitle==null) pagetitle = document.title;
142   var count = $(data).find('notif').attr('count');
143   if (count>0) {
144     document.title = "("+count+") "+pagetitle;
145   } else {
146     document.title = pagetitle;
147   }
148 });
149 </script>