Skip to content

Commit 4dfd38b

Browse files
committedJul 23, 2018
Modifications for version 1.4.2
1 parent 257054d commit 4dfd38b

14 files changed

+146
-169
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
22
*.iml
33
bower_components
4-
node_modules
4+
node_modules
5+
package-lock.json

‎LICENSE

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
Copyright 2014-2015 © Eugene Simakin
1+
Copyright 2014-2018 © Eugene Simakin
22

3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
66

77
http://www.apache.org/licenses/LICENSE-2.0
88

9-
Unless required by applicable law or agreed to in writing,
10-
software distributed under the License is distributed on an "AS IS" BASIS,
11-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
See the License for the specific language governing permissions and
9+
Unless required by applicable law or agreed to in writing,
10+
software distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
1313
limitations under the License.

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ For development use grunt build to make minified file.
2323
To use grunt install packages by using: npm install
2424

2525
## Demo and Docs
26-
For more information see [docs on github pages](http://esimakin.github.io/twbs-pagination/) (not completed yet)
26+
For more information see [docs on github pages](http://esimakin.github.io/twbs-pagination/) (not completed yet)

‎bower.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "twbs-pagination",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"homepage": "https://github.com/esimakin/twbs-pagination",
55
"authors": [
6+
"Jose Cebellán <josecebe@gmail.com>",
67
"Eugene Simakin <eugenesimakin@mail.ru>"
78
],
89
"description": "jQuery simple pagination plugin for bootstrap-style webpages",

‎examples/bootstrap-v3.html

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>jQuery Pagination plugin</title>
6+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
7+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
8+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
9+
<script src="../jquery.twbsPagination.js" type="text/javascript"></script>
10+
</head>
11+
<body>
12+
<div class="container">
13+
<nav aria-label="Page navigation">
14+
<ul class="pagination" id="pagination"></ul>
15+
</nav>
16+
</div>
17+
<script type="text/javascript">
18+
$(function () {
19+
window.pagObj = $('#pagination').twbsPagination({
20+
totalPages: 35,
21+
visiblePages: 10,
22+
onPageClick: function (event, page) {
23+
console.info(page + ' (from options)');
24+
}
25+
}).on('page', function (event, page) {
26+
console.info(page + ' (from event listening)');
27+
});
28+
});
29+
</script>
30+
</body>
31+
</html>

‎examples/bootstrap-v4.html

-31
This file was deleted.

‎examples/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>jQuery Pagination plugin</title>
6-
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
7-
<script src="//code.jquery.com/jquery-2.0.3.min.js" type="text/javascript"></script>
8-
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
6+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
7+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
8+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js"></script>
99
<script src="../jquery.twbsPagination.js" type="text/javascript"></script>
1010
</head>
1111
<body>
@@ -28,4 +28,4 @@
2828
});
2929
</script>
3030
</body>
31-
</html>
31+
</html>

‎jquery.twbsPagination.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*!
2-
* jQuery pagination plugin v1.4.1
2+
* jQuery pagination plugin v1.4.2
33
* http://esimakin.github.io/twbs-pagination/
44
*
5-
* Copyright 2014-2016, Eugene Simakin
5+
* Copyright 2014-2018, Eugene Simakin
66
* Released under Apache 2.0 license
77
* http://apache.org/licenses/LICENSE-2.0.html
88
*/
@@ -332,6 +332,6 @@
332332
return this;
333333
};
334334

335-
$.fn.twbsPagination.version = "1.4.1";
335+
$.fn.twbsPagination.version = "1.4.2";
336336

337337
})(window.jQuery, window, document);

