x-editable-rails 1.5.1 → 1.5.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- jQuery ($) ->
1
+ unless EditableForm
2
2
  EditableForm = $.fn.editableform.Constructor
3
3
  EditableForm.prototype.saveWithUrlHook = (value) ->
4
4
  originalUrl = @options.url
@@ -6,50 +6,46 @@ jQuery ($) ->
6
6
  nestedName = @options.nested
7
7
  nestedId = @options.nid
8
8
  nestedLocale = @options.locale
9
-
9
+
10
10
  @options.url = (params) =>
11
11
  if typeof originalUrl == 'function'
12
12
  originalUrl.call(@options.scope, params)
13
13
  else if originalUrl? && @options.send != 'never'
14
14
  myName = params.name
15
-
16
- if typeof params.value == 'string'
17
- myValue = params.value.replace(/(\r\n|\n|\r)/gm,"<br/>")
18
- else
19
- myValue = params.value
20
-
15
+ myValue = params.value
16
+
21
17
  # if there are no values in a list, add a blank value so Rails knows all values were removed
22
18
  if Object.prototype.toString.call(params.value) == '[object Array]' && params.value.length == 0
23
19
  params.value.push("")
24
-
20
+
25
21
  obj = {}
26
-
22
+
27
23
  if nestedName
28
24
  nested = {}
29
25
  nested[myName] = myValue
30
26
  nested['id'] = nestedId
31
-
27
+
32
28
  if nestedLocale
33
29
  nested['locale'] = nestedLocale
34
-
30
+
35
31
  obj[nestedName + '_attributes'] = nested
36
32
  else
37
33
  obj[myName] = myValue
38
-
34
+
39
35
  params[model] = obj
40
-
36
+
41
37
  delete params.name
42
38
  delete params.value
43
39
  delete params.pk
44
-
40
+
45
41
  $.ajax($.extend({
46
42
  url: originalUrl
47
43
  data: params
48
44
  type: 'PUT'
49
45
  dataType: 'json'
50
46
  }, @options.ajaxOptions))
51
-
47
+
52
48
  @saveWithoutUrlHook(value)
53
-
49
+
54
50
  EditableForm.prototype.saveWithoutUrlHook = EditableForm.prototype.save
55
- EditableForm.prototype.save = EditableForm.prototype.saveWithUrlHook
51
+ EditableForm.prototype.save = EditableForm.prototype.saveWithUrlHook
@@ -0,0 +1,4 @@
1
+ $.fn.editable.defaults.error = (response, newValue) ->
2
+ field_name = $(this).data("name")
3
+ error_msgs = response.responseJSON.errors[field_name]
4
+ error_msgs.join "; "
@@ -1,2 +1,3 @@
1
1
  #= require ./rails/editable_form
