best_in_place 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,12 +42,12 @@ BestInPlaceEditor.prototype = {
42
42
  to_display = this.element.html();
43
43
  }
44
44
 
45
- var elem = this.isNil ? "" : this.element.html();
45
+ var elem = this.isNil ? "-" : this.element.html();
46
46
  this.oldValue = elem;
47
47
  this.display_value = to_display;
48
48
  jQuery(this.activator).unbind("click", this.clickHandler);
49
- this.element.trigger(jQuery.Event("best_in_place:activate"));
50
49
  this.activateForm();
50
+ this.element.trigger(jQuery.Event("best_in_place:activate"));
51
51
  },
52
52
 
53
53
  abort : function() {
@@ -178,8 +178,9 @@ BestInPlaceEditor.prototype = {
178
178
  var tmp = document.createElement("DIV");
179
179
  tmp.innerHTML = s;
180
180
  s = tmp.textContent || tmp.innerText;
181
+ s = s.replace(/"/g, '"');
181
182
  }
182
- return jQuery.trim(s).replace(/"/g, '"');
183
+ return jQuery.trim(s);
183
184
  },
184
185
 
185
186
  /* Generate the data sent in the POST request */
@@ -1,3 +1,3 @@
1
1
  module BestInPlace
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -41,6 +41,18 @@ describe "JS behaviour", :js => true do
41
41
  end
42
42
  end
43
43
 
44
+ it "should render the default '-' string when there is an error and if the intial string is '-'" do
45
+ @user.money = nil
46
+ @user.save!
47
+ visit user_path(@user)
48
+
49
+ bip_text @user, :money, "abcd"
50
+
51
+ within("#money") do
52
+ page.should have_content("-")
53
+ end
54
+ end
55
+
44
56
  it "should render the passed nil value if the field is empty" do
45
57
  @user.last_name = ""
46
58
  @user.save :validate => false
@@ -585,4 +597,17 @@ describe "JS behaviour", :js => true do
585
597
  text.should == "A last name \"with double quotes\""
586
598
  end
587
599
  end
600
+
601
+ it "should allow me to set texts with quotes with sanitize => false" do
602
+ @user.save!
603
+
604
+ retry_on_timeout do
605
+ visit double_init_user_path(@user)
606
+
607
+ bip_area @user, :description, "A <a href=\"http://google.es\">link in this text</a> not sanitized."
608
+ visit double_init_user_path(@user)
609
+
610
+ page.should have_link("link in this text", :href => "http://google.es")
611
+ end
612
+ end
588
613
  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.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &77792460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- version: '3.1'
24
+ version_requirements: *77792460
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: jquery-rails
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &77792250 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *77792250
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rspec-rails
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &77791980 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ~>
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: 2.8.0
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 2.8.0
46
+ version_requirements: *77791980
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: nokogiri
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &77791730 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: 1.5.0
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: 1.5.0
57
+ version_requirements: *77791730
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: capybara
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &77791500 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,12 +65,7 @@ dependencies:
85
65
  version: 1.0.1
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: 1.0.1
68
+ version_requirements: *77791500
94
69
  description: BestInPlace is a jQuery script and a Rails 3 helper that provide the
95
70
  method best_in_place to display any object field easily editable for the user by
96
71
  just clicking on it. It supports input data, text data, boolean data and custom
@@ -224,30 +199,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
199
  - - ! '>='
225
200
  - !ruby/object:Gem::Version
226
201
  version: '0'
227
- segments:
228
- - 0
229
- hash: -3850247748831605605
230
202
  required_rubygems_version: !ruby/object:Gem::Requirement
231
203
  none: false
232
204
  requirements:
233
205
  - - ! '>='
234
206
  - !ruby/object:Gem::Version
235
207
  version: '0'
236
- segments:
237
- - 0
238
- hash: -3850247748831605605
239
208
  requirements: []
240
209
  rubyforge_project: best_in_place
241
- rubygems_version: 1.8.19
210
+ rubygems_version: 1.8.15
242
211
  signing_key:
243
212
  specification_version: 3
244
213
  summary: It makes any field in place editable by clicking on it, it works for inputs,
245
214
  textareas, select dropdowns and checkboxes
246
- test_files:
247
- - spec/helpers/best_in_place_spec.rb
248
- - spec/integration/double_init_spec.rb
249
- - spec/integration/js_spec.rb
250
- - spec/integration/live_spec.rb
251
- - spec/integration/text_area_spec.rb
252
- - spec/spec_helper.rb
253
- - spec/support/retry_on_timeout.rb
215
+ test_files: []