‎package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "twbs-pagination",
33
"nativeName": "jQuery Bootstrap Pagination",
4-
"version": "1.4.1",
4+
"version": "1.4.2",
55
"homepage": "https://github.com/esimakin/twbs-pagination",
66
"author": "Eugene Simakin <john-24@list.ru>",
77
"description": "jQuery simple pagination plugin for bootstrap-style webpages",
@@ -10,11 +10,11 @@
1010
"jquery": ">=1.7"
1111
},
1212
"devDependencies": {
13-
"grunt": "^1.0.1",
14-
"grunt-cli": "~1.2.0",
15-
"grunt-contrib-watch": "~1.0.0",
16-
"grunt-contrib-uglify": "^2.0.0",
17-
"load-grunt-tasks": "^3.1.0"
13+
"grunt": "1.0.3",
14+
"grunt-cli": "1.2.0",
15+
"grunt-contrib-uglify": "3.3.0",
16+
"grunt-contrib-watch": "1.1.0",
17+
"load-grunt-tasks": "4.0.0"
1818
},
1919
"repository": {
2020
"type": "git",

‎tests/index.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<title>All tests</title>
66
</head>
77
<body>
8-
<iframe src="run-test-jquery-1.8.1.html" width="100%" height="480px"></iframe>
9-
<iframe src="run-test-jquery-latest.html" width="100%" height="480px"></iframe>
8+
<iframe src="run-test-jquery-latest.html" width="100%" height="800px"></iframe>
109
</body>
11-
</html>
10+
</html>

‎tests/run-test-jquery-1.8.1.html

-22
This file was deleted.

‎tests/run-test-jquery-latest.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44
<meta charset="utf-8">
55
<title>Tests</title>
66

7-
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.13.0.css">
7+
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.6.1.css">
88

9-
<script src="http://code.jquery.com/jquery-3.1.1.min.js" type="text/javascript"></script>
9+
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
10+
<script src="https://code.jquery.com/qunit/qunit-2.6.1.js" type="text/javascript"></script>
1011
<script src="../jquery.twbsPagination.js" type="text/javascript"></script>
11-
1212
</head>
1313
<body>
1414
<div id="qunit"></div>
1515
<div id="qunit-fixture"></div>
1616
<ul id="pagination" style="display: none;"></ul>
1717

18-
<script src="http://code.jquery.com/qunit/qunit-1.13.0.js"></script>
1918
<script src="./test.js"></script>
2019
</body>
21-
</html>
20+
</html>

‎tests/test.js

+82-83
Original file line numberDiff line numberDiff line change
@@ -6,75 +6,75 @@
66
elem.twbsPagination(opts);
77
};
88

9-
QUnit.test("Test destroy called before initialization", function () {
10-
ok(pag1.twbsPagination('destroy'));
9+
QUnit.test("Test destroy called before initialization", function (assert) {
10+
assert.ok(pag1.twbsPagination('destroy'));
1111
});
1212

13-
QUnit.test("Test 'getPages' method (EVEN visible pages number)", function () {
13+
QUnit.test("Test 'getPages' method (EVEN visible pages number)", function (assert) {
1414
destroyAndCreateWithOpts(pag1, {
1515
totalPages: 30
1616
});
1717

18-
deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3, 4, 5]});
19-
deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3, 4, 5]});
20-
deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3, 4, 5]});
18+
assert.deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3, 4, 5]});
19+
assert.deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3, 4, 5]});
20+
assert.deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3, 4, 5]});
2121

22-
deepEqual(pag1.twbsPagination('getPages', 4), {currentPage: 4, numeric: [2, 3, 4, 5, 6]});
23-
deepEqual(pag1.twbsPagination('getPages', 5), {currentPage: 5, numeric: [3, 4, 5, 6, 7]});
24-
deepEqual(pag1.twbsPagination('getPages', 20), {currentPage: 20, numeric: [18, 19, 20, 21, 22]});
22+
assert.deepEqual(pag1.twbsPagination('getPages', 4), {currentPage: 4, numeric: [2, 3, 4, 5, 6]});
23+
assert.deepEqual(pag1.twbsPagination('getPages', 5), {currentPage: 5, numeric: [3, 4, 5, 6, 7]});
24+
assert.deepEqual(pag1.twbsPagination('getPages', 20), {currentPage: 20, numeric: [18, 19, 20, 21, 22]});
2525

26-
deepEqual(pag1.twbsPagination('getPages', 27), {currentPage: 27, numeric: [25, 26, 27, 28, 29]});
27-
deepEqual(pag1.twbsPagination('getPages', 28), {currentPage: 28, numeric: [26, 27, 28, 29, 30]});
28-
deepEqual(pag1.twbsPagination('getPages', 29), {currentPage: 29, numeric: [26, 27, 28, 29, 30]});
29-
deepEqual(pag1.twbsPagination('getPages', 30), {currentPage: 30, numeric: [26, 27, 28, 29, 30]});
26+
assert.deepEqual(pag1.twbsPagination('getPages', 27), {currentPage: 27, numeric: [25, 26, 27, 28, 29]});
27+
assert.deepEqual(pag1.twbsPagination('getPages', 28), {currentPage: 28, numeric: [26, 27, 28, 29, 30]});
28+
assert.deepEqual(pag1.twbsPagination('getPages', 29), {currentPage: 29, numeric: [26, 27, 28, 29, 30]});
29+
assert.deepEqual(pag1.twbsPagination('getPages', 30), {currentPage: 30, numeric: [26, 27, 28, 29, 30]});
3030
});
3131

