datatablesassets-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/CODE_OF_CONDUCT.md +49 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +84 -0
  7. data/Rakefile +2 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/datatablesassets-rails.gemspec +24 -0
  11. data/lib/datatablesassets-rails.rb +1 -0
  12. data/lib/datatablesassets/rails.rb +7 -0
  13. data/lib/datatablesassets/rails/engine.rb +7 -0
  14. data/lib/datatablesassets/rails/version.rb +5 -0
  15. data/vendor/assets/images/datatables/Sorting icons.psd +0 -0
  16. data/vendor/assets/images/datatables/favicon.ico +0 -0
  17. data/vendor/assets/images/datatables/sort_asc.png +0 -0
  18. data/vendor/assets/images/datatables/sort_asc_disabled.png +0 -0
  19. data/vendor/assets/images/datatables/sort_both.png +0 -0
  20. data/vendor/assets/images/datatables/sort_desc.png +0 -0
  21. data/vendor/assets/images/datatables/sort_desc_disabled.png +0 -0
  22. data/vendor/assets/javascript/datatables/dataTables.bootstrap.js +182 -0
  23. data/vendor/assets/javascript/datatables/dataTables.bootstrap.min.js +8 -0
  24. data/vendor/assets/javascript/datatables/dataTables.bootstrap4.js +184 -0
  25. data/vendor/assets/javascript/datatables/dataTables.bootstrap4.min.js +8 -0
  26. data/vendor/assets/javascript/datatables/dataTables.foundation.js +174 -0
  27. data/vendor/assets/javascript/datatables/dataTables.foundation.min.js +8 -0
  28. data/vendor/assets/javascript/datatables/dataTables.jqueryui.js +164 -0
  29. data/vendor/assets/javascript/datatables/dataTables.jqueryui.min.js +9 -0
  30. data/vendor/assets/javascript/datatables/dataTables.material.js +191 -0
  31. data/vendor/assets/javascript/datatables/dataTables.material.min.js +8 -0
  32. data/vendor/assets/javascript/datatables/dataTables.semanticui.js +208 -0
  33. data/vendor/assets/javascript/datatables/dataTables.semanticui.min.js +9 -0
  34. data/vendor/assets/javascript/datatables/dataTables.uikit.js +176 -0
  35. data/vendor/assets/javascript/datatables/dataTables.uikit.min.js +8 -0
  36. data/vendor/assets/javascript/datatables/jquery.dataTables.js +15278 -0
  37. data/vendor/assets/javascript/datatables/jquery.dataTables.min.js +166 -0
  38. data/vendor/assets/stylesheets/datatables/dataTables.bootstrap.css +185 -0
  39. data/vendor/assets/stylesheets/datatables/dataTables.bootstrap.min.css +1 -0
  40. data/vendor/assets/stylesheets/datatables/dataTables.bootstrap4.css +193 -0
  41. data/vendor/assets/stylesheets/datatables/dataTables.bootstrap4.min.css +1 -0
  42. data/vendor/assets/stylesheets/datatables/dataTables.foundation.css +116 -0
  43. data/vendor/assets/stylesheets/datatables/dataTables.foundation.min.css +1 -0
  44. data/vendor/assets/stylesheets/datatables/dataTables.jqueryui.css +481 -0
  45. data/vendor/assets/stylesheets/datatables/dataTables.jqueryui.min.css +1 -0
  46. data/vendor/assets/stylesheets/datatables/dataTables.material.css +87 -0
  47. data/vendor/assets/stylesheets/datatables/dataTables.material.min.css +1 -0
  48. data/vendor/assets/stylesheets/datatables/dataTables.semanticui.css +103 -0
  49. data/vendor/assets/stylesheets/datatables/dataTables.semanticui.min.css +1 -0
  50. data/vendor/assets/stylesheets/datatables/dataTables.uikit.css +146 -0
  51. data/vendor/assets/stylesheets/datatables/dataTables.uikit.min.css +1 -0
  52. data/vendor/assets/stylesheets/datatables/jquery.dataTables.css +452 -0
  53. data/vendor/assets/stylesheets/datatables/jquery.dataTables.min.css +1 -0
  54. data/vendor/assets/stylesheets/datatables/jquery.dataTables_themeroller.css +417 -0
  55. metadata +127 -0
