ez-rsponsive-table 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/ez-rsponsive-table.gemspec +22 -0
- data/lib/ez/rsponsive/table.rb +10 -0
- data/lib/ez/rsponsive/table/version.rb +7 -0
- data/vendor/assets/javascript/ezRtable.js +27 -0
- data/vendor/assets/stylesheets/ezRtable.css +27 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1efae28cf88ed4b0a73d265636ff8760c16a6411
|
4
|
+
data.tar.gz: a073eea3747ce1bc66b59ad20bb169a9b536be11
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4cfca607ee8e5d5658c596dd9d2337ad9baacb2dbeefb207310e161af5344291d3a4e853feb55295cd4d86ebe0939375ccb23fc25436bafdfb52fca010c53ee
|
7
|
+
data.tar.gz: dc03d594ba6fe168ebae1298a7040b4f84eee067d5740403604b91fc4c7477a37d00c9c9136fc691c9aa68f21212c235d183db44360de9eb3d462e4a6e9fdda8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 GeorgioWan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# ezResponsiveTable
|
2
|
+
If you need a EASY way to **Responsive** your table.
|
3
|
+
You can give **ezRtable** a shot :gun:
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
#### 1. Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'ez-rsponsive-table'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute: `$ bundle`
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install ez-rsponsive-table
|
18
|
+
|
19
|
+
#### 2. Add require **ezRtable** into your application.js
|
20
|
+
```javascript
|
21
|
+
//= require jquery
|
22
|
+
//= require jquery.turbolinks
|
23
|
+
//= require jquery_ujs
|
24
|
+
...
|
25
|
+
//= require ezRtable
|
26
|
+
//= require turbolinks
|
27
|
+
```
|
28
|
+
|
29
|
+
#### 3. Add import **ezRtable** into your application.scss
|
30
|
+
```scss
|
31
|
+
@import "ezRtable";
|
32
|
+
```
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
1. Set `table-ezr` in your table class.
|
36
|
+
2. Set `th-ezr` in your **th** class which you wanna responsive
|
37
|
+
3. Set `td-ezr` in your **td** class which you wanna responsive
|
38
|
+
|
39
|
+
## Demo
|
40
|
+
![Desktop](http://i.imgur.com/yVrxP9R.png?1)
|
41
|
+
![Mobile](http://i.imgur.com/8uBWwvV.png?1)
|
42
|
+
|
43
|
+
## Example
|
44
|
+
Check this [jsfiddle](https://jsfiddle.net/GeorgioWan/far3Lgss/), it's a simple use.
|
45
|
+
|
46
|
+
## Reference
|
47
|
+
Source in [Dudley Store's Opencode](http://codepen.io/dudleystorey/pen/Geprd)
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
52
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ez/rsponsive/table"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ez/rsponsive/table/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ez-rsponsive-table"
|
8
|
+
spec.version = Ez::Rsponsive::Table::VERSION
|
9
|
+
spec.authors = ["GeorgioWan"]
|
10
|
+
spec.email = ["georgio.wan@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Easy way to responsive your table.}
|
13
|
+
spec.description = %q{If you need a EASY way to Responsive your table, you can give ezRtable a shot}
|
14
|
+
spec.homepage = "https://github.com/GeorgioWan/ezResponsiveTable-Rails"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/*****************************************************/
|
2
|
+
/*********** ezRtable - Responsive table *************/
|
3
|
+
/** https://github.com/GeorgioWan/ezResponsiveTable **/
|
4
|
+
/*****************************************************/
|
5
|
+
function ezRtable(){
|
6
|
+
if($('.table-ezr').length){
|
7
|
+
var headertext = [],
|
8
|
+
headers = document.querySelectorAll(".table-ezr .th-ezr"),
|
9
|
+
tablebody = document.querySelector(".table-ezr tbody");
|
10
|
+
|
11
|
+
for(var i = 0; i < headers.length; i++) {
|
12
|
+
var current = headers[i];
|
13
|
+
headertext.push(current.textContent.replace(/\r?\n|\r/,""));
|
14
|
+
}
|
15
|
+
for (var i = 0, row; row = tablebody.rows[i]; i++) {
|
16
|
+
var ht = 0;
|
17
|
+
for (var j = 0, col; col = row.cells[j]; j++) {
|
18
|
+
if ( col.className == "td-ezr" )
|
19
|
+
col.setAttribute("data-th", headertext[ht++]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
$(document).ready(function() {
|
26
|
+
ezRtable();
|
27
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/*****************************************************/
|
2
|
+
/*********** ezRtable - Responsive table *************/
|
3
|
+
/** https://github.com/GeorgioWan/ezResponsiveTable **/
|
4
|
+
/*****************************************************/
|
5
|
+
@media screen and (max-width: 600px) {
|
6
|
+
table.table-ezr thead { display: none; }
|
7
|
+
table.table-ezr tbody td {
|
8
|
+
display: block;
|
9
|
+
padding: .6rem;
|
10
|
+
text-align: center;
|
11
|
+
}
|
12
|
+
table.table-ezr tbody tr td:first-child {
|
13
|
+
font-weight: bold;
|
14
|
+
background: #34495E;
|
15
|
+
color: #fff;
|
16
|
+
}
|
17
|
+
table.table-ezr tbody tr td:first-child a{
|
18
|
+
color: #1ABC9C;
|
19
|
+
}
|
20
|
+
table.table-ezr tbody tr .td-ezr:before {
|
21
|
+
content: attr(data-th);
|
22
|
+
font-weight: bold;
|
23
|
+
width: 6rem;
|
24
|
+
float: left;
|
25
|
+
text-align: left;
|
26
|
+
}
|
27
|
+
}
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ez-rsponsive-table
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- GeorgioWan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: If you need a EASY way to Responsive your table, you can give ezRtable
|
42
|
+
a shot
|
43
|
+
email:
|
44
|
+
- georgio.wan@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".rspec"
|
51
|
+
- ".travis.yml"
|
52
|
+
- CODE_OF_CONDUCT.md
|
53
|
+
- Gemfile
|
54
|
+
- LICENSE.txt
|
55
|
+
- README.md
|
56
|
+
- Rakefile
|
57
|
+
- bin/console
|
58
|
+
- bin/setup
|
59
|
+
- ez-rsponsive-table.gemspec
|
60
|
+
- lib/ez/rsponsive/table.rb
|
61
|
+
- lib/ez/rsponsive/table/version.rb
|
62
|
+
- vendor/assets/javascript/ezRtable.js
|
63
|
+
- vendor/assets/stylesheets/ezRtable.css
|
64
|
+
homepage: https://github.com/GeorgioWan/ezResponsiveTable-Rails
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata: {}
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 2.5.1
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: Easy way to responsive your table.
|
88
|
+
test_files: []
|