ink_ui_rails 2.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +39 -0
  4. data/lib/ink_ui_rails.rb +8 -0
  5. data/lib/ink_ui_rails/version.rb +3 -0
  6. data/vendor/assets/fonts/font/FontAwesome.otf +0 -0
  7. data/vendor/assets/fonts/font/fontawesome-webfont.eot +0 -0
  8. data/vendor/assets/fonts/font/fontawesome-webfont.svg +399 -0
  9. data/vendor/assets/fonts/font/fontawesome-webfont.ttf +0 -0
  10. data/vendor/assets/fonts/font/fontawesome-webfont.woff +0 -0
  11. data/vendor/assets/fonts/font/ubuntu-b-webfont.eot +0 -0
  12. data/vendor/assets/fonts/font/ubuntu-b-webfont.svg +245 -0
  13. data/vendor/assets/fonts/font/ubuntu-b-webfont.ttf +0 -0
  14. data/vendor/assets/fonts/font/ubuntu-b-webfont.woff +0 -0
  15. data/vendor/assets/fonts/font/ubuntu-bi-webfont.eot +0 -0
  16. data/vendor/assets/fonts/font/ubuntu-bi-webfont.svg +245 -0
  17. data/vendor/assets/fonts/font/ubuntu-bi-webfont.ttf +0 -0
  18. data/vendor/assets/fonts/font/ubuntu-bi-webfont.woff +0 -0
  19. data/vendor/assets/fonts/font/ubuntu-c-webfont.eot +0 -0
  20. data/vendor/assets/fonts/font/ubuntu-c-webfont.svg +245 -0
  21. data/vendor/assets/fonts/font/ubuntu-c-webfont.ttf +0 -0
  22. data/vendor/assets/fonts/font/ubuntu-c-webfont.woff +0 -0
  23. data/vendor/assets/fonts/font/ubuntu-l-webfont.eot +0 -0
  24. data/vendor/assets/fonts/font/ubuntu-l-webfont.svg +245 -0
  25. data/vendor/assets/fonts/font/ubuntu-l-webfont.ttf +0 -0
  26. data/vendor/assets/fonts/font/ubuntu-l-webfont.woff +0 -0
  27. data/vendor/assets/fonts/font/ubuntu-li-webfont.eot +0 -0
  28. data/vendor/assets/fonts/font/ubuntu-li-webfont.svg +245 -0
  29. data/vendor/assets/fonts/font/ubuntu-li-webfont.ttf +0 -0
  30. data/vendor/assets/fonts/font/ubuntu-li-webfont.woff +0 -0
  31. data/vendor/assets/fonts/font/ubuntu-m-webfont.eot +0 -0
  32. data/vendor/assets/fonts/font/ubuntu-m-webfont.svg +245 -0
  33. data/vendor/assets/fonts/font/ubuntu-m-webfont.ttf +0 -0
  34. data/vendor/assets/fonts/font/ubuntu-m-webfont.woff +0 -0
  35. data/vendor/assets/fonts/font/ubuntu-mi-webfont.eot +0 -0
  36. data/vendor/assets/fonts/font/ubuntu-mi-webfont.svg +245 -0
  37. data/vendor/assets/fonts/font/ubuntu-mi-webfont.ttf +0 -0
  38. data/vendor/assets/fonts/font/ubuntu-mi-webfont.woff +0 -0
  39. data/vendor/assets/fonts/font/ubuntu-r-webfont.eot +0 -0
  40. data/vendor/assets/fonts/font/ubuntu-r-webfont.svg +245 -0
  41. data/vendor/assets/fonts/font/ubuntu-r-webfont.ttf +0 -0
  42. data/vendor/assets/fonts/font/ubuntu-r-webfont.woff +0 -0
  43. data/vendor/assets/fonts/font/ubuntu-ri-webfont.eot +0 -0
  44. data/vendor/assets/fonts/font/ubuntu-ri-webfont.svg +245 -0
  45. data/vendor/assets/fonts/font/ubuntu-ri-webfont.ttf +0 -0
  46. data/vendor/assets/fonts/font/ubuntu-ri-webfont.woff +0 -0
  47. data/vendor/assets/fonts/font/ubuntumono-b-webfont.eot +0 -0
  48. data/vendor/assets/fonts/font/ubuntumono-b-webfont.svg +242 -0
  49. data/vendor/assets/fonts/font/ubuntumono-b-webfont.ttf +0 -0
  50. data/vendor/assets/fonts/font/ubuntumono-b-webfont.woff +0 -0
  51. data/vendor/assets/fonts/font/ubuntumono-bi-webfont.eot +0 -0
  52. data/vendor/assets/fonts/font/ubuntumono-bi-webfont.svg +242 -0
  53. data/vendor/assets/fonts/font/ubuntumono-bi-webfont.ttf +0 -0
  54. data/vendor/assets/fonts/font/ubuntumono-bi-webfont.woff +0 -0
  55. data/vendor/assets/fonts/font/ubuntumono-r-webfont.eot +0 -0
  56. data/vendor/assets/fonts/font/ubuntumono-r-webfont.svg +242 -0
  57. data/vendor/assets/fonts/font/ubuntumono-r-webfont.ttf +0 -0
  58. data/vendor/assets/fonts/font/ubuntumono-r-webfont.woff +0 -0
  59. data/vendor/assets/fonts/font/ubuntumono-ri-webfont.eot +0 -0
  60. data/vendor/assets/fonts/font/ubuntumono-ri-webfont.svg +242 -0
  61. data/vendor/assets/fonts/font/ubuntumono-ri-webfont.ttf +0 -0
  62. data/vendor/assets/fonts/font/ubuntumono-ri-webfont.woff +0 -0
  63. data/vendor/assets/images/img/SAPOlogo.png +0 -0
  64. data/vendor/assets/images/img/favicon.ico +0 -0
  65. data/vendor/assets/images/img/home_bkg.png +0 -0
  66. data/vendor/assets/images/img/home_logo_IE.jpg +0 -0
  67. data/vendor/assets/images/img/icon_Sprite.png +0 -0
  68. data/vendor/assets/images/img/ink-favicon.ico +0 -0
  69. data/vendor/assets/images/img/logo_home.png +0 -0
  70. data/vendor/assets/images/img/shot_ink.png +0 -0
  71. data/vendor/assets/images/img/shot_intra.png +0 -0
  72. data/vendor/assets/images/img/shot_livebots.png +0 -0
  73. data/vendor/assets/images/img/shot_meo.png +0 -0
  74. data/vendor/assets/images/img/shot_musicbox.png +0 -0
  75. data/vendor/assets/images/img/shot_pessoa.png +0 -0
  76. data/vendor/assets/images/img/splash.1024x748.png +0 -0
  77. data/vendor/assets/images/img/splash.320x460.png +0 -0
  78. data/vendor/assets/images/img/splash.768x1004.png +0 -0
  79. data/vendor/assets/images/img/touch-icon.114.png +0 -0
  80. data/vendor/assets/images/img/touch-icon.16.png +0 -0
  81. data/vendor/assets/images/img/touch-icon.256.png +0 -0
  82. data/vendor/assets/images/img/touch-icon.57.png +0 -0
  83. data/vendor/assets/images/img/touch-icon.72.png +0 -0
  84. data/vendor/assets/javascripts/autoload.js +85 -0
  85. data/vendor/assets/javascripts/example.json +1174 -0
  86. data/vendor/assets/javascripts/holder.js +440 -0
  87. data/vendor/assets/javascripts/html5shiv-printshiv.js +496 -0
  88. data/vendor/assets/javascripts/html5shiv.js +298 -0
  89. data/vendor/assets/javascripts/ink-all.js +18015 -0
  90. data/vendor/assets/javascripts/ink-ui.js +7737 -0
  91. data/vendor/assets/javascripts/ink.aux.js +506 -0
  92. data/vendor/assets/javascripts/ink.close.js +54 -0
  93. data/vendor/assets/javascripts/ink.datepicker.js +1194 -0
  94. data/vendor/assets/javascripts/ink.datepicker.pt.js +32 -0
  95. data/vendor/assets/javascripts/ink.draggable.js +437 -0
  96. data/vendor/assets/javascripts/ink.droppable.js +193 -0
  97. data/vendor/assets/javascripts/ink.formvalidator.js +712 -0
  98. data/vendor/assets/javascripts/ink.gallery.js +757 -0
  99. data/vendor/assets/javascripts/ink.imagequery.js +259 -0
  100. data/vendor/assets/javascripts/ink.js +10278 -0
  101. data/vendor/assets/javascripts/ink.modal.js +628 -0
  102. data/vendor/assets/javascripts/ink.pagination.js +473 -0
  103. data/vendor/assets/javascripts/ink.progressbar.js +110 -0
  104. data/vendor/assets/javascripts/ink.smoothscroller.js +234 -0
  105. data/vendor/assets/javascripts/ink.sortablelist.js +338 -0
  106. data/vendor/assets/javascripts/ink.spy.js +123 -0
  107. data/vendor/assets/javascripts/ink.sticky.js +254 -0
  108. data/vendor/assets/javascripts/ink.table.js +621 -0
  109. data/vendor/assets/javascripts/ink.tabs.js +426 -0
  110. data/vendor/assets/javascripts/ink.toggle.js +218 -0
  111. data/vendor/assets/javascripts/ink.treeview.js +179 -0
  112. data/vendor/assets/javascripts/ink_ui.js +1 -0
  113. data/vendor/assets/javascripts/modernizr.js +815 -0
  114. data/vendor/assets/javascripts/prettify.js +28 -0
  115. data/vendor/assets/stylesheets/ink/_ink-ie7.css +1662 -0
  116. data/vendor/assets/stylesheets/ink/_ink.css +7496 -0
  117. data/vendor/assets/stylesheets/ink/ink_ui.scss.css +2 -0
  118. data/vendor/assets/stylesheets/ink_ui.scss.css +1 -0
  119. metadata +203 -0
