]> git.mxchange.org Git - friendica.git/blob - view/theme/quattro/js/quattro.js
Merge pull request #13758 from Raroun/frio_More_space_between_photo_permissions_and_s...
[friendica.git] / view / theme / quattro / js / quattro.js
1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
2 $(document).ready(function(){
3         $('nav').bind('nav-update', function(e,data){
4                 var notifCount = $(data).find('notif').attr('count');
5                 var intro = parseInt($(data).find('intro').text());
6                 var mail = parseInt($(data).find('mail').text());
7
8                 $(".tool .notify").removeClass("on");
9                 $(data).find("circle").each(function() {
10                         var gid = this.id;
11                         var gcount = this.innerHTML;
12                         $(".circle-"+gid+" .notify").addClass("on").text(gcount);
13                 });
14
15                 $(".group-widget-entry .notify").removeClass("on");
16                 $(data).find("group").each(function() {
17                         var fid = this.id;
18                         var fcount = this.innerHTML;
19                         $(".group-"+fid+" .notify").addClass("on").text(fcount);
20                 });
21
22                 console.log(intro,mail);
23
24                 if (notifCount > 0 ) {
25                         Tinycon.setBubble(notifCount);
26                 } else {
27                         Tinycon.setBubble('');
28                 }
29
30                 if (intro>0){
31                         $("#nav-introductions-link").addClass("on");
32                 } else {
33                         $("#nav-introductions-link").removeClass("on");
34                 }
35
36                 if (mail>0){
37                         $("#nav-messages-link").addClass("on");
38                 } else {
39                         $("#nav-messages-link").removeClass("on");
40                 }
41
42         });
43
44         /*
45          * show and hide contact action buttons in
46          * contacts page on contacts' checkbox selection
47          */
48         $('.contact-select').bind('click', function(e) {
49                 var y = e.clientY;
50                 var elm = $("#contacts-actions");
51                 y=y-40;
52                 if (y<0) y=0;
53                 if (y+elm.height() > $("html").height()) y=$("html").height()-elm.height();
54                 elm.css('top', y+"px");
55                 if ($(".contact-select:checked").length > 0) {
56                         elm.show();
57                 } else {
58                         elm.hide();
59                 }
60         });
61 });
62
63 function showThread(id) {
64         $("#collapsed-comments-" + id).show()
65         $("#collapsed-comments-" + id + " .collapsed-comments").show()
66 }
67 function hideThread(id) {
68         $("#collapsed-comments-" + id).hide()
69         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
70 }
71
72
73 function cmtBbOpen(id) {
74         $("#comment-edit-bb-" + id).show();
75 }
76 function cmtBbClose(id) {
77         $("#comment-edit-bb-" + id).hide();
78 }
79
80 $(document).ready(function() {
81
82         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
83
84         $('.circle-edit-icon').hover(
85                 function() {
86                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
87                 function() {
88                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
89                 );
90
91         $('.sidebar-circle-element').hover(
92                 function() {
93                         id = $(this).attr('id');
94                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
95
96                 function() {
97                         id = $(this).attr('id');
98                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
99                 );
100
101
102         $('.savedsearchdrop').hover(
103                 function() {
104                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
105                 function() {
106                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
107                 );
108
109         $('.savedsearchterm').hover(
110                 function() {
111                         id = $(this).attr('id');
112                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
113
114                 function() {
115                         id = $(this).attr('id');
116                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
117         );
118
119 });
120
121 // @license-end