foo_table-rails 2.0.1.4 → 2.0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,429 @@
1
+ /**
2
+ * Footable Memory
3
+ *
4
+ * Version 1.1.0
5
+ *
6
+ * Requires browser support for localStorage. Fallback to cookies using
7
+ * jQuery Cookie (https://github.com/carhartl/jquery-cookie)
8
+ *
9
+ * Stores table state in a cookie and reloads state when page is refreshed.
10
+ *
11
+ * Supports common FooTable features:
12
+ * - Pagination
13
+ * - Sorting
14
+ * - Filtering
15
+ * - Expansion
16
+ *
17
+ * Written to be compatible with multiple FooTables per page and with
18
+ * JavaScript libraries like AngularJS and Ember that use hash based URLs.
19
+ *
20
+ * Disabled by default, to enable add the following section to the footable
21
+ * options:
22
+ *
23
+ * $('#table').footable({
24
+ * memory: {
25
+ * enabled: true
26
+ * }
27
+ * });
28
+ *
29
+ * Based on FooTable Plugin Bookmarkable by Amy Farrell (https://github.com/akf)
30
+ *
31
+ * Created by Chris Laskey (https://github.com/chrislaskey)
32
+ */
33
+
34
+ (function ($, w, undefined) {
35
+
36
+ if (w.footable === undefined || w.foobox === null) {
37
+ throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
38
+ }
39
+
40
+ var defaults = {
41
+ memory: {
42
+ enabled: false
43
+ }
44
+ };
45
+
46
+ var storage;
47
+
48
+ var storage_engines = {};
49
+
50
+ storage_engines.local_storage = (function($){
51
+
52
+ 'use strict';
53
+
54
+ var path_page = function(){
55
+ return location.pathname;
56
+ };
57
+
58
+ var path_subpage = function(){
59
+ return location.hash || 'root';
60
+ };
61
+
62
+ var storage_key = function(index){
63
+ return path_page() + '/' + path_subpage() + '/index-' + index;
64
+ };
65
+
66
+ var get = function(index){
67
+ var key = storage_key(index),
68
+ as_string = localStorage.getItem(key);
69
+
70
+ return as_string ? JSON.parse(as_string) : {};
71
+ };
72
+
73
+ var set = function(index, item){
74
+ var key = storage_key(index),
75
+ as_string = JSON.stringify(item);
76
+
77
+ localStorage.setItem(key, as_string);
78
+ };
79
+
80
+ return {
81
+ get: function(index){
82
+ return get(index);
83
+ },
84
+ set: function(index, item){
85
+ set(index, item);
86
+ }
87
+ };
88
+
89
+ })($);
90
+
91
+ storage_engines.cookie = (function($){
92
+
93
+ 'use strict';
94
+
95
+ /**
96
+ * Stores footable bookmarkable data in a cookie
97
+ *
98
+ * By default will store each page in its own cookie.
99
+ * Supports multiple FooTables per page.
100
+ * Supports JS frameworks that use hashmap URLs (AngularJS, Ember, etc).
101
+ *
102
+ * For example take an example application:
103
+ *
104
+ * http://example.com/application-data (2 FooTables on this page)
105
+ * http://example.com/application-data/#/details (1 FooTable on this page)
106
+ * http://example.com/other-data (1 FooTable on this page)
107
+ *
108
+ * Would be stored like this:
109
+ *
110
+ * cookie['/application-data'] = {
111
+ * '/': {
112
+ * 1: {
113
+ * key1: value1,
114
+ * key2: value2
115
+ * },
116
+ * 2: {
117
+ * key1: value1,
118
+ * key2: value2
119
+ * }
120
+ * },
121
+ * '#/details': {
122
+ * 1: {
123
+ * key1: value1,
124
+ * key2: value2
125
+ * }
126
+ * }
127
+ * };
128
+ *
129
+ * cookie['/other-data'] = {
130
+ * '/': {
131
+ * 1: {
132
+ * key1: value1,
133
+ * key2: value2
134
+ * },
135
+ * }
136
+ * }
137
+ *
138
+ */
139
+
140
+ if( $.cookie ){
141
+ $.cookie.json = true;
142
+ }
143
+
144
+ var days_to_keep_data = 7;
145
+
146
+ var path_page = function(){
147
+ return location.pathname;
148
+ };
149
+
150
+ var path_subpage = function(){
151
+ return location.hash || '/';
152
+ };
153
+
154
+ var get_data = function(){
155
+ var page = path_page(),
156
+ data = $.cookie(page);
157
+
158
+ return data || {};
159
+ };
160
+
161
+ var get_table = function(index){
162
+ var subpage = path_subpage(),
163
+ data = get_data();
164
+
165
+ if( data[subpage] && data[subpage][index] ){
166
+ return data[subpage][index];
167
+ } else {
168
+ return {};
169
+ }
170
+ };
171
+
172
+ var set = function(index, item){
173
+ var page = path_page(),
174
+ subpage = path_subpage(),
175
+ data = get_data(),
176
+ options;
177
+
178
+ if( !data[subpage] ){
179
+ data[subpage] = {};
180
+ }
181
+
182
+ data[subpage][index] = item;
183
+
184
+ options = {
185
+ path: page,
186
+ expires: days_to_keep_data
187
+ };
188
+
189
+ $.cookie(page, data, options);
190
+ };
191
+
192
+ return {
193
+ get: function(index){
194
+ return get_table(index);
195
+ },
196
+ set: function(index, item){
197
+ set(index, item);
198
+ }
199
+ };
200
+
201
+ })($);
202
+
203
+ var set_storage_engine = (function(){
204
+ var test = 'footable-memory-plugin-storage-test';
205
+
206
+ try {
207
+ localStorage.setItem(test, test);
208
+ localStorage.removeItem(test);
209
+ storage = storage_engines.local_storage;
210
+ } catch(e) {
211
+ try {
212
+ $.cookie(test, test);
213
+ storage = storage_engines.cookie;
214
+ } catch(e) {
215
+ throw new Error('FooTable Memory requires either localStorage or cookie support via jQuery $.cookie plugin (https://github.com/carhartl/jquery-cookie)');
216
+ }
217
+ }
218
+ })($);
219
+
220
+ var state = (function($){
221
+
222
+ 'use strict';
223
+
224
+ /**
225
+ * Gets and sets current table state
226
+ */
227
+
228
+ var vars = {};
229
+
230
+ var get = {};
231
+
232
+ var set = {};
233
+
234
+ set.vars = function(ft){
235
+ vars.ft = ft;
236
+ vars.table = $(ft.table);
237
+ };
238
+
239
+ get.descending = function(){
240
+ var descending = false;
241
+ $.each(vars.table.find('th'), function(index){
242
+ if( $(this).hasClass('footable-sorted-desc') ){
243
+ descending = true;
244
+ }
245
+ });
246
+ return descending;
247
+ };
248
+
249
+ get.expanded = function(){
250
+ var indexes = [];
251
+ $.each(vars.ft.table.rows, function(index, value){
252
+ if( $(this).hasClass('footable-detail-show') ){
253
+ indexes.push(index);
254
+ }
255
+ });
256
+ return indexes;
257
+ };
258
+
259
+ set.expanded = function(data){
260
+ if( data.expanded ){
261
+ $.each(data.expanded, function(index, value){
262
+ // var row = $(vars.ft.table.rows[value]);
263
+ // row.find('> td:first').trigger('footable_toggle_row');
264
+
265
+ // Trying to execute the lines above, but the expanded row
266
+ // shows raw AngularJS template (with {{ values }}) instead
267
+ // of the fully rendered result.
268
+ //
269
+ // Best guess is some things happen after
270
+ // 'footable_initialized' event and row expanding can not
271
+ // occur until after those fire.
272
+ //
273
+ // A hack to get around this is to wait an interval before
274
+ // executing the intended commands. Wrapped in an
275
+ // immediately executing function to ensure ft is the
276
+ // current value.
277
+
278
+ (function(ft){
279
+ setTimeout(function(){
280
+ var row = $(ft.table.rows[value]);
281
+ row.find('> td:first').trigger('footable_toggle_row');
282
+ }, 150);
283
+ })(vars.ft);
284
+ });
285
+ }
286
+ };
287
+
288
+ get.filter = function(){
289
+ return vars.table.data('filter') ? $(vars.table.data('filter')).val() : '';
290
+ };
291
+
292
+ set.filter = function(data){
293
+ if( data.filter ){
294
+ $(vars.table.data('filter'))
295
+ .val(data.filter)
296
+ .trigger('keyup');
297
+ }
298
+ };
299
+
300
+ get.page = function(){
301
+ return vars.ft.pageInfo && vars.ft.pageInfo.currentPage !== undefined ? vars.ft.pageInfo.currentPage : 0;
302
+ };
303
+
304
+ set.page = function(data){
305
+ if( data.page ){
306
+ vars.table.data('currentPage', data.page);
307
+ // Delay triggering table until sort is updated, since both effect
308
+ // pagination.
309
+ }
310
+ };
311
+
312
+ get.shown = function(){
313
+ return vars.table
314
+ .find('tbody')
315
+ .find('tr:not(.footable-row-detail)')
316
+ .filter(':visible').length;
317
+ };
318
+
319
+ get.sorted = function(){
320
+ if( vars.table.data('sorted') !== undefined ){
321
+ return vars.table.data('sorted');
322
+ } else {
323
+ return -1;
324
+ }
325
+ };
326
+
327
+ set.sorted = function(data){
328
+ if( data.sorted >= 0 ) {
329
+ // vars.table.data('footable-sort').doSort(data.sorted, !data.descending);
330
+
331
+ // Trying to execute the line above, but only sort icon on the
332
+ // <th> element gets set. The rows themselves do not get sorted.
333
+ //
334
+ // Best guess is some things happen after 'footable_initialized' event
335
+ // and sorting can not occur until after those fire.
336
+ //
337
+ // A hack to get around this is to wait an interval before executing
338
+ // the intended commands. Wrapped in an immediately executing
339
+ // function to ensure ft is the current value.
340
+
341
+ (function(ft){
342
+ setTimeout(function(){
343
+ $(ft.table).data('footable-sort').doSort(data.sorted, !data.descending);
344
+ }, 150);
345
+ })(vars.ft);
346
+ } else {
347
+ vars.table.trigger('footable_setup_paging');
348
+ }
349
+ };
350
+
351
+ get.total = function(){
352
+ return vars.table
353
+ .find('tbody')
354
+ .find('tr:not(.footable-row-detail, .footable-filtered)').length;
355
+ };
356
+
357
+ var get_state = function(){
358
+ return {
359
+ descending: get.descending(),
360
+ expanded: get.expanded(),
361
+ filter: get.filter(),
362
+ page: get.page(),
363
+ shown: get.shown(),
364
+ sorted: get.sorted(),
365
+ total: get.total()
366
+ };
367
+ };
368
+
369
+ var set_state = function(data){
370
+ set.filter(data);
371
+ set.page(data);
372
+ set.sorted(data);
373
+ set.expanded(data);
374
+ };
375
+
376
+ return {
377
+ get: function(ft){
378
+ set.vars(ft);
379
+ return get_state();
380
+ },
381
+ set: function(ft, data){
382
+ set.vars(ft);
383
+ return set_state(data);
384
+ }
385
+ };
386
+
387
+ })($);
388
+
389
+ var is_enabled = function(ft){
390
+ return ft.options.memory.enabled;
391
+ };
392
+
393
+ var update = function(ft, event) {
394
+ var index = ft.id,
395
+ data = state.get(ft);
396
+
397
+ storage.set(index, data);
398
+ };
399
+
400
+ var load = function(ft){
401
+ var index = ft.id,
402
+ data = storage.get(index);
403
+
404
+ state.set(ft, data);
405
+ ft.memory_plugin_loaded = true;
406
+ };
407
+
408
+ function Memory() {
409
+ var p = this;
410
+ p.name = 'Footable Memory';
411
+ p.init = function(ft) {
412
+ if (is_enabled(ft)) {
413
+ $(ft.table).bind({
414
+ 'footable_initialized': function(){
415
+ load(ft);
416
+ },
417
+ 'footable_page_filled footable_redrawn footable_filtered footable_sorted footable_row_expanded footable_row_collapsed': function(e) {
418
+ if (ft.memory_plugin_loaded) {
419
+ update(ft, e);
420
+ }
421
+ }
422
+ });
423
+ }
424
+ };
425
+ }
426
+
427
+ w.footable.plugins.register(Memory, defaults);
428
+
429
+ })(jQuery, window);
@@ -224,6 +224,7 @@
224
224
  $(ft.pageInfo.pages[pageNumber]).each(function () {
225
225
  p.showRow(this, ft);
226
226
  });
