PageSourceSearch

https://www.fcnantes.com/articles/includes/pagination-news/script.js

js fcnantes.com collected 2026-09-24 22:16:54 UTC 8,012 bytes, 182 lines download raw bytes

1 // Pagination
2        $(document).ready(function(){
3          
4          
5          // Compte combien il y a de page
6          var nbPage = $(".numero-pagination").length;
7          
8            // Si que 3 page affiche pas le dernier saut de page
9            if(nbPage === 3){
10              $(".saut-page-fin").remove();
11            }
12                  
13            $("ul.pagination li a").click(function(){
14                var id = $(this).parent().attr('id');
15                $(".home-news").addClass("not-page");
16                $("#page-" + id).removeClass("not-page");
17            });
18
19          
20            // Click suivant
21            $(".next-pagination a").click(function(){
22                var pagination = parseInt($(".numero-pagination.courant-page").attr('id'));
23                var idPagination = pagination + 1;
24           
25                $(".numero-pagination").removeClass("courant-page");
26                $(".numero-pagination#" + idPagination).addClass("courant-page");
27                $(".home-news").addClass("not-page");
28                $("#page-" + idPagination).removeClass("not-page");
29          
30                if($(".numero-pagination#1").removeClass("courant-page")){
31                    $(".prev-pagination").removeClass("not-pagination");
32                }
33            });
34
35          
36            // Click precedent
37            $(".prev-pagination a").click(function(){
38                var pagination = parseInt($(".numero-pagination.courant-page").attr('id'));
39                var idPagination = pagination - 1;
40                
41                $(".numero-pagination").removeClass("courant-page");
42                $(".numero-pagination#" + idPagination).addClass("courant-page");
43                $(".home-news").addClass("not-page");
44                $("#page-" + idPagination).removeClass("not-page");
45
46                if($(".numero-pagination#1").hasClass("courant-page")){
47                    $(".prev-pagination").addClass("not-pagination");
48                }
49            });
50
51          
52            // Déplace les numéro vers next
53            $(".next-pagination").click(function(){
54                if($(".numero-pagination.courant-page").hasClass("courant-page")){
55                    var suprPrev = $(".numero-pagination.courant-page").prev();
56                  
57                    $(".numero-pagination.courant-page").next().removeClass("not-pagination");
58                    $(suprPrev).prev().addClass("not-pagination");
59                  
60                    if($(".numero-pagination#2").hasClass("courant-page")){
61                        $(".prev-pagination").removeClass("not-pagination");
62                    }
63                }
64            });
65
66          
67            // Déplace les numéro vers prev
68            $(".prev-pagination").click(function(){
69                if($(".numero-pagination.courant-page").hasClass("courant-page")){
70                    var suprNext = $(".numero-pagination.courant-page").next();
71                  
72                    $(".numero-pagination.courant-page").prev().removeClass("not-pagination");
73                  
74                    if($(".numero-pagination#1").hasClass("courant-page")){
75                        $(".prev-pagination").addClass("not-pagination");
76                    }
77                  
78                    $(suprNext).next().addClass("not-pagination");
79                }
80            });
81
82
83            // Click sur chiffres
84            $(".numero-pagination a").click(function(){
85                var choix = parseInt($(this).parent().attr('id'));
86                var courantPage = parseInt($(".numero-pagination.courant-page").attr('id'));
87
88                if(courantPage < choix){
89                    $(".numero-pagination").removeClass("courant-page");
90                    $(".numero-pagination#" + choix).addClass("courant-page");
91                    var prevPrev = $(".numero-pagination.courant-page").prev()
92                    $(prevPrev).prev().addClass("not-pagination");
93                    $(".numero-pagination.courant-page").next().removeClass("not-pagination");
94                    $(".prev-pagination").removeClass("not-pagination");
95
96                } else{
97                    $(".numero-pagination").removeClass("courant-page");
98                    $(".numero-pagination#" + choix).addClass("courant-page");
99                    var nextNext = $(".numero-pagination.courant-page").next()
100                    $(nextNext).next().addClass("not-pagination");
101                    $(".numero-pagination.courant-page").prev().removeClass("not-pagination");
102                }
103            });
104
105          
106            // Regle le premier qui pose soucis
107            $(".pagination").click(function(){
108                if($(".numero-pagination#1").hasClass("courant-page")){
109                    $(".numero-pagination#3").removeClass("not-pagination");
110                    $(".saut-page-un").addClass("not-pagination");
111                }
112            });
113          
114            $(".numero-pagination#1 a").click(function(){
115                $(".prev-pagination").addClass("not-pagination");
116            });
117
118            // Click sur retour debut
119            $(".saut-page-un a").click(function(){
120                $(".numero-pagination").removeClass("courant-page");
121                $(".numero-pagination").addClass("not-pagination");
122                $(".numero-pagination#1").removeClass("not-pagination");
123                $(".numero-pagination#1").addClass("courant-page");
124                $(".numero-pagination#2").removeClass("not-pagination");
125                $(".numero-pagination#3").removeClass("not-pagination");
126                $(".prev-pagination").addClass("not-pagination");
127                $("#page-1").removeClass("not-page");
128            });
129
130            $("ul.pagination li a").click(function(){
131                var idCourant = $(".numero-pagination.courant-page").attr('id');
132              
133                if(nbPage == idCourant){
134                    $(".next-pagination").addClass("not-pagination");
135                } else {
136                    $(".next-pagination").removeClass("not-pagination");
137                }
138            });
139          
140          
141            // Action pour allez a la fin
142            $('.saut-page-fin a').click(function(){
143                var choixLast = parseInt($(this).parent().attr('id'));
144
145                $(".numero-pagination").removeClass("courant-page");
146                $(".numero-pagination").addClass("not-pagination");
147                $(".numero-pagination#" + choixLast).removeClass("not-pagination");
148                $(".numero-pagination#" + choixLast).addClass("courant-page");
149                $(".numero-pagination#" + choixLast).prev().removeClass("not-pagination");
150                $(".next-pagination").addClass("not-pagination");
151                $(".prev-pagination").removeClass("not-pagination");
152                $(".saut-page-fin").addClass("not-pagination");
153            });
154          
155          
156            $('.pagination li a').click(function(){
157                var prevLast = nbPage - 1;
158            
159                // Allez a la fin
160                if($(".numero-pagination#" + nbPage).hasClass("courant-page")){
161                  $(".saut-page-fin").addClass("not-pagination");
162                }
163                else{
164                  $(".saut-page-fin").removeClass("not-pagination");
165                }
166                if($("#" + prevLast).hasClass("courant-page")){
167                  $(".saut-page-fin").addClass("not-pagination");
168                }
169
170                // Retour au debut
171                if($(".numero-pagination#1").hasClass("courant-page")){
172                  $(".saut-page-un").addClass("not-pagination");
173                }
174                else{
175                  $(".saut-page-un").removeClass("not-pagination");
176                }
177                if($("#2").hasClass("courant-page")){
178                  $(".saut-page-un").addClass("not-pagination");
179                }
180            });
181          
182        });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.