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