jquery-minicolors-rails 2.1.1.0 → 2.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjY3MmZmOWRiZjE2Yjk4Y2VmYzViY2IyYTcyMWQ0MTM1ZjE2MzE4OQ==
4
+ ZDliOTljMDkwMTMzMGM5NjdkMDU2OWFjMmRkOTIzOGE3NGQ4NzgyNg==
5
5
  data.tar.gz: !binary |-
6
- YWVmODM2ZjVhZmNlYThiNWM3Y2FmNTg4OTJjNzI3NjcwODIzMzJiOA==
6
+ N2NiNGMzNmE2Y2Q5MWM0ZGRhYzQwYzA3MGNlODllYzVhNGVjMjQzZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzM4YTBhNDA3ZDRhZjJkNjRlODE3YjE3ZDg5OWU0NzMxMzdmY2I2NzFhY2Y0
10
- OWU1ZWUzMGNlMzk3NjY2N2ViNTJjZDZkMzM4MjU1ZmRlYTQwODA5N2RjMzE4
11
- NDQyNTYzODdlOWFkMTAyYjgyYzAxZDNlZmQzODJmNDY4YTE2YjE=
9
+ MzM3OTkyOTk2N2RhZTAxY2EwMDgzZGYxM2Y4YmNiZWZiZjZiMWNhNGRjNjJm
10
+ MmI3NTVhYzhjNDZlODRmNTE3MTc2YmYyYWM0NTVmNDRkNjJhNmFkZjg2N2Qw
11
+ Mzc4ODBjY2RjYTEyNjI2NmRmNGZmOTBmODY2N2IyNjYxZmRjNjY=
12
12
  data.tar.gz: !binary |-
13
- MjFlOTI1YzI5MDc1NDFhNzEzYzA0YmYyZDc4NDA5YjZlYzNmZjhkYmIwNTI1
14
- ZDFkNjEzOTAyYTY5M2Y3ZmU3ZjhhNzQ5Y2NiNGQ4YzllYjdlZDhiNzJiNThm
15
- MmY5NmU2ZTQ1ZmQ1MWRjZDZjMWEzODZmMWY3ZGE2ZGQ0NmYyODY=
13
+ YzQ5NzZhZjYwMGJlMTlhYTE0OWRlOTIyY2JiNTM0YzJlYzkyNTQ3NzAyZGY1
14
+ YjA1NzQxNjBkMTA3NTBhMTE2ZDdmNDRkNzcxMTM4NzY2OTNhZThmZDM1ZTJh
15
+ YTNjYTBkM2E0NGY0YjQ0M2I0MTRiZWMwMjYzMGIyODU0Y2Y1YjI=
data/README.md CHANGED
@@ -78,14 +78,11 @@ See https://github.com/plataformatec/simple_form
78
78
  As of https://github.com/rails/rails/pull/7968 (Rails > 4.*) the asset pipeline precompile command will ignore the images.
79
79
  Since `jquery.minicolors` uses an image for backgrounds you have two options:
80
80
 
81
- #### Option 1: use an optional stylesheet with data-URLs.
81
+ #### Option 1: use data-URLs in the stylesheet.
82
82
 
