]> git.mxchange.org Git - friendica.git/blob - view/theme/diabook/templates/bottom.tpl
removed old comment that is no longer true
[friendica.git] / view / theme / diabook / templates / bottom.tpl
1
2 <script type="text/javascript" src="{{$baseurl}}/view/theme/diabook/js/jquery.autogrow.textarea.js"></script>
3 <script type="text/javascript">
4
5 $(document).ready(function() {
6     
7     
8     $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
9     $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
10     $(document).keydown(function(event) {
11     if (!$("div#pause").html()){
12     $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
13                 }});  
14     $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
15          
16         });
17         
18         $(document).ready(function(){
19                 $("#sortable_boxes").sortable({
20                         update: function(event, ui) {
21                                 var BoxOrder = $(this).sortable("toArray").toString();
22                                 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
23                         }
24                 });
25
26         var cookie = $.cookie("Boxorder");              
27         if (!cookie) return;
28         var SavedID = cookie.split(",");
29            for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
30            $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
31                }
32              
33         });
34         
35         
36         function tautogrow(id){
37                 $("textarea#comment-edit-text-" +id).autogrow();        
38         };
39         
40         function open_boxsettings() {
41                 $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
42                 $("label").attr("style","width: 150px;");
43                 };
44         
45         function yt_iframe() {
46         $("iframe").load(function() { 
47         var ifr_src = $(this).contents().find("body iframe").attr("src");
48         $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
49     });
50
51         };
52
53         function scrolldown(){
54                         $("html, body").animate({scrollTop:$(document).height()}, "slow");
55                         return false;
56                 };
57                 
58         function scrolltop(){
59                         $("html, body").animate({scrollTop:0}, "slow");
60                         return false;
61                 };
62                 
63         $(window).scroll(function () { 
64                 
65                 var footer_top = $(document).height() - 30;
66                 $("div#footerbox").css("top", footer_top);
67         
68                 var scrollInfo = $(window).scrollTop();      
69                 
70                 if (scrollInfo <= "900"){
71       $("a#top").attr("id","down");
72       $("a#down").attr("onclick","scrolldown()");
73                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
74                 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
75                 } 
76                     
77       if (scrollInfo > "900"){
78       $("a#down").attr("id","top");
79       $("a#top").attr("onclick","scrolltop()");
80                 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
81                 $("img#scroll_top_bottom").attr("title","Back to top");
82                 }
83                 
84     });
85   
86
87         function insertFormatting(comment,BBcode,id) {
88         
89                 var tmpStr = $("#comment-edit-text-" + id).val();
90                 if(tmpStr == comment) {
91                         tmpStr = "";
92                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
93                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
94                         openMenu("comment-edit-submit-wrapper-" + id);
95                                                                 }
96
97         textarea = document.getElementById("comment-edit-text-" +id);
98         if (document.selection) {
99                 textarea.focus();
100                 selected = document.selection.createRange();
101                 if (BBcode == "url"){
102                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
103                         } else                  
104                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
105         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
106                 var start = textarea.selectionStart;
107                 var end = textarea.selectionEnd;
108                 if (BBcode == "url"){
109                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
110                         } else
111                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
112         }
113         return true;
114         }
115
116         function cmtBbOpen(id) {
117         $(".comment-edit-bb-" + id).show();
118         }
119         function cmtBbClose(id) {
120         $(".comment-edit-bb-" + id).hide();
121         }
122         
123         /*$(document).ready(function(){
124         var doctitle = document.title;
125         function checkNotify() {
126         if(document.getElementById("notify-update").innerHTML != "")
127         document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
128         else
129         document.title = doctitle;
130         };
131         setInterval(function () {checkNotify();}, 10 * 1000);
132         })*/
133 </script>
134 <script>
135 var pagetitle = null;
136 $("nav").bind('nav-update',  function(e,data){
137   if (pagetitle==null) pagetitle = document.title;
138   var count = $(data).find('notif').attr('count');
139   if (count>0) {
140     document.title = "("+count+") "+pagetitle;
141   } else {
142     document.title = pagetitle;
143   }
144 });
145 </script>