administrate-field-jsonb 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/administrate-field-jsonb.gemspec +1 -1
- data/app/assets/javascripts/administrate-field-jsonb/components/accordion.js +11 -5
- data/app/assets/javascripts/administrate-field-jsonb/components/editor.js +32 -26
- data/app/assets/javascripts/administrate-field-jsonb/components/viewer.js +21 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9550424cd11a77f0d5fe6ffc59b3ac8b294834949b8cbf2fea2eea476c775864
|
4
|
+
data.tar.gz: 34caa8f731541eb501587bbe78b1a7bf83fcc54e150c22f8acdb21055d3b21b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e965f5825e01a763da79bd477beb339312b2ef63919662c857b464066fce9cd5aaf7148906a4bfa37b1cff23eaffc9c65dc41c389dfc88e00bf082da7cd2f71
|
7
|
+
data.tar.gz: 0e8ca6fa4a20ac3d594959f25e5f9f2089a095494826f7f08cb6b1a5a1066d23374c2466f43ef5b1c94171d0b00bc50011fccba2b0d48a4426e82cb7c553ed24
|
data/README.md
CHANGED
@@ -151,7 +151,7 @@ languages: Field::JSONB.with_options(advanced_view: {
|
|
151
151
|
|
152
152
|
## License
|
153
153
|
|
154
|
-
Copyright © 2015-
|
154
|
+
Copyright © 2015-2022 Codica. It is released under the [MIT License](https://opensource.org/licenses/MIT).
|
155
155
|
|
156
156
|
## About Codica
|
157
157
|
|
@@ -2,7 +2,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'administrate-field-jsonb'
|
5
|
-
gem.version = '0.4.
|
5
|
+
gem.version = '0.4.5'
|
6
6
|
gem.authors = ['Sergey Volkov', 'Codica']
|
7
7
|
gem.email = ['sergvolkov.codica@gmail.com']
|
8
8
|
gem.homepage = 'https://github.com/codica2/administrate-field-jsonb'
|
@@ -1,7 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
(function () {
|
2
|
+
let eventName = 'ready'
|
3
|
+
if (typeof TurboLinks !== 'undefined') eventName = 'turbolinks:load'
|
4
|
+
if (typeof Turbo !== 'undefined') eventName = 'turbo:load'
|
5
|
+
|
6
|
+
$(document).on(eventName, function () {
|
7
|
+
$(".administrate-field-jsonb-accordion").each(function () {
|
8
|
+
$(this).click(function () {
|
9
|
+
$(this).toggleClass("administrate-field-jsonb-active").next().toggle();
|
10
|
+
});
|
5
11
|
});
|
6
12
|
});
|
7
|
-
});
|
13
|
+
})();
|
@@ -1,32 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
(function () {
|
2
|
+
eventName = 'ready'
|
3
|
+
if (typeof TurboLinks !== 'undefined') eventName = 'turbolinks:load'
|
4
|
+
if (typeof Turbo !== 'undefined') eventName = 'turbo:load'
|
4
5
|
|
5
|
-
|
6
|
+
$(document).on(eventName, function () {
|
7
|
+
let editor, updatedJson;
|
8
|
+
$('.administrate-jsoneditor').each(function (index) {
|
6
9
|
|
7
|
-
|
8
|
-
onChange: function () {
|
9
|
-
try {
|
10
|
-
updatedJson = editor.get();
|
11
|
-
} catch (err) {
|
12
|
-
console.log(err);
|
13
|
-
}
|
10
|
+
let $current = $(this).find("textarea");
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
enableSort: false,
|
23
|
-
enableTransform: false,
|
24
|
-
mode: 'tree',
|
25
|
-
modes: ['text', 'tree'],
|
26
|
-
};
|
12
|
+
let options = {
|
13
|
+
onChange: function () {
|
14
|
+
try {
|
15
|
+
updatedJson = editor.get();
|
16
|
+
} catch (err) {
|
17
|
+
console.log(err);
|
18
|
+
}
|
27
19
|
|
28
|
-
|
20
|
+
$current.val(JSON.stringify(updatedJson));
|
21
|
+
},
|
22
|
+
onError: function (err) {
|
23
|
+
alert(err.toString());
|
24
|
+
},
|
25
|
+
navigationBar: false,
|
26
|
+
search: false,
|
27
|
+
enableSort: false,
|
28
|
+
enableTransform: false,
|
29
|
+
mode: 'tree',
|
30
|
+
modes: ['text', 'tree'],
|
31
|
+
};
|
29
32
|
|
30
|
-
|
33
|
+
let editor = new JSONEditor(this, options);
|
34
|
+
|
35
|
+
editor.set(JSON.parse($current.val()));
|
36
|
+
});
|
31
37
|
});
|
32
|
-
});
|
38
|
+
})();
|
@@ -1,20 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
(function () {
|
2
|
+
eventName = 'ready'
|
3
|
+
if (typeof TurboLinks !== 'undefined') eventName = 'turbolinks:load'
|
4
|
+
if (typeof Turbo !== 'undefined') eventName = 'turbo:load'
|
4
5
|
|
5
|
-
|
6
|
+
$(document).on(eventName, function () {
|
7
|
+
let viewer;
|
8
|
+
$('.administrate-jsoneditor-viewer').each(function (index) {
|
6
9
|
|
7
|
-
|
8
|
-
navigationBar: false,
|
9
|
-
search: false,
|
10
|
-
enableSort: false,
|
11
|
-
enableTransform: false,
|
12
|
-
mode: 'view',
|
13
|
-
modes: [],
|
14
|
-
};
|
10
|
+
let $current = $(this).find("textarea");
|
15
11
|
|
16
|
-
|
12
|
+
let options = {
|
13
|
+
navigationBar: false,
|
14
|
+
search: false,
|
15
|
+
enableSort: false,
|
16
|
+
enableTransform: false,
|
17
|
+
mode: 'view',
|
18
|
+
modes: [],
|
19
|
+
};
|
17
20
|
|
18
|
-
|
21
|
+
let viewer = new JSONEditor(this, options);
|
22
|
+
|
23
|
+
viewer.set(JSON.parse($current.val()));
|
24
|
+
});
|
19
25
|
});
|
20
|
-
});
|
26
|
+
})();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-jsonb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Volkov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-01-
|
12
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: administrate
|