83
- Just change `app/assets/stylesheets/application.css` to:
84
-
85
- ```css
86
- /*
87
- *= require jquery.minicolors.embedded
88
- */
83
+ ```ruby
84
+ # config/initializers/jquery_minicolors_rails.rb
85
+ JqueryMinicolorsRails.use_data_urls = true
89
86
  ```
90
87
 
91
88
  __Benefit__: simpler deployment setup.
@@ -1,8 +1,16 @@
1
1
  require 'jquery-minicolors-rails/engine'
2
2
 
3
3
  module JqueryMinicolorsRails
4
- def self.background_image_data_url
5
- @_background_image_data_url ||=
6
- File.read(File.expand_path('../../vendor/assets/images/jquery.minicolors.txt', __FILE__))
4
+ class << self
5
+ attr_writer :use_data_urls
6
+
7
+ def use_data_urls?
8
+ !!@use_data_urls
9
+ end
10
+
11
+ def image_data_url
12
+ @image_data_url ||=
13
+ File.read(File.expand_path('../../vendor/assets/images/jquery.minicolors.txt', __FILE__))
14
+ end
7
15
  end
8
16
  end
@@ -1,3 +1,3 @@
1
1
  module JqueryMinicolorsRails
2
- VERSION = '2.1.1.0'
2
+ VERSION = '2.1.1.1'
3
3
  end
@@ -5,7 +5,7 @@
5
5
  .minicolors-swatch {
6
6
  position: absolute;
7
7
  vertical-align: middle;
8
- background: url(<%= image_path 'jquery.minicolors.png' %>) -80px 0;
8
+ background: url(<%= JqueryMinicolorsRails.use_data_urls? ? JqueryMinicolorsRails.image_data_url : image_path('jquery.minicolors.png') %>) -80px 0;
9
9
  border: solid 1px #ccc;
10
10
  cursor: text;
11
11
  padding: 0;
@@ -73,7 +73,7 @@
73
73
  left: 1px;
74
74
  width: 150px;
75
75
  height: 150px;
76
- background: url(<%= image_path 'jquery.minicolors.png' %>) -120px 0;
76
+ background: url(<%= JqueryMinicolorsRails.use_data_urls? ? JqueryMinicolorsRails.image_data_url : image_path('jquery.minicolors.png') %>) -120px 0;
77
77
  cursor: crosshair;
78
78
  }
79
79
 
@@ -91,7 +91,7 @@
91
91
  }
92
92
 
93
93
  .minicolors-slider-saturation .minicolors-grid-inner {
94
- background: url(<%= image_path 'jquery.minicolors.png' %>) -270px 0;
94
+ background: url(<%= JqueryMinicolorsRails.use_data_urls? ? JqueryMinicolorsRails.image_data_url : image_path('jquery.minicolors.png') %>) -270px 0;
95
95
  }
96
96
 
97
97
  .minicolors-slider-brightness .minicolors-grid {
@@ -113,7 +113,7 @@
113
113
  left: 152px;
114
114
  width: 20px;
115
115
  height: 150px;
116
- background: white url(<%= image_path 'jquery.minicolors.png' %>) 0 0;
116
+ background: white url(<%= JqueryMinicolorsRails.use_data_urls? ? JqueryMinicolorsRails.image_data_url : image_path('jquery.minicolors.png') %>) 0 0;
117
117
  cursor: row-resize;
118
118
  }
119
119
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-minicolors-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1.0
4
+ version: 2.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kostiantyn Kahanskyi
@@ -152,7 +152,6 @@ files:
152
152
  - vendor/assets/javascripts/jquery.minicolors.js
153
153
  - vendor/assets/javascripts/jquery.minicolors.simple_form.js
154
154
  - vendor/assets/stylesheets/jquery.minicolors.css.erb
155
- - vendor/assets/stylesheets/jquery.minicolors.embedded.css.erb
156
155
  - Rakefile
157
156
  - README.md
158
157
  homepage: https://github.com/kostia/jquery-minicolors-rails
@@ -1,245 +0,0 @@
1
- .minicolors {
2
- position: relative;
3
- }
4
-
5
- .minicolors-swatch {
6
- position: absolute;
7
- vertical-align: middle;
8
- background: url(<%= JqueryMinicolorsRails.background_image_data_url %>) -80px 0;
9
- border: solid 1px #ccc;
10
- cursor: text;
11
- padding: 0;
12
- margin: 0;
13
- display: inline-block;
14
- }
15
-
16
- .minicolors-swatch-color {
17
- position: absolute;
18
- top: 0;
19
- left: 0;
20
- right: 0;
21
- bottom: 0;
22
- }
23
-
24
- .minicolors input[type=hidden] + .minicolors-swatch {
25
- width: 28px;
26
- position: static;
27
- cursor: pointer;
28
- }
29
-
30
- /* Panel */
31
- .minicolors-panel {
32
- position: absolute;
33
- width: 173px;
34
- height: 152px;
35
- background: white;
36
- border: solid 1px #CCC;
37
- box-shadow: 0 0 20px rgba(0, 0, 0, .2);
38
- z-index: 99999;
39
- -moz-box-sizing: content-box;
40
- -webkit-box-sizing: content-box;
41
- box-sizing: content-box;
42
- display: none;
43
- }
44
-
45
- .minicolors-panel.minicolors-visible {
46
- display: block;
47
- }
48
-
49
- /* Panel positioning */
50
- .minicolors-position-top .minicolors-panel {
51
- top: -154px;
52
- }
53
-
54
- .minicolors-position-right .minicolors-panel {
55
- right: 0;
56
- }
57
-
58
- .minicolors-position-bottom .minicolors-panel {
59
- top: auto;
60
- }
61
-
62
- .minicolors-position-left .minicolors-panel {
63
- left: 0;
64
- }
65
-
66
- .minicolors-with-opacity .minicolors-panel {
67
- width: 194px;
68
- }
69
-
70
- .minicolors .minicolors-grid {
71
- position: absolute;
72
- top: 1px;
73
- left: 1px;
74
- width: 150px;
75
- height: 150px;
76
- background: url(<%= JqueryMinicolorsRails.background_image_data_url %>) -120px 0;
77
- cursor: crosshair;
78
- }
79
-
80
- .minicolors .minicolors-grid-inner {
81
- position: absolute;
82
- top: 0;
83
- left: 0;
84
- width: 150px;
85
- height: 150px;
86
- background: none;
87
- }
88
-
89
- .minicolors-slider-saturation .minicolors-grid {
90
- background-position: -420px 0;
91
- }
92
-
93
- .minicolors-slider-saturation .minicolors-grid-inner {
94
- background: url(<%= JqueryMinicolorsRails.background_image_data_url %>) -270px 0;
95
- }
96
-
97
- .minicolors-slider-brightness .minicolors-grid {
98
- background-position: -570px 0;
99
- }
100
-
101
- .minicolors-slider-brightness .minicolors-grid-inner {
102
- background: black;
103
- }
104
-
105
- .minicolors-slider-wheel .minicolors-grid {
106
- background-position: -720px 0;
107
- }
108
-
109
- .minicolors-slider,
110
- .minicolors-opacity-slider {
111
- position: absolute;
112
- top: 1px;
113
- left: 152px;
114
- width: 20px;
115
- height: 150px;
116
- background: white url(<%= JqueryMinicolorsRails.background_image_data_url %>) 0 0;
117
- cursor: row-resize;
118
- }
119
-
120
- .minicolors-slider-saturation .minicolors-slider {
121
- background-position: -60px 0;
122
- }
123
-
124
- .minicolors-slider-brightness .minicolors-slider {
125
- background-position: -20px 0;
126
- }
127
-
128
- .minicolors-slider-wheel .minicolors-slider {
129
- background-position: -20px 0;
130
- }
131
-
132
- .minicolors-opacity-slider {
133
- left: 173px;
134
- background-position: -40px 0;
135
- display: none;
136
- }
137
-
138
- .minicolors-with-opacity .minicolors-opacity-slider {
139
- display: block;
140
- }
141
-
142
- /* Pickers */
143
- .minicolors-grid .minicolors-picker {
144
- position: absolute;
145
- top: 70px;
146
- left: 70px;
147
- width: 12px;
148
- height: 12px;
149
- border: solid 1px black;
150
- border-radius: 10px;
151
- margin-top: -6px;
152
- margin-left: -6px;
153
- background: none;
154
- }
155
-
156
- .minicolors-grid .minicolors-picker > div {
157
- position: absolute;
158
- top: 0;
159
- left: 0;
160
- width: 8px;
161
- height: 8px;
162
- border-radius: 8px;
163
- border: solid 2px white;
164
- -moz-box-sizing: content-box;
165
- -webkit-box-sizing: content-box;
166
- box-sizing: content-box;
167
- }
168
-
169
- .minicolors-picker {
170
- position: absolute;
171
- top: 0;
172
- left: 0;
173
- width: 18px;
174
- height: 2px;
175
- background: white;
176
- border: solid 1px black;
177
- margin-top: -2px;
178
- -moz-box-sizing: content-box;
179
- -webkit-box-sizing: content-box;
180
- box-sizing: content-box;
181
- }
182
-
183
- /* Inline controls */
184
- .minicolors-inline {
185
- display: inline-block;
186
- }
187
-
188
- .minicolors-inline .minicolors-input {
189
- display: none !important;
190
- }
191
-
192
- .minicolors-inline .minicolors-panel {
193
- position: relative;
194
- top: auto;
195
- left: auto;
196
- box-shadow: none;
197
- z-index: auto;
198
- display: inline-block;
199
- }
200
-
201
- /* Default theme */
202
- .minicolors-theme-default .minicolors-swatch {
203
- top: 5px;
204
- left: 5px;
205
- width: 18px;
206
- height: 18px;
207
- }
208
- .minicolors-theme-default.minicolors-position-right .minicolors-swatch {
209
- left: auto;
210
- right: 5px;
211
- }
212
- .minicolors-theme-default.minicolors {
213
- width: auto;
214
- display: inline-block;
215
- }
216
- .minicolors-theme-default .minicolors-input {
217
- height: 20px;
218
- width: auto;
219
- display: inline-block;
220
- padding-left: 26px;
221
- }
222
- .minicolors-theme-default.minicolors-position-right .minicolors-input {
223
- padding-right: 26px;
224
- padding-left: inherit;
225
- }
226
-
227
- /* Bootstrap theme */
228
- .minicolors-theme-bootstrap .minicolors-swatch {
229
- top: 3px;
230
- left: 3px;
231
- width: 28px;
232
- height: 28px;
233
- border-radius: 3px;
234
- }
235
- .minicolors-theme-bootstrap.minicolors-position-right .minicolors-swatch {
236
- left: auto;
237
- right: 3px;
238
- }
239
- .minicolors-theme-bootstrap .minicolors-input {
240
- padding-left: 44px;
241
- }
242
- .minicolors-theme-bootstrap.minicolors-position-right .minicolors-input {
243
- padding-right: 44px;
244
- padding-left: 12px;
245
- }