bootstrap-scrolltable-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTgwYTI3NzNiMjc2Y2M1OGI1MmQyMTJlMDMxOTU1ZTIxN2NhY2U2MA==
5
+ data.tar.gz: !binary |-
6
+ NmVlMGIwMjI1YmVkNzMwZmIwOTMxYzUyNDNmNmY4NDIwMzBlMmE0NQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NDdkNmNmODJmNzMxZWQ0ZGYzYTc2YmM2OTZlMjkzYWE4ZmQzNjRlOTU5Nzgy
10
+ NGI4ODc4MmQxMmZkYjg5ZTAzOTY0ZWNhMWQ4YjEwNGMxMmZkZGFmYjZiMjM1
11
+ MmNiOGVlMjgyMjZlYjA2OWY1M2E3ZmJmMTc0N2E2ZGEyZGE2NjA=
12
+ data.tar.gz: !binary |-
13
+ MDU5NzIyNzZhY2ExYTA4NTNmNTA5N2IwOTMyMTIxZTBmOWM5NWNlOWRlOTY1
14
+ NmRkYzJmMjE5MDcwNmU4YjJjYmI3MTEyMjE5NDZmYmE1YWU0YTJmYzFkMmVi
15
+ OTk3ZDM3NDhkZDlhN2Q5YzdkNDMwOTk5M2VhMjAzODU4ZWZiYzI=
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bootstrap-scrolltable-rails.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Pierrick Rouxel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ # bootstrap-scrolltable-rails
2
+
3
+ Table with fixed header for Twitter Bootstrap
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ group :assets do
10
+ gem 'bootstrap-scrolltable-rails'
11
+ end
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Stylesheets
18
+ Add necessary stylesheet file to app/assets/stylesheets/application.css
19
+
20
+ *= require bootstrap-scrolltable
21
+
22
+ Javascripts
23
+ Add necessary javascript(s) files to app/assets/javascripts/application.js
24
+
25
+ //= require bootstrap-scrolltable
26
+
27
+ ## Usage
28
+
29
+ ### Via JavaScript
30
+
31
+ ```javascript
32
+ $('#scrolltable').scrolltable()
33
+ ```
34
+
35
+ ### Methods
36
+
37
+ **.scrolltable()**
38
+ Initializes a table with scrolltable.
39
+
40
+ ## Contributing
41
+
42
+ 1. Fork it
43
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
44
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
45
+ 4. Push to the branch (`git push origin my-new-feature`)
46
+ 5. Create new Pull Request
47
+
48
+ ## Thanks
49
+
50
+ Thanks to twitter bootstrap.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -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 'bootstrap/scrolltable/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bootstrap-scrolltable-rails"
8
+ spec.version = Bootstrap::Scrolltable::Rails::VERSION
9
+ spec.authors = ["Pierrick Rouxel"]
10
+ spec.email = ["pierrick.rouxel@me.com"]
11
+ spec.description = %q{Table with fixed header for Twitter Bootstrap}
12
+ spec.summary = spec.description
13
+ spec.homepage = "https://github.com/pierrickrouxel/bootstrap-scrolltable-rails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "railties", ">= 3.1"
20
+ spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "rake"
22
+ end
@@ -0,0 +1,10 @@
1
+ require "bootstrap/scrolltable/rails/version"
2
+
3
+ module Bootstrap
4
+ module Scrolltable
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Bootstrap
2
+ module Scrolltable
3
+ module Rails
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,73 @@
1
+ !function($){
2
+
3
+ "use strict"; // jshint ;_;
4
+
5
+ /* SCROLLTABLE PUBLIC CLASS DEFINITION
6
+ * ================================= */
7
+
8
+ var Scrolltable = function (element, options) {
9
+ this.$zone = $("<div></div>").addClass("scrolltable")
10
+ this.$element = $(element)
11
+ this.options = $.extend({}, $.fn.scrolltable.defaults, options)
12
+
13
+ this.drawTable()
14
+ }
15
+
16
+ Scrolltable.prototype = {
17
+
18
+ constructor: Scrolltable
19
+
20
+ , drawTable: function() {
21
+ this.$element.wrap(this.$zone)
22
+ $("<div></div>").addClass("scrolltable-header").insertBefore(this.$element)
23
+ var scrollable = $("<div></div>").addClass("scrolltable-div").css("max-height", this.options.maxHeight + "px")
24
+ this.$element.wrap(scrollable)
25
+
26
+ this.$element.find("th").each(function(index) {
27
+ $(this).wrapInner("<div></div>")
28
+ })
29
+ }
30
+
31
+ }
32
+
33
+ /* SCROLLTABLE PLUGIN DEFINITION
34
+ * =========================== */
35
+
36
+ var old = $.fn.scrolltable
37
+
38
+ $.fn.scrolltable = function (option) {
39
+ return this.each(function () {
40
+ var $this = $(this)
41
+ , data = $this.data('scrolltable')
42
+ , options = typeof option == 'object' && option
43
+ if (!data) $this.data('scrolltable', (data = new Scrolltable(this, options)))
44
+ if (typeof option == 'string') data[option]()
45
+ })
46
+ }
47
+
48
+ $.fn.scrolltable.defaults = {
49
+ maxHeight: 100
50
+ }
51
+
52
+ $.fn.scrolltable.Constructor = Scrolltable
53
+
54
+
55
+ /* SCROLLTABLE NO CONFLICT
56
+ * =================== */
57
+
58
+ $.fn.scrolltable.noConflict = function () {
59
+ $.fn.scrolltable = old
60
+ return this
61
+ }
62
+
63
+ /* SCROLLTABLE DATA-API
64
+ * ================== */
65
+
66
+ $(document).on('focus.scrolltable.data-api', '[data-provide="scrolltable"]', function (e) {
67
+ var $this = $(this)
68
+ if ($this.data('scrolltable')) return
69
+ e.preventDefault()
70
+ $this.scrolltable($this.data())
71
+ })
72
+
73
+ }(window.jQuery);
@@ -0,0 +1,25 @@
1
+ .scrolltable {
2
+ position: relative;
3
+ }
4
+
5
+ .scrolltable .scrolltable-header {
6
+ height: 2em;
7
+ }
8
+
9
+ .scrolltable .scrolltable-div {
10
+ overflow-x: hidden;
11
+ overflow-y: auto;
12
+ }
13
+
14
+ .scrolltable th {
15
+ padding-top: 0;
16
+ padding-bottom: 0;
17
+ margin-top: 0;
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ .scrolltable th div {
22
+ height: 2em;
23
+ position: absolute;
24
+ top: 0;
25
+ }
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap-scrolltable-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Pierrick Rouxel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Table with fixed header for Twitter Bootstrap
56
+ email:
57
+ - pierrick.rouxel@me.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - bootstrap-scrolltable-rails.gemspec
68
+ - lib/bootstrap/scrolltable/rails.rb
69
+ - lib/bootstrap/scrolltable/rails/version.rb
70
+ - vendor/javascripts/bootstrap-scrolltable.js
71
+ - vendor/stylesheets/bootstrap-scrolltable.css
72
+ homepage: https://github.com/pierrickrouxel/bootstrap-scrolltable-rails
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.0.3
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Table with fixed header for Twitter Bootstrap
96
+ test_files: []