card-mod-tinymce_editor 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a0f7c294c1a779090579c8255567e252daa6a2fcb1946efa4a7e9649a928263
4
- data.tar.gz: ebe57387772116e54e1be64e1714835a7dfa82d19c917b7c56faa39712087c9a
3
+ metadata.gz: ab280dd10c55298431d648fcb595bb0810648d767fec22ec05a24ccc67d10567
4
+ data.tar.gz: bd92756e7ae86d9aa6b0cc1defa3d1b131859bb0cd0b5b8a3badfc178b130471
5
5
  SHA512:
6
- metadata.gz: 3224b815fa632f9c2c2999d12437165103ceac2c3eef9bdcdc26f225763fea117880655a340b43a68e06a41542064a847123c60245b52abfe8f8f0b086f9805a
7
- data.tar.gz: a674cc2a4cac8f3d971d0070b86200b5181eb68a272774962afea7d33c44675cdf94abd537d888c42b6e2f970803d5acbac4ae973e65c158f60d9ceea09bc291
6
+ metadata.gz: 54e208312d97b2c463ee5f08ac62469a6f6f3a62a2f7481a027e16a0fc3e262d363eec6a009cf6487c8a585a7c04ff6c1a4cb78bdc368a8929f1f5e4eb7741a0
7
+ data.tar.gz: e12cbf08e7b12c545ad7239bb9c828399905fa4d8ebf1605a7580a8d337e4c1d8b3bdebda4d34b58627e46e1af4545c7596625d01a2a2a5f2d5423132bf5f34d
@@ -43,18 +43,23 @@ class Card
43
43
  end
44
44
 
45
45
  def extract_options options
46
- Card::Reference::NestParser::NEST_OPTIONS.each_with_object([]) do |key, res|
47
- next unless options[key]
48
-
46
+ applicable_options(options).each_with_object([]) do |key, res|
49
47
  if key.in? %i[show hide]
50
- values = Card::View.normalize_list(options[key])
51
- res.concat(values.map { |val| [key, val] })
48
+ res.concat viz_values(key, options)
52
49
  else
53
50
  res << [key, options[key]]
54
51
  end
55
52
  end
56
53
  end
57
54
 
55
+ def viz_values key, options
56
+ Card::View.normalize_list(options[key]).map { |val| [key, val] }
57
+ end
58
+
59
+ def applicable_options options
60
+ Card::Reference::NestParser::NEST_OPTIONS.select { |key| options[key] }
61
+ end
62
+
58
63
  def extract_item_options options
59
64
  @item_options = []
60
65
  item_options = options[:items]
@@ -5,6 +5,8 @@ format :html do
5
5
  params[:tinymce_id]
6
6
  end
7
7
 
8
+ private
9
+
8
10
  def tm_param key
9
11
  params[:"tm_snippet_#{key}"]
10
12
  end
@@ -13,17 +15,27 @@ format :html do
13
15
  @tm_snippet_editor_mode != :overlay
14
16
  end
15
17
 
16
- private
17
-
18
18
  def apply_tm_snippet_data snippet
19
19
  { "data-tinymce-id": tinymce_id }.tap do |data|
20
- apply_tm_snippet_var(data, :start) { tm_param :start }
21
- apply_tm_snippet_var(data, :size, :raw) { snippet.raw.size }
22
- data["data-dismiss"] = "modal" if modal_tm_snippet_editor?
23
- data["data-index"] = params["index"] if params["index"].present?
20
+ apply_tm_snippet_vars data, snippet
21
+ apply_tm_data_dismiss data
22
+ apply_tm_data_index data
24
23
  end
25
24
  end
26
25
 
26
+ def apply_tm_data_dismiss data
27
+ data["data-dismiss"] = "modal" if modal_tm_snippet_editor?
28
+ end
29
+
30
+ def apply_tm_data_index data
31
+ data["data-index"] = params["index"] if params["index"].present?
32
+ end
33
+
34
+ def apply_tm_snippet_vars data, snippet
35
+ apply_tm_snippet_var(data, :start) { tm_param :start }
36
+ apply_tm_snippet_var(data, :size, :raw) { snippet.raw.size }
37
+ end
38
+
27
39
  def apply_tm_snippet_var data, varname, paramname=nil
28
40
  return unless tm_param(paramname || varname).present?
29
41
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-tinymce_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-12-24 00:00:00.000000000 Z
13
+ date: 2021-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.0
21
+ version: 1.101.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.101.0
28
+ version: 1.101.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-edit
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.11.0
35
+ version: 0.11.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.11.0
42
+ version: 0.11.1
43
43
  description: ''
44
44
  email:
45
45
  - info@decko.org