administrate-field-jsonb 0.4.4 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d1b00158b771122554eee9bf66a5ea9be2531a154a39599824cca08b2580736
4
- data.tar.gz: c189cf1d7a7c7599af35a9935c057a6e6a3064cb8bb13c422031b86ad3ad2151
3
+ metadata.gz: 9550424cd11a77f0d5fe6ffc59b3ac8b294834949b8cbf2fea2eea476c775864
4
+ data.tar.gz: 34caa8f731541eb501587bbe78b1a7bf83fcc54e150c22f8acdb21055d3b21b5
5
5
  SHA512:
6
- metadata.gz: ef54adbd97f8dfd9151af88e419eb26dd78c88fee1c4b7eebe790c6d4514f24c363f732c348c12789ef268c24b596e96b025717db46829fe9a3a128d535bcb45
7
- data.tar.gz: 9c2d9180b29c40f42f98b0c73de7b9efa8998cfdd3aeb3b54f8039fd165b761c6bc60c245e11ff1792512a182de6dd6fe646aa9ae658307d10fe29e93ff11788
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-2019 Codica. It is released under the [MIT License](https://opensource.org/licenses/MIT).
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.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
- $(document).on(typeof Turbolinks === 'undefined' ? 'ready' : 'turbolinks:load', function() {
2
- $(".administrate-field-jsonb-accordion").each(function() {
3
- $(this).click(function() {
4
- $(this).toggleClass("administrate-field-jsonb-active").next().toggle();
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
- $(document).on(typeof Turbolinks === 'undefined' ? 'ready' : 'turbolinks:load', function() {
2
- let editor, updatedJson;
3
- $('.administrate-jsoneditor').each(function(index) {
1
+ (function () {
2
+ eventName = 'ready'
3
+ if (typeof TurboLinks !== 'undefined') eventName = 'turbolinks:load'
4
+ if (typeof Turbo !== 'undefined') eventName = 'turbo:load'
4
5
 
5
- let $current = $(this).find("textarea");
6
+ $(document).on(eventName, function () {
7
+ let editor, updatedJson;
8
+ $('.administrate-jsoneditor').each(function (index) {
6
9
 
7
- let options = {
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
- $current.val(JSON.stringify(updatedJson));
16
- },
17
- onError: function(err) {
18
- alert(err.toString());
19
- },
20
- navigationBar: false,
21
- search: false,
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
- let editor = new JSONEditor(this, options);
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
- editor.set(JSON.parse($current.val()));
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
- $(document).on(typeof Turbolinks === 'undefined' ? 'ready' : 'turbolinks:load', function() {
2
- let viewer;
3
- $('.administrate-jsoneditor-viewer').each(function (index) {
1
+ (function () {
2
+ eventName = 'ready'
3
+ if (typeof TurboLinks !== 'undefined') eventName = 'turbolinks:load'
4
+ if (typeof Turbo !== 'undefined') eventName = 'turbo:load'
4
5
 
5
- let $current = $(this).find("textarea");
6
+ $(document).on(eventName, function () {
7
+ let viewer;
8
+ $('.administrate-jsoneditor-viewer').each(function (index) {
6
9
 
7
- let options = {
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
- let viewer = new JSONEditor(this, options);
12
+ let options = {
13
+ navigationBar: false,
14
+ search: false,
15
+ enableSort: false,
16
+ enableTransform: false,
17
+ mode: 'view',
18
+ modes: [],
19
+ };
17
20
 
18
- viewer.set(JSON.parse($current.val()));
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
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-06 00:00:00.000000000 Z
12
+ date: 2022-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: administrate