rest_in_place_bootstrap_slider 0.0.1 → 0.0.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b9fbd90a188f7253d7b94ab22001b71d8def31c
|
4
|
+
data.tar.gz: 0f7c3d7781e074f937e4127b029b990970527699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e1ab561fdc929982b31cc761fc8579e87f8725df487ea32ad6eb60cafbd7be22f8525ea76b4c0a82d3a57d196257f422ba4df6cabd873e184c58d1cd51f72a4
|
7
|
+
data.tar.gz: 90facb30cfb496f1c03cca3117d3bebfc2c1fcf0382569fa3755f599c09f1785b1a07a2ac859aa67f5691c84f61aaf852dc862677447836465206d482d4c2ae5
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# rest_in_place_bootstrap_slider
|
2
2
|
|
3
3
|
An AJAX Inplace-Editor + Bootstrap-Slider for the Rails 3.1+ asset pipeline.
|
4
4
|
|
@@ -17,18 +17,9 @@ For the styling of the slider you'll need to setup a proper twitter bootstrap en
|
|
17
17
|
|
18
18
|
Add this lines to your application's Gemfile:
|
19
19
|
|
20
|
-
gem 'rest_in_place_bootstrap_slider'
|
21
|
-
|
20
|
+
gem 'rest_in_place_bootstrap_slider'
|
22
21
|
gem 'bootstrap-sass' # or any other bootstrap gem
|
23
22
|
|
24
|
-
And then execute:
|
25
|
-
|
26
|
-
$ bundle
|
27
|
-
|
28
|
-
Or install it yourself as:
|
29
|
-
|
30
|
-
$ gem install rest_in_place_bootstrap_slider
|
31
|
-
|
32
23
|
Example `application.js.coffee`:
|
33
24
|
|
34
25
|
//= require bootstrap
|
@@ -43,7 +34,27 @@ Example `application.css.scss`:
|
|
43
34
|
|
44
35
|
## Usage
|
45
36
|
|
46
|
-
|
37
|
+
The following example snippet provides an inline editor for a `User#age` attribute and a slider control. The User model must be exposed via RESTful JSON API (just like the one generated by `rails g scaffold Users`).
|
38
|
+
|
39
|
+
<p class="rest-in-place-slider">
|
40
|
+
<strong>Age:</strong>
|
41
|
+
<span class="rest-in-place"
|
42
|
+
data-url="<%= url_for(@user) %>"
|
43
|
+
data-object="user"
|
44
|
+
data-attribute="age">
|
45
|
+
<%= @user.age %>
|
46
|
+
</span>
|
47
|
+
<input class="slider"
|
48
|
+
data-slider-id="user-<%= @user.id %>-age"
|
49
|
+
type="text" data-slider-min="0"
|
50
|
+
data-slider-max="199"
|
51
|
+
data-slider-step="1"
|
52
|
+
data-slider-value="<%= @user.age %>" />
|
53
|
+
</p>
|
54
|
+
|
55
|
+
The [TestApp](TestApp) contains a full rails app with a working [HTML example](TestApp/app/views/users/show.html.erb).
|
56
|
+
|
57
|
+
See [rest_in_place](http://github.com/janv/rest_in_place/) and [bootstrap-slider-rails](https://github.com/utahstreetlabs/bootstrap-slider-rails) for more detailed instructions about their APIs.
|
47
58
|
|
48
59
|
## Contributing
|
49
60
|
|
data/lib/assets/javascripts/rest_in_place_bootstrap_slider/rest_in_place_bootstrap_slider.js.coffee
CHANGED
@@ -25,7 +25,7 @@ class RestInPlaceSlider
|
|
25
25
|
bindSliderInput : () ->
|
26
26
|
@$sliderInput
|
27
27
|
.slider()
|
28
|
-
.on('
|
28
|
+
.on('slideStop', @sliderInputUpdatedHandler)
|
29
29
|
|
30
30
|
bindTextInput : () ->
|
31
31
|
@$textInput.bind('success.rest-in-place', @textInputUpdatedHandler)
|