Skip to content

Commit d1d54be

Browse files
committed
Simple Full featured jQuery Pagination System Pagination js
1 parent b100a8f commit d1d54be

File tree

15 files changed

+3515
-0
lines changed

15 files changed

+3515
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build and Release Folders
2+
bin/
3+
bin-debug/
4+
bin-release/
5+
6+
# Other files and folders
7+
.settings/
8+
node_modules/
9+
.idea/
10+
.DS_Store
11+
npm-debug.log
12+
13+
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
14+
# should NOT be excluded as they contain compiler settings and other important
15+
# information for Eclipse / Flash Builder.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// grunt
2+
module.exports = function(grunt){
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON('package.json'),
5+
uglify: {
6+
options: {
7+
banner: '/*\n' +
8+
' * pagination.js <%= pkg.version %>\n' +
9+
' * <%= pkg.description %>\n' +
10+
' * https://github.com/superRaytin/paginationjs\n\n' +
11+
' * Homepage: http://paginationjs.com\n' +
12+
' *\n' +
13+
' * Copyright 2014-2100, superRaytin\n' +
14+
' * Released under the MIT license.\n' +
15+
'*/\n'
16+
},
17+
main: {
18+
files: [
19+
{
20+
src: ['dist/pagination.js'],
21+
dest: 'dist/pagination.min.js'
22+
},
23+
{
24+
src: ['dist/pagination-with-styles.js'],
25+
dest: 'dist/pagination-with-styles.min.js'
26+
}
27+
]
28+
}
29+
}
30+
});
31+
grunt.loadNpmTasks('grunt-contrib-uglify');
32+
grunt.registerTask('default', ['uglify']);
33+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2048 SuperRaytin 柳裟 &lt;[email protected]&gt;
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
Pagination.js
2+
=================
3+
4+
> A jQuery plugin to provide simple yet fully customisable pagination.
5+
6+
See demos and full documentation at:
7+
8+
## [paginationjs.com](http://paginationjs.com)
9+
10+
![paginationjs](examples/images/paginationjs_record.gif)
11+
12+
# Usage
13+
14+
### Normal
15+
16+
```
17+
$('#demo').pagination({
18+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195],
19+
callback: function(data, pagination){
20+
// template method of yourself
21+
var html = template(data);
22+
dataContainer.html(html);
23+
}
24+
})
25+
```
26+
27+
### Only page numbers
28+
29+
```
30+
$('#demo').pagination({
31+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 100],
32+
pageSize: 5,
33+
showPrevious: false,
34+
showNext: false,
35+
callback: function(data, pagination){
36+
// template method of yourself
37+
var html = template(data);
38+
dataContainer.html(html);
39+
}
40+
})
41+
```
42+
43+
### Show "go" input & button
44+
45+
```
46+
$('#demo').pagination({
47+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 40],
48+
pageSize: 5,
49+
showGoInput: true,
50+
showGoButton: true,
51+
callback: function(data, pagination){
52+
// template method of yourself
53+
var html = template(data);
54+
dataContainer.html(html);
55+
}
56+
})
57+
```
58+
59+
### Auto hide previous & next button
60+
61+
```
62+
$('#demo').pagination({
63+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 35],
64+
pageSize: 5,
65+
autoHidePrevious: true,
66+
autoHideNext: true,
67+
callback: function(data, pagination){
68+
// template method of yourself
69+
var html = template(data);
70+
dataContainer.html(html);
71+
}
72+
})
73+
```
74+
75+
76+
### Mini
77+
78+
```
79+
$('#demo').pagination({
80+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 50],
81+
pageSize: 5,
82+
showPageNumbers: false,
83+
showNavigator: true,
84+
callback: function(data, pagination){
85+
// template method of yourself
86+
var html = template(data);
87+
dataContainer.html(html);
88+
}
89+
})
90+
```
91+
92+
### Asynchronous or JSONP
93+
94+
```
95+
$('#demo').pagination({
96+
dataSource: 'https://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?',
97+
locator: 'items',
98+
totalNumber: 120,
99+
pageSize: 20,
100+
ajax: {
101+
beforeSend: function(){
102+
dataContainer.html('Loading data from flickr.com ...');
103+
}
104+
},
105+
callback: function(data, pagination){
106+
// template method of yourself
107+
var html = template(data);
108+
dataContainer.html(html);
109+
}
110+
})
111+
```
112+
113+
### Specify default
114+
115+
```
116+
$('#demo').pagination({
117+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 35],
118+
pageSize: 5,
119+
pageNumber: 3,
120+
callback: function(data, pagination){
121+
// template method of yourself
122+
var html = template(data);
123+
dataContainer.html(html);
124+
}
125+
})
126+
```
127+
128+
### Format result data
129+
130+
```
131+
$('#demo').pagination({
132+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 100],
133+
pageSize: 8,
134+
formatResult: function(data){
135+
var result = [];
136+
for(var i = 0, len = data.length; i < len; i++){
137+
result.push(data[i] + ' - good guys');
138+
}
139+
return result;
140+
},
141+
callback: function(data, pagination){
142+
// template method of yourself
143+
var html = template(data);
144+
dataContainer.html(html);
145+
}
146+
})
147+
```
148+
149+
### Another format result data
150+
151+
```
152+
$('#demo').pagination({
153+
dataSource: [{a :1}, {a :2}, {a :3}, {a :4}, ... , {a :50}],
154+
pageSize: 8,
155+
formatResult: function(data){
156+
for(var i = 0, len = data.length; i < len; i++){
157+
data[i].a = data[i].a + ' - bad guys';
158+
}
159+
},
160+
callback: function(data, pagination){
161+
// template method of yourself
162+
var html = template(data);
163+
dataContainer.html(html);
164+
}
165+
})
166+
```
167+
168+
### Format navigator
169+
170+
```
171+
$('#demo').pagination({
172+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 15],
173+
pageSize: 5,
174+
showNavigator: true,
175+
formatNavigator: '<span style="color: #f00"><%= currentPage %></span> st/rd/th, <%= totalPage %> pages, <%= totalNumber %> entries',
176+
position: 'top',
177+
callback: function(data, pagination){
178+
// template method of yourself
179+
var html = template(data);
180+
dataContainer.html(html);
181+
}
182+
})
183+
```
184+
185+
### Format "go" input
186+
187+
```
188+
$('#demo').pagination({
189+
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 25],
190+
pageSize: 5,
191+
showGoInput: true,
192+
showGoButton: true,
193+
formatGoInput: 'go to <%= input %> st/rd/th',
194+
callback: function(data, pagination){
195+
// template method of yourself
196+
var html = template(data);
197+
dataContainer.html(html);
198+
}
199+
})
200+
```
201+
202+
# License
203+
Released under the MIT license.
204+
205+
MIT: [http://rem.mit-license.org](http://rem.mit-license.org/), See [LICENSE](/LICENSE)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "paginationjs",
3+
"version": "2.0.5",
4+
"main": "./pagination.min.js",
5+
"ignore": [
6+
"**/.*",
7+
"examples",
8+
"LICENSE",
9+
"component.json",
10+
"bower.json",
11+
"package.json",
12+
"README*.md",
13+
"example.js",
14+
"Gruntfile.js"
15+
]
16+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "paginationjs",
3+
"version": "2.0.5",
4+
"repo": "superRaytin/paginationjs",
5+
"description": "A jQuery plugin to provide simple yet fully customisable pagination",
6+
"keywords": [
7+
"paginationjs",
8+
"pagination.js",
9+
"pagination",
10+
"jquery.pagination",
11+
"jquery pagination"
12+
],
13+
"main": "dist/pagination.min.js",
14+
"scripts": [
15+
"dist/pagination.min.js",
16+
"dist/pagination.js",
17+
"dist/pagination-with-styles.min.js",
18+
"dist/pagination-with-styles.js",
19+
"dist/pagination.css",
20+
"dist/pagination.less"
21+
],
22+
"license": "MIT"
23+
}

0 commit comments

Comments
 (0)