simple_form_extension 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@
5
5
  #= require spinbox
6
6
  #= require jasny-bootstrap
7
7
  #= require jquery.datetimepicker
8
+ #= require bootstrap-slider
8
9
  #= require_self
9
10
  #= require_tree ./simple_form_extension
10
11
 
@@ -0,0 +1,16 @@
1
+ class Slider
2
+ constructor: (@$el) ->
3
+ if @$el.bootstrapSlider
4
+ @$el.bootstrapSlider()
5
+ else
6
+ @$el.slider()
7
+
8
+ $.fn.simpleFormSlider = ->
9
+ @each (i, el) ->
10
+ $select = $(el)
11
+ return if $select.data('simple-form:slider')
12
+ instance = new Slider($select)
13
+ $select.data('simple-form:slider', instance)
14
+
15
+ onPageReady ->
16
+ $('[data-slider]').simpleFormSlider()
@@ -0,0 +1,246 @@
1
+ /*! =========================================================
2
+ * bootstrap-slider.js
3
+ *
4
+ * Maintainers:
5
+ * Kyle Kemp
6
+ * - Twitter: @seiyria
7
+ * - Github: seiyria
8
+ * Rohit Kalkur
9
+ * - Twitter: @Rovolutionary
10
+ * - Github: rovolution
11
+ *
12
+ * =========================================================
13
+ *
14
+ * Licensed under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ * ========================================================= */
26
+ .slider {
27
+ display: inline-block;
28
+ vertical-align: middle;
29
+ position: relative;
30
+ }
31
+ .slider.slider-horizontal {
32
+ width: 210px;
33
+ height: 20px;
34
+ }
35
+ .slider.slider-horizontal .slider-track {
36
+ height: 10px;
37
+ width: 100%;
38
+ margin-top: -5px;
39
+ top: 50%;
40
+ left: 0;
41
+ }
42
+ .slider.slider-horizontal .slider-selection,
43
+ .slider.slider-horizontal .slider-track-low,
44
+ .slider.slider-horizontal .slider-track-high {
45
+ height: 100%;
46
+ top: 0;
47
+ bottom: 0;
48
+ }
49
+ .slider.slider-horizontal .slider-tick,
50
+ .slider.slider-horizontal .slider-handle {
51
+ margin-left: -10px;
52
+ margin-top: -5px;
53
+ }
54
+ .slider.slider-horizontal .slider-tick.triangle,
55
+ .slider.slider-horizontal .slider-handle.triangle {
56
+ border-width: 0 10px 10px 10px;
57
+ width: 0;
58
+ height: 0;
59
+ border-bottom-color: #0480be;
60
+ margin-top: 0;
61
+ }
62
+ .slider.slider-horizontal .slider-tick-label-container {
63
+ white-space: nowrap;
64
+ margin-top: 20px;
65
+ }
66
+ .slider.slider-horizontal .slider-tick-label-container .slider-tick-label {
67
+ padding-top: 4px;
68
+ display: inline-block;
69
+ text-align: center;
70
+ }
71
+ .slider.slider-vertical {
72
+ height: 210px;
73
+ width: 20px;
74
+ }
75
+ .slider.slider-vertical .slider-track {
76
+ width: 10px;
77
+ height: 100%;
78
+ margin-left: -5px;
79
+ left: 50%;
80
+ top: 0;
81
+ }
82
+ .slider.slider-vertical .slider-selection {
83
+ width: 100%;
84
+ left: 0;
85
+ top: 0;
86
+ bottom: 0;
87
+ }
88
+ .slider.slider-vertical .slider-track-low,
89
+ .slider.slider-vertical .slider-track-high {
90
+ width: 100%;
91
+ left: 0;
92
+ right: 0;
93
+ }
94
+ .slider.slider-vertical .slider-tick,
95
+ .slider.slider-vertical .slider-handle {
96
+ margin-left: -5px;
97
+ margin-top: -10px;
98
+ }
99
+ .slider.slider-vertical .slider-tick.triangle,
100
+ .slider.slider-vertical .slider-handle.triangle {
101
+ border-width: 10px 0 10px 10px;
102
+ width: 1px;
103
+ height: 1px;
104
+ border-left-color: #0480be;
105
+ margin-left: 0;
106
+ }
107
+ .slider.slider-disabled .slider-handle {
108
+ background-image: -webkit-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
109
+ background-image: -o-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
110
+ background-image: linear-gradient(to bottom, #dfdfdf 0%, #bebebe 100%);
111
+ background-repeat: repeat-x;
112
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdfdfdf', endColorstr='#ffbebebe', GradientType=0);
113
+ }
114
+ .slider.slider-disabled .slider-track {
115
+ background-image: -webkit-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
116
+ background-image: -o-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
117
+ background-image: linear-gradient(to bottom, #e5e5e5 0%, #e9e9e9 100%);
118
+ background-repeat: repeat-x;
119
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe5e5e5', endColorstr='#ffe9e9e9', GradientType=0);
120
+ cursor: not-allowed;
121
+ }
122
+ .slider input {
123
+ display: none;
124
+ }
125
+ .slider .tooltip.top {
126
+ margin-top: -36px;
127
+ }
128
+ .slider .tooltip-inner {
129
+ white-space: nowrap;
130
+ }
131
+ .slider .hide {
132
+ display: none;
133
+ }
134
+ .slider-track {
135
+ position: absolute;
136
+ cursor: pointer;
137
+ background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%);
138
+ background-image: -o-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%);
139
+ background-image: linear-gradient(to bottom, #f5f5f5 0%, #f9f9f9 100%);
140
+ background-repeat: repeat-x;
141
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
142
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
143
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
144
+ border-radius: 4px;
145
+ }
146
+ .slider-selection {
147
+ position: absolute;
148
+ background-image: -webkit-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
149
+ background-image: -o-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
150
+ background-image: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
151
+ background-repeat: repeat-x;
152
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
153
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
154
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
155
+ -webkit-box-sizing: border-box;
156
+ -moz-box-sizing: border-box;
157
+ box-sizing: border-box;
158
+ border-radius: 4px;
159
+ }
160
+ .slider-selection.tick-slider-selection {
161
+ background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
162
+ background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
163
+ background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
164
+ background-repeat: repeat-x;
165
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
166
+ }
167
+ .slider-track-low,
168
+ .slider-track-high {
169
+ position: absolute;
170
+ background: transparent;
171
+ -webkit-box-sizing: border-box;
172
+ -moz-box-sizing: border-box;
173
+ box-sizing: border-box;
174
+ border-radius: 4px;
175
+ }
176
+ .slider-handle {
177
+ position: absolute;
178
+ width: 20px;
179
+ height: 20px;
180
+ background-color: #337ab7;
181
+ background-image: -webkit-linear-gradient(top, #149bdf 0%, #0480be 100%);
182
+ background-image: -o-linear-gradient(top, #149bdf 0%, #0480be 100%);
183
+ background-image: linear-gradient(to bottom, #149bdf 0%, #0480be 100%);
184
+ background-repeat: repeat-x;
185
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
186
+ filter: none;
187
+ -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
188
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
189
+ border: 0px solid transparent;
190
+ }
191
+ .slider-handle.round {
192
+ border-radius: 50%;
193
+ }
194
+ .slider-handle.triangle {
195
+ background: transparent none;
196
+ }
197
+ .slider-handle.custom {
198
+ background: transparent none;
199
+ }
200
+ .slider-handle.custom::before {
201
+ line-height: 20px;
202
+ font-size: 20px;
203
+ content: '\2605';
204
+ color: #726204;
205
+ }
206
+ .slider-tick {
207
+ position: absolute;
208
+ width: 20px;
209
+ height: 20px;
210
+ background-image: -webkit-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
211
+ background-image: -o-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
212
+ background-image: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
213
+ background-repeat: repeat-x;
214
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
215
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
216
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
217
+ -webkit-box-sizing: border-box;
218
+ -moz-box-sizing: border-box;
219
+ box-sizing: border-box;
220
+ filter: none;
221
+ opacity: 0.8;
222
+ border: 0px solid transparent;
223
+ }
224
+ .slider-tick.round {
225
+ border-radius: 50%;
226
+ }
227
+ .slider-tick.triangle {
228
+ background: transparent none;
229
+ }
230
+ .slider-tick.custom {
231
+ background: transparent none;
232
+ }
233
+ .slider-tick.custom::before {
234
+ line-height: 20px;
235
+ font-size: 20px;
236
+ content: '\2605';
237
+ color: #726204;
238
+ }
239
+ .slider-tick.in-selection {
240
+ background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
241
+ background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
242
+ background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
243
+ background-repeat: repeat-x;
244
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
245
+ opacity: 1;
246
+ }
@@ -4,4 +4,4 @@
4
4
  //= require selectize.bootstrap3
5
5
  //= require jquery.datetimepicker
6
6
  //= require jasny-bootstrap
7
-
7
+ //= require bootstrap-slider
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -142,11 +142,13 @@ files:
142
142
  - lib/simple_form_extension/inputs/numeric_input.rb
143
143
  - lib/simple_form_extension/inputs/redactor_input.rb
144
144
  - lib/simple_form_extension/inputs/selectize_input.rb
145
+ - lib/simple_form_extension/inputs/slider_input.rb
145
146
  - lib/simple_form_extension/railtie.rb
146
147
  - lib/simple_form_extension/translations.rb
147
148
  - lib/simple_form_extension/version.rb
148
149
  - simple_form_extension.gemspec
149
150
  - vendor/assets/javascripts/.DS_Store
151
+ - vendor/assets/javascripts/bootstrap-slider.js
150
152
  - vendor/assets/javascripts/jasny-bootstrap.js
151
153
  - vendor/assets/javascripts/jquery.datetimepicker.js
152
154
  - vendor/assets/javascripts/simple_form_extension.coffee
@@ -155,8 +157,10 @@ files:
155
157
  - vendor/assets/javascripts/simple_form_extension/fileinput.coffee
156
158
  - vendor/assets/javascripts/simple_form_extension/redactor.coffee
157
159
  - vendor/assets/javascripts/simple_form_extension/selectize.coffee
160
+ - vendor/assets/javascripts/simple_form_extension/slider.coffee
158
161
  - vendor/assets/javascripts/simple_form_extension/spinbox.coffee
159
162
  - vendor/assets/javascripts/spinbox.js
163
+ - vendor/assets/stylesheets/bootstrap-slider.css
160
164
  - vendor/assets/stylesheets/jasny-bootstrap.css
161
165
  - vendor/assets/stylesheets/jquery.datetimepicker.css
162
166
  - vendor/assets/stylesheets/simple_form_extension.sass