Skip to content

Update dataTables base code and extras #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ task :fix_css do
Dir.glob(File.join("app/assets/stylesheets/dataTables", "*.scss")).each do |filename|
content = File.read(filename)
content.gsub!(/url\('\.\.\/images\/([A-Za-z0-9_]*\.png)'\)/) do
"image-url('dataTables/#{$1}')"
"image_url('dataTables/#{$1}')"
end
File.open(filename, 'w') { |f| f << content }
end
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ This will add to the corresponding asset files

## Responsive Installation

1 - Complete steps 1-3 of the General Installation.
1 - Complete steps 1-2 of the General Installation.

2 - Run the install generator:
```bash
Expand Down
Binary file modified app/assets/images/dataTables/sort_asc.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/dataTables/sort_asc_disabled.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/dataTables/sort_both.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/dataTables/sort_desc.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/dataTables/sort_desc_disabled.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*! Bootstrap integration for DataTables' AutoFill
* ©2015 SpryMedia Ltd - datatables.net/license
*/

(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs', 'datatables.net-autofill'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}

if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net-bs')(root, $).$;
}

if ( ! $.fn.dataTable.AutoFill ) {
require('datatables.net-autofill')(root, $);
}

return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;


DataTable.AutoFill.classes.btn = 'btn btn-primary';


return DataTable;
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*! Bootstrap integration for DataTables' Buttons
* ©2016 SpryMedia Ltd - datatables.net/license
*/

(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs', 'datatables.net-buttons'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}

if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net-bs')(root, $).$;
}

if ( ! $.fn.dataTable.Buttons ) {
require('datatables.net-buttons')(root, $);
}

return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;


$.extend( true, DataTable.Buttons.defaults, {
dom: {
container: {
className: 'dt-buttons btn-group'
},
button: {
className: 'btn btn-default'
},
collection: {
tag: 'ul',
className: 'dt-button-collection dropdown-menu',
button: {
tag: 'li',
className: 'dt-button'
},
buttonLiner: {
tag: 'a',
className: ''
}
}
}
} );

DataTable.ext.buttons.collection.text = function ( dt ) {
return dt.i18n('buttons.collection', 'Collection <span class="caret"/>');
};


return DataTable.Buttons;
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*! Bootstrap integration for DataTables' Responsive
* ©2015-2016 SpryMedia Ltd - datatables.net/license
*/

(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs', 'datatables.net-responsive'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}

if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net-bs')(root, $).$;
}

if ( ! $.fn.dataTable.Responsive ) {
require('datatables.net-responsive')(root, $);
}

return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;


var _display = DataTable.Responsive.display;
var _original = _display.modal;
var _modal = $(
'<div class="modal fade dtr-bs-modal" role="dialog">'+
'<div class="modal-dialog" role="document">'+
'<div class="modal-content">'+
'<div class="modal-header">'+
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>'+
'</div>'+
'<div class="modal-body"/>'+
'</div>'+
'</div>'+
'</div>'
);

_display.modal = function ( options ) {
return function ( row, update, render ) {
if ( ! $.fn.modal ) {
_original( row, update, render );
}
else {
if ( ! update ) {
if ( options && options.header ) {
_modal.find('div.modal-header')
.empty()
.append( '<h4 class="modal-title">'+options.header( row )+'</h4>' );
}

_modal.find( 'div.modal-body' )
.empty()
.append( render() );

_modal
.appendTo( 'body' )
.modal();
}
}
};
};


return DataTable.Responsive;
}));
Loading