richer_text 0.18.0 → 0.20.0
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/app/helpers/richer_text/tag_helper.rb +1 -0
- data/lib/richer_text/attribute.rb +5 -1
- data/lib/richer_text/html_visitor.rb +1 -1
- data/lib/richer_text/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678e1169424b3442c3a1930a2ab34e4e7ec724e2a2e8381bfdd7f8b789bb1eff
|
4
|
+
data.tar.gz: 5dfd1574889342d9308fbbe79c5959bdc86eb816ae8d82f466ed6140f8ab3dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59ca2d890918fb81e3d4ee4619c2ce1c5e41ea97736f90cf0bec50ab2eb10a2e007cdd2a466e5bdfe8ad0bb522252fa00165984bc8fcc729489eededf47c884d
|
7
|
+
data.tar.gz: 7fcb45cebc874bbe5437a695688677d6d4eb90493e18021b46e776453c105722946e14aa0845f33bd050bf1cfed64ca67063dd381044924d0c4b71b6d8552306
|
@@ -12,6 +12,7 @@ module ActionView::Helpers
|
|
12
12
|
options["input"] ||= dom_id(object, [options["id"], :richer_text_input].compact.join("_")) if object
|
13
13
|
options["value"] = options.fetch("value") { value&.to_editor_format }
|
14
14
|
options["serializer"] = options.fetch("serializer") { object.class.send(:"richer_text_#{@method_name}_json") ? "json" : "html" }
|
15
|
+
options["attachments"] = options.fetch("attachments") { object.class.send(:"richer_text_#{@method_name}_allow_attachments") }
|
15
16
|
|
16
17
|
@template_object.richer_text_area_tag(options.delete("name"), options["value"], options.except("value"))
|
17
18
|
end
|
@@ -3,11 +3,15 @@ module RicherText
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
class_methods do
|
6
|
-
def has_richer_text(name, store_as: :html)
|
6
|
+
def has_richer_text(name, store_as: :html, attachments: true)
|
7
7
|
# Store if the attribute is using JSON or not.
|
8
8
|
class_attribute :"richer_text_#{name}_json", instance_writer: false
|
9
9
|
self.send(:"richer_text_#{name}_json=", store_as == :json)
|
10
10
|
|
11
|
+
# Store if the attribute allows attachments
|
12
|
+
class_attribute :"richer_text_#{name}_allow_attachments", instance_writer: false
|
13
|
+
self.send(:"richer_text_#{name}_allow_attachments=", attachments)
|
14
|
+
|
11
15
|
class_eval <<-CODE, __FILE__, __LINE__ + 1
|
12
16
|
def #{name}
|
13
17
|
richer_text_#{name} || build_richer_text_#{name}
|
data/lib/richer_text/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: richer_text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Fomera
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -38,7 +37,6 @@ dependencies:
|
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '0'
|
41
|
-
description:
|
42
40
|
email:
|
43
41
|
- afomera@hey.com
|
44
42
|
executables: []
|
@@ -112,7 +110,6 @@ licenses:
|
|
112
110
|
- MIT
|
113
111
|
metadata:
|
114
112
|
homepage_uri: https://github.com/afomera/richer_text
|
115
|
-
post_install_message:
|
116
113
|
rdoc_options: []
|
117
114
|
require_paths:
|
118
115
|
- lib
|
@@ -127,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
124
|
- !ruby/object:Gem::Version
|
128
125
|
version: '0'
|
129
126
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
131
|
-
signing_key:
|
127
|
+
rubygems_version: 3.6.2
|
132
128
|
specification_version: 4
|
133
129
|
summary: A richer text editor for Rails
|
134
130
|
test_files: []
|