kaminari-bootstrap-3000 0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 778e5e0addec29bbc0b29d7215cbcc2dd55714ee
4
+ data.tar.gz: f43b7fe3f985c3cb5635b2faf9edd3aa2a84d37b
5
+ SHA512:
6
+ metadata.gz: c7c939981119e8aa9a811de16b42aca7277f942e56355aa4d91a0ddb7320bb59c9e15d35ea77122ab2b8bd5024fa08d8eb03d9952a2ed33709e778c8cb11ef7d
7
+ data.tar.gz: de159169dff9c6ad2495aacf94de124a485e7300bd81d07cb9d1c5d4a5f7e339b740611156d7d45a33cf28c8c36c0cb7d68a397107283410690ebbb95cf1f2ad
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Hyo Seong Choi
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # Kaminari::Bootstrap3000
2
+
3
+ Original Git source - https://github.com/elik-ri/kaminari-bootstrap-3000
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'kaminari-bootstrap-3000'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install kaminari-bootstrap-3000
19
+
20
+ ## Usage
21
+
22
+ in app/assets/application.js
23
+
24
+ ```
25
+ //= require kaminari-bootstrap-3000
26
+ ```
27
+
28
+ in app/assets/application.scss
29
+
30
+ ```
31
+ @import "bootstrap";
32
+ @import "kaminari-bootstrap-3000";
33
+ ```
34
+
35
+ in view
36
+
37
+ ```
38
+ <%= paginate3000 @objects %>
39
+ ```
40
+
41
+ That's it
42
+
43
+ ## Contributing
44
+
45
+ 1. Fork it
46
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
47
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
48
+ 4. Push to the branch (`git push origin my-new-feature`)
49
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ <%= url %><%= url.match(/\?/) ? "&" : "?" -%>
@@ -0,0 +1,12 @@
1
+ <%= paginator.render do -%>
2
+ <div class="paginator" id="paginator_example" style=""></div>
3
+ <script type="text/javascript">
4
+ paginator_example = new Paginator(
5
+ "paginator_example", // id контейнера, куда ляжет пагинатор
6
+ <%= total_pages %>, // общее число страниц
7
+ 20, // число страниц, видимых одновременно
8
+ <%= current_page %>, // номер текущей страницы/
9
+ "<%= first_page_tag %>page="
10
+ );
11
+ </script>
12
+ <% end -%>
@@ -0,0 +1,10 @@
1
+ module Kaminari
2
+ end
3
+
4
+ require 'kaminari/bootstrap3000/helpers/action_view_extension'
5
+ require 'kaminari/bootstrap3000/hooks'
6
+
7
+ if defined? Rails
8
+ require 'kaminari/bootstrap3000/railtie'
9
+ require 'kaminari/bootstrap3000/engine'
10
+ end
@@ -0,0 +1,6 @@
1
+ module Kaminari #:nodoc:
2
+ module Bootstrap3000
3
+ class Engine < ::Rails::Engine #:nodoc:
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,37 @@
1
+ module Kaminari
2
+ module Bootstrap3000
3
+ # = Helpers
4
+ module ActionViewExtension
5
+ # A helper that renders the pagination links.
6
+ #
7
+ # <%= paginate @articles %>
8
+ #
9
+ # ==== Options
10
+ # * <tt>:window</tt> - The "inner window" size (4 by default).
11
+ # * <tt>:outer_window</tt> - The "outer window" size (0 by default).
12
+ # * <tt>:left</tt> - The "left outer window" size (0 by default).
13
+ # * <tt>:right</tt> - The "right outer window" size (0 by default).
14
+ # * <tt>:params</tt> - url_for parameters for the links (:controller, :action, etc.)
15
+ # * <tt>:param_name</tt> - parameter name for page number in the links (:page by default)
16
+ # * <tt>:remote</tt> - Ajax? (false by default)
17
+ # * <tt>:ANY_OTHER_VALUES</tt> - Any other hash key & values would be directly passed into each tag as :locals value.
18
+
19
+
20
+
21
+ def paginate3000stats(scope, options = {}, &block)
22
+ raw %Q(<div class="paginator_totals panel panel-default">
23
+ <div class="panel-body text-right">
24
+ <div class="items">#{scope.total_count} #{Russian.p(scope.total_count,"запись","записи","записей")}</div>
25
+ <div class="pages">#{scope.total_pages} #{Russian.p(scope.total_pages,"страница","страницы","страниц")}</div>
26
+ </div>
27
+ </div>)
28
+ end
29
+
30
+ def paginate3000(scope, options = {}, &block)
31
+ paginate3000stats(scope)+
32
+ paginate(scope,options.reverse_merge(:theme => '3000'),&block)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,11 @@
1
+ module Kaminari
2
+ module Bootstrap3000
3
+ class Hooks
4
+ def self.init
5
+ ActiveSupport.on_load(:action_view) do
6
+ ::ActionView::Base.send :include, Kaminari::Bootstrap3000::ActionViewExtension
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module Kaminari
2
+ module Bootstrap3000
3
+ class Railtie < ::Rails::Railtie #:nodoc:
4
+ initializer 'kaminari-bootstrap-3000' do |_app|
5
+ Kaminari::Bootstrap3000::Hooks.init
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,5 @@
1
+ module Kaminari
2
+ module Bootstrap3000
3
+ VERSION = "0.1"
4
+ end
5
+ end
@@ -0,0 +1,397 @@
1
+ /*
2
+ Paginator 3000
3
+ - idea by ecto (ecto.ru)
4
+ - coded by karaboz (karaboz.ru)
5
+
6
+ How to implement:
7
+ <div class="paginator" id="paginator_example"></div>
8
+ <script type="text/javascript">
9
+ paginator_example = new Paginator('paginator_example', 2048, 10, 1, 'http://www.yourwebsite.com/pages/');
10
+ </script>
11
+
12
+ Be sure that width of your paginator does not change after page is loaded
13
+ If it happens you must call Paginator.resizePaginator(paginator_example) function to redraw paginator
14
+
15
+ */
16
+
17
+ /*
18
+ Paginator class
19
+ paginatorHolderId - id of the html element where paginator will be placed as innerHTML (String): required
20
+ pagesTotal - number of pages (Number, required)
21
+ pagesSpan - number of pages which are visible at once (Number, required)
22
+ pageCurrent - the number of current page (Number, required)
23
+ baseUrl - the url of the website (String)
24
+ if baseUrl is 'http://www.yourwebsite.com/pages/' the links on the pages will be:
25
+ http://www.yourwebsite.com/pages/1, http://www.yourwebsite.com/pages/2, etc
26
+ */
27
+ var Paginator = function(paginatorHolderId, pagesTotal, pagesSpan, pageCurrent, baseUrl){
28
+ if(!document.getElementById(paginatorHolderId) || !pagesTotal || !pagesSpan) return false;
29
+
30
+ this.inputData = {
31
+ paginatorHolderId: paginatorHolderId,
32
+ pagesTotal: pagesTotal,
33
+ pagesSpan: pagesSpan < pagesTotal ? pagesSpan : pagesTotal,
34
+ pageCurrent: pageCurrent,
35
+ baseUrl: baseUrl ? baseUrl : '/pages/'
36
+ };
37
+
38
+ this.html = {
39
+ holder: null,
40
+
41
+ table: null,
42
+ trPages: null,
43
+ trScrollBar: null,
44
+ tdsPages: null,
45
+
46
+ scrollBar: null,
47
+ scrollThumb: null,
48
+
49
+ pageCurrentMark: null
50
+ };
51
+
52
+
53
+ this.prepareHtml();
54
+
55
+ this.initScrollThumb();
56
+ this.initPageCurrentMark();
57
+ this.initEvents();
58
+
59
+ this.scrollToPageCurrent();
60
+ }
61
+
62
+ /*
63
+ Set all .html properties (links to dom objects)
64
+ */
65
+ Paginator.prototype.prepareHtml = function(){
66
+
67
+ this.html.holder = document.getElementById(this.inputData.paginatorHolderId);
68
+ this.html.holder.innerHTML = this.makePagesTableHtml();
69
+
70
+ this.html.table = this.html.holder.getElementsByTagName('table')[0];
71
+
72
+ var trPages = this.html.table.getElementsByTagName('tr')[0];
73
+ this.html.tdsPages = trPages.getElementsByTagName('td');
74
+
75
+ this.html.scrollBar = getElementsByClassName(this.html.table, 'div', 'scroll_bar')[0];
76
+ this.html.scrollThumb = getElementsByClassName(this.html.table, 'div', 'scroll_thumb')[0];
77
+ this.html.pageCurrentMark = getElementsByClassName(this.html.table, 'div', 'current_page_mark')[0];
78
+
79
+ // hide scrollThumb if there is no scroll (we see all pages at once)
80
+ if(this.inputData.pagesSpan == this.inputData.pagesTotal){
81
+ addClass(this.html.holder, 'fullsize');
82
+ }
83
+ }
84
+
85
+ /*
86
+ Make html for pages (table)
87
+ */
88
+ Paginator.prototype.makePagesTableHtml = function(){
89
+ var tdWidth = (100 / this.inputData.pagesSpan) + '%';
90
+
91
+ var html = '' +
92
+ '<table width="100%">' +
93
+ '<tr>'
94
+ for (var i=1; i<=this.inputData.pagesSpan; i++){
95
+ html += '<td width="' + tdWidth + '"></td>';
96
+ }
97
+ html += '' +
98
+ '</tr>' +
99
+ '<tr>' +
100
+ '<td colspan="' + this.inputData.pagesSpan + '">' +
101
+ '<div class="scroll_bar">' +
102
+ '<div class="scroll_trough"></div>' +
103
+ '<div class="scroll_thumb">' +
104
+ '<div class="scroll_knob"></div>' +
105
+ '</div>' +
106
+ '<div class="current_page_mark"></div>' +
107
+ '</div>' +
108
+ '</td>' +
109
+ '</tr>' +
110
+ '</table>';
111
+
112
+ return html;
113
+ }
114
+
115
+ /*
116
+ Set all needed properties for scrollThumb and it's width
117
+ */
118
+ Paginator.prototype.initScrollThumb = function(){
119
+ this.html.scrollThumb.widthMin = '8'; // minimum width of the scrollThumb (px)
120
+ this.html.scrollThumb.widthPercent = this.inputData.pagesSpan/this.inputData.pagesTotal * 100;
121
+
122
+ this.html.scrollThumb.xPosPageCurrent = (this.inputData.pageCurrent - Math.round(this.inputData.pagesSpan/2))/this.inputData.pagesTotal * this.html.table.offsetWidth;
123
+ this.html.scrollThumb.xPos = this.html.scrollThumb.xPosPageCurrent;
124
+
125
+ this.html.scrollThumb.xPosMin = 0;
126
+ this.html.scrollThumb.xPosMax;
127
+
128
+ this.html.scrollThumb.widthActual;
129
+
130
+ this.setScrollThumbWidth();
131
+
132
+ }
133
+
134
+ Paginator.prototype.setScrollThumbWidth = function(){
135
+ // Try to set width in percents
136
+ this.html.scrollThumb.style.width = this.html.scrollThumb.widthPercent + "%";
137
+
138
+ // Fix the actual width in px
139
+ this.html.scrollThumb.widthActual = this.html.scrollThumb.offsetWidth;
140
+
141
+ // If actual width less then minimum which we set
142
+ if(this.html.scrollThumb.widthActual < this.html.scrollThumb.widthMin){
143
+ this.html.scrollThumb.style.width = this.html.scrollThumb.widthMin + 'px';
144
+ }
145
+
146
+ this.html.scrollThumb.xPosMax = this.html.table.offsetWidth - this.html.scrollThumb.widthActual;
147
+ }
148
+
149
+ Paginator.prototype.moveScrollThumb = function(){
150
+ this.html.scrollThumb.style.left = this.html.scrollThumb.xPos + "px";
151
+ }
152
+
153
+
154
+ /*
155
+ Set all needed properties for pageCurrentMark, it's width and move it
156
+ */
157
+ Paginator.prototype.initPageCurrentMark = function(){
158
+ this.html.pageCurrentMark.widthMin = '3';
159
+ this.html.pageCurrentMark.widthPercent = 100 / this.inputData.pagesTotal;
160
+ this.html.pageCurrentMark.widthActual;
161
+
162
+ this.setPageCurrentPointWidth();
163
+ this.movePageCurrentPoint();
164
+ }
165
+
166
+ Paginator.prototype.setPageCurrentPointWidth = function(){
167
+ // Try to set width in percents
168
+ this.html.pageCurrentMark.style.width = this.html.pageCurrentMark.widthPercent + '%';
169
+
170
+ // Fix the actual width in px
171
+ this.html.pageCurrentMark.widthActual = this.html.pageCurrentMark.offsetWidth;
172
+
173
+ // If actual width less then minimum which we set
174
+ if(this.html.pageCurrentMark.widthActual < this.html.pageCurrentMark.widthMin){
175
+ this.html.pageCurrentMark.style.width = this.html.pageCurrentMark.widthMin + 'px';
176
+ }
177
+ }
178
+
179
+ Paginator.prototype.movePageCurrentPoint = function(){
180
+ if(this.html.pageCurrentMark.widthActual < this.html.pageCurrentMark.offsetWidth){
181
+ this.html.pageCurrentMark.style.left = (this.inputData.pageCurrent - 1)/this.inputData.pagesTotal * this.html.table.offsetWidth - this.html.pageCurrentMark.offsetWidth/2 + "px";
182
+ } else {
183
+ this.html.pageCurrentMark.style.left = (this.inputData.pageCurrent - 1)/this.inputData.pagesTotal * this.html.table.offsetWidth + "px";
184
+ }
185
+ }
186
+
187
+
188
+
189
+ /*
190
+ Drag, click and resize events
191
+ */
192
+ Paginator.prototype.initEvents = function(){
193
+ var _this = this;
194
+
195
+ this.html.scrollThumb.onmousedown = function(e){
196
+ if (!e) var e = window.event;
197
+ e.cancelBubble = true;
198
+ if (e.stopPropagation) e.stopPropagation();
199
+
200
+ var dx = getMousePosition(e).x - this.xPos;
201
+ document.onmousemove = function(e){
202
+ if (!e) var e = window.event;
203
+ _this.html.scrollThumb.xPos = getMousePosition(e).x - dx;
204
+
205
+ // the first: draw pages, the second: move scrollThumb (it was logically but ie sucks!)
206
+ _this.moveScrollThumb();
207
+ _this.drawPages();
208
+
209
+
210
+ }
211
+ document.onmouseup = function(){
212
+ document.onmousemove = null;
213
+ _this.enableSelection();
214
+ }
215
+ _this.disableSelection();
216
+ }
217
+
218
+ this.html.scrollBar.onmousedown = function(e){
219
+ if (!e) var e = window.event;
220
+ if(matchClass(_this.paginatorBox, 'fullsize')) return;
221
+
222
+ _this.html.scrollThumb.xPos = getMousePosition(e).x - getPageX(_this.html.scrollBar) - _this.html.scrollThumb.offsetWidth/2;
223
+
224
+ _this.moveScrollThumb();
225
+ _this.drawPages();
226
+
227
+
228
+ }
229
+
230
+ // Comment the row beneath if you set paginator width fixed
231
+ addEvent(window, 'resize', function(){Paginator.resizePaginator(_this)});
232
+ }
233
+
234
+ /*
235
+ Redraw current span of pages
236
+ */
237
+ Paginator.prototype.drawPages = function(){
238
+ var percentFromLeft = this.html.scrollThumb.xPos/(this.html.table.offsetWidth);
239
+ var cellFirstValue = Math.round(percentFromLeft * this.inputData.pagesTotal);
240
+
241
+ var html = "";
242
+ // drawing pages control the position of the scrollThumb on the edges!
243
+ if(cellFirstValue < 1){
244
+ cellFirstValue = 1;
245
+ this.html.scrollThumb.xPos = 0;
246
+ this.moveScrollThumb();
247
+ } else if(cellFirstValue >= this.inputData.pagesTotal - this.inputData.pagesSpan) {
248
+ cellFirstValue = this.inputData.pagesTotal - this.inputData.pagesSpan + 1;
249
+ this.html.scrollThumb.xPos = this.html.table.offsetWidth - this.html.scrollThumb.offsetWidth;
250
+ this.moveScrollThumb();
251
+ }
252
+
253
+
254
+
255
+ for(var i=0; i<this.html.tdsPages.length; i++){
256
+ var cellCurrentValue = cellFirstValue + i;
257
+ if(cellCurrentValue == this.inputData.pageCurrent){
258
+ html = "<span>" + "<strong>" + cellCurrentValue + "</strong>" + "</span>";
259
+ } else {
260
+ // if baseUrl is function
261
+ var url = (typeof this.inputData.baseUrl == 'function')
262
+ ? this.inputData.baseUrl(cellCurrentValue)
263
+ : this.inputData.baseUrl + cellCurrentValue;
264
+ html = "<span>" + "<a href='" + url + "'>" + cellCurrentValue + "</a>" + "</span>";
265
+ }
266
+ this.html.tdsPages[i].innerHTML = html;
267
+ }
268
+ }
269
+
270
+ /*
271
+ Scroll to current page
272
+ */
273
+ Paginator.prototype.scrollToPageCurrent = function(){
274
+ this.html.scrollThumb.xPosPageCurrent = (this.inputData.pageCurrent - Math.round(this.inputData.pagesSpan/2))/this.inputData.pagesTotal * this.html.table.offsetWidth;
275
+ this.html.scrollThumb.xPos = this.html.scrollThumb.xPosPageCurrent;
276
+
277
+ this.moveScrollThumb();
278
+ this.drawPages();
279
+
280
+ }
281
+
282
+
283
+
284
+ Paginator.prototype.disableSelection = function(){
285
+ document.onselectstart = function(){
286
+ return false;
287
+ }
288
+ this.html.scrollThumb.focus();
289
+ }
290
+
291
+ Paginator.prototype.enableSelection = function(){
292
+ document.onselectstart = function(){
293
+ return true;
294
+ }
295
+ }
296
+
297
+ /*
298
+ Function is used when paginator was resized (window.onresize fires it automatically)
299
+ Use it when you change paginator with DHTML
300
+ Do not use it if you set fixed width of paginator
301
+ */
302
+ Paginator.resizePaginator = function (paginatorObj){
303
+
304
+ paginatorObj.setPageCurrentPointWidth();
305
+ paginatorObj.movePageCurrentPoint();
306
+
307
+ paginatorObj.setScrollThumbWidth();
308
+ paginatorObj.scrollToPageCurrent();
309
+ }
310
+
311
+
312
+
313
+
314
+ /*
315
+ Global functions which are used
316
+ */
317
+ function getElementsByClassName(objParentNode, strNodeName, strClassName){
318
+ var nodes = objParentNode.getElementsByTagName(strNodeName);
319
+ if(!strClassName){
320
+ return nodes;
321
+ }
322
+ var nodesWithClassName = [];
323
+ for(var i=0; i<nodes.length; i++){
324
+ if(matchClass( nodes[i], strClassName )){
325
+ nodesWithClassName[nodesWithClassName.length] = nodes[i];
326
+ }
327
+ }
328
+ return nodesWithClassName;
329
+ }
330
+
331
+
332
+ function addClass( objNode, strNewClass ) {
333
+ replaceClass( objNode, strNewClass, '' );
334
+ }
335
+
336
+ function removeClass( objNode, strCurrClass ) {
337
+ replaceClass( objNode, '', strCurrClass );
338
+ }
339
+
340
+ function replaceClass( objNode, strNewClass, strCurrClass ) {
341
+ var strOldClass = strNewClass;
342
+ if ( strCurrClass && strCurrClass.length ){
343
+ strCurrClass = strCurrClass.replace( /\s+(\S)/g, '|$1' );
344
+ if ( strOldClass.length ) strOldClass += '|';
345
+ strOldClass += strCurrClass;
346
+ }
347
+ objNode.className = objNode.className.replace( new RegExp('(^|\\s+)(' + strOldClass + ')($|\\s+)', 'g'), '$1' );
348
+ objNode.className += ( (objNode.className.length)? ' ' : '' ) + strNewClass;
349
+ }
350
+
351
+ function matchClass( objNode, strCurrClass ) {
352
+ return ( objNode && objNode.className.length && objNode.className.match( new RegExp('(^|\\s+)(' + strCurrClass + ')($|\\s+)') ) );
353
+ }
354
+
355
+
356
+ function addEvent(objElement, strEventType, ptrEventFunc) {
357
+ if (objElement.addEventListener)
358
+ objElement.addEventListener(strEventType, ptrEventFunc, false);
359
+ else if (objElement.attachEvent)
360
+ objElement.attachEvent('on' + strEventType, ptrEventFunc);
361
+ }
362
+ function removeEvent(objElement, strEventType, ptrEventFunc) {
363
+ if (objElement.removeEventListener) objElement.removeEventListener(strEventType, ptrEventFunc, false);
364
+ else if (objElement.detachEvent) objElement.detachEvent('on' + strEventType, ptrEventFunc);
365
+ }
366
+
367
+
368
+ function getPageY( oElement ) {
369
+ var iPosY = oElement.offsetTop;
370
+ while ( oElement.offsetParent != null ) {
371
+ oElement = oElement.offsetParent;
372
+ iPosY += oElement.offsetTop;
373
+ if (oElement.tagName == 'BODY') break;
374
+ }
375
+ return iPosY;
376
+ }
377
+
378
+ function getPageX( oElement ) {
379
+ var iPosX = oElement.offsetLeft;
380
+ while ( oElement.offsetParent != null ) {
381
+ oElement = oElement.offsetParent;
382
+ iPosX += oElement.offsetLeft;
383
+ if (oElement.tagName == 'BODY') break;
384
+ }
385
+ return iPosX;
386
+ }
387
+
388
+ function getMousePosition(e) {
389
+ if (e.pageX || e.pageY){
390
+ var posX = e.pageX;
391
+ var posY = e.pageY;
392
+ }else if (e.clientX || e.clientY) {
393
+ var posX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
394
+ var posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
395
+ }
396
+ return {x:posX, y:posY}
397
+ }
@@ -0,0 +1,143 @@
1
+ /*
2
+ Paginator 3000
3
+ - idea by ecto (ecto.ru)
4
+ - coded by karaboz (karaboz.ru)
5
+
6
+ HTML example
7
+ <div class="paginator" id="paginator_example">
8
+ <table>
9
+ <tr>
10
+ <td><span><strong>1</strong></span></td>
11
+ ...
12
+ <td><span><a href="">3000</a></span></td>
13
+ </tr>
14
+ <tr>
15
+ <td colspan="">
16
+ <div class="scroll_bar">
17
+ <div class="scroll_trough"></div>
18
+ <div class="scroll_thumb">
19
+ <div class="scroll_knob"></div>
20
+ </div>
21
+ <div class="current_page_mark"></div>
22
+ </div>
23
+ </td>
24
+
25
+ </tr>
26
+ </table>
27
+ </div>
28
+ */
29
+
30
+ .paginator_totals {
31
+ float: left;
32
+ width: 15%;
33
+ height: 86px;
34
+ margin-top: 30px;
35
+ }
36
+ .paginator_totals .items{
37
+ font-size: 1.6em;
38
+ font-weight: bold;
39
+ }
40
+ .paginator_totals .pages{
41
+ font-size: 1.1em;
42
+ }
43
+ .paginator {
44
+ margin-top:60px;
45
+ font-size:1em;
46
+ width: 85%;
47
+ float:left;
48
+ padding-left: 20px;
49
+ }
50
+ .paginator table {
51
+ border-collapse:collapse;
52
+ table-layout:fixed;
53
+ width:100%;
54
+ }
55
+ .paginator table td {
56
+ padding:0;
57
+ white-space:nowrap;
58
+ text-align:center;
59
+ }
60
+ .paginator span {
61
+ display:block;
62
+ padding:3px 0;
63
+ color:#fff;
64
+ }
65
+ .paginator span strong,
66
+ .paginator span a {
67
+ padding:2px 6px;
68
+ }
69
+ .paginator span strong {
70
+ background:#ff6c24;
71
+ font-style:normal;
72
+ font-weight:normal;
73
+ }
74
+ .paginator .scroll_bar {
75
+ width:100%; height:20px;
76
+ position:relative;
77
+ margin-top:10px;
78
+ }
79
+ .paginator .scroll_trough {
80
+ width:100%; height:3px;
81
+ background:#ccc;
82
+ overflow:hidden;
83
+ }
84
+ .paginator .scroll_thumb {
85
+ position:absolute;
86
+ z-index:2;
87
+ width:0; height:3px;
88
+ top:0; left:0;
89
+ font-size:1px;
90
+ background:#363636;
91
+ }
92
+ .paginator .scroll_knob {
93
+ position:absolute;
94
+ top:-5px; left:50%;
95
+ margin-left:-10px;
96
+ width:20px; height:20px;
97
+ overflow:hidden;
98
+ background: image-url('kaminari-bootstrap-3000/slider_knob.gif') no-repeat 50% 50%;
99
+ cursor:pointer; cursor:hand;
100
+ }
101
+ .paginator .current_page_mark {
102
+ position:absolute;
103
+ z-index:1;
104
+ top:0; left:0;
105
+ width:0; height:3px;
106
+ overflow:hidden;
107
+ background:#ff6c24;
108
+ }
109
+
110
+ .fullsize .scroll_thumb {
111
+ display:none;
112
+ }
113
+
114
+
115
+ .paginator_pages {
116
+ width:600px;
117
+ text-align:right;
118
+ font-size:0.8em;
119
+ color:#808080;
120
+ margin-top:-10px;
121
+ }
122
+
123
+ @media (max-width: $screen-xs-max) {
124
+ .paginator_totals {
125
+ width: 100%;
126
+ height: 86px;
127
+ margin-top: 30px;
128
+ }
129
+ .paginator {
130
+ margin-top:0px;
131
+ font-size:1em;
132
+ width: 100%;
133
+ padding-left: 0px;
134
+ }
135
+ }
136
+ @media (min-width: $screen-sm-min) and (max-width: $screen-md-max) {
137
+ .paginator_totals {
138
+ width: 25%;
139
+ }
140
+ .paginator {
141
+ width: 75%;
142
+ }
143
+ }
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kaminari-bootstrap-3000
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Elchinov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Paginator3000+bootstrap3 skin for Kaminari
56
+ email:
57
+ - elik@elik.ru
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE.txt
63
+ - README.md
64
+ - app/views/kaminari/3000/_first_page.html.erb
65
+ - app/views/kaminari/3000/_paginator.html.erb
66
+ - lib/kaminari-bootstrap-3000.rb
67
+ - lib/kaminari/bootstrap3000/engine.rb
68
+ - lib/kaminari/bootstrap3000/helpers/action_view_extension.rb
69
+ - lib/kaminari/bootstrap3000/hooks.rb
70
+ - lib/kaminari/bootstrap3000/railtie.rb
71
+ - lib/kaminari/bootstrap3000/version.rb
72
+ - vendor/assets/images/kaminari-bootstrap-3000/slider_knob.gif
73
+ - vendor/assets/javascripts/kaminari-bootstrap-3000.js
74
+ - vendor/assets/stylesheets/kaminari-bootstrap-3000.scss
75
+ homepage: http://github.com/elik-ru/kaminari-bootstrap-3000/
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.8
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Packaging the assets with Bunlder
99
+ test_files: []
100
+ has_rdoc: