@osimatic/helpers-js 1.1.77 → 1.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/paging.js CHANGED
@@ -1,279 +1,279 @@
1
- // Fonction commune de pagination
2
- //Bootstrap class pagination https://getbootstrap.com/docs/3.3/components/#pagination
3
-
4
- class Pagination {
5
- static paginateCards(div, nbItemsPerPage, doublePagination) {
6
- Pagination.paginate(div, div.find('.pagination_item'), nbItemsPerPage, undefined, doublePagination);
7
- }
8
-
9
- static paginateTable(table, select, doublePagination) {
10
- Pagination.paginate(table, table.find('tbody tr:not(.hide)'), parseInt(table.data('max_rows')), select, doublePagination);
11
- }
12
-
13
- static paginate(div, items, nbItemsPerPage, select, doublePagination) {
14
- let maxItems = nbItemsPerPage;
15
-
16
- if (typeof div == 'undefined' || !div.length) {
17
- return;
18
- }
19
-
20
- if (typeof select != 'undefined' && select.length) {
21
- if (!select.children().length) {
22
- select.append('<option value="0">'+labelDisplayAll+'</option>');
23
- let nbRowsList = select.data('nb_rows_list') ? select.data('nb_rows_list').split(',') : [5, 10, 25, 50];
24
- $.each(nbRowsList, function(idx, nbRows) {
25
- select.append('<option value="'+nbRows+'">'+nbRows+'</option>');
26
- });
27
-
28
- if (select.data('default_nb_rows')) {
29
- select.val(select.data('default_nb_rows'))
30
- }
31
- }
32
-
33
- maxItems = parseInt(select.val());
34
-
35
- select.change(update);
36
- }
37
-
38
- const ulPagination = $('ul.pagination');
39
- if (doublePagination) {
40
- ulPagination.each((index, ul) => $(ul).remove());
41
- Pagination.initPaginationDiv(div, ulPagination, true, true); //top
42
- Pagination.initPaginationDiv(div, ulPagination, false, true); //bottom
43
- } else {
44
- Pagination.initPaginationDiv(div, ulPagination, false, false); //bottom
45
- }
46
-
47
- Pagination.initPaginationItems(items, maxItems, doublePagination);
48
- }
49
-
50
- static initPaginationDiv(div, ulDiv, onTop, doublePagination) {
51
- if (!ulDiv.length || doublePagination) {
52
- ulDiv = $('<ul class="pagination"></ul>');
53
- if (div.find('.pagination_links').length) {
54
- (onTop ? div.find('.pagination_links').prepend(ulDiv) : div.find('.pagination_links').append(ulDiv))
55
- } else {
56
- (onTop ? div.before(ulDiv) : div.after(ulDiv));
57
- }
58
- }
59
- }
60
-
61
- static initPaginationItems(items, maxItems, doublePagination) {
62
- const paginationUl = $('ul.pagination');
63
-
64
- let totalItems = items.length;
65
-
66
- let lineNum = 0;
67
- items.each(function () {
68
- lineNum++;
69
- if (0 === maxItems || lineNum <= maxItems) {
70
- $(this).show();
71
- }
72
- else {
73
- $(this).hide();
74
- }
75
- });
76
-
77
- paginationUl.each((index, ul) => $(ul).find('li').remove());
78
-
79
- if (0 === maxItems || totalItems < maxItems) {
80
- paginationUl.each((index, ul) => $(ul).addClass('hide'));
81
- return;
82
- }
83
-
84
- let nbPages = Math.ceil(totalItems/maxItems);
85
- for (let i=1; i <= nbPages; i++) {
86
- paginationUl.each((index, ul) => $(ul).append('<li class="page-item" data-page="'+i+'"><a href="#" class="page-link">'+i+'<span class="sr-only">(current)</span></a></li>').show());
87
- }
88
-
89
- paginationUl.each((index, ul) => $(ul).removeClass('hide'));
90
- paginationUl.each((index, ul) => $(ul).find('li:first-child').addClass('active'));
91
- paginationUl.each((index, ul) => $(ul).find('li').click(function () {
92
- paginationUl.each((index, ul) => $(ul).find('li').removeClass('active'));
93
-
94
- let pageNum = $(this).data('page');
95
- let trIndex = 0;
96
-
97
- if (doublePagination) {
98
- $('li[data-page="' + pageNum + '"]').each((index, li) => $(li).addClass('active'));
99
- } else {
100
- $(this).addClass('active');
101
- }
102
-
103
- items.each(function () {
104
- trIndex++;
105
- if (trIndex > (maxItems*pageNum) || trIndex <= ((maxItems*pageNum)-maxItems)) {
106
- $(this).hide();
107
- }
108
- else{
109
- $(this).show();
110
- }
111
- });
112
-
113
- return false;
114
- }));
115
- }
116
- }
117
-
118
- class Navigation {
119
- static activateTab(a) {
120
- //console.log(a);
121
- //a.click();
122
- let ulNav = a.closest('.nav');
123
- let tabContent = ulNav.parent().find('.tab-content');
124
-
125
- // déselection éventuel des onglets
126
- ulNav.find('a.nav-link').each(function(idx, navLink) {
127
- $(navLink).removeClass('active');
128
- let id = $(navLink).attr('href');
129
- if (id.substr(0, 1) === '#') {
130
- tabContent.find(id).removeClass('active').removeClass('show');
131
- }
132
- });
133
-
134
- // sélection de l'onglet correspondant au navLink passé en paramètre
135
- a.addClass('active');
136
- tabContent.find(a.attr('href')).addClass('active').addClass('show');
137
- }
138
-
139
- static showTab(a) {
140
- if (typeof bootstrap == 'undefined') {
141
- return;
142
- }
143
- let tab = new bootstrap.Tab(a[0]);
144
- tab.show();
145
- }
146
-
147
- static addTabInHistory(tabId, queryStringKey='tab', replace=true) {
148
- let url = window.location.href;
149
- url = UrlAndQueryString.setParamOfUrl(queryStringKey, tabId, url);
150
- if (replace) {
151
- window.history.replaceState('', document.title, url);
152
- }
153
- else {
154
- window.history.pushState("", "", newUrl);
155
- }
156
- }
157
- }
158
-
159
- module.exports = { Pagination, Navigation };
160
-
161
- // deprecated
162
- /*
163
- function paginationAsList(nbResultatsTotal, nbResultatsParPage, urlPage, nomParamPage) {
164
- var currentUrl = urlPage || window.location.href;
165
- var afficherLienFirstLastPage = true;
166
- var afficherLienPagePrecedenteSuivante = true;
167
- var emptyStringIfOnlyOnePage = true;
168
- var nbLiensPageDebutFin = 3;
169
- var nbLiensPageAvantApresPageCourante = 2;
170
- var strEntreLiensPageDebutFinEtAvantApresPageCourante = '…';
171
- nomParamPage = nomParamPage || 'page';
172
-
173
- // Si le nombre de résultat total est inférieur au nombre d'affichage par page, il n'y a qu'une seule page.
174
- if (nbResultatsTotal < nbResultatsParPage && emptyStringIfOnlyOnePage) {
175
- return '';
176
- }
177
-
178
- // Initialisation du nombre de pages
179
- var nbPages = Math.ceil(nbResultatsTotal/nbResultatsParPage);
180
-
181
- // Initialisation du numéro de la page courante
182
- //var query = window.location.search.substring(1).query.split("&");
183
-
184
- var url = new URL(currentUrl);
185
- var params = url.searchParams;
186
-
187
- var numPageCourante = 1;
188
- if (typeof params.get(nomParamPage) != 'undefined' && params.get(nomParamPage) != null) {
189
- numPageCourante = parseInt(params.get(nomParamPage));
190
- }
191
- if (numPageCourante < 0) {
192
- numPageCourante = 1;
193
- }
194
- if (numPageCourante > nbPages) {
195
- numPageCourante = nbPages;
196
- }
197
-
198
- var strPagination = '<ul class="pagination">';
199
-
200
- // Lien pour la première page
201
- if (afficherLienFirstLastPage) {
202
- var strLienFirstPage = '&lt;&lt;';
203
- if (numPageCourante > 1) {
204
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, 1, currentUrl)+'">'+strLienFirstPage+'</a></li>';
205
- }
206
- else {
207
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienFirstPage+'</a></li>';
208
- }
209
- }
210
-
211
- // Lien pour la page précédente
212
- if (afficherLienPagePrecedenteSuivante) {
213
- var strLienPagePrecedente = '&lt;';
214
- if (numPageCourante > 1) {
215
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, (numPageCourante - 1), currentUrl)+'">'+strLienPagePrecedente+'</a></li>';
216
- }
217
- else {
218
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienPagePrecedente+'</a></li>';
219
- }
220
- }
221
-
222
- var strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche = false;
223
- var strEntreLiensPageFinEtApresPageCouranteDejaAffiche = false;
224
-
225
- for (var numPage=1; numPage<=nbPages; numPage++) {
226
- if (numPage < numPageCourante) {
227
- if (numPage <= nbLiensPageDebutFin || numPage >= (numPageCourante-nbLiensPageAvantApresPageCourante)) {
228
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, numPage, currentUrl)+'">'+numPage+'</a></li>';
229
- }
230
- else {
231
- if (!strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche) {
232
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strEntreLiensPageDebutFinEtAvantApresPageCourante+'</a></li>';
233
- strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche = true;
234
- }
235
- }
236
- }
237
- else if (numPage > numPageCourante) {
238
- if (numPage >= (nbPages-(nbLiensPageDebutFin-1)) || numPage <= (numPageCourante+nbLiensPageAvantApresPageCourante)) {
239
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, numPage, currentUrl)+'">'+numPage+'</a></li>';
240
- }
241
- else {
242
- if (!strEntreLiensPageFinEtApresPageCouranteDejaAffiche) {
243
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strEntreLiensPageDebutFinEtAvantApresPageCourante+'</a></li>';
244
- strEntreLiensPageFinEtApresPageCouranteDejaAffiche = true;
245
- }
246
- }
247
- }
248
- else {
249
- strPagination += '<li class="page-item active"><a class="page-link" href="#">'+numPage+'</a></li>';
250
- }
251
- }
252
-
253
- // Lien pour la page suivante
254
- if (afficherLienPagePrecedenteSuivante) {
255
- var strLienPageSuivante = '&gt;';
256
- if (numPageCourante < nbPages) {
257
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, (numPageCourante + 1), currentUrl)+'">'+strLienPageSuivante+'</a></li>';
258
- }
259
- else {
260
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienPageSuivante+'</a></li>';
261
- }
262
- }
263
-
264
- // Lien pour la dernière page
265
- if (afficherLienFirstLastPage) {
266
- var strLienLastPage = '&gt;&gt;';
267
- if (numPageCourante < nbPages) {
268
- strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, nbPages, currentUrl)+'">'+strLienLastPage+'</a></li>';
269
- }
270
- else {
271
- strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienLastPage+'</a></li>';
272
- }
273
- }
274
-
275
- strPagination += '</ul>';
276
-
277
- return strPagination;
278
- }
1
+ // Fonction commune de pagination
2
+ //Bootstrap class pagination https://getbootstrap.com/docs/3.3/components/#pagination
3
+
4
+ class Pagination {
5
+ static paginateCards(div, nbItemsPerPage, doublePagination) {
6
+ Pagination.paginate(div, div.find('.pagination_item'), nbItemsPerPage, undefined, doublePagination);
7
+ }
8
+
9
+ static paginateTable(table, select, doublePagination) {
10
+ Pagination.paginate(table, table.find('tbody tr:not(.hide)'), parseInt(table.data('max_rows')), select, doublePagination);
11
+ }
12
+
13
+ static paginate(div, items, nbItemsPerPage, select, doublePagination) {
14
+ let maxItems = nbItemsPerPage;
15
+
16
+ if (typeof div == 'undefined' || !div.length) {
17
+ return;
18
+ }
19
+
20
+ if (typeof select != 'undefined' && select.length) {
21
+ if (!select.children().length) {
22
+ select.append('<option value="0">'+labelDisplayAll+'</option>');
23
+ let nbRowsList = select.data('nb_rows_list') ? select.data('nb_rows_list').split(',') : [5, 10, 25, 50];
24
+ $.each(nbRowsList, function(idx, nbRows) {
25
+ select.append('<option value="'+nbRows+'">'+nbRows+'</option>');
26
+ });
27
+
28
+ if (select.data('default_nb_rows')) {
29
+ select.val(select.data('default_nb_rows'))
30
+ }
31
+ }
32
+
33
+ maxItems = parseInt(select.val());
34
+
35
+ select.change(update);
36
+ }
37
+
38
+ const ulPagination = $('ul.pagination');
39
+ if (doublePagination) {
40
+ ulPagination.each((index, ul) => $(ul).remove());
41
+ Pagination.initPaginationDiv(div, ulPagination, true, true); //top
42
+ Pagination.initPaginationDiv(div, ulPagination, false, true); //bottom
43
+ } else {
44
+ Pagination.initPaginationDiv(div, ulPagination, false, false); //bottom
45
+ }
46
+
47
+ Pagination.initPaginationItems(items, maxItems, doublePagination);
48
+ }
49
+
50
+ static initPaginationDiv(div, ulDiv, onTop, doublePagination) {
51
+ if (!ulDiv.length || doublePagination) {
52
+ ulDiv = $('<ul class="pagination"></ul>');
53
+ if (div.find('.pagination_links').length) {
54
+ (onTop ? div.find('.pagination_links').prepend(ulDiv) : div.find('.pagination_links').append(ulDiv))
55
+ } else {
56
+ (onTop ? div.before(ulDiv) : div.after(ulDiv));
57
+ }
58
+ }
59
+ }
60
+
61
+ static initPaginationItems(items, maxItems, doublePagination) {
62
+ const paginationUl = $('ul.pagination');
63
+
64
+ let totalItems = items.length;
65
+
66
+ let lineNum = 0;
67
+ items.each(function () {
68
+ lineNum++;
69
+ if (0 === maxItems || lineNum <= maxItems) {
70
+ $(this).show();
71
+ }
72
+ else {
73
+ $(this).hide();
74
+ }
75
+ });
76
+
77
+ paginationUl.each((index, ul) => $(ul).find('li').remove());
78
+
79
+ if (0 === maxItems || totalItems < maxItems) {
80
+ paginationUl.each((index, ul) => $(ul).addClass('hide'));
81
+ return;
82
+ }
83
+
84
+ let nbPages = Math.ceil(totalItems/maxItems);
85
+ for (let i=1; i <= nbPages; i++) {
86
+ paginationUl.each((index, ul) => $(ul).append('<li class="page-item" data-page="'+i+'"><a href="#" class="page-link">'+i+'<span class="sr-only">(current)</span></a></li>').show());
87
+ }
88
+
89
+ paginationUl.each((index, ul) => $(ul).removeClass('hide'));
90
+ paginationUl.each((index, ul) => $(ul).find('li:first-child').addClass('active'));
91
+ paginationUl.each((index, ul) => $(ul).find('li').click(function () {
92
+ paginationUl.each((index, ul) => $(ul).find('li').removeClass('active'));
93
+
94
+ let pageNum = $(this).data('page');
95
+ let trIndex = 0;
96
+
97
+ if (doublePagination) {
98
+ $('li[data-page="' + pageNum + '"]').each((index, li) => $(li).addClass('active'));
99
+ } else {
100
+ $(this).addClass('active');
101
+ }
102
+
103
+ items.each(function () {
104
+ trIndex++;
105
+ if (trIndex > (maxItems*pageNum) || trIndex <= ((maxItems*pageNum)-maxItems)) {
106
+ $(this).hide();
107
+ }
108
+ else{
109
+ $(this).show();
110
+ }
111
+ });
112
+
113
+ return false;
114
+ }));
115
+ }
116
+ }
117
+
118
+ class Navigation {
119
+ static activateTab(a) {
120
+ //console.log(a);
121
+ //a.click();
122
+ let ulNav = a.closest('.nav');
123
+ let tabContent = ulNav.parent().find('.tab-content');
124
+
125
+ // déselection éventuel des onglets
126
+ ulNav.find('a.nav-link').each(function(idx, navLink) {
127
+ $(navLink).removeClass('active');
128
+ let id = $(navLink).attr('href');
129
+ if (id.substr(0, 1) === '#') {
130
+ tabContent.find(id).removeClass('active').removeClass('show');
131
+ }
132
+ });
133
+
134
+ // sélection de l'onglet correspondant au navLink passé en paramètre
135
+ a.addClass('active');
136
+ tabContent.find(a.attr('href')).addClass('active').addClass('show');
137
+ }
138
+
139
+ static showTab(a) {
140
+ if (typeof bootstrap == 'undefined') {
141
+ return;
142
+ }
143
+ let tab = new bootstrap.Tab(a[0]);
144
+ tab.show();
145
+ }
146
+
147
+ static addTabInHistory(tabId, queryStringKey='tab', replace=true) {
148
+ let url = window.location.href;
149
+ url = UrlAndQueryString.setParamOfUrl(queryStringKey, tabId, url);
150
+ if (replace) {
151
+ window.history.replaceState('', document.title, url);
152
+ }
153
+ else {
154
+ window.history.pushState("", "", newUrl);
155
+ }
156
+ }
157
+ }
158
+
159
+ module.exports = { Pagination, Navigation };
160
+
161
+ // deprecated
162
+ /*
163
+ function paginationAsList(nbResultatsTotal, nbResultatsParPage, urlPage, nomParamPage) {
164
+ var currentUrl = urlPage || window.location.href;
165
+ var afficherLienFirstLastPage = true;
166
+ var afficherLienPagePrecedenteSuivante = true;
167
+ var emptyStringIfOnlyOnePage = true;
168
+ var nbLiensPageDebutFin = 3;
169
+ var nbLiensPageAvantApresPageCourante = 2;
170
+ var strEntreLiensPageDebutFinEtAvantApresPageCourante = '…';
171
+ nomParamPage = nomParamPage || 'page';
172
+
173
+ // Si le nombre de résultat total est inférieur au nombre d'affichage par page, il n'y a qu'une seule page.
174
+ if (nbResultatsTotal < nbResultatsParPage && emptyStringIfOnlyOnePage) {
175
+ return '';
176
+ }
177
+
178
+ // Initialisation du nombre de pages
179
+ var nbPages = Math.ceil(nbResultatsTotal/nbResultatsParPage);
180
+
181
+ // Initialisation du numéro de la page courante
182
+ //var query = window.location.search.substring(1).query.split("&");
183
+
184
+ var url = new URL(currentUrl);
185
+ var params = url.searchParams;
186
+
187
+ var numPageCourante = 1;
188
+ if (typeof params.get(nomParamPage) != 'undefined' && params.get(nomParamPage) != null) {
189
+ numPageCourante = parseInt(params.get(nomParamPage));
190
+ }
191
+ if (numPageCourante < 0) {
192
+ numPageCourante = 1;
193
+ }
194
+ if (numPageCourante > nbPages) {
195
+ numPageCourante = nbPages;
196
+ }
197
+
198
+ var strPagination = '<ul class="pagination">';
199
+
200
+ // Lien pour la première page
201
+ if (afficherLienFirstLastPage) {
202
+ var strLienFirstPage = '&lt;&lt;';
203
+ if (numPageCourante > 1) {
204
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, 1, currentUrl)+'">'+strLienFirstPage+'</a></li>';
205
+ }
206
+ else {
207
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienFirstPage+'</a></li>';
208
+ }
209
+ }
210
+
211
+ // Lien pour la page précédente
212
+ if (afficherLienPagePrecedenteSuivante) {
213
+ var strLienPagePrecedente = '&lt;';
214
+ if (numPageCourante > 1) {
215
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, (numPageCourante - 1), currentUrl)+'">'+strLienPagePrecedente+'</a></li>';
216
+ }
217
+ else {
218
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienPagePrecedente+'</a></li>';
219
+ }
220
+ }
221
+
222
+ var strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche = false;
223
+ var strEntreLiensPageFinEtApresPageCouranteDejaAffiche = false;
224
+
225
+ for (var numPage=1; numPage<=nbPages; numPage++) {
226
+ if (numPage < numPageCourante) {
227
+ if (numPage <= nbLiensPageDebutFin || numPage >= (numPageCourante-nbLiensPageAvantApresPageCourante)) {
228
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, numPage, currentUrl)+'">'+numPage+'</a></li>';
229
+ }
230
+ else {
231
+ if (!strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche) {
232
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strEntreLiensPageDebutFinEtAvantApresPageCourante+'</a></li>';
233
+ strEntreLiensPageDebutEtAvantPageCouranteDejaAffiche = true;
234
+ }
235
+ }
236
+ }
237
+ else if (numPage > numPageCourante) {
238
+ if (numPage >= (nbPages-(nbLiensPageDebutFin-1)) || numPage <= (numPageCourante+nbLiensPageAvantApresPageCourante)) {
239
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, numPage, currentUrl)+'">'+numPage+'</a></li>';
240
+ }
241
+ else {
242
+ if (!strEntreLiensPageFinEtApresPageCouranteDejaAffiche) {
243
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strEntreLiensPageDebutFinEtAvantApresPageCourante+'</a></li>';
244
+ strEntreLiensPageFinEtApresPageCouranteDejaAffiche = true;
245
+ }
246
+ }
247
+ }
248
+ else {
249
+ strPagination += '<li class="page-item active"><a class="page-link" href="#">'+numPage+'</a></li>';
250
+ }
251
+ }
252
+
253
+ // Lien pour la page suivante
254
+ if (afficherLienPagePrecedenteSuivante) {
255
+ var strLienPageSuivante = '&gt;';
256
+ if (numPageCourante < nbPages) {
257
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, (numPageCourante + 1), currentUrl)+'">'+strLienPageSuivante+'</a></li>';
258
+ }
259
+ else {
260
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienPageSuivante+'</a></li>';
261
+ }
262
+ }
263
+
264
+ // Lien pour la dernière page
265
+ if (afficherLienFirstLastPage) {
266
+ var strLienLastPage = '&gt;&gt;';
267
+ if (numPageCourante < nbPages) {
268
+ strPagination += '<li class="page-item"><a class="page-link" href="'+UrlAndQueryString.setParamOfUrl(nomParamPage, nbPages, currentUrl)+'">'+strLienLastPage+'</a></li>';
269
+ }
270
+ else {
271
+ strPagination += '<li class="page-item disabled"><a class="page-link" href="#">'+strLienLastPage+'</a></li>';
272
+ }
273
+ }
274
+
275
+ strPagination += '</ul>';
276
+
277
+ return strPagination;
278
+ }
279
279
  */
