Skip to content

Commit 0daf840

Browse files
committed
Merge branch 'tablesorter-2.4.6'
2 parents 5015765 + 8eed4ce commit 0daf840

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3447
-1373
lines changed

README.markdown

+52-30
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,94 @@
1-
jQuery Table Sorter plugin for Rails
2-
===
1+
# jQuery Table Sorter plugin for Rails
32

43
Simple integration of jquery-tablesorter into the asset pipeline.
54

6-
Current version: 2.3.11(7/12/2012), [documentation]
5+
Current tablesorter version: 2.4.6 (10/25/2012), [documentation]
76

87
Any issue associate with the js/css files, please report to [Mottie's fork].
98

109

11-
NOTICE:
12-
---
10+
## NOTICE:
1311

1412
v0.0.5 users, from v1.0.0, this gem will use [Mottie's fork] :smile:.
1513

16-
Install
17-
---
18-
In your Gemfile
14+
## Installation
1915

20-
```
21-
gem 'jquery-tablesorter'
22-
```
16+
Add this line to your application's Gemfile:
17+
18+
gem 'jquery-tablesorter'
19+
20+
And then execute:
21+
22+
$ bundle
2323

24-
Requirements
25-
---
24+
Or install it yourself as:
25+
26+
$ gem install jquery-tablesorter
27+
28+
## Requirements
2629

2730
Rails 3.1 and higher
2831

29-
Usage
30-
---
32+
## Usage
3133

32-
### In your `application.js`
34+
### JavaScript files
3335

34-
```
35-
require jquery-tablesorter
36+
In your `application.js`
37+
38+
```javascript
39+
//= require jquery-tablesorter
3640
```
3741

38-
this will require all files.
42+
This will require all jquery-tablesorter files (exclude addons).
3943

4044
Or you can include single file with:
4145

42-
```
46+
```javascript
4347
//= require jquery-tablesorter/jquery.metadata
4448
//= require jquery-tablesorter/jquery.tablesorter
4549
//= require jquery-tablesorter/jquery.tablesorter.widgets
46-
//= require jquery-tablesorter/addons/jquery.tablesorter.pager
50+
//= require jquery-tablesorter/addons/pager/jquery.tablesorter.pager
4751
```
4852

53+
### Stylesheet files
4954

50-
### In your `application.css`
55+
In your `application.css`
5156

52-
```
57+
```css
5358
/*
54-
* = require jquery-tablesorter/<theme name>
59+
*= require jquery-tablesorter/<theme name>
5560
*/
5661
```
5762

5863
Avaliable theme names:
5964

60-
* blue
61-
* ui
65+
* theme.black-ice
66+
* theme.blue
67+
* theme.bootstrap
68+
* theme.dark
69+
* theme.default
70+
* theme.dropbox
71+
* theme.green
72+
* theme.grey
73+
* theme.ice
74+
* theme.jui
6275

76+
pager theme:
6377

64-
### In CoffeeScript file:
65-
66-
```
67-
$('table.tablesorter').tablesorter()
78+
```css
79+
/*
80+
*= require jquery-tablesorter/addons/pager/jquery.tablesorter.pager
81+
*/
6882
```
6983

84+
## Contributing
85+
86+
1. Fork it
87+
2. Create your feature branch (`git checkout -b my-new-feature`)
88+
3. Commit your changes (`git commit -am 'Added some feature'`)
89+
4. Push to the branch (`git push origin my-new-feature`)
90+
5. Create new Pull Request
91+
7092
[Mottie's fork]: https://github.com/Mottie/tablesorter
7193
[documentation]: http://mottie.github.com/tablesorter/docs/index.html
7294

Rakefile

100644100755
+56-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,59 @@
33
require 'bundler'
44
Bundler::GemHelper.install_tasks
55

6-
load 'lib/tasks/jquery-tablesorter_tasks.rake'
6+
namespace :jquery_tablesorter do
7+
desc 'update tablesorter'
8+
task :update do
9+
# javascripts
10+
#
11+
javascript_dir = 'vendor/assets/javascripts/jquery-tablesorter'
12+
FileUtils.mkdir_p(javascript_dir)
13+
Dir.glob('tablesorter/js/*.js').each do |file|
14+
FileUtils.cp file, javascript_dir, :verbose => true
15+
end
16+
17+
# stylesheets
18+
#
19+
stylesheet_dir = 'vendor/assets/stylesheets/jquery-tablesorter'
20+
FileUtils.mkdir_p(stylesheet_dir)
21+
Dir.glob('tablesorter/css/*.css').each do |file|
22+
FileUtils.cp file, stylesheet_dir, :verbose => true
23+
end
24+
25+
# images
26+
#
27+
images_dir = 'vendor/assets/images/jquery-tablesorter'
28+
FileUtils.mkdir_p(images_dir)
29+
Dir.glob('tablesorter/css/images/*').each do |file|
30+
FileUtils.cp file, images_dir, :verbose => true
31+
end
32+
33+
# addons
34+
#
35+
## pager
36+
pager_stylesheet_dir = stylesheet_dir + '/addons/pager'
37+
FileUtils.mkdir_p(pager_stylesheet_dir)
38+
FileUtils.cp 'tablesorter/addons/pager/jquery.tablesorter.pager.css',
39+
pager_stylesheet_dir,
40+
:verbose => true
41+
42+
pager_javascript_dir = javascript_dir + '/addons/pager'
43+
FileUtils.mkdir_p(pager_javascript_dir)
44+
FileUtils.cp 'tablesorter/addons/pager/jquery.tablesorter.pager.js',
45+
pager_javascript_dir,
46+
:verbose => true
47+
48+
pager_images_dir = images_dir + '/addons/pager'
49+
FileUtils.mkdir_p(pager_images_dir)
50+
FileUtils.cp_r 'tablesorter/addons/pager/icons', pager_images_dir,
51+
:verbose => true
52+
end
53+
54+
desc 'Sanitize image paths'
55+
task :sanitize_image_paths do
56+
Dir.glob('vendor/assets/stylesheets/jquery-tablesorter/*.css').each do |file_path|
57+
content = File.read(file_path).gsub(/url\(images\//, "url(/assets/jquery-tablesorter/")
58+
File.open(file_path, "w") {|file| file.write content}
59+
end
60+
end
61+
end

lib/tasks/jquery-tablesorter_tasks.rake

-39
This file was deleted.

tablesorter

Submodule tablesorter updated 126 files

vendor/assets/images/jquery-tablesorter/.gitkeep

Whitespace-only changes.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
290 Bytes
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
//= require_tree ./jquery-tablesorter
1+
//= require jquery-tablesorter/jquery.metadata
2+
//= require jquery-tablesorter/jquery.tablesorter
3+
//= require jquery-tablesorter/jquery.tablesorter.widgets

0 commit comments

Comments
 (0)