2
- #= require ./rails/data_classes
2
+ #= require ./rails/data_classes
3
+ #= require ./rails/error_handling
@@ -306,12 +306,12 @@ a.editable-click.editable-disabled:hover {
306
306
  .datepicker table tr td.today.disabled,
307
307
  .datepicker table tr td.today.disabled:hover {
308
308
  background-color: #fde19a;
309
- background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
310
- background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
309
+ background-image: -moz-linear-gradient(to bottom, #fdd49a, #fdf59a);
310
+ background-image: -ms-linear-gradient(to bottom, #fdd49a, #fdf59a);
311
311
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
312
- background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
313
- background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
314
- background-image: linear-gradient(top, #fdd49a, #fdf59a);
312
+ background-image: -webkit-linear-gradient(to bottom, #fdd49a, #fdf59a);
313
+ background-image: -o-linear-gradient(to bottom, #fdd49a, #fdf59a);
314
+ background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
315
315
  background-repeat: repeat-x;
316
316
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
317
317
  border-color: #fdf59a #fdf59a #fbed50;
@@ -371,12 +371,12 @@ a.editable-click.editable-disabled:hover {
371
371
  .datepicker table tr td.range.today.disabled,
372
372
  .datepicker table tr td.range.today.disabled:hover {
373
373
  background-color: #f3d17a;
374
- background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a);
375
- background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a);
374
+ background-image: -moz-linear-gradient(to bottom, #f3c17a, #f3e97a);
375
+ background-image: -ms-linear-gradient(to bottom, #f3c17a, #f3e97a);
376
376
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
377
- background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a);
378
- background-image: -o-linear-gradient(top, #f3c17a, #f3e97a);
379
- background-image: linear-gradient(top, #f3c17a, #f3e97a);
377
+ background-image: -webkit-linear-gradient(to bottom, #f3c17a, #f3e97a);
378
+ background-image: -o-linear-gradient(to bottom, #f3c17a, #f3e97a);
379
+ background-image: linear-gradient(to bottom, #f3c17a, #f3e97a);
380
380
  background-repeat: repeat-x;
381
381
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
382
382
  border-color: #f3e97a #f3e97a #edde34;
@@ -423,12 +423,12 @@ a.editable-click.editable-disabled:hover {
423
423
  .datepicker table tr td.selected.disabled,
424
424
  .datepicker table tr td.selected.disabled:hover {
425
425
  background-color: #9e9e9e;
426
- background-image: -moz-linear-gradient(top, #b3b3b3, #808080);
427
- background-image: -ms-linear-gradient(top, #b3b3b3, #808080);
426
+ background-image: -moz-linear-gradient(to bottom, #b3b3b3, #808080);
427
+ background-image: -ms-linear-gradient(to bottom, #b3b3b3, #808080);
428
428
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
429
- background-image: -webkit-linear-gradient(top, #b3b3b3, #808080);
430
- background-image: -o-linear-gradient(top, #b3b3b3, #808080);
431
- background-image: linear-gradient(top, #b3b3b3, #808080);
429
+ background-image: -webkit-linear-gradient(to bottom, #b3b3b3, #808080);
430
+ background-image: -o-linear-gradient(to bottom, #b3b3b3, #808080);
431
+ background-image: linear-gradient(to bottom, #b3b3b3, #808080);
432
432
  background-repeat: repeat-x;
433
433
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
434
434
  border-color: #808080 #808080 #595959;
@@ -474,12 +474,12 @@ a.editable-click.editable-disabled:hover {
474
474
  .datepicker table tr td.active.disabled,
475
475
  .datepicker table tr td.active.disabled:hover {
476
476
  background-color: #006dcc;
477
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
478
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
477
+ background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
478
+ background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
479
479
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
480
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
481
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
482
- background-image: linear-gradient(top, #0088cc, #0044cc);
480
+ background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
481
+ background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
482
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
483
483
  background-repeat: repeat-x;
484
484
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
485
485
  border-color: #0044cc #0044cc #002a80;
@@ -546,12 +546,12 @@ a.editable-click.editable-disabled:hover {
546
546
  .datepicker table tr td span.active.disabled,
547
547
  .datepicker table tr td span.active.disabled:hover {
548
548
  background-color: #006dcc;
549
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
550
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
549
+ background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
550
+ background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
551
551
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
552
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
553
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
554
- background-image: linear-gradient(top, #0088cc, #0044cc);
552
+ background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
553
+ background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
554
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
555
555
  background-repeat: repeat-x;
556
556
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
557
557
  border-color: #0044cc #0044cc #002a80;
@@ -306,12 +306,12 @@ a.editable-click.editable-disabled:hover {
306
306
  .datepicker table tr td.today.disabled,
307
307
  .datepicker table tr td.today.disabled:hover {
308
308
  background-color: #fde19a;
309
- background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
310
- background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
309
+ background-image: -moz-linear-gradient(to bottom, #fdd49a, #fdf59a);
310
+ background-image: -ms-linear-gradient(to bottom, #fdd49a, #fdf59a);
311
311
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
312
- background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
313
- background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
314
- background-image: linear-gradient(top, #fdd49a, #fdf59a);
312
+ background-image: -webkit-linear-gradient(to bottom, #fdd49a, #fdf59a);
313
+ background-image: -o-linear-gradient(to bottom, #fdd49a, #fdf59a);
314
+ background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
315
315
  background-repeat: repeat-x;
316
316
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
317
317
  border-color: #fdf59a #fdf59a #fbed50;
@@ -371,12 +371,12 @@ a.editable-click.editable-disabled:hover {
371
371
  .datepicker table tr td.range.today.disabled,
372
372
  .datepicker table tr td.range.today.disabled:hover {
373
373
  background-color: #f3d17a;
374
- background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a);
375
- background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a);
374
+ background-image: -moz-linear-gradient(to bottom, #f3c17a, #f3e97a);
375
+ background-image: -ms-linear-gradient(to bottom, #f3c17a, #f3e97a);
376
376
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
377
- background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a);
378
- background-image: -o-linear-gradient(top, #f3c17a, #f3e97a);
379
- background-image: linear-gradient(top, #f3c17a, #f3e97a);
377
+ background-image: -webkit-linear-gradient(to bottom, #f3c17a, #f3e97a);
378
+ background-image: -o-linear-gradient(to bottom, #f3c17a, #f3e97a);
379
+ background-image: linear-gradient(to bottom, #f3c17a, #f3e97a);
380
380
  background-repeat: repeat-x;
381
381
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
382
382
  border-color: #f3e97a #f3e97a #edde34;
@@ -423,12 +423,12 @@ a.editable-click.editable-disabled:hover {
423
423
  .datepicker table tr td.selected.disabled,
424
424
  .datepicker table tr td.selected.disabled:hover {
425
425
  background-color: #9e9e9e;
426
- background-image: -moz-linear-gradient(top, #b3b3b3, #808080);
427
- background-image: -ms-linear-gradient(top, #b3b3b3, #808080);
426
+ background-image: -moz-linear-gradient(to bottom, #b3b3b3, #808080);
427
+ background-image: -ms-linear-gradient(to bottom, #b3b3b3, #808080);
428
428
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
429
- background-image: -webkit-linear-gradient(top, #b3b3b3, #808080);
430
- background-image: -o-linear-gradient(top, #b3b3b3, #808080);
431
- background-image: linear-gradient(top, #b3b3b3, #808080);
429
+ background-image: -webkit-linear-gradient(to bottom, #b3b3b3, #808080);
430
+ background-image: -o-linear-gradient(to bottom, #b3b3b3, #808080);
431
+ background-image: linear-gradient(to bottom, #b3b3b3, #808080);
432
432
  background-repeat: repeat-x;
433
433
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
434
434
  border-color: #808080 #808080 #595959;
@@ -474,12 +474,12 @@ a.editable-click.editable-disabled:hover {
474
474
  .datepicker table tr td.active.disabled,
475
475
  .datepicker table tr td.active.disabled:hover {
476
476
  background-color: #006dcc;
477
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
478
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
477
+ background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
478
+ background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
479
479
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
480
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
481
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
482
- background-image: linear-gradient(top, #0088cc, #0044cc);
480
+ background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
481
+ background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
482
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
483
483
  background-repeat: repeat-x;
484
484
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
485
485
  border-color: #0044cc #0044cc #002a80;
@@ -546,12 +546,12 @@ a.editable-click.editable-disabled:hover {
546
546
  .datepicker table tr td span.active.disabled,
547
547
  .datepicker table tr td span.active.disabled:hover {
548
548
  background-color: #006dcc;
549
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
550
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
549
+ background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
550
+ background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
551
551
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
552
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
553
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
554
- background-image: linear-gradient(top, #0088cc, #0044cc);
552
+ background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
553
+ background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
554
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
555
555
  background-repeat: repeat-x;
556
556
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
557
557
  border-color: #0044cc #0044cc #002a80;
metadata CHANGED
@@ -1,84 +1,72 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x-editable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.5.1
5
5
  platform: ruby
6
6
  authors:
7
- - Jiri Kolarik
7
+ - We're in
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-15 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: cancan
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
26
  version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ~>
31
+ - - "~>"
46
32
  - !ruby/object:Gem::Version
47
33
  version: '4.0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - ~>
38
+ - - "~>"
53
39
  - !ruby/object:Gem::Version
54
40
  version: '4.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: sqlite3
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - '>='
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
47
  version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - '>='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  description: X-editable for Rails
70
56
  email:
71
- - jiri.kolarik@imin.cz
57
+ - info@wereinhq.com
72
58
  executables: []
73
59
  extensions: []
74
60
  extra_rdoc_files: []
75
61
  files:
62
+ - LICENSE.txt
63
+ - README.md
76
64
  - lib/generators/x_editable_rails/install_generator.rb
77
65
  - lib/generators/x_editable_rails/templates/x-editable.yml
66
+ - lib/x-editable-rails.rb
78
67
  - lib/x-editable-rails/configuration.rb
79
68
  - lib/x-editable-rails/version.rb
80
69
  - lib/x-editable-rails/view_helpers.rb
81
- - lib/x-editable-rails.rb
82
70
  - vendor/assets/images/editable/clear.png
83
71
  - vendor/assets/images/editable/loading.gif
84
72
  - vendor/assets/javascripts/editable/bootstrap-editable.js
@@ -91,19 +79,18 @@ files:
91
79
  - vendor/assets/javascripts/editable/inputs-ext/wysihtml5.js
92
80
  - vendor/assets/javascripts/editable/jquery-editable-poshytip.js
93
81
  - vendor/assets/javascripts/editable/jqueryui-editable.js
82
+ - vendor/assets/javascripts/editable/rails.js.coffee
94
83
  - vendor/assets/javascripts/editable/rails/data_classes.js.coffee
95
84
  - vendor/assets/javascripts/editable/rails/editable_form.js.coffee
96
- - vendor/assets/javascripts/editable/rails.js.coffee
85
+ - vendor/assets/javascripts/editable/rails/error_handling.js.coffee
97
86
  - vendor/assets/stylesheets/editable/bootstrap-editable.scss
98
87
  - vendor/assets/stylesheets/editable/bootstrap2-editable.scss
99
88
  - vendor/assets/stylesheets/editable/inputs-ext/address.css
100
- - vendor/assets/stylesheets/editable/inputs-ext/bootstrap-typehead.css
89
+ - vendor/assets/stylesheets/editable/inputs-ext/bootstrap-typeahead.css
101
90
  - vendor/assets/stylesheets/editable/inputs-ext/bootstrap-wysihtml5.css
102
91
  - vendor/assets/stylesheets/editable/inputs-ext/wysiwyg-color.css
103
92
  - vendor/assets/stylesheets/editable/jquery-editable.scss
104
93
  - vendor/assets/stylesheets/editable/jqueryui-editable.scss
105
- - LICENSE.txt
106
- - README.md
107
94
  homepage: https://github.com/werein/x-editable-rails
108
95
  licenses:
109
96
  - MIT
@@ -115,17 +102,17 @@ require_paths:
115
102
  - vendor
116
103
  required_ruby_version: !ruby/object:Gem::Requirement
117
104
  requirements:
118
- - - '>='
105
+ - - ">="
119
106
  - !ruby/object:Gem::Version
120
107
  version: '0'
121
108
  required_rubygems_version: !ruby/object:Gem::Requirement
122
109
  requirements:
123
- - - '>='
110
+ - - ">="
124
111
  - !ruby/object:Gem::Version
125
112
  version: '0'
126
113
  requirements: []
127
114
  rubyforge_project:
128
- rubygems_version: 2.0.3
115
+ rubygems_version: 2.5.1
129
116
  signing_key:
130
117
  specification_version: 4
131
118
  summary: X-editable for Rails