]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/InfiniteScroll/infinitescroll.js
Introduced common_location_shared() to check if location sharing is always,
[quix0rs-gnu-social.git] / plugins / InfiniteScroll / infinitescroll.js
1
2 // notices
3 jQuery(document).ready(function($){
4   $('notices_primary').infinitescroll({
5     debug: false,
6     infiniteScroll  : !infinite_scroll_on_next_only,
7     nextSelector    : 'body#public li.nav_next a,'+
8                       'body#all li.nav_next a,'+
9                       'body#showstream li.nav_next a,'+
10                       'body#replies li.nav_next a,'+
11                       'body#showfavorites li.nav_next a,'+
12                       'body#showgroup li.nav_next a,'+
13                       'body#favorited li.nav_next a',
14     loadingImg      : ajax_loader_url,
15     text            : "<em>Loading the next set of posts...</em>",
16     donetext        : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
17     navSelector     : "#pagination",
18     contentSelector : "#notices_primary ol.notices",
19     itemSelector    : "#notices_primary ol.notices > li"
20     },function(){
21         // Reply button and attachment magic need to be set up
22         // for each new notice.
23         // DO NOT run SN.Init.Notices() which will duplicate stuff.
24         $(this).find('.notice').each(function() {
25             SN.U.NoticeReplyTo($(this));
26             SN.U.NoticeWithAttachment($(this));
27         });
28
29         // moving the loaded notices out of their container
30                 $('#infscr-loading').remove();  
31                 var ids_to_append = Array(); var i=0;
32                 $.each($('.infscr-pages').children('.notice'),function(){
33                         
34                         // remove dupes
35                         if($('.threaded-notices > #' + $(this).attr('id')).length > 0) {
36                                 $(this).remove();
37                                 }
38                         
39                         // keep new unique notices
40                         else {
41                                 ids_to_append[i] = $(this).attr('id');                          
42                                 i++;
43                                 }
44                         });
45                 var loaded_html = $('.infscr-pages').html();
46                 $('.infscr-pages').remove();
47
48                 // no results
49                 if(loaded_html == '') { 
50                         }
51                 // append
52                 else {
53                         $('#notices_primary ol.notices').append(loaded_html);
54                         }
55         
56     });
57 });
58
59
60 // users
61 jQuery(document).ready(function($){
62   $('profile_list').infinitescroll({
63     debug: false,
64     infiniteScroll  : !infinite_scroll_on_next_only,
65     nextSelector    : 'body#subscribers li.nav_next a, body#subscriptions li.nav_next a',
66     loadingImg      : ajax_loader_url,
67     text            : "<em>Loading the next set of users...</em>",
68     donetext        : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
69     navSelector     : "#pagination",
70     contentSelector : "#content_inner ul.profile_list",
71     itemSelector    : "#content_inner ul.profile_list > li"
72     },function(){
73         // Reply button and attachment magic need to be set up
74         // for each new notice.
75         // DO NOT run SN.Init.Notices() which will duplicate stuff.
76         $(this).find('.profile').each(function() {
77             SN.U.NoticeReplyTo($(this));
78             SN.U.NoticeWithAttachment($(this));
79         });
80
81         // moving the loaded notices out of their container
82                 $('#infscr-loading').remove();  
83                 var ids_to_append = Array(); var i=0;
84                 $.each($('.infscr-pages').children('.profile'),function(){
85                         
86                         // remove dupes
87                         if($('.profile_list > #' + $(this).attr('id')).length > 0) {
88                                 $(this).remove();
89                                 }
90                         
91                         // keep new unique notices
92                         else {
93                                 ids_to_append[i] = $(this).attr('id');                          
94                                 i++;
95                                 }
96                         });
97                 var loaded_html = $('.infscr-pages').html();
98                 $('.infscr-pages').remove();
99
100                 // no results
101                 if(loaded_html == '') { 
102                         }
103                 // append
104                 else {
105                         $('#content_inner ul.profile_list').append(loaded_html);
106                         }
107         
108     });
109 });
110
111
112 // user directory
113 jQuery(document).ready(function($){
114   $('profile_list').infinitescroll({
115     debug: false,
116     infiniteScroll  : !infinite_scroll_on_next_only,
117     nextSelector    : 'body#userdirectory li.nav_next a',
118     loadingImg      : ajax_loader_url,
119     text            : "<em>Loading the next set of users...</em>",
120     donetext        : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
121     navSelector     : "#pagination",
122     contentSelector : "#profile_directory table.profile_list tbody",
123     itemSelector    : "#profile_directory table.profile_list tbody tr"
124     },function(){
125         // Reply button and attachment magic need to be set up
126         // for each new notice.
127         // DO NOT run SN.Init.Notices() which will duplicate stuff.
128         $(this).find('.profile').each(function() {
129             SN.U.NoticeReplyTo($(this));
130             SN.U.NoticeWithAttachment($(this));
131         });
132
133         // moving the loaded notices out of their container
134                 $('#infscr-loading').remove();  
135                 var ids_to_append = Array(); var i=0;
136                 $.each($('.infscr-pages').children('.profile'),function(){
137                         
138                         // remove dupes
139                         if($('.profile_list > #' + $(this).attr('id')).length > 0) {
140                                 $(this).remove();
141                                 }
142                         
143                         // keep new unique notices
144                         else {
145                                 ids_to_append[i] = $(this).attr('id');                          
146                                 i++;
147                                 }
148                         });
149                 var loaded_html = $('.infscr-pages').html();
150                 $('.infscr-pages').remove();
151
152                 // no results
153                 if(loaded_html == '') { 
154                         }
155                 // append
156                 else {
157                         $('#profile_directory table.profile_list tbody').append(loaded_html);
158                         }
159         
160     });
161 });