32-
QUnit.test("Test 'getPages' method (ODD visible pages number)", function () {
32+
QUnit.test("Test 'getPages' method (ODD visible pages number)", function (assert) {
3333
destroyAndCreateWithOpts(pag1, {
3434
totalPages: 30,
3535
visiblePages: 6
3636
});
3737

38-
deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3, 4, 5, 6]});
39-
deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3, 4, 5, 6]});
40-
deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3, 4, 5, 6]});
38+
assert.deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3, 4, 5, 6]});
39+
assert.deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3, 4, 5, 6]});
40+
assert.deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3, 4, 5, 6]});
4141

42-
deepEqual(pag1.twbsPagination('getPages', 4), {currentPage: 4, numeric: [2, 3, 4, 5, 6, 7]});
43-
deepEqual(pag1.twbsPagination('getPages', 5), {currentPage: 5, numeric: [3, 4, 5, 6, 7, 8]});
44-
deepEqual(pag1.twbsPagination('getPages', 20), {currentPage: 20, numeric: [18, 19, 20, 21, 22, 23]});
42+
assert.deepEqual(pag1.twbsPagination('getPages', 4), {currentPage: 4, numeric: [2, 3, 4, 5, 6, 7]});
43+
assert.deepEqual(pag1.twbsPagination('getPages', 5), {currentPage: 5, numeric: [3, 4, 5, 6, 7, 8]});
44+
assert.deepEqual(pag1.twbsPagination('getPages', 20), {currentPage: 20, numeric: [18, 19, 20, 21, 22, 23]});
4545

46-
deepEqual(pag1.twbsPagination('getPages', 27), {currentPage: 27, numeric: [25, 26, 27, 28, 29, 30]});
47-
deepEqual(pag1.twbsPagination('getPages', 28), {currentPage: 28, numeric: [25, 26, 27, 28, 29, 30]});
48-
deepEqual(pag1.twbsPagination('getPages', 29), {currentPage: 29, numeric: [25, 26, 27, 28, 29, 30]});
49-
deepEqual(pag1.twbsPagination('getPages', 30), {currentPage: 30, numeric: [25, 26, 27, 28, 29, 30]});
46+
assert.deepEqual(pag1.twbsPagination('getPages', 27), {currentPage: 27, numeric: [25, 26, 27, 28, 29, 30]});
47+
assert.deepEqual(pag1.twbsPagination('getPages', 28), {currentPage: 28, numeric: [25, 26, 27, 28, 29, 30]});
48+
assert.deepEqual(pag1.twbsPagination('getPages', 29), {currentPage: 29, numeric: [25, 26, 27, 28, 29, 30]});
49+
assert.deepEqual(pag1.twbsPagination('getPages', 30), {currentPage: 30, numeric: [25, 26, 27, 28, 29, 30]});
5050
});
5151

52-
QUnit.test("Test 'getPages' method (total < visible)", function () {
52+
QUnit.test("Test 'getPages' method (total < visible)", function (assert) {
5353
destroyAndCreateWithOpts(pag1, {
5454
totalPages: 3,
5555
visiblePages: 5
5656
});
57-
deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3]});
58-
deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3]});
59-
deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3]});
57+
assert.deepEqual(pag1.twbsPagination('getPages', 1), {currentPage: 1, numeric: [1, 2, 3]});
58+
assert.deepEqual(pag1.twbsPagination('getPages', 2), {currentPage: 2, numeric: [1, 2, 3]});
59+
assert.deepEqual(pag1.twbsPagination('getPages', 3), {currentPage: 3, numeric: [1, 2, 3]});
6060
});
6161

