best_in_place 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/assets/javascripts/best_in_place.js +1 -2
- data/lib/best_in_place/test_helpers.rb +11 -11
- data/lib/best_in_place/version.rb +1 -1
- metadata +11 -11
@@ -177,8 +177,7 @@ BestInPlaceEditor.prototype = {
|
|
177
177
|
{
|
178
178
|
var tmp = document.createElement("DIV");
|
179
179
|
tmp.innerHTML = s;
|
180
|
-
s = tmp.textContent || tmp.innerText;
|
181
|
-
s = s.replace(/"/g, '"');
|
180
|
+
s = jQuery.trim(tmp.textContent || tmp.innerText).replace(/"/g, '"');
|
182
181
|
}
|
183
182
|
return jQuery.trim(s);
|
184
183
|
},
|
@@ -4,34 +4,34 @@ module BestInPlace
|
|
4
4
|
def bip_area(model, attr, new_value)
|
5
5
|
id = BestInPlace::Utils.build_best_in_place_id model, attr
|
6
6
|
page.execute_script <<-JS
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
jQuery("##{id}").click();
|
8
|
+
jQuery("##{id} form textarea").val('#{new_value}');
|
9
|
+
jQuery("##{id} form textarea").blur();
|
10
10
|
JS
|
11
11
|
end
|
12
12
|
|
13
13
|
def bip_text(model, attr, new_value)
|
14
14
|
id = BestInPlace::Utils.build_best_in_place_id model, attr
|
15
15
|
page.execute_script <<-JS
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
jQuery("##{id}").click();
|
17
|
+
jQuery("##{id} input[name='#{attr}']").val('#{new_value}');
|
18
|
+
jQuery("##{id} form").submit();
|
19
19
|
JS
|
20
20
|
end
|
21
21
|
|
22
22
|
def bip_bool(model, attr)
|
23
23
|
id = BestInPlace::Utils.build_best_in_place_id model, attr
|
24
|
-
page.execute_script("
|
24
|
+
page.execute_script("jQuery('##{id}').click();")
|
25
25
|
end
|
26
26
|
|
27
27
|
def bip_select(model, attr, name)
|
28
28
|
id = BestInPlace::Utils.build_best_in_place_id model, attr
|
29
29
|
page.execute_script <<-JS
|
30
30
|
(function() {
|
31
|
-
|
32
|
-
var opt_value =
|
33
|
-
|
34
|
-
|
31
|
+
jQuery("##{id}").click();
|
32
|
+
var opt_value = jQuery("##{id} select option:contains('#{name}')").attr('value');
|
33
|
+
jQuery("##{id} select option[value='" + opt_value + "']").attr('selected', true);
|
34
|
+
jQuery("##{id} select").change();
|
35
35
|
})();
|
36
36
|
JS
|
37
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: best_in_place
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &77694080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *77694080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &77693870 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *77693870
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &77693600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.8.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *77693600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: nokogiri
|
49
|
-
requirement: &
|
49
|
+
requirement: &77693350 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.5.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *77693350
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: capybara
|
60
|
-
requirement: &
|
60
|
+
requirement: &77693120 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.0.1
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *77693120
|
69
69
|
description: BestInPlace is a jQuery script and a Rails 3 helper that provide the
|
70
70
|
method best_in_place to display any object field easily editable for the user by
|
71
71
|
just clicking on it. It supports input data, text data, boolean data and custom
|