rails_slickgrid 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,153 @@
1
+ /*
2
+ IMPORTANT:
3
+ In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes.
4
+ No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS
5
+ classes should alter those!
6
+ */
7
+
8
+
9
+ .slick-header.ui-state-default {
10
+ width: 100%;
11
+ overflow: hidden;
12
+ border-left: 0px;
13
+ }
14
+
15
+ .slick-header-columns {
16
+ width: 999999px;
17
+ position: relative;
18
+ white-space: nowrap;
19
+ cursor: default;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .slick-header-column.ui-state-default {
24
+ position: relative;
25
+ display: inline-block;
26
+ overflow: hidden;
27
+ text-overflow: ellipsis;
28
+ height: 16px;
29
+ line-height: 16px;
30
+ margin: 0;
31
+ padding: 4px;
32
+ border-right: 1px solid silver;
33
+ border-left: 0px;
34
+ border-top: 0px;
35
+ border-bottom: 0px;
36
+ float: left;
37
+ }
38
+
39
+ .slick-header-column-sorted {
40
+ font-style: italic;
41
+ }
42
+
43
+ .slick-sort-indicator {
44
+ display: inline-block;
45
+ width: 8px;
46
+ height: 5px;
47
+ margin-left: 4px;
48
+ }
49
+
50
+ .slick-sort-indicator-desc {
51
+ background: url(images/sort-desc.gif);
52
+ }
53
+
54
+ .slick-sort-indicator-asc {
55
+ background: url(images/sort-asc.gif);
56
+ }
57
+
58
+ .slick-resizable-handle {
59
+ position: absolute;
60
+ font-size: 0.1px;
61
+ display: block;
62
+ cursor: col-resize;
63
+ width: 4px;
64
+ right: 0px;
65
+ top: 0;
66
+ height: 100%;
67
+ }
68
+
69
+ .slick-sortable-placeholder {
70
+ background: silver;
71
+ }
72
+
73
+ .grid-canvas {
74
+ position: relative;
75
+ outline: 0;
76
+ }
77
+
78
+ .slick-row.ui-widget-content, .slick-row.ui-state-active {
79
+ position: absolute;
80
+ border: 0px;
81
+ }
82
+
83
+ .slick-cell {
84
+ float: left;
85
+
86
+ border: 1px solid transparent;
87
+ border-right: 1px dotted silver;
88
+ border-bottom-color: silver;
89
+
90
+ overflow: hidden;
91
+ text-overflow: ellipsis;
92
+ white-space: nowrap;
93
+ vertical-align: middle;
94
+ z-index: 1;
95
+ padding: 1px 2px 2px 1px;
96
+ margin: 0;
97
+
98
+ white-space: nowrap;
99
+
100
+ cursor: default;
101
+ }
102
+
103
+ .slick-cell.highlighted {
104
+ background: lightskyblue;
105
+ background: rgba(0,0,255,0.2);
106
+ -webkit-transition: all 0.5s;
107
+ -moz-transition: all 0.5s;
108
+ transition: all 0.5s;
109
+ }
110
+
111
+ .slick-cell.flashing {
112
+ border: 1px solid red !important;
113
+ }
114
+
115
+ .slick-cell.editable {
116
+ z-index: 11;
117
+ overflow: visible;
118
+ background: white;
119
+ border-color: black;
120
+ border-style: solid;
121
+ }
122
+
123
+ .slick-cell:focus {
124
+ outline: none;
125
+ }
126
+
127
+ .slick-reorder-proxy {
128
+ display: inline-block;
129
+ background: blue;
130
+ opacity: 0.15;
131
+ filter: alpha(opacity=15);
132
+ cursor: move;
133
+ }
134
+
135
+ .slick-reorder-guide {
136
+ display: inline-block;
137
+ height: 2px;
138
+ background: blue;
139
+ opacity: 0.7;
140
+ filter: alpha(opacity=70);
141
+ }
142
+
143
+ .slick-selection {
144
+ z-index: 10;
145
+ position: absolute;
146
+ background: gray;
147
+ border: 1px solid black;
148
+ opacity: 0.3;
149
+ filter: alpha(opacity=30);
150
+ -webkit-box-shadow: 0px 0px 10px black;
151
+ -moz-box-shadow: 0px 0px 10px black;
152
+ box-shadow: 0px 0px 10px black;
153
+ }
@@ -0,0 +1,48 @@
1
+ .slick-pager
2
+ {
3
+ width: 100%;
4
+ height: 26px;
5
+ border: 1px solid gray;
6
+ border-top: 0;
7
+ background: url('images/header-columns-bg.gif') repeat-x center bottom;
8
+ vertical-align: middle;
9
+ }
10
+
11
+ .slick-pager .slick-pager-status
12
+ {
13
+ display: inline-block;
14
+ padding: 6px;
15
+ }
16
+
17
+ .slick-pager .ui-icon-container
18
+ {
19
+ display: inline-block;
20
+ margin: 2px;
21
+ border-color: gray;
22
+ }
23
+
24
+ .slick-pager .slick-pager-nav
25
+ {
26
+ display: inline-block;
27
+ float: left;
28
+ padding: 2px;
29
+ }
30
+
31
+ .slick-pager .slick-pager-settings
32
+ {
33
+ display: block;
34
+ float: right;
35
+ padding: 2px;
36
+ }
37
+
38
+ .slick-pager .slick-pager-settings *
39
+ {
40
+ vertical-align: middle;
41
+ }
42
+
43
+ .slick-pager .slick-pager-settings a
44
+ {
45
+ padding: 2px;
46
+ text-decoration: underline;
47
+ cursor: pointer;
48
+ }
@@ -0,0 +1,7 @@
1
+ module RailsSlickgrid
2
+ end
3
+
4
+ if defined?(::Rails::Railtie)
5
+ require 'rails_slickgrid/railtie'
6
+ end
7
+
@@ -0,0 +1,22 @@
1
+ module RailsSlickgrid
2
+ module ActionView
3
+ STYLESHEETS = %w(slick.columnpicker slick.grid slick.pager)
4
+ JAVASCRIPTS = %w(slick.columnpicker slick.editors slick.model slick.pager slick.grid)
5
+
6
+ def slickgrid_assets
7
+ (slickgrid_stylesheets + slickgrid_javascripts).html_safe
8
+ end
9
+
10
+ def slickgrid_stylesheets
11
+ STYLESHEETS.map do |ss|
12
+ stylesheet_link_tag("slickgrid/#{ss}")
13
+ end.join("\n")
14
+ end
15
+
16
+ def slickgrid_javascripts
17
+ JAVASCRIPTS.map do |ss|
18
+ javascript_include_tag("slickgrid/#{ss}")
19
+ end.join("\n")
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ require 'rails_slickgrid'
2
+
3
+ module RailsSlickgrid
4
+ class Railtie < Rails::Railtie
5
+ initializer "rails_slickgrid.action_view" do |app|
6
+ require 'rails_slickgrid/action_view'
7
+ ::ActionView::Base.send(:include, RailsSlickgrid::ActionView)
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,37 @@
1
+ # ripped from Homebrew
2
+ module RailsSlickgrid
3
+ module Utils
4
+ class ExecutionError < StandardError; end
5
+ extend self
6
+ def system cmd, *args
7
+ #puts "#{cmd} #{args*' '}" if ARGV.verbose?
8
+ fork do
9
+ yield if block_given?
10
+ args.collect!{|arg| arg.to_s}
11
+ exec(cmd, *args) rescue nil
12
+ exit! 1 # never gets here unless exec failed
13
+ end
14
+ Process.wait
15
+ $?.success?
16
+ end
17
+
18
+ # Kernel.system but with exceptions
19
+ def safe_system cmd, *args
20
+ raise ExecutionError.new($?) unless system(cmd, *args)
21
+ end
22
+
23
+ # prints no output
24
+ def quiet_system cmd, *args
25
+ system(cmd, *args) do
26
+ $stdout.close
27
+ $stderr.close
28
+ end
29
+ end
30
+
31
+ def curl *args
32
+ safe_system '/usr/bin/curl', '-f#LA', 'Rails SlickGrid', *args unless args.empty?
33
+ end
34
+ end
35
+ end
36
+
37
+
@@ -0,0 +1,3 @@
1
+ module RailsSlickgrid
2
+ VERSION = "0.0.1".freeze
3
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_slickgrid
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Joe Martinez
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-22 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: ""
23
+ email: joe@joemartinez.name
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - lib/generators/rails_slickgrid/install/install_generator.rb
32
+ - lib/generators/rails_slickgrid/install/javascripts/slick.columnpicker.js
33
+ - lib/generators/rails_slickgrid/install/javascripts/slick.editors.js
34
+ - lib/generators/rails_slickgrid/install/javascripts/slick.grid.js
35
+ - lib/generators/rails_slickgrid/install/javascripts/slick.model.js
36
+ - lib/generators/rails_slickgrid/install/javascripts/slick.pager.js
37
+ - lib/generators/rails_slickgrid/install/stylesheets/slick.columnpicker.css
38
+ - lib/generators/rails_slickgrid/install/stylesheets/slick.grid.css
39
+ - lib/generators/rails_slickgrid/install/stylesheets/slick.pager.css
40
+ - lib/rails_slickgrid/action_view.rb
41
+ - lib/rails_slickgrid/railtie.rb
42
+ - lib/rails_slickgrid/utils.rb
43
+ - lib/rails_slickgrid/version.rb
44
+ - lib/rails_slickgrid.rb
45
+ - MIT-LICENSE
46
+ - Rakefile
47
+ - README.md
48
+ has_rdoc: true
49
+ homepage: http://github.com/capitalist/rails_slickgrid
50
+ licenses: []
51
+
52
+ post_install_message:
53
+ rdoc_options: []
54
+
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ requirements: []
76
+
77
+ rubyforge_project:
78
+ rubygems_version: 1.3.7
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Allows easy rendering of Slickgrids in Rails 3 views.
82
+ test_files: []
83
+