@@ -0,0 +1,9 @@
1
+ /*!
2
+ DataTables jQuery UI integration
3
+ ©2011-2014 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,d){b||(b=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(b,d).$;return a(d,b,b.document)}:a(jQuery,window,document)})(function(a){var b=a.fn.dataTable;a.extend(!0,b.defaults,{dom:'<"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix ui-corner-tl ui-corner-tr"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix ui-corner-bl ui-corner-br"ip>',
6
+ renderer:"jqueryui"});a.extend(b.ext.classes,{sWrapper:"dataTables_wrapper dt-jqueryui",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default sorting_asc",sSortDesc:"ui-state-default sorting_desc",sSortable:"ui-state-default sorting",sSortableAsc:"ui-state-default sorting_asc_disabled",sSortableDesc:"ui-state-default sorting_desc_disabled",
7
+ sSortableNone:"ui-state-default sorting_disabled",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sHeaderTH:"ui-state-default",sFooterTH:"ui-state-default"});b.ext.renderer.header.jqueryui=function(b,h,e,c){var f="css_right ui-icon ui-icon-carat-2-n-s",g=-1!==a.inArray("asc",e.asSorting),i=-1!==a.inArray("desc",e.asSorting);!e.bSortable||!g&&!i?f="":g&&!i?f="css_right ui-icon ui-icon-carat-1-n":!g&&i&&(f="css_right ui-icon ui-icon-carat-1-s");
8
+ a("<div/>").addClass("DataTables_sort_wrapper").append(h.contents()).append(a("<span/>").addClass(c.sSortIcon+" "+f)).appendTo(h);a(b.nTable).on("order.dt",function(a,g,i,j){b===g&&(a=e.idx,h.removeClass(c.sSortAsc+" "+c.sSortDesc).addClass("asc"==j[a]?c.sSortAsc:"desc"==j[a]?c.sSortDesc:e.sSortingClass),h.find("span."+c.sSortIcon).removeClass("css_right ui-icon ui-icon-triangle-1-n css_right ui-icon ui-icon-triangle-1-s css_right ui-icon ui-icon-carat-2-n-s css_right ui-icon ui-icon-carat-1-n css_right ui-icon ui-icon-carat-1-s").addClass("asc"==
9
+ j[a]?"css_right ui-icon ui-icon-triangle-1-n":"desc"==j[a]?"css_right ui-icon ui-icon-triangle-1-s":f))})};b.TableTools&&a.extend(!0,b.TableTools.classes,{container:"DTTT_container ui-buttonset ui-buttonset-multi",buttons:{normal:"DTTT_button ui-button ui-state-default"},collection:{container:"DTTT_collection ui-buttonset ui-buttonset-multi"}});return b});
@@ -0,0 +1,191 @@
1
+ /*! DataTables Bootstrap 3 integration
2
+ * ©2011-2015 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ /**
6
+ * DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
7
+ * DataTables 1.10 or newer.
8
+ *
9
+ * This file sets the defaults and adds options to DataTables to style its
10
+ * controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
11
+ * for further information.
12
+ */
13
+ (function( factory ){
14
+ if ( typeof define === 'function' && define.amd ) {
15
+ // AMD
16
+ define( ['jquery', 'datatables.net'], function ( $ ) {
17
+ return factory( $, window, document );
18
+ } );
19
+ }
20
+ else if ( typeof exports === 'object' ) {
21
+ // CommonJS
22
+ module.exports = function (root, $) {
23
+ if ( ! root ) {
24
+ root = window;
25
+ }
26
+
27
+ if ( ! $ || ! $.fn.dataTable ) {
28
+ // Require DataTables, which attaches to jQuery, including
29
+ // jQuery if needed and have a $ property so we can access the
30
+ // jQuery object that is used
31
+ $ = require('datatables.net')(root, $).$;
32
+ }
33
+
34
+ return factory( $, root, root.document );
35
+ };
36
+ }
37
+ else {
38
+ // Browser
39
+ factory( jQuery, window, document );
40
+ }
41
+ }(function( $, window, document, undefined ) {
42
+ 'use strict';
43
+ var DataTable = $.fn.dataTable;
44
+
45
+
46
+ /* Set the defaults for DataTables initialisation */
47
+ $.extend( true, DataTable.defaults, {
48
+ dom:
49
+ "<'mdl-grid'"+
50
+ "<'mdl-cell mdl-cell--6-col'l>"+
51
+ "<'mdl-cell mdl-cell--6-col'f>"+
52
+ ">"+
53
+ "<'mdl-grid dt-table'"+
54
+ "<'mdl-cell mdl-cell--12-col'tr>"+
55
+ ">"+
56
+ "<'mdl-grid'"+
57
+ "<'mdl-cell mdl-cell--4-col'i>"+
58
+ "<'mdl-cell mdl-cell--8-col'p>"+
59
+ ">",
60
+ renderer: 'material'
61
+ } );
62
+
63
+
64
+ /* Default class modification */
65
+ $.extend( DataTable.ext.classes, {
66
+ sWrapper: "dataTables_wrapper form-inline dt-material",
67
+ sFilterInput: "form-control input-sm",
68
+ sLengthSelect: "form-control input-sm",
69
+ sProcessing: "dataTables_processing panel panel-default"
70
+ } );
71
+
72
+
73
+ /* Bootstrap paging button renderer */
74
+ DataTable.ext.renderer.pageButton.material = function ( settings, host, idx, buttons, page, pages ) {
75
+ var api = new DataTable.Api( settings );
76
+ var classes = settings.oClasses;
77
+ var lang = settings.oLanguage.oPaginate;
78
+ var aria = settings.oLanguage.oAria.paginate || {};
79
+ var btnDisplay, btnClass, counter=0;
80
+
81
+ var attach = function( container, buttons ) {
82
+ var i, ien, node, button, disabled, active;
83
+ var clickHandler = function ( e ) {
84
+ e.preventDefault();
85
+ if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
86
+ api.page( e.data.action ).draw( 'page' );
87
+ }
88
+ };
89
+
90
+ for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
91
+ button = buttons[i];
92
+
93
+ if ( $.isArray( button ) ) {
94
+ attach( container, button );
95
+ }
96
+ else {
97
+ btnDisplay = '';
98
+ active = false;
99
+
100
+ switch ( button ) {
101
+ case 'ellipsis':
102
+ btnDisplay = '&#x2026;';
103
+ btnClass = 'disabled';
104
+ break;
105
+
106
+ case 'first':
107
+ btnDisplay = lang.sFirst;
108
+ btnClass = button + (page > 0 ?
109
+ '' : ' disabled');
110
+ break;
111
+
112
+ case 'previous':
113
+ btnDisplay = lang.sPrevious;
114
+ btnClass = button + (page > 0 ?
115
+ '' : ' disabled');
116
+ break;
117
+
118
+ case 'next':
119
+ btnDisplay = lang.sNext;
120
+ btnClass = button + (page < pages-1 ?
121
+ '' : ' disabled');
122
+ break;
123
+
124
+ case 'last':
125
+ btnDisplay = lang.sLast;
126
+ btnClass = button + (page < pages-1 ?
127
+ '' : ' disabled');
128
+ break;
129
+
130
+ default:
131
+ btnDisplay = button + 1;
132
+ btnClass = '';
133
+ active = page === button;
134
+ break;
135
+ }
136
+
137
+ if ( active ) {
138
+ btnClass += ' mdl-button--raised mdl-button--colored';
139
+ }
140
+
141
+ if ( btnDisplay ) {
142
+ node = $('<button>', {
143
+ 'class': 'mdl-button '+btnClass,
144
+ 'id': idx === 0 && typeof button === 'string' ?
145
+ settings.sTableId +'_'+ button :
146
+ null,
147
+ 'aria-controls': settings.sTableId,
148
+ 'aria-label': aria[ button ],
149
+ 'data-dt-idx': counter,
150
+ 'tabindex': settings.iTabIndex,
151
+ 'disabled': btnClass.indexOf('disabled') !== -1
152
+ } )
153
+ .html( btnDisplay )
154
+ .appendTo( container );
155
+
156
+ settings.oApi._fnBindAction(
157
+ node, {action: button}, clickHandler
158
+ );
159
+
160
+ counter++;
161
+ }
162
+ }
163
+ }
164
+ };
165
+
166
+ // IE9 throws an 'unknown error' if document.activeElement is used
167
+ // inside an iframe or frame.
168
+ var activeEl;
169
+
170
+ try {
171
+ // Because this approach is destroying and recreating the paging
172
+ // elements, focus is lost on the select button which is bad for
173
+ // accessibility. So we want to restore focus once the draw has
174
+ // completed
175
+ activeEl = $(host).find(document.activeElement).data('dt-idx');
176
+ }
177
+ catch (e) {}
178
+
179
+ attach(
180
+ $(host).empty().html('<div class="pagination"/>').children(),
181
+ buttons
182
+ );
183
+
184
+ if ( activeEl ) {
185
+ $(host).find( '[data-dt-idx='+activeEl+']' ).focus();
186
+ }
187
+ };
188
+
189
+
190
+ return DataTable;
191
+ }));
@@ -0,0 +1,8 @@
1
+ /*!
2
+ DataTables Bootstrap 3 integration
3
+ ©2011-2015 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return c(d,a,a.document)}:c(jQuery,window,document)})(function(c,a,d){var g=c.fn.dataTable;c.extend(!0,g.defaults,{dom:"<'mdl-grid'<'mdl-cell mdl-cell--6-col'l><'mdl-cell mdl-cell--6-col'f>><'mdl-grid dt-table'<'mdl-cell mdl-cell--12-col'tr>><'mdl-grid'<'mdl-cell mdl-cell--4-col'i><'mdl-cell mdl-cell--8-col'p>>",
6
+ renderer:"material"});c.extend(g.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-material",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});g.ext.renderer.pageButton.material=function(a,h,r,s,i,n){var o=new g.Api(a),l=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,e,p=0,q=function(d,g){var m,h,j,b,k=function(a){a.preventDefault();!c(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&
7
+ o.page(a.data.action).draw("page")};m=0;for(h=g.length;m<h;m++)if(b=g[m],c.isArray(b))q(d,b);else{f="";j=!1;switch(b){case "ellipsis":f="&#x2026;";e="disabled";break;case "first":f=l.sFirst;e=b+(0<i?"":" disabled");break;case "previous":f=l.sPrevious;e=b+(0<i?"":" disabled");break;case "next":f=l.sNext;e=b+(i<n-1?"":" disabled");break;case "last":f=l.sLast;e=b+(i<n-1?"":" disabled");break;default:f=b+1,e="",j=i===b}j&&(e+=" mdl-button--raised mdl-button--colored");f&&(j=c("<button>",{"class":"mdl-button "+
8
+ e,id:0===r&&"string"===typeof b?a.sTableId+"_"+b:null,"aria-controls":a.sTableId,"aria-label":t[b],"data-dt-idx":p,tabindex:a.iTabIndex,disabled:-1!==e.indexOf("disabled")}).html(f).appendTo(d),a.oApi._fnBindAction(j,{action:b},k),p++)}},k;try{k=c(h).find(d.activeElement).data("dt-idx")}catch(u){}q(c(h).empty().html('<div class="pagination"/>').children(),s);k&&c(h).find("[data-dt-idx="+k+"]").focus()};return g});
@@ -0,0 +1,208 @@
1
+ /*! DataTables Bootstrap 3 integration
2
+ * ©2011-2015 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ /**
6
+ * DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
7
+ * DataTables 1.10 or newer.
8
+ *
9
+ * This file sets the defaults and adds options to DataTables to style its
10
+ * controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
11
+ * for further information.
12
+ */
13
+ (function( factory ){
14
+ if ( typeof define === 'function' && define.amd ) {
15
+ // AMD
16
+ define( ['jquery', 'datatables.net'], function ( $ ) {
17
+ return factory( $, window, document );
18
+ } );
19
+ }
20
+ else if ( typeof exports === 'object' ) {
21
+ // CommonJS
22
+ module.exports = function (root, $) {
23
+ if ( ! root ) {
24
+ root = window;
25
+ }
26
+
27
+ if ( ! $ || ! $.fn.dataTable ) {
28
+ // Require DataTables, which attaches to jQuery, including
29
+ // jQuery if needed and have a $ property so we can access the
30
+ // jQuery object that is used
31
+ $ = require('datatables.net')(root, $).$;
32
+ }
33
+
34
+ return factory( $, root, root.document );
35
+ };
36
+ }
37
+ else {
38
+ // Browser
39
+ factory( jQuery, window, document );
40
+ }
41
+ }(function( $, window, document, undefined ) {
42
+ 'use strict';
43
+ var DataTable = $.fn.dataTable;
44
+
45
+
46
+ /* Set the defaults for DataTables initialisation */
47
+ $.extend( true, DataTable.defaults, {
48
+ dom:
49
+ "<'ui grid'"+
50
+ "<'row'"+
51
+ "<'eight wide column'l>"+
52
+ "<'right aligned eight wide column'f>"+
53
+ ">"+
54
+ "<'row dt-table'"+
55
+ "<'sixteen wide column'tr>"+
56
+ ">"+
57
+ "<'row'"+
58
+ "<'seven wide column'i>"+
59
+ "<'right aligned nine wide column'p>"+
60
+ ">"+
61
+ ">",
62
+ renderer: 'semanticUI'
63
+ } );
64
+
65
+
66
+ /* Default class modification */
67
+ $.extend( DataTable.ext.classes, {
68
+ sWrapper: "dataTables_wrapper dt-semanticUI",
69
+ sFilter: "dataTables_filter ui input",
70
+ sProcessing: "dataTables_processing ui segment",
71
+ sPageButton: "paginate_button item"
72
+ } );
73
+
74
+
75
+ /* Bootstrap paging button renderer */
76
+ DataTable.ext.renderer.pageButton.semanticUI = function ( settings, host, idx, buttons, page, pages ) {
77
+ var api = new DataTable.Api( settings );
78
+ var classes = settings.oClasses;
79
+ var lang = settings.oLanguage.oPaginate;
80
+ var aria = settings.oLanguage.oAria.paginate || {};
81
+ var btnDisplay, btnClass, counter=0;
82
+
83
+ var attach = function( container, buttons ) {
84
+ var i, ien, node, button;
85
+ var clickHandler = function ( e ) {
86
+ e.preventDefault();
87
+ if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
88
+ api.page( e.data.action ).draw( 'page' );
89
+ }
90
+ };
91
+
92
+ for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
93
+ button = buttons[i];
94
+
95
+ if ( $.isArray( button ) ) {
96
+ attach( container, button );
97
+ }
98
+ else {
99
+ btnDisplay = '';
100
+ btnClass = '';
101
+
102
+ switch ( button ) {
103
+ case 'ellipsis':
104
+ btnDisplay = '&#x2026;';
105
+ btnClass = 'disabled';
106
+ break;
107
+
108
+ case 'first':
109
+ btnDisplay = lang.sFirst;
110
+ btnClass = button + (page > 0 ?
111
+ '' : ' disabled');
112
+ break;
113
+
114
+ case 'previous':
115
+ btnDisplay = lang.sPrevious;
116
+ btnClass = button + (page > 0 ?
117
+ '' : ' disabled');
118
+ break;
119
+
120
+ case 'next':
121
+ btnDisplay = lang.sNext;
122
+ btnClass = button + (page < pages-1 ?
123
+ '' : ' disabled');
124
+ break;
125
+
126
+ case 'last':
127
+ btnDisplay = lang.sLast;
128
+ btnClass = button + (page < pages-1 ?
129
+ '' : ' disabled');
130
+ break;
131
+
132
+ default:
133
+ btnDisplay = button + 1;
134
+ btnClass = page === button ?
135
+ 'active' : '';
136
+ break;
137
+ }
138
+
139
+ var tag = btnClass.indexOf( 'disabled' ) === -1 ?
140
+ 'a' :
141
+ 'div';
142
+
143
+ if ( btnDisplay ) {
144
+ node = $('<'+tag+'>', {
145
+ 'class': classes.sPageButton+' '+btnClass,
146
+ 'id': idx === 0 && typeof button === 'string' ?
147
+ settings.sTableId +'_'+ button :
148
+ null,
149
+ 'href': '#',
150
+ 'aria-controls': settings.sTableId,
151
+ 'aria-label': aria[ button ],
152
+ 'data-dt-idx': counter,
153
+ 'tabindex': settings.iTabIndex
154
+ } )
155
+ .html( btnDisplay )
156
+ .appendTo( container );
157
+
158
+ settings.oApi._fnBindAction(
159
+ node, {action: button}, clickHandler
160
+ );
161
+
162
+ counter++;
163
+ }
164
+ }
165
+ }
166
+ };
167
+
168
+ // IE9 throws an 'unknown error' if document.activeElement is used
169
+ // inside an iframe or frame.
170
+ var activeEl;
171
+
172
+ try {
173
+ // Because this approach is destroying and recreating the paging
174
+ // elements, focus is lost on the select button which is bad for
175
+ // accessibility. So we want to restore focus once the draw has
176
+ // completed
177
+ activeEl = $(host).find(document.activeElement).data('dt-idx');
178
+ }
179
+ catch (e) {}
180
+
181
+ attach(
182
+ $(host).empty().html('<div class="ui pagination menu"/>').children(),
183
+ buttons
184
+ );
185
+
186
+ if ( activeEl ) {
187
+ $(host).find( '[data-dt-idx='+activeEl+']' ).focus();
188
+ }
189
+ };
190
+
191
+
192
+ // Javascript enhancements on table initialisation
193
+ $(document).on( 'init.dt', function (e, ctx) {
194
+ if ( e.namespace !== 'dt' ) {
195
+ return;
196
+ }
197
+
198
+ // Length menu drop down
199
+ if ( $.fn.dropdown ) {
200
+ var api = new $.fn.dataTable.Api( ctx );
201
+
202
+ $( 'div.dataTables_length select', api.table().container() ).dropdown();
203
+ }
204
+ } );
205
+
206
+
207
+ return DataTable;
208
+ }));
@@ -0,0 +1,9 @@
1
+ /*!
2
+ DataTables Bootstrap 3 integration
3
+ ©2011-2015 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var e=b.fn.dataTable;b.extend(!0,e.defaults,{dom:"<'ui grid'<'row'<'eight wide column'l><'right aligned eight wide column'f>><'row dt-table'<'sixteen wide column'tr>><'row'<'seven wide column'i><'right aligned nine wide column'p>>>",
6
+ renderer:"semanticUI"});b.extend(e.ext.classes,{sWrapper:"dataTables_wrapper dt-semanticUI",sFilter:"dataTables_filter ui input",sProcessing:"dataTables_processing ui segment",sPageButton:"paginate_button item"});e.ext.renderer.pageButton.semanticUI=function(h,a,r,s,j,m){var n=new e.Api(h),t=h.oClasses,k=h.oLanguage.oPaginate,u=h.oLanguage.oAria.paginate||{},f,g,o=0,p=function(a,d){var e,i,l,c,q=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&n.page()!=a.data.action&&n.page(a.data.action).draw("page")};
7
+ e=0;for(i=d.length;e<i;e++)if(c=d[e],b.isArray(c))p(a,c);else{g=f="";switch(c){case "ellipsis":f="&#x2026;";g="disabled";break;case "first":f=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":f=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":f=k.sNext;g=c+(j<m-1?"":" disabled");break;case "last":f=k.sLast;g=c+(j<m-1?"":" disabled");break;default:f=c+1,g=j===c?"active":""}l=-1===g.indexOf("disabled")?"a":"div";f&&(l=b("<"+l+">",{"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?
8
+ h.sTableId+"_"+c:null,href:"#","aria-controls":h.sTableId,"aria-label":u[c],"data-dt-idx":o,tabindex:h.iTabIndex}).html(f).appendTo(a),h.oApi._fnBindAction(l,{action:c},q),o++)}},i;try{i=b(a).find(d.activeElement).data("dt-idx")}catch(v){}p(b(a).empty().html('<div class="ui pagination menu"/>').children(),s);i&&b(a).find("[data-dt-idx="+i+"]").focus()};b(d).on("init.dt",function(a,d){if("dt"===a.namespace&&b.fn.dropdown){var e=new b.fn.dataTable.Api(d);b("div.dataTables_length select",e.table().container()).dropdown()}});
9
+ return e});
@@ -0,0 +1,176 @@
1
+ /*! DataTables UIkit 3 integration
2
+ */
3
+
4
+ /**
5
+ * This is a tech preview of UIKit integration with DataTables.
6
+ */
7
+ (function( factory ){
8
+ if ( typeof define === 'function' && define.amd ) {
9
+ // AMD
10
+ define( ['jquery', 'datatables.net'], function ( $ ) {
11
+ return factory( $, window, document );
12
+ } );
13
+ }
14
+ else if ( typeof exports === 'object' ) {
15
+ // CommonJS
16
+ module.exports = function (root, $) {
17
+ if ( ! root ) {
18
+ root = window;
19
+ }
20
+
21
+ if ( ! $ || ! $.fn.dataTable ) {
22
+ // Require DataTables, which attaches to jQuery, including
23
+ // jQuery if needed and have a $ property so we can access the
24
+ // jQuery object that is used
25
+ $ = require('datatables.net')(root, $).$;
26
+ }
27
+
28
+ return factory( $, root, root.document );
29
+ };
30
+ }
31
+ else {
32
+ // Browser
33
+ factory( jQuery, window, document );
34
+ }
35
+ }(function( $, window, document, undefined ) {
36
+ 'use strict';
37
+ var DataTable = $.fn.dataTable;
38
+
39
+
40
+ /* Set the defaults for DataTables initialisation */
41
+ $.extend( true, DataTable.defaults, {
42
+ dom:
43
+ "<'row uk-grid'<'uk-width-1-2'l><'uk-width-1-2'f>>" +
44
+ "<'row uk-grid dt-merge-grid'<'uk-width-1-1'tr>>" +
45
+ "<'row uk-grid dt-merge-grid'<'uk-width-2-5'i><'uk-width-3-5'p>>",
46
+ renderer: 'uikit'
47
+ } );
48
+
49
+
50
+ /* Default class modification */
51
+ $.extend( DataTable.ext.classes, {
52
+ sWrapper: "dataTables_wrapper uk-form dt-uikit",
53
+ sFilterInput: "uk-form-small",
54
+ sLengthSelect: "uk-form-small",
55
+ sProcessing: "dataTables_processing uk-panel"
56
+ } );
57
+
58
+
59
+ /* UIkit paging button renderer */
60
+ DataTable.ext.renderer.pageButton.uikit = function ( settings, host, idx, buttons, page, pages ) {
61
+ var api = new DataTable.Api( settings );
62
+ var classes = settings.oClasses;
63
+ var lang = settings.oLanguage.oPaginate;
64
+ var aria = settings.oLanguage.oAria.paginate || {};
65
+ var btnDisplay, btnClass, counter=0;
66
+
67
+ var attach = function( container, buttons ) {
68
+ var i, ien, node, button;
69
+ var clickHandler = function ( e ) {
70
+ e.preventDefault();
71
+ if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
72
+ api.page( e.data.action ).draw( 'page' );
73
+ }
74
+ };
75
+
76
+ for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
77
+ button = buttons[i];
78
+
79
+ if ( $.isArray( button ) ) {
80
+ attach( container, button );
81
+ }
82
+ else {
83
+ btnDisplay = '';
84
+ btnClass = '';
85
+
86
+ switch ( button ) {
87
+ case 'ellipsis':
88
+ btnDisplay = '<i class="uk-icon-ellipsis-h"></i>';
89
+ btnClass = 'uk-disabled disabled';
90
+ break;
91
+
92
+ case 'first':
93
+ btnDisplay = '<i class="uk-icon-angle-double-left"></i> ' + lang.sFirst;
94
+ btnClass = (page > 0 ?
95
+ '' : ' uk-disabled disabled');
96
+ break;
97
+
98
+ case 'previous':
99
+ btnDisplay = '<i class="uk-icon-angle-left"></i> ' + lang.sPrevious;
100
+ btnClass = (page > 0 ?
101
+ '' : 'uk-disabled disabled');
102
+ break;
103
+
104
+ case 'next':
105
+ btnDisplay = lang.sNext + ' <i class="uk-icon-angle-right"></i>';
106
+ btnClass = (page < pages-1 ?
107
+ '' : 'uk-disabled disabled');
108
+ break;
109
+
110
+ case 'last':
111
+ btnDisplay = lang.sLast + ' <i class="uk-icon-angle-double-right"></i>';
112
+ btnClass = (page < pages-1 ?
113
+ '' : ' uk-disabled disabled');
114
+ break;
115
+
116
+ default:
117
+ btnDisplay = button + 1;
118
+ btnClass = page === button ?
119
+ 'uk-active' : '';
120
+ break;
121
+ }
122
+
123
+ if ( btnDisplay ) {
124
+ node = $('<li>', {
125
+ 'class': classes.sPageButton+' '+btnClass,
126
+ 'id': idx === 0 && typeof button === 'string' ?
127
+ settings.sTableId +'_'+ button :
128
+ null
129
+ } )
130
+ .append( $(( -1 != btnClass.indexOf('disabled') || -1 != btnClass.indexOf('active') ) ? '<span>' : '<a>', {
131
+ 'href': '#',
132
+ 'aria-controls': settings.sTableId,
133
+ 'aria-label': aria[ button ],
134
+ 'data-dt-idx': counter,
135
+ 'tabindex': settings.iTabIndex
136
+ } )
137
+ .html( btnDisplay )
138
+ )
139
+ .appendTo( container );
140
+
141
+ settings.oApi._fnBindAction(
142
+ node, {action: button}, clickHandler
143
+ );
144
+
145
+ counter++;
146
+ }
147
+ }
148
+ }
149
+ };
150
+
151
+ // IE9 throws an 'unknown error' if document.activeElement is used
152
+ // inside an iframe or frame.
153
+ var activeEl;
154
+
155
+ try {
156
+ // Because this approach is destroying and recreating the paging
157
+ // elements, focus is lost on the select button which is bad for
158
+ // accessibility. So we want to restore focus once the draw has
159
+ // completed
160
+ activeEl = $(host).find(document.activeElement).data('dt-idx');
161
+ }
162
+ catch (e) {}
163
+
164
+ attach(
165
+ $(host).empty().html('<ul class="uk-pagination uk-pagination-right"/>').children('ul'),
166
+ buttons
167
+ );
168
+
169
+ if ( activeEl ) {
170
+ $(host).find( '[data-dt-idx='+activeEl+']' ).focus();
171
+ }
172
+ };
173
+
174
+
175
+ return DataTable;
176
+ }));