ponkotsu-md-editor 0.2.0 → 0.2.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62a1a937b8cf271a226386c2661c8decedc24ae6b2189e92ba2358f8a9428228
|
|
4
|
+
data.tar.gz: 72feda410a62df3df6f05ba7fae531eb7c44f8f1fc77d73284d85a1b69258efa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57667cc623bba7c40bb54d83dedc7eb8b7a85af87a6b4314f67a43ced501b7d068ef770b0d43b055d8ed5c9cb039c764b16800d5e28c45e19c44d2f6f495590f
|
|
7
|
+
data.tar.gz: e998286e7ddfead67721ed9d287ec148b770e7a1c9f0ec9b360fe02ceec263dca7e146b2608d959aef970d6b4c140f07e2622476c1006d38fbdf3107963eb06d
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
2
|
_form = locals[:form]
|
|
3
|
-
_content = locals[:content]
|
|
4
3
|
_options = {
|
|
5
4
|
lang: locals[:options][:lang] || :en,
|
|
6
5
|
preview: locals[:options][:preview] || true,
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
|
|
61
60
|
<div class="markdown-editor">
|
|
62
61
|
<%= render "ponkotsu_md_editor/toolbar", locals: { options: _options } %>
|
|
63
|
-
<%= render "ponkotsu_md_editor/input_area", locals: { form: _form,
|
|
62
|
+
<%= render "ponkotsu_md_editor/input_area", locals: { form: _form, attribute: locals[:attribute], options: _options } %>
|
|
64
63
|
</div>
|
|
65
64
|
<div class="form-text medium-contrast-text">
|
|
66
65
|
<strong><%= case _options[:lang]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
2
|
_form = locals[:form]
|
|
3
|
-
_content = locals[:content]
|
|
4
3
|
_placeholder = locals[:options][:placeholder]
|
|
5
4
|
%>
|
|
6
5
|
|
|
@@ -9,14 +8,14 @@
|
|
|
9
8
|
contenteditable="true"
|
|
10
9
|
data-field="content"
|
|
11
10
|
class="form-control markdown-textarea">
|
|
12
|
-
<%= raw
|
|
11
|
+
<%= raw locals[:attribute] %>
|
|
13
12
|
</div>
|
|
14
13
|
|
|
15
14
|
<div id="editor_content_placeholder">
|
|
16
15
|
<%= _placeholder %>
|
|
17
16
|
</div>
|
|
18
17
|
|
|
19
|
-
<%= _form.hidden_field
|
|
18
|
+
<%= _form.hidden_field locals[:attribute], id: "content_hidden_field" %>
|
|
20
19
|
|
|
21
20
|
<%= render "ponkotsu_md_editor/preview_area" %>
|
|
22
21
|
</div>
|
|
@@ -22,9 +22,9 @@ module PonkotsuMdEditor
|
|
|
22
22
|
# tools: [ :bold, :italic, :strikethrough ],
|
|
23
23
|
# placeholder: "This is Placeholder."
|
|
24
24
|
# }) %>
|
|
25
|
-
def markdown_editor(form,
|
|
25
|
+
def markdown_editor(form, attribute, options = {})
|
|
26
26
|
form = form[:form] if form.is_a?(Hash)
|
|
27
|
-
render "ponkotsu_md_editor/editor", locals: {
|
|
27
|
+
render "ponkotsu_md_editor/editor", locals: { attribute: attribute, form: form, options: options }
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
end
|