227
+ ft.raise('footable_page_filled');
227
228
  };
228
229
 
229
230
  p.showRow = function (row, ft) {
@@ -238,4 +239,4 @@
238
239
 
239
240
  w.footable.plugins.register(Paginate, defaults);
240
241
 
241
- })(jQuery, window);
242
+ })(jQuery, window);
@@ -1 +1 @@
1
- (function(e,t,undefined){function a(t){var a=e(t.table),i=a.data();this.pageNavigation=i.pageNavigation||t.options.pageNavigation,this.pageSize=i.pageSize||t.options.pageSize,this.firstText=i.firstText||t.options.firstText,this.previousText=i.previousText||t.options.previousText,this.nextText=i.nextText||t.options.nextText,this.lastText=i.lastText||t.options.lastText,this.limitNavigation=parseInt(i.limitNavigation||t.options.limitNavigation||o.limitNavigation,10),this.limitPreviousText=i.limitPreviousText||t.options.limitPreviousText,this.limitNextText=i.limitNextText||t.options.limitNextText,this.limit=this.limitNavigation>0,this.currentPage=0,this.pages=[],this.control=!1}function i(){var t=this;t.name="Footable Paginate",t.init=function(a){if(a.options.paginate===!0){if(e(a.table).data("page")===!1)return;t.footable=a,e(a.table).unbind(".paging").bind({"footable_initialized.paging footable_row_removed.paging footable_redrawn.paging footable_sorted.paging footable_filtered.paging":function(){t.setupPaging()}}).data("footable-paging",t)}},t.setupPaging=function(){var i=t.footable,o=e(i.table).find("> tbody");i.pageInfo=new a(i),t.createPages(i,o),t.createNavigation(i,o),t.fillPage(i,o,i.pageInfo.currentPage)},t.createPages=function(t,a){var i=1,o=t.pageInfo,n=i*o.pageSize,l=[],r=[];o.pages=[];var d=a.find("> tr:not(.footable-filtered,.footable-row-detail)");d.each(function(e,t){l.push(t),e===n-1?(o.pages.push(l),i++,n=i*o.pageSize,l=[]):e>=d.length-d.length%o.pageSize&&r.push(t)}),r.length>0&&o.pages.push(r),o.currentPage>=o.pages.length&&(o.currentPage=o.pages.length-1),0>o.currentPage&&(o.currentPage=0),1===o.pages.length?e(t.table).addClass("no-paging"):e(t.table).removeClass("no-paging")},t.createNavigation=function(a){var i=e(a.table).find(a.pageInfo.pageNavigation);if(0===i.length){if(i=e(a.pageInfo.pageNavigation),i.parents("table:first").length>0&&i.parents("table:first")!==e(a.table))return;i.length>1&&a.options.debug===!0&&console.error("More than one pagination control was found!")}if(0!==i.length){i.is("ul")||(0===i.find("ul:first").length&&i.append("<ul />"),i=i.find("ul")),i.find("li").remove();var o=a.pageInfo;o.control=i,o.pages.length>0&&(i.append('<li class="footable-page-arrow"><a data-page="first" href="#first">'+a.pageInfo.firstText+"</a>"),i.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">'+a.pageInfo.previousText+"</a></li>"),o.limit&&i.append('<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">'+a.pageInfo.limitPreviousText+"</a></li>"),o.limit||e.each(o.pages,function(e,t){t.length>0&&i.append('<li class="footable-page"><a data-page="'+e+'" href="#">'+(e+1)+"</a></li>")}),o.limit&&(i.append('<li class="footable-page-arrow"><a data-page="limit-next" href="#limit-next">'+a.pageInfo.limitNextText+"</a></li>"),t.createLimited(i,o,0)),i.append('<li class="footable-page-arrow"><a data-page="next" href="#next">'+a.pageInfo.nextText+"</a></li>"),i.append('<li class="footable-page-arrow"><a data-page="last" href="#last">'+a.pageInfo.lastText+"</a></li>")),i.off("click","a[data-page]").on("click","a[data-page]",function(n){n.preventDefault();var l=e(this).data("page"),r=o.currentPage;if("first"===l)r=0;else if("prev"===l)r>0&&r--;else if("next"===l)o.pages.length-1>r&&r++;else if("last"===l)r=o.pages.length-1;else if("limit-prev"===l){r=-1;var d=i.find(".footable-page:first a").data("page");t.createLimited(i,o,d-o.limitNavigation),t.setPagingClasses(i,o.currentPage,o.pages.length)}else if("limit-next"===l){r=-1;var s=i.find(".footable-page:last a").data("page");t.createLimited(i,o,s+1),t.setPagingClasses(i,o.currentPage,o.pages.length)}else r=l;if(r>=0){if(o.limit&&o.currentPage!=r){for(var f=r;0!==f%o.limitNavigation;)f-=1;t.createLimited(i,o,f)}t.paginate(a,r)}}),t.setPagingClasses(i,o.currentPage,o.pages.length)}},t.createLimited=function(e,t,a){a=a||0,e.find("li.footable-page").remove();var i,o,n=e.find('li.footable-page-arrow > a[data-page="limit-prev"]').parent(),l=e.find('li.footable-page-arrow > a[data-page="limit-next"]').parent();for(i=t.pages.length-1;i>=0;i--)o=t.pages[i],i>=a&&a+t.limitNavigation>i&&o.length>0&&n.after('<li class="footable-page"><a data-page="'+i+'" href="#">'+(i+1)+"</a></li>");0===a?n.hide():n.show(),a+t.limitNavigation>=t.pages.length?l.hide():l.show()},t.paginate=function(a,i){var o=a.pageInfo;if(o.currentPage!==i){var n=e(a.table).find("> tbody"),l=a.raise("footable_paging",{page:i,size:o.pageSize});if(l&&l.result===!1)return;t.fillPage(a,n,i),o.control.find("li").removeClass("active disabled"),t.setPagingClasses(o.control,o.currentPage,o.pages.length)}},t.setPagingClasses=function(e,t,a){e.find("li.footable-page > a[data-page="+t+"]").parent().addClass("active"),t>=a-1&&(e.find('li.footable-page-arrow > a[data-page="next"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass("disabled")),1>t&&(e.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="prev"]').parent().addClass("disabled"))},t.fillPage=function(a,i,o){a.pageInfo.currentPage=o,i.find("> tr").hide(),e(a.pageInfo.pages[o]).each(function(){t.showRow(this,a)})},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show()}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var o={paginate:!0,pageSize:10,pageNavigation:".pagination",firstText:"&laquo;",previousText:"&lsaquo;",nextText:"&rsaquo;",lastText:"&raquo;",limitNavigation:0,limitPreviousText:"...",limitNextText:"..."};t.footable.plugins.register(i,o)})(jQuery,window);
1
+ (function(e,t,undefined){function a(t){var a=e(t.table),i=a.data();this.pageNavigation=i.pageNavigation||t.options.pageNavigation,this.pageSize=i.pageSize||t.options.pageSize,this.firstText=i.firstText||t.options.firstText,this.previousText=i.previousText||t.options.previousText,this.nextText=i.nextText||t.options.nextText,this.lastText=i.lastText||t.options.lastText,this.limitNavigation=parseInt(i.limitNavigation||t.options.limitNavigation||o.limitNavigation,10),this.limitPreviousText=i.limitPreviousText||t.options.limitPreviousText,this.limitNextText=i.limitNextText||t.options.limitNextText,this.limit=this.limitNavigation>0,this.currentPage=i.currentPage||0,this.pages=[],this.control=!1}function i(){var t=this;t.name="Footable Paginate",t.init=function(a){if(a.options.paginate===!0){if(e(a.table).data("page")===!1)return;t.footable=a,e(a.table).unbind(".paging").bind({"footable_initialized.paging footable_row_removed.paging footable_redrawn.paging footable_sorted.paging footable_filtered.paging":function(){t.setupPaging()}}).data("footable-paging",t)}},t.setupPaging=function(){var i=t.footable,o=e(i.table).find("> tbody");i.pageInfo=new a(i),t.createPages(i,o),t.createNavigation(i,o),t.fillPage(i,o,i.pageInfo.currentPage)},t.createPages=function(t,a){var i=1,o=t.pageInfo,n=i*o.pageSize,l=[],r=[];o.pages=[];var d=a.find("> tr:not(.footable-filtered,.footable-row-detail)");d.each(function(e,t){l.push(t),e===n-1?(o.pages.push(l),i++,n=i*o.pageSize,l=[]):e>=d.length-d.length%o.pageSize&&r.push(t)}),r.length>0&&o.pages.push(r),o.currentPage>=o.pages.length&&(o.currentPage=o.pages.length-1),0>o.currentPage&&(o.currentPage=0),1===o.pages.length?e(t.table).addClass("no-paging"):e(t.table).removeClass("no-paging")},t.createNavigation=function(a){var i=e(a.table).find(a.pageInfo.pageNavigation);if(0===i.length){if(i=e(a.pageInfo.pageNavigation),i.parents("table:first").length>0&&i.parents("table:first")!==e(a.table))return;i.length>1&&a.options.debug===!0&&console.error("More than one pagination control was found!")}if(0!==i.length){i.is("ul")||(0===i.find("ul:first").length&&i.append("<ul />"),i=i.find("ul")),i.find("li").remove();var o=a.pageInfo;o.control=i,o.pages.length>0&&(i.append('<li class="footable-page-arrow"><a data-page="first" href="#first">'+a.pageInfo.firstText+"</a>"),i.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">'+a.pageInfo.previousText+"</a></li>"),o.limit&&i.append('<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">'+a.pageInfo.limitPreviousText+"</a></li>"),o.limit||e.each(o.pages,function(e,t){t.length>0&&i.append('<li class="footable-page"><a data-page="'+e+'" href="#">'+(e+1)+"</a></li>")}),o.limit&&(i.append('<li class="footable-page-arrow"><a data-page="limit-next" href="#limit-next">'+a.pageInfo.limitNextText+"</a></li>"),t.createLimited(i,o,0)),i.append('<li class="footable-page-arrow"><a data-page="next" href="#next">'+a.pageInfo.nextText+"</a></li>"),i.append('<li class="footable-page-arrow"><a data-page="last" href="#last">'+a.pageInfo.lastText+"</a></li>")),i.off("click","a[data-page]").on("click","a[data-page]",function(n){n.preventDefault();var l=e(this).data("page"),r=o.currentPage;if("first"===l)r=0;else if("prev"===l)r>0&&r--;else if("next"===l)o.pages.length-1>r&&r++;else if("last"===l)r=o.pages.length-1;else if("limit-prev"===l){r=-1;var d=i.find(".footable-page:first a").data("page");t.createLimited(i,o,d-o.limitNavigation),t.setPagingClasses(i,o.currentPage,o.pages.length)}else if("limit-next"===l){r=-1;var s=i.find(".footable-page:last a").data("page");t.createLimited(i,o,s+1),t.setPagingClasses(i,o.currentPage,o.pages.length)}else r=l;if(r>=0){if(o.limit&&o.currentPage!=r){for(var f=r;0!==f%o.limitNavigation;)f-=1;t.createLimited(i,o,f)}t.paginate(a,r)}}),t.setPagingClasses(i,o.currentPage,o.pages.length)}},t.createLimited=function(e,t,a){a=a||0,e.find("li.footable-page").remove();var i,o,n=e.find('li.footable-page-arrow > a[data-page="limit-prev"]').parent(),l=e.find('li.footable-page-arrow > a[data-page="limit-next"]').parent();for(i=t.pages.length-1;i>=0;i--)o=t.pages[i],i>=a&&a+t.limitNavigation>i&&o.length>0&&n.after('<li class="footable-page"><a data-page="'+i+'" href="#">'+(i+1)+"</a></li>");0===a?n.hide():n.show(),a+t.limitNavigation>=t.pages.length?l.hide():l.show()},t.paginate=function(a,i){var o=a.pageInfo;if(o.currentPage!==i){var n=e(a.table).find("> tbody"),l=a.raise("footable_paging",{page:i,size:o.pageSize});if(l&&l.result===!1)return;t.fillPage(a,n,i),o.control.find("li").removeClass("active disabled"),t.setPagingClasses(o.control,o.currentPage,o.pages.length)}},t.setPagingClasses=function(e,t,a){e.find("li.footable-page > a[data-page="+t+"]").parent().addClass("active"),t>=a-1&&(e.find('li.footable-page-arrow > a[data-page="next"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass("disabled")),1>t&&(e.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="prev"]').parent().addClass("disabled"))},t.fillPage=function(a,i,o){a.pageInfo.currentPage=o,e(a.table).data("currentPage",o),i.find("> tr").hide(),e(a.pageInfo.pages[o]).each(function(){t.showRow(this,a)}),a.raise("footable_page_filled")},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show()}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var o={paginate:!0,pageSize:10,pageNavigation:".pagination",firstText:"&laquo;",previousText:"&lsaquo;",nextText:"&rsaquo;",lastText:"&raquo;",limitNavigation:0,limitPreviousText:"...",limitNextText:"..."};t.footable.plugins.register(i,o)})(jQuery,window);
@@ -0,0 +1 @@
1
+ (function(e,t,undefined){function a(){var t=this;t.name="Footable Striping",t.init=function(a){t.footable=a,e(a.table).unbind("striping").bind({"footable_initialized.striping footable_row_removed.striping footable_redrawn.striping footable_sorted.striping footable_filtered.striping":function(){e(this).data("striping")!==!1&&t.setupStriping(a)}})},t.setupStriping=function(t){var a=0;e(t.table).find("> tbody > tr:not(.footable-row-detail)").each(function(){var i=e(this);i.removeClass(t.options.classes.striping.even).removeClass(t.options.classes.striping.odd),0===a%2?i.addClass(t.options.classes.striping.even):i.addClass(t.options.classes.striping.odd),a++})}}if(t.footable===undefined||null===t.foobox)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={striping:{enabled:!0},classes:{striping:{odd:"footable-odd",even:"footable-even"}}};t.footable.plugins.register(a,i)})(jQuery,window);
@@ -23,7 +23,7 @@
23
23
  .footable.breakpoint > tbody > tr.footable-detail-show > td {
24
24
  border-bottom: none;
25
25
  }
26
- .footable.breakpoint > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
26
+ .footable.breakpoint > tbody > tr.footable-detail-show span.footable-toggle:before {
27
27
  content: "\e001";
28
28
  }
29
29
  .footable.breakpoint > tbody > tr:hover:not(.footable-row-detail) {
@@ -33,7 +33,7 @@
33
33
  background: #eee;
34
34
  border-top: none;
35
35
  }
36
- .footable.breakpoint > tbody > tr > td > span.footable-toggle {
36
+ .footable.breakpoint > tbody > tr span.footable-toggle {
37
37
  display: inline-block;
38
38
  font-family: 'footable';
39
39
  speak: none;
@@ -46,73 +46,73 @@
46
46
  font-size: 14px;
47
47
  color: #888888;
48
48
  }
49
- .footable.breakpoint > tbody > tr > td > span.footable-toggle:before {
49
+ .footable.breakpoint > tbody > tr span.footable-toggle:before {
50
50
  content: "\e000";
51
51
  }
52
52
  .footable.breakpoint.toggle-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
53
53
  content: "\e005";
54
54
  }
55
- .footable.breakpoint.toggle-circle > tbody > tr > td > span.footable-toggle:before {
55
+ .footable.breakpoint.toggle-circle > tbody > tr span.footable-toggle:before {
56
56
  content: "\e004";
57
57
  }
58
58
  .footable.breakpoint.toggle-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
59
59
  content: "\e003";
60
60
  }
61
- .footable.breakpoint.toggle-circle-filled > tbody > tr > td > span.footable-toggle:before {
61
+ .footable.breakpoint.toggle-circle-filled > tbody > tr span.footable-toggle:before {
62
62
  content: "\e002";
63
63
  }
64
64
  .footable.breakpoint.toggle-square > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
65
65
  content: "\e007";
66
66
  }
67
- .footable.breakpoint.toggle-square > tbody > tr > td > span.footable-toggle:before {
67
+ .footable.breakpoint.toggle-square > tbody > tr span.footable-toggle:before {
68
68
  content: "\e006";
69
69
  }
70
70
  .footable.breakpoint.toggle-square-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
71
71
  content: "\e009";
72
72
  }
73
- .footable.breakpoint.toggle-square-filled > tbody > tr > td > span.footable-toggle:before {
73
+ .footable.breakpoint.toggle-square-filled > tbody > tr span.footable-toggle:before {
74
74
  content: "\e008";
75
75
  }
76
76
  .footable.breakpoint.toggle-arrow > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
77
77
  content: "\e00f";
78
78
  }
79
- .footable.breakpoint.toggle-arrow > tbody > tr > td > span.footable-toggle:before {
79
+ .footable.breakpoint.toggle-arrow > tbody > tr span.footable-toggle:before {
80
80
  content: "\e011";
81
81
  }
82
82
  .footable.breakpoint.toggle-arrow-small > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
83
83
  content: "\e013";
84
84
  }
85
- .footable.breakpoint.toggle-arrow-small > tbody > tr > td > span.footable-toggle:before {
85
+ .footable.breakpoint.toggle-arrow-small > tbody > tr span.footable-toggle:before {
86
86
  content: "\e015";
87
87
  }
88
88
  .footable.breakpoint.toggle-arrow-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
89
89
  content: "\e01b";
90
90
  }
91
- .footable.breakpoint.toggle-arrow-circle > tbody > tr > td > span.footable-toggle:before {
91
+ .footable.breakpoint.toggle-arrow-circle > tbody > tr span.footable-toggle:before {
92
92
  content: "\e01d";
93
93
  }
94
94
  .footable.breakpoint.toggle-arrow-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
95
95
  content: "\e00b";
96
96
  }
97
- .footable.breakpoint.toggle-arrow-circle-filled > tbody > tr > td > span.footable-toggle:before {
97
+ .footable.breakpoint.toggle-arrow-circle-filled > tbody > tr span.footable-toggle:before {
98
98
  content: "\e00d";
99
99
  }
100
100
  .footable.breakpoint.toggle-arrow-tiny > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
101
101
  content: "\e01f";
102
102
  }
103
- .footable.breakpoint.toggle-arrow-tiny > tbody > tr > td > span.footable-toggle:before {
103
+ .footable.breakpoint.toggle-arrow-tiny > tbody > tr span.footable-toggle:before {
104
104
  content: "\e021";
105
105
  }
106
106
  .footable.breakpoint.toggle-arrow-alt > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
107
107
  content: "\e017";
108
108
  }
109
- .footable.breakpoint.toggle-arrow-alt > tbody > tr > td > span.footable-toggle:before {
109
+ .footable.breakpoint.toggle-arrow-alt > tbody > tr span.footable-toggle:before {
110
110
  content: "\e019";
111
111
  }
112
- .footable.breakpoint.toggle-medium > tbody > tr > td > span.footable-toggle {
112
+ .footable.breakpoint.toggle-medium > tbody > tr span.footable-toggle {
113
113
  font-size: 18px;
114
114
  }
115
- .footable.breakpoint.toggle-large > tbody > tr > td > span.footable-toggle {
115
+ .footable.breakpoint.toggle-large > tbody > tr span.footable-toggle {
116
116
  font-size: 24px;
117
117
  }
118
118
  .footable > thead > tr > th {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foo_table-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1.4
4
+ version: 2.0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Stevens
@@ -72,15 +72,20 @@ files:
72
72
  - vendor/assets/images/foo_table/sorting_sprite.png
73
73
  - vendor/assets/images/foo_table/up.png
74
74
  - vendor/assets/javascripts/footable.all.min.js
75
+ - vendor/assets/javascripts/footable.bookmarkable.js
76
+ - vendor/assets/javascripts/footable.bookmarkable.min.js
75
77
  - vendor/assets/javascripts/footable.core.js
76
78
  - vendor/assets/javascripts/footable.core.min.js
77
79
  - vendor/assets/javascripts/footable.filter.js
78
80
  - vendor/assets/javascripts/footable.filter.min.js
81
+ - vendor/assets/javascripts/footable.grid.js
82
+ - vendor/assets/javascripts/footable.memory.js
79
83
  - vendor/assets/javascripts/footable.paginate.js
80
84
  - vendor/assets/javascripts/footable.paginate.min.js
81
85
  - vendor/assets/javascripts/footable.sort.js
82
86
  - vendor/assets/javascripts/footable.sort.min.js
83
87
  - vendor/assets/javascripts/footable.striping.js
88
+ - vendor/assets/javascripts/footable.striping.min.js
84
89
  - vendor/assets/stylesheets/fonts/footable.eot
85
90
  - vendor/assets/stylesheets/fonts/footable.svg
86
91
  - vendor/assets/stylesheets/fonts/footable.ttf