package/php.min.js CHANGED
@@ -1,6 +1,6 @@
1
- function chr(codePt){if(codePt>65535){codePt-=65536;return String.fromCharCode(55296+(codePt>>10),56320+(codePt&1023))}return String.fromCharCode(codePt)}
2
- function ord(string){var str=string+"",code=str.charCodeAt(0);if(55296<=code&&code<=56319){var hi=code;if(str.length===1){return code}var low=str.charCodeAt(1);return((hi-55296)*1024)+(low-56320)+65536}if(56320<=code&&code<=57343){return code}return code}
3
- function trim(str){return str.replace(/^\s+/g,"").replace(/\s+$/g,"")}
4
- function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||typeof mixed_var==="undefined"){return true}if(typeof mixed_var=="object"){for(key in mixed_var){return false}return true}return false}
5
-
1
+ function chr(codePt){if(codePt>65535){codePt-=65536;return String.fromCharCode(55296+(codePt>>10),56320+(codePt&1023))}return String.fromCharCode(codePt)}
2
+ function ord(string){var str=string+"",code=str.charCodeAt(0);if(55296<=code&&code<=56319){var hi=code;if(str.length===1){return code}var low=str.charCodeAt(1);return((hi-55296)*1024)+(low-56320)+65536}if(56320<=code&&code<=57343){return code}return code}
3
+ function trim(str){return str.replace(/^\s+/g,"").replace(/\s+$/g,"")}
4
+ function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||typeof mixed_var==="undefined"){return true}if(typeof mixed_var=="object"){for(key in mixed_var){return false}return true}return false}
5
+
6
6
  module.exports = { chr, ord, trim, empty };