62-
QUnit.test("Test classes appended for pagination", function () {
62+
QUnit.test("Test classes appended for pagination", function (assert) {
6363
destroyAndCreateWithOpts(pag1, {
6464
totalPages: 3,
6565
visiblePages: 5
6666
});
67-
equal(pag1.find('.page-item').length, 7);
68-
equal(pag1.find('.next').length, 1);
69-
equal(pag1.find('.prev').length, 1);
70-
equal(pag1.find('.last').length, 1);
71-
equal(pag1.find('.first').length, 1);
72-
equal(pag1.find('.page-item.active').length, 1);
73-
equal(pag1.find('.prev.disabled').length, 1);
74-
equal(pag1.find('.first.disabled').length, 1);
67+
assert.equal(pag1.find('.page-item').length, 7);
68+
assert.equal(pag1.find('.next').length, 1);
69+
assert.equal(pag1.find('.prev').length, 1);
70+
assert.equal(pag1.find('.last').length, 1);
71+
assert.equal(pag1.find('.first').length, 1);
72+
assert.equal(pag1.find('.page-item.active').length, 1);
73+
assert.equal(pag1.find('.prev.disabled').length, 1);
74+
assert.equal(pag1.find('.first.disabled').length, 1);
7575
});
7676

77-
QUnit.test("Test custom classes appended for pagination", function () {
77+
QUnit.test("Test custom classes appended for pagination", function (assert) {
7878
destroyAndCreateWithOpts(pag1, {
7979
totalPages: 10,
8080
visiblePages: 5,
@@ -86,28 +86,28 @@
8686
activeClass: 'my-active-class',
8787
disabledClass: 'my-disabled-class'
8888
});
89-
equal(pag1.find('.my-page').length, 5);
90-
equal(pag1.find('.my-next-page').length, 1);
91-
equal(pag1.find('.my-prev-page').length, 1);
92-
equal(pag1.find('.my-last-page').length, 1);
93-
equal(pag1.find('.my-first-page').length, 1);
94-
equal(pag1.find('.my-page.my-active-class').length, 1);
95-
equal(pag1.find('.my-prev-page.my-disabled-class').length, 1);
96-
equal(pag1.find('.my-first-page.my-disabled-class').length, 1);
89+
assert.equal(pag1.find('.my-page').length, 5);
90+
assert.equal(pag1.find('.my-next-page').length, 1);
91+
assert.equal(pag1.find('.my-prev-page').length, 1);
92+
assert.equal(pag1.find('.my-last-page').length, 1);
93+
assert.equal(pag1.find('.my-first-page').length, 1);
94+
assert.equal(pag1.find('.my-page.my-active-class').length, 1);
95+
assert.equal(pag1.find('.my-prev-page.my-disabled-class').length, 1);
96+
assert.equal(pag1.find('.my-first-page.my-disabled-class').length, 1);
9797
});
9898

99-
QUnit.test("Test page numbers text", function () {
99+
QUnit.test("Test page numbers text", function (assert) {
100100
destroyAndCreateWithOpts(pag1, {
101101
totalPages: 2
102102
});
103-
equal(pag1.find('.page-item:eq(2)').text(), '1');
104-
equal(pag1.find('.next').text(), 'Next');
105-
equal(pag1.find('.prev').text(), 'Previous');
106-
equal(pag1.find('.first').text(), 'First');
107-
equal(pag1.find('.last').text(), 'Last');
103+
assert.equal(pag1.find('.page-item:eq(2)').text(), '1');
104+
assert.equal(pag1.find('.next').text(), 'Next');
105+
assert.equal(pag1.find('.prev').text(), 'Previous');
106+
assert.equal(pag1.find('.first').text(), 'First');
107+
assert.equal(pag1.find('.last').text(), 'Last');
108108
});
109109

110-
QUnit.test("Test custom texts", function () {
110+
QUnit.test("Test custom texts", function (assert) {
111111
destroyAndCreateWithOpts(pag1, {
112112
totalPages: 2,
113113
page: '[{{page}}]',
@@ -116,41 +116,40 @@
116116
next: '>>',
117117
last: '(last)[{{total_pages}}]'
118118
});
119-
equal(pag1.find('.page-item:eq(2)').text(), '[1]');
120-
equal(pag1.find('.next').text(), '>>');
121-
equal(pag1.find('.prev').text(), '<<');
122-
equal(pag1.find('.first').text(), '(first)');
123-
equal(pag1.find('.last').text(), '(last)[2]');
119+
assert.equal(pag1.find('.page-item:eq(2)').text(), '[1]');
120+
assert.equal(pag1.find('.next').text(), '>>');
121+
assert.equal(pag1.find('.prev').text(), '<<');
122+
assert.equal(pag1.find('.first').text(), '(first)');
123+
assert.equal(pag1.find('.last').text(), '(last)[2]');
124124
});
125125

126-
QUnit.test("Test 'getPageFromQueryString' method", function () {
126+
QUnit.test("Test 'getPageFromQueryString' method", function (assert) {
127127
destroyAndCreateWithOpts(pag1, {pageVariable: 'page'});
128-
equal(pag1.twbsPagination('getPageFromQueryString', '?page=1'), 1);
129-
equal(pag1.twbsPagination('getPageFromQueryString', '?page='), null);
130-
equal(pag1.twbsPagination('getPageFromQueryString', '?page'), null);
131-
equal(pag1.twbsPagination('getPageFromQueryString', '?'), null);
132-
equal(pag1.twbsPagination('getPageFromQueryString', ''), null)
133-
;
134-
equal(pag1.twbsPagination('getPageFromQueryString', '?page=2'), 2);
135-
equal(pag1.twbsPagination('getPageFromQueryString', '?page=3&param=taram'), 3);
136-
equal(pag1.twbsPagination('getPageFromQueryString', '?page=4&param=test&opilki'), 4);
137-
equal(pag1.twbsPagination('getPageFromQueryString', '?page=5&param=test or not&opilki='), 5);
138-
equal(pag1.twbsPagination('getPageFromQueryString', '?ID=1&keyWord=net&page=6'), 6);
128+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page=1'), 1);
129+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page='), null);
130+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page'), null);
131+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?'), null);
132+
assert.equal(pag1.twbsPagination('getPageFromQueryString', ''), null);
133+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page=2'), 2);
134+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page=3&param=taram'), 3);
135+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page=4&param=test&opilki'), 4);
136+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?page=5&param=test or not&opilki='), 5);
137+
assert.equal(pag1.twbsPagination('getPageFromQueryString', '?ID=1&keyWord=net&page=6'), 6);
139138
});
140139

141-
QUnit.test("Test 'generateQueryString' method", function () {
140+
QUnit.test("Test 'generateQueryString' method", function (assert) {
142141
destroyAndCreateWithOpts(pag1, {pageVariable: 'page'});
143-
equal(pag1.twbsPagination('generateQueryString', 1, '?page=1'), '?page=1');
144-
equal(pag1.twbsPagination('generateQueryString', 1, '?page='), '?page=1');
145-
equal(pag1.twbsPagination('generateQueryString', 1, '?page'), '?page=1');
146-
equal(pag1.twbsPagination('generateQueryString', 1, '?'), '');
147-
equal(pag1.twbsPagination('generateQueryString', 1, ''), window.location.search);
148-
149-
equal(pag1.twbsPagination('generateQueryString', 2, '?page=1'), '?page=2');
150-
equal(pag1.twbsPagination('generateQueryString', 3, '?page=2&param=taram'), '?page=3&param=taram');
151-
equal(pag1.twbsPagination('generateQueryString', 4, '?page=3&param=test&opilki'), '?page=4&param=test&opilki');
152-
equal(pag1.twbsPagination('generateQueryString', 5, '?page=4&param=test or not&opilki='), '?page=5&param=test or not&opilki=');
153-
equal(pag1.twbsPagination('generateQueryString', 6, '?ID=1&keyWord=net&page=50'), '?ID=1&keyWord=net&page=6');
142+
assert.equal(pag1.twbsPagination('generateQueryString', 1, '?page=1'), '?page=1');
143+
assert.equal(pag1.twbsPagination('generateQueryString', 1, '?page='), '?page=1');
144+
assert.equal(pag1.twbsPagination('generateQueryString', 1, '?page'), '?page=1');
145+
assert.equal(pag1.twbsPagination('generateQueryString', 1, '?'), '');
146+
assert.equal(pag1.twbsPagination('generateQueryString', 1, ''), window.location.search);
147+
148+
assert.equal(pag1.twbsPagination('generateQueryString', 2, '?page=1'), '?page=2');
149+
assert.equal(pag1.twbsPagination('generateQueryString', 3, '?page=2&param=taram'), '?page=3&param=taram');
150+
assert.equal(pag1.twbsPagination('generateQueryString', 4, '?page=3&param=test&opilki'), '?page=4&param=test&opilki');
151+
assert.equal(pag1.twbsPagination('generateQueryString', 5, '?page=4&param=test or not&opilki='), '?page=5&param=test or not&opilki=');
152+
assert.equal(pag1.twbsPagination('generateQueryString', 6, '?ID=1&keyWord=net&page=50'), '?ID=1&keyWord=net&page=6');
154153
});
155154

156155
QUnit.test("Test 'hideOnlyOnePage' option", function (assert) {
@@ -419,4 +418,4 @@
419418
);
420419
$html.remove();
421420
});
422-
})(window.jQuery);
421+
})(window.jQuery);

‎twbs-pagination.jquery.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twbs-pagination",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"title": "jQuery Bootstrap Pagination",
55
"author": {
66
"name": "Eugene Simakin",
@@ -26,4 +26,4 @@
2626
"demo": "http://esimakin.github.io/twbs-pagination/",
2727
"download": "https://github.com/esimakin/twbs-pagination/zipball/master",
2828
"bugs": "https://github.com/esimakin/twbs-pagination/issues"
29-
}
29+
}

0 commit comments

Comments
 (0)
Please sign in to comment.