-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
215 lines (192 loc) · 7.65 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Pagination using activejs and jquery</title>
<style type="text/css">
body, a{font-size: 70%; font: 8px Arial, Helvetica sans-serif;}
ul.ui-paginated{list-style-type: none; padding: 0; width: 250px; border: 1px solid #f0f0f0;}
#col1, #col2, #col3{float: left;}
ul.ui-paginated li{margin: 1px; border: 1px solid #ccc;}
ul.ui-paginated h2 {font-size: 10px; margin: 0; padding: 0;}
.ui-paginated-nav{width: 250px;position: relative;}
.ui-paginated-nav .ui-pager>div{display: block; position: relative; overflow: hidden; height: 20px; width: 100%; clear: right;}
.ui-paginated-nav .ui-pager>div>*{}
.ui-paginated-nav .ui-pager a.previous{position: absolute; display: block; left: 0; width: 55px;}
.ui-paginated-nav .ui-pager a.next{position: absolute; right: 0; width: 55px; text-align: right;}
.ui-paginated-nav .ui-pager .startpoints{position: absolute; left: 55px;}
.ui-paginated-nav .ui-pager .endpoints{position: absolute; right: 55px;}
/* IE */
ul.ui-paginated{margin-left: 0}
</style>
<script type="text/javascript" src="active.js" runat="both" autoload="true"></script>
<script type="text/javascript" src="jquery-1.3.2.js" runat="both"></script>
<script type="text/javascript" src="jquery.profile.js" runat="both" autoload="true"></script>
<script type="text/javascript" src="jquery.parseQuery.js" runat="both"></script>
<script type="text/javascript" src="jquery.parseUri.js" runat="both"></script>
<script type="text/javascript" src="jquery.domToSelector.js" runat="both"></script>
<script type="text/javascript" src="jquery.history.js" runat="client"></script>
<script type="text/javascript" src="jquery.object_utils.js" runat="client"></script>
<script type="text/javascript" src="jquery.remote.js" runat="both"></script>
<script src="jaxer-include/jquery.serverPagination.js" runat="server" ></script>
<script type="text/javascript" runat="server">
$(document).ready(function(){
var opts = {};
opts.definition = {'fieldDefinition': { title: '', text: ''} }; //for ActiveRecord.define :
opts.randomText = {language: ''};
opts.randomText.params = { title: 15, text: 80};
opts.startpoints = 4;
opts.endpoints = 3;
$('#posts').serverPagination(opts);
$('#postts').serverPagination({'allpoints': true});
$('#books').serverPagination();
});
</script>
<script runat='server-proxy'>
function posts(offset, limit){
//Jaxer.load('../latest/active.js');
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('posts',{title: '',text: ''});
Post.belongsTo('users');
return Post.find({all: true, order: 'id DESC', offset: offset, limit: limit });
}
function postsById(postId){
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('posts',{title: '',text: ''});
return Post.find({ all: true, where: {id: postId} });
}
function postts(offset, limit){
//Jaxer.load('../latest/active.js');
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('postts',{title: '',text: ''});
return Post.find({all: true, order: 'id DESC', offset: offset, limit: limit });
}
function posttsById(postId){
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('postts',{title: '',text: ''});
return Post.find({ all: true, where: {id: postId} });
}
function books(offset, limit){
//Jaxer.load('../latest/active.js');
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('books',{name: '',author: ''});
Post.belongsTo('users');
return Post.find({all: true, order: 'id DESC', offset: offset, limit: limit });
}
function booksById(postId){
ActiveRecord.connect(ActiveRecord.Adapters.JaxerSQLite);
var Post = ActiveRecord.define('books',{name: '',author: ''});
Post.belongsTo('users');
return Post.find({ all: true, where: {id: postId} });
}
</script>
<script src="jquery.transition.js" type="text/javascript" runat="client"></script>
<script src="jquery.clientPagination.js" type="text/javascript" runat="client"></script>
<script type="text/javascript" runat="client">
$(document).ready(function(){
//target usage : $('.pagination').pagination($tpl_pager, $tpl_list, $tpl_item, pairs selector - value (db field), array paramNames );
$('#posts').clientPagination({'startpoints':4, 'endpoints': 3, 'tpl_pager': false, 'tpl_list': false, 'tpl_item': false, 'data': {'1': {'1': 'fieldName', '2': '.selector'}} });
$('#postts').clientPagination({'allpoints': true, 'tpl_pager': false, 'tpl_list': false, 'tpl_item': false, 'transition': 'reversed', 'data': {'1': {'1': 'fieldName', '2': '.selector'}} });
$('#books').clientPagination();
});
</script>
</head>
<body>
<div id="col1">
<ul id="posts">
<li>
<h2 class="title"></h2>
<span class="text"></span>
<span class="mysterious"></span>
<span class="i"></span>
<span class="id"></span>
</li>
</ul>
<div class="ui-paginated-nav">
<div class="ui-pager">
<div>
<a href="index.html" class="previous">previous</a>
<span class="startpoints"></span>
<span class="endpoints"></span>
<a href="index.html" class="next">next</a>
</div>
<div>
limit
<span class="limit">
<a href="index.html?posts~limit=5">5</a>
<a href="index.html?posts~limit=10">10</a>
<a href="index.html?posts~limit=50">50</a>
<a href="index.html?posts~limit=100">100</a>
</span>
count <span class="count"></span>
</div>
</div>
</div>
</div>
<div id="col2">
<ul id="postts">
<li>
<h2 class="title"></h2>
<span class="text"></span>
<span class="mysterious"></span>
<span class="i"></span>
<span class="id"></span>
</li>
</ul>
<div class="ui-paginated-nav">
<div class="ui-pager">
<div>
<a href="index.html" class="previous">previous</a>
<a href="index.html" class="next">next</a>
</div>
<span class="allpoints"></span>
<div>
limit
<span class="limit">
<a href="index.html?postts~limit=5">5</a>
<a href="index.html?postts~limit=10">10</a>
<a href="index.html?postts~limit=50">50</a>
<a href="index.html?postts~limit=100">100</a>
</span>
total post count<span class="count"></span>
</div>
<div>
<form class="limit">
<select>
<option value="index.html?postts~limit=2">2</option>
<option value="index.html?postts~limit=4">4</option>
<option value="index.html?postts~limit=6">6</option>
</select>
</form>
</div>
</div>
</div>
</div>
<div id="col3">
<ul id="books">
<li>
<h2 class="name"></h2>
<span class="author"></span>
<span class="i"></span>
<span class="id"></span>
</li>
</ul>
<div class="ui-paginated-nav">
<div class="ui-pager">
<div>
<a href="index.html" class="previous">previous</a>
<a href="index.html" class="next">next</a>
</div>
<div>
<span class="limit">
<a href="index.html?books~limit=5">5</a>
<a href="index.html?books~limit=10">10</a>
<a href="index.html?books~limit=15">15</a>
</span>
total post count<span class="count"></span>
</div>
</div>
</div>
</div>
</body>
</html>