package/revolut.js CHANGED
@@ -1,23 +1,23 @@
1
- const RevolutCheckout = require('@revolut/checkout');
2
-
3
- class Revolut {
4
- constructor() {
5
- this.mode = 'prod';
6
- }
7
-
8
- static setMode(mode) {
9
- this.mode = mode;
10
- }
11
-
12
- static displayPaymentPopup(orderId, onSuccess, onError, onCancel) {
13
- RevolutCheckout.default(orderId, this.mode).then((instance) => {
14
- instance.payWithPopup({
15
- onSuccess,
16
- onError,
17
- onCancel
18
- });
19
- });
20
- }
21
- }
22
-
1
+ const RevolutCheckout = require('@revolut/checkout');
2
+
3
+ class Revolut {
4
+ constructor() {
5
+ this.mode = 'prod';
6
+ }
7
+
8
+ static setMode(mode) {
9
+ this.mode = mode;
10
+ }
11
+
12
+ static displayPaymentPopup(orderId, onSuccess, onError, onCancel) {
13
+ RevolutCheckout.default(orderId, this.mode).then((instance) => {
14
+ instance.payWithPopup({
15
+ onSuccess,
16
+ onError,
17
+ onCancel
18
+ });
19
+ });
20
+ }
21
+ }
22
+
23
23
  module.exports = { Revolut };