@@ -0,0 +1,473 @@
1
+ /**
2
+ * @module Ink.UI.Pagination_1
3
+ * @author inkdev AT sapo.pt
4
+ * @version 1
5
+ */
6
+ Ink.createModule('Ink.UI.Pagination', '1', ['Ink.UI.Aux_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1'], function(Aux, Event, Css, Element, Selector ) {
7
+ 'use strict';
8
+
9
+ /**
10
+ * Function to create the pagination anchors
11
+ *
12
+ * @method genAel
13
+ * @param {String} inner HTML to be placed inside the anchor.
14
+ * @return {DOMElement} Anchor created
15
+ */
16
+ var genAEl = function(inner) {
17
+ var aEl = document.createElement('a');
18
+ aEl.setAttribute('href', '#');
19
+ aEl.innerHTML = inner;
20
+ return aEl;
21
+ };
22
+
23
+ /**
24
+ * @class Ink.UI.Pagination
25
+ * @constructor
26
+ * @version 1
27
+ * @uses Ink.UI.Aux
28
+ * @uses Ink.Dom.Event
29
+ * @uses Ink.Dom.Css
30
+ * @uses Ink.Dom.Element
31
+ * @uses Ink.Dom.Selector
32
+ * @param {String|DOMElement} selector
33
+ * @param {Object} options Options
34
+ * @param {Number} options.size number of pages
35
+ * @param {Number} [options.maxSize] if passed, only shows at most maxSize items. displays also first|prev page and next page|last buttons
36
+ * @param {Number} [options.start] start page. defaults to 1
37
+ * @param {String} [options.previousLabel] label to display on previous page button
38
+ * @param {String} [options.nextLabel] label to display on next page button
39
+ * @param {String} [options.previousPageLabel] label to display on previous page button
40
+ * @param {String} [options.nextPageLabel] label to display on next page button
41
+ * @param {String} [options.firstLabel] label to display on previous page button
42
+ * @param {String} [options.lastLabel] label to display on next page button
43
+ * @param {Function} [options.onChange] optional callback
44
+ * @param {Boolean} [options.setHash] if true, sets hashParameter on the location.hash. default is disabled
45
+ * @param {String} [options.hashParameter] parameter to use on setHash. by default uses 'page'
46
+ */
47
+ var Pagination = function(selector, options) {
48
+
49
+ this._options = Ink.extendObj({
50
+ size: undefined,
51
+ start: 1,
52
+ firstLabel: 'First',
53
+ lastLabel: 'Last',
54
+ previousLabel: 'Previous',
55
+ nextLabel: 'Next',
56
+ onChange: undefined,
57
+ setHash: false,
58
+ hashParameter: 'page'
59
+ }, options || {});
60
+
61
+ if (!this._options.previousPageLabel) {
62
+ this._options.previousPageLabel = 'Previous ' + this._options.maxSize;
63
+ }
64
+
65
+ if (!this._options.nextPageLabel) {
66
+ this._options.nextPageLabel = 'Next ' + this._options.maxSize;
67
+ }
68
+
69
+
70
+ this._handlers = {
71
+ click: Ink.bindEvent(this._onClick,this)
72
+ };
73
+
74
+ this._element = Aux.elOrSelector(selector, '1st argument');
75
+
76
+ if (!Aux.isInteger(this._options.size)) {
77
+ throw new TypeError('size option is a required integer!');
78
+ }
79
+
80
+ if (!Aux.isInteger(this._options.start) && this._options.start > 0 && this._options.start <= this._options.size) {
81
+ throw new TypeError('start option is a required integer between 1 and size!');
82
+ }
83
+
84
+ if (this._options.maxSize && !Aux.isInteger(this._options.maxSize) && this._options.maxSize > 0) {
85
+ throw new TypeError('maxSize option is a positive integer!');
86
+ }
87
+
88
+ else if (this._options.size < 0) {
89
+ throw new RangeError('size option must be equal or more than 0!');
90
+ }
91
+
92
+ if (this._options.onChange !== undefined && typeof this._options.onChange !== 'function') {
93
+ throw new TypeError('onChange option must be a function!');
94
+ }
95
+
96
+ this._current = this._options.start - 1;
97
+ this._itemLiEls = [];
98
+
99
+ this._init();
100
+ };
101
+
102
+ Pagination.prototype = {
103
+
104
+ /**
105
+ * Init function called by the constructor
106
+ *
107
+ * @method _init
108
+ * @private
109
+ */
110
+ _init: function() {
111
+ // generate and apply DOM
112
+ this._generateMarkup(this._element);
113
+ this._updateItems();
114
+
115
+ // subscribe events
116
+ this._observe();
117
+
118
+ Aux.registerInstance(this, this._element, 'pagination');
119
+ },
120
+
121
+ /**
122
+ * Responsible for setting listener in the 'click' event of the Pagination element.
123
+ *
124
+ * @method _observe
125
+ * @private
126
+ */
127
+ _observe: function() {
128
+ Event.observe(this._element, 'click', this._handlers.click);
129
+ },
130
+
131
+ /**
132
+ * Updates the markup everytime there's a change in the Pagination object.
133
+ *
134
+ * @method _updateItems
135
+ * @private
136
+ */
137
+ _updateItems: function() {
138
+ var liEls = this._itemLiEls;
139
+
140
+ var isSimpleToggle = this._options.size === liEls.length;
141
+
142
+ var i, f, liEl;
143
+
144
+ if (isSimpleToggle) {
145
+ // just toggle active class
146
+ for (i = 0, f = this._options.size; i < f; ++i) {
147
+ Css.setClassName(liEls[i], 'active', i === this._current);
148
+ }
149
+ }
150
+ else {
151
+ // remove old items
152
+ for (i = liEls.length - 1; i >= 0; --i) {
153
+ this._ulEl.removeChild(liEls[i]);
154
+ }
155
+
156
+ // add new items
157
+ liEls = [];
158
+ for (i = 0, f = this._options.size; i < f; ++i) {
159
+ liEl = document.createElement('li');
160
+ liEl.appendChild( genAEl( i + 1 ) );
161
+ Css.setClassName(liEl, 'active', i === this._current);
162
+ this._ulEl.insertBefore(liEl, this._nextEl);
163
+ liEls.push(liEl);
164
+ }
165
+ this._itemLiEls = liEls;
166
+ }
167
+
168
+ if (this._options.maxSize) {
169
+ // toggle visible items
170
+ var page = Math.floor( this._current / this._options.maxSize );
171
+ var pi = this._options.maxSize * page;
172
+ var pf = pi + this._options.maxSize - 1;
173
+
174
+ for (i = 0, f = this._options.size; i < f; ++i) {
175
+ liEl = liEls[i];
176
+ Css.setClassName(liEl, 'hide-all', i < pi || i > pf);
177
+ }
178
+
179
+ this._pageStart = pi;
180
+ this._pageEnd = pf;
181
+ this._page = page;
182
+
183
+ Css.setClassName(this._prevPageEl, 'disabled', !this.hasPreviousPage());
184
+ Css.setClassName(this._nextPageEl, 'disabled', !this.hasNextPage());
185
+
186
+ Css.setClassName(this._firstEl, 'disabled', this.isFirst());
187
+ Css.setClassName(this._lastEl, 'disabled', this.isLast());
188
+ }
189
+
190
+ // update prev and next
191
+ Css.setClassName(this._prevEl, 'disabled', !this.hasPrevious());
192
+ Css.setClassName(this._nextEl, 'disabled', !this.hasNext());
193
+ },
194
+
195
+ /**
196
+ * Returns the top element for the gallery DOM representation
197
+ *
198
+ * @method _generateMarkup
199
+ * @param {DOMElement} el
200
+ * @private
201
+ */
202
+ _generateMarkup: function(el) {
203
+ Css.addClassName(el, 'ink-navigation');
204
+
205
+ var
206
+ ulEl,liEl,
207
+ hasUlAlready = false
208
+ ;
209
+ if( ( ulEl = Selector.select('ul.pagination',el)).length < 1 ){
210
+ ulEl = document.createElement('ul');
211
+ Css.addClassName(ulEl, 'pagination');
212
+ } else {
213
+ hasUlAlready = true;
214
+ ulEl = ulEl[0];
215
+ }
216
+
217
+ if (this._options.maxSize) {
218
+ liEl = document.createElement('li');
219
+ liEl.appendChild( genAEl(this._options.firstLabel) );
220
+ this._firstEl = liEl;
221
+ Css.addClassName(liEl, 'first');
222
+ ulEl.appendChild(liEl);
223
+
224
+ liEl = document.createElement('li');
225
+ liEl.appendChild( genAEl(this._options.previousPageLabel) );
226
+ this._prevPageEl = liEl;
227
+ Css.addClassName(liEl, 'previousPage');
228
+ ulEl.appendChild(liEl);
229
+ }
230
+
231
+ liEl = document.createElement('li');
232
+ liEl.appendChild( genAEl(this._options.previousLabel) );
233
+ this._prevEl = liEl;
234
+ Css.addClassName(liEl, 'previous');
235
+ ulEl.appendChild(liEl);
236
+
237
+ liEl = document.createElement('li');
238
+ liEl.appendChild( genAEl(this._options.nextLabel) );
239
+ this._nextEl = liEl;
240
+ Css.addClassName(liEl, 'next');
241
+ ulEl.appendChild(liEl);
242
+
243
+ if (this._options.maxSize) {
244
+ liEl = document.createElement('li');
245
+ liEl.appendChild( genAEl(this._options.nextPageLabel) );
246
+ this._nextPageEl = liEl;
247
+ Css.addClassName(liEl, 'nextPage');
248
+ ulEl.appendChild(liEl);
249
+
250
+ liEl = document.createElement('li');
251
+ liEl.appendChild( genAEl(this._options.lastLabel) );
252
+ this._lastEl = liEl;
253
+ Css.addClassName(liEl, 'last');
254
+ ulEl.appendChild(liEl);
255
+ }
256
+
257
+ if( !hasUlAlready ){
258
+ el.appendChild(ulEl);
259
+ }
260
+
261
+ this._ulEl = ulEl;
262
+ },
263
+
264
+ /**
265
+ * Click handler
266
+ *
267
+ * @method _onClick
268
+ * @param {Event} ev
269
+ * @private
270
+ */
271
+ _onClick: function(ev) {
272
+ Event.stop(ev);
273
+
274
+ var tgtEl = Event.element(ev);
275
+ if (tgtEl.nodeName.toLowerCase() !== 'a') {
276
+ do{
277
+ tgtEl = tgtEl.parentNode;
278
+ }while( (tgtEl.nodeName.toLowerCase() !== 'a') && (tgtEl !== this._element) );
279
+
280
+ if( tgtEl === this._element){
281
+ return;
282
+ }
283
+ }
284
+
285
+ var liEl = tgtEl.parentNode;
286
+ if (liEl.nodeName.toLowerCase() !== 'li') { return; }
287
+
288
+ if ( Css.hasClassName(liEl, 'active') ||
289
+ Css.hasClassName(liEl, 'disabled') ) { return; }
290
+
291
+ var isPrev = Css.hasClassName(liEl, 'previous');
292
+ var isNext = Css.hasClassName(liEl, 'next');
293
+ var isPrevPage = Css.hasClassName(liEl, 'previousPage');
294
+ var isNextPage = Css.hasClassName(liEl, 'nextPage');
295
+ var isFirst = Css.hasClassName(liEl, 'first');
296
+ var isLast = Css.hasClassName(liEl, 'last');
297
+
298
+ if (isFirst) {
299
+ this.setCurrent(0);
300
+ }
301
+ else if (isLast) {
302
+ this.setCurrent(this._options.size - 1);
303
+ }
304
+ else if (isPrevPage || isNextPage) {
305
+ this.setCurrent( (isPrevPage ? -1 : 1) * this._options.maxSize, true);
306
+ }
307
+ else if (isPrev || isNext) {
308
+ this.setCurrent(isPrev ? -1 : 1, true);
309
+ }
310
+ else {
311
+ var nr = parseInt( tgtEl.innerHTML, 10) - 1;
312
+ this.setCurrent(nr);
313
+ }
314
+ },
315
+
316
+
317
+
318
+ /**************
319
+ * PUBLIC API *
320
+ **************/
321
+
322
+ /**
323
+ * Sets the number of pages
324
+ *
325
+ * @method setSize
326
+ * @param {Number} sz number of pages
327
+ * @public
328
+ */
329
+ setSize: function(sz) {
330
+ if (!Aux.isInteger(sz)) {
331
+ throw new TypeError('1st argument must be an integer number!');
332
+ }
333
+
334
+ this._options.size = sz;
335
+ this._updateItems();
336
+ this._current = 0;
337
+ },
338
+
339
+ /**
340
+ * Sets the current page
341
+ *
342
+ * @method setCurrent
343
+ * @param {Number} nr sets the current page to given number
344
+ * @param {Boolean} isRelative trueish to set relative change instead of absolute (default)
345
+ * @public
346
+ */
347
+ setCurrent: function(nr, isRelative) {
348
+ if (!Aux.isInteger(nr)) {
349
+ throw new TypeError('1st argument must be an integer number!');
350
+ }
351
+
352
+ if (isRelative) {
353
+ nr += this._current;
354
+ }
355
+
356
+ if (nr < 0) {
357
+ nr = 0;
358
+ }
359
+ else if (nr > this._options.size - 1) {
360
+ nr = this._options.size - 1;
361
+ }
362
+ this._current = nr;
363
+ this._updateItems();
364
+
365
+ /*if (this._options.setHash) {
366
+ var o = {};
367
+ o[this._options.hashParameter] = nr;
368
+ Aux.setHash(o);
369
+ }*/
370
+
371
+ if (this._options.onChange) { this._options.onChange(this); }
372
+ },
373
+
374
+ /**
375
+ * Returns the number of pages
376
+ *
377
+ * @method getSize
378
+ * @return {Number} Number of pages
379
+ * @public
380
+ */
381
+ getSize: function() {
382
+ return this._options.size;
383
+ },
384
+
385
+ /**
386
+ * Returns current page
387
+ *
388
+ * @method getCurrent
389
+ * @return {Number} Current page
390
+ * @public
391
+ */
392
+ getCurrent: function() {
393
+ return this._current;
394
+ },
395
+
396
+ /**
397
+ * Returns true iif at first page
398
+ *
399
+ * @method isFirst
400
+ * @return {Boolean} True if at first page
401
+ * @public
402
+ */
403
+ isFirst: function() {
404
+ return this._current === 0;
405
+ },
406
+
407
+ /**
408
+ * Returns true iif at last page
409
+ *
410
+ * @method isLast
411
+ * @return {Boolean} True if at last page
412
+ * @public
413
+ */
414
+ isLast: function() {
415
+ return this._current === this._options.size - 1;
416
+ },
417
+
418
+ /**
419
+ * Returns true iif has prior pages
420
+ *
421
+ * @method hasPrevious
422
+ * @return {Boolean} True if has prior pages
423
+ * @public
424
+ */
425
+ hasPrevious: function() {
426
+ return this._current > 0;
427
+ },
428
+
429
+ /**
430
+ * Returns true iif has pages ahead
431
+ *
432
+ * @method hasNext
433
+ * @return {Boolean} True if has pages ahead
434
+ * @public
435
+ */
436
+ hasNext: function() {
437
+ return this._current < this._options.size - 1;
438
+ },
439
+
440
+ /**
441
+ * Returns true iif has prior set of page(s)
442
+ *
443
+ * @method hasPreviousPage
444
+ * @return {Boolean} Returns true iif has prior set of page(s)
445
+ * @public
446
+ */
447
+ hasPreviousPage: function() {
448
+ return this._options.maxSize && this._current > this._options.maxSize - 1;
449
+ },
450
+
451
+ /**
452
+ * Returns true iif has set of page(s) ahead
453
+ *
454
+ * @method hasNextPage
455
+ * @return {Boolean} Returns true iif has set of page(s) ahead
456
+ * @public
457
+ */
458
+ hasNextPage: function() {
459
+ return this._options.maxSize && this._options.size - this._current >= this._options.maxSize + 1;
460
+ },
461
+
462
+ /**
463
+ * Unregisters the component and removes its markup from the DOM
464
+ *
465
+ * @method destroy
466
+ * @public
467
+ */
468
+ destroy: Aux.destroyComponent
469
+ };
470
+
471
+ return Pagination;
472
+
473
+ });