]> git.mxchange.org Git - friendica.git/blob - view/head.tpl
more post branch bug fixes
[friendica.git] / view / head.tpl
1 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
2 <base href="$baseurl" />
3 <link rel="stylesheet" type="text/css" href="$baseurl/view/style.css" media="all" />
4
5 <!--[if IE]>
6 <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
7 <![endif]-->
8 <script type="text/javascript" src="$baseurl/include/jquery.js" ></script>
9 <script type="text/javascript" src="$baseurl/include/main.js" ></script>
10
11 <script type="text/javascript">
12
13         var src = null;
14         var prev = null;
15         var livetime = null;
16         var msie = false;
17
18         $(document).ready(function() {
19                 $.ajaxSetup({cache: false});
20                 msie = $.browser.msie ;
21                 NavUpdate(); 
22
23
24
25         });
26
27         function NavUpdate() {
28
29                 if($('#live-network').length) { src = 'network'; liveUpdate(); }
30                 if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
31
32                 $.get("ping",function(data) {
33                         $(data).find('result').each(function() {
34                                 var net = $(this).find('net').text();
35                                 if(net == 0) { net = ''; }
36                                 $('#net-update').html(net);
37                                 var home = $(this).find('home').text();
38                                 if(home == 0) { home = ''; }
39                                 $('#home-update').html(home);
40                                 var mail = $(this).find('mail').text();
41                                 if(mail == 0) { mail = ''; }
42                                 $('#mail-update').html(mail);
43                                 var intro = $(this).find('intro').text();
44                                 if(intro == 0) { intro = ''; }
45                                 $('#notify-update').html(intro);
46                         });
47                 }) ;
48                 setTimeout(NavUpdate,30000);
49
50         }
51
52         function liveUpdate() {
53                 if(src == null) { return; }
54                 if($('.comment-edit-text-full').length) {
55                         livetime = setTimeout(liveUpdate, 10000);
56                         return;
57                 }
58                 prev = 'live-' + src;
59
60                 $.get('update_' + src + '?msie=' + ((msie) ? 1 : 0),function(data) {
61                         $('.wall-item-outside-wrapper',data).each(function() {
62                                 var ident = $(this).attr('id');
63                                 if($('#' + ident).length == 0) { 
64                                         $('#' + prev).after($(this));
65                                 }
66                                 else { 
67                                         $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago')); 
68                                         $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
69                                 }
70                                 prev = ident; 
71                         });
72                 });
73
74         }
75
76         function confirmDelete() { 
77                 return confirm("Delete this item?");
78         }
79
80         function imgbright(node) {
81                 $(node).attr("src",$(node).attr("src").replace('hide','show'));
82                 $(node).css('width',24);
83                 $(node).css('height',24);
84         }
85
86         function imgdull(node) {
87                 $(node).attr("src",$(node).attr("src").replace('show','hide'));
88                 $(node).css('width',16);
89                 $(node).css('height',16);
90         }
91
92
93
94
95
96
97 </script>
98