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