activeadmin_json_editor 0.0.5 → 0.0.6
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 +4 -4
- data/Gemfile.lock +20 -16
- data/README.md +6 -3
- data/activeadmin_json_editor.gemspec +2 -1
- data/app/assets/javascripts/active_admin/json_editor.js +13 -1
- data/app/assets/stylesheets/active_admin/json_editor.css +18 -0
- data/app/inputs/jsonb_input.rb +3 -0
- data/lib/activeadmin/json_editor/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbef1ee8e097aad025b4a7febfc5f6e9fc4dcbf9
|
|
4
|
+
data.tar.gz: 4c8d99161fbd5dbddb8fd98619f9117e314b2b2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52b5e34e12f30c0f5f24b380704f90a0db9bdf90085df6ecef6a78703382c61242b49d7a02b7aa18a96a40062aaab9b80c856339e1148ced5f5254ab471e1671
|
|
7
|
+
data.tar.gz: 311f2eadac714faff1f6b144fa400c0d777bc616297273e4b0941a10f6b452a3da481bb1a1f7d5d84761beef9e6c2996670d30b354db00115eb8a74fc86a1f06
|
data/Gemfile.lock
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
activeadmin_json_editor (0.0.
|
|
4
|
+
activeadmin_json_editor (0.0.6)
|
|
5
|
+
ace-rails-ap
|
|
5
6
|
railties (>= 3.0, < 5.0)
|
|
6
7
|
|
|
7
8
|
GEM
|
|
8
9
|
remote: https://rubygems.org/
|
|
9
10
|
specs:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
ace-rails-ap (4.1.0)
|
|
12
|
+
actionpack (4.2.7)
|
|
13
|
+
actionview (= 4.2.7)
|
|
14
|
+
activesupport (= 4.2.7)
|
|
13
15
|
rack (~> 1.6)
|
|
14
16
|
rack-test (~> 0.6.2)
|
|
15
17
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
16
18
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
17
|
-
actionview (4.2.
|
|
18
|
-
activesupport (= 4.2.
|
|
19
|
+
actionview (4.2.7)
|
|
20
|
+
activesupport (= 4.2.7)
|
|
19
21
|
builder (~> 3.1)
|
|
20
22
|
erubis (~> 2.7.0)
|
|
21
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
22
24
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
23
|
-
activesupport (4.2.
|
|
25
|
+
activesupport (4.2.7)
|
|
24
26
|
i18n (~> 0.7)
|
|
25
27
|
json (~> 1.7, >= 1.7.7)
|
|
26
28
|
minitest (~> 5.1)
|
|
@@ -32,10 +34,12 @@ GEM
|
|
|
32
34
|
json (1.8.3)
|
|
33
35
|
loofah (2.0.3)
|
|
34
36
|
nokogiri (>= 1.5.9)
|
|
35
|
-
mini_portile2 (2.
|
|
36
|
-
minitest (5.
|
|
37
|
-
nokogiri (1.6.
|
|
38
|
-
mini_portile2 (~> 2.
|
|
37
|
+
mini_portile2 (2.1.0)
|
|
38
|
+
minitest (5.9.0)
|
|
39
|
+
nokogiri (1.6.8)
|
|
40
|
+
mini_portile2 (~> 2.1.0)
|
|
41
|
+
pkg-config (~> 1.1.7)
|
|
42
|
+
pkg-config (1.1.7)
|
|
39
43
|
rack (1.6.4)
|
|
40
44
|
rack-test (0.6.3)
|
|
41
45
|
rack (>= 1.0)
|
|
@@ -47,12 +51,12 @@ GEM
|
|
|
47
51
|
rails-deprecated_sanitizer (>= 1.0.1)
|
|
48
52
|
rails-html-sanitizer (1.0.3)
|
|
49
53
|
loofah (~> 2.0)
|
|
50
|
-
railties (4.2.
|
|
51
|
-
actionpack (= 4.2.
|
|
52
|
-
activesupport (= 4.2.
|
|
54
|
+
railties (4.2.7)
|
|
55
|
+
actionpack (= 4.2.7)
|
|
56
|
+
activesupport (= 4.2.7)
|
|
53
57
|
rake (>= 0.8.7)
|
|
54
58
|
thor (>= 0.18.1, < 2.0)
|
|
55
|
-
rake (
|
|
59
|
+
rake (11.2.2)
|
|
56
60
|
thor (0.19.1)
|
|
57
61
|
thread_safe (0.3.5)
|
|
58
62
|
tzinfo (1.2.2)
|
|
@@ -66,4 +70,4 @@ DEPENDENCIES
|
|
|
66
70
|
bundler (~> 1.5)
|
|
67
71
|
|
|
68
72
|
BUNDLED WITH
|
|
69
|
-
1.
|
|
73
|
+
1.12.5
|
data/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# ActiveAdmin::JsonEditor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/activeadmin_json_editor)
|
|
4
|
+
|
|
5
|
+
"json_input" and "jsonb_input" field type to active_admin that allow to edit Postgresql json and jsonb values as json tree.
|
|
4
6
|
Data shown by using jsoneditor.js from http://jsoneditoronline.org
|
|
5
7
|
|
|
6
8
|
## Installation
|
|
7
9
|
|
|
8
10
|
Add this line to your application's Gemfile:
|
|
9
11
|
|
|
10
|
-
gem 'activeadmin_json_editor',
|
|
12
|
+
gem 'activeadmin_json_editor', '~> 0.0.6'
|
|
11
13
|
|
|
12
14
|
And then execute:
|
|
13
15
|
|
|
@@ -36,6 +38,7 @@ ActiveAdmin.register User do
|
|
|
36
38
|
form do |f|
|
|
37
39
|
f.inputs do
|
|
38
40
|
f.input :settings, as: :json
|
|
41
|
+
f.input :other_settings, as: :jsonb
|
|
39
42
|
end
|
|
40
43
|
|
|
41
44
|
f.actions
|
|
@@ -45,7 +48,7 @@ end
|
|
|
45
48
|
|
|
46
49
|
## Contributing
|
|
47
50
|
|
|
48
|
-
1. Fork it ( http://github.com/
|
|
51
|
+
1. Fork it ( http://github.com/udacity/activeadmin_json_editor/fork )
|
|
49
52
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
50
53
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
51
54
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
|
6
6
|
spec.version = ActiveAdmin::JsonEditor::VERSION
|
|
7
7
|
spec.authors = ['allanbreyes']
|
|
8
8
|
spec.email = ['allan@udacity.com']
|
|
9
|
-
spec.summary = 'add "json_input" field type to active_admin that allow to edit Postgresql json values'
|
|
9
|
+
spec.summary = 'add "json_input" and "jsonb_input" field type to active_admin that allow to edit Postgresql json and jsonb values'
|
|
10
10
|
spec.description = '"json_input" field allow to edit json value as json array with using jsoneditor.js from http://jsoneditoronline.org'
|
|
11
11
|
spec.homepage = 'https://github.com/wild-r/activeadmin_json_editor'
|
|
12
12
|
spec.license = 'MIT'
|
|
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.add_dependency 'railties', '>= 3.0', '< 5.0'
|
|
22
22
|
# spec.add_development_dependency "rake", "~> 0"
|
|
23
23
|
# spec.add_dependency "active_admin", "~> 1.0.0"
|
|
24
|
+
spec.add_dependency 'ace-rails-ap'
|
|
24
25
|
end
|
|
@@ -4,13 +4,25 @@
|
|
|
4
4
|
;(function(window, $) {
|
|
5
5
|
$(function() {
|
|
6
6
|
$('div.jsoneditor-wrap').each(function(i,wrap){
|
|
7
|
+
var fieldset = $(wrap).parents('li:eq(0)');
|
|
7
8
|
var container = $(wrap)[0];
|
|
8
9
|
var textarea = $($(wrap).find('textarea'));
|
|
9
10
|
var editor;
|
|
10
11
|
var options = {
|
|
12
|
+
modes: ['tree', 'text'],
|
|
11
13
|
mode: 'tree',
|
|
12
14
|
change: function(ev){
|
|
13
|
-
|
|
15
|
+
try {
|
|
16
|
+
var text = JSON.stringify(editor.get());
|
|
17
|
+
textarea.text(text);
|
|
18
|
+
$(fieldset).toggleClass('error',false);
|
|
19
|
+
textarea.text(JSON.stringify(editor.get()));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
editor.options.error(e);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
error: function(e){
|
|
25
|
+
$(fieldset).toggleClass('error',true);
|
|
14
26
|
}
|
|
15
27
|
};
|
|
16
28
|
editor = new JSONEditor(container, options,JSON.parse(textarea.val()));
|
|
@@ -44,3 +44,21 @@
|
|
|
44
44
|
.jsoneditor .search .frame {
|
|
45
45
|
border-color: rgb(201, 208, 214);
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* Use text mode
|
|
51
|
+
*/
|
|
52
|
+
.jsoneditor-wrap textarea.text {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
.jsoneditor .menu button.separator {
|
|
56
|
+
color: black;
|
|
57
|
+
text-shadow: none;
|
|
58
|
+
}
|
|
59
|
+
.jsoneditor-contextmenu ul li button {
|
|
60
|
+
text-shadow: none;
|
|
61
|
+
}
|
|
62
|
+
form fieldset > ol > li.error .jsoneditor {
|
|
63
|
+
border: 1px solid #932419;
|
|
64
|
+
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin_json_editor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- allanbreyes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -44,6 +44,20 @@ dependencies:
|
|
|
44
44
|
- - "<"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: '5.0'
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: ace-rails-ap
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :runtime
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
47
61
|
description: '"json_input" field allow to edit json value as json array with using
|
|
48
62
|
jsoneditor.js from http://jsoneditoronline.org'
|
|
49
63
|
email:
|
|
@@ -61,6 +75,7 @@ files:
|
|
|
61
75
|
- app/assets/javascripts/active_admin/json_editor.js
|
|
62
76
|
- app/assets/stylesheets/active_admin/json_editor.css
|
|
63
77
|
- app/inputs/json_input.rb
|
|
78
|
+
- app/inputs/jsonb_input.rb
|
|
64
79
|
- lib/activeadmin/json_editor.rb
|
|
65
80
|
- lib/activeadmin/json_editor/version.rb
|
|
66
81
|
- lib/activeadmin/resource_dsl.rb
|
|
@@ -104,6 +119,6 @@ rubyforge_project:
|
|
|
104
119
|
rubygems_version: 2.4.5.1
|
|
105
120
|
signing_key:
|
|
106
121
|
specification_version: 4
|
|
107
|
-
summary: add "json_input" field type to active_admin that allow
|
|
108
|
-
json values
|
|
122
|
+
summary: add "json_input" and "jsonb_input" field type to active_admin that allow
|
|
123
|
+
to edit Postgresql json and jsonb values
|
|
109
124
|
test_files: []
|