playbook_ui_docs 14.1.0.pre.alpha.PA1477timestampkit3601 → 14.1.0.pre.alpha.PBNTR449rtepreviewerrails3605
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: 3676b191a74b77086758143b0ccf8471796f8c026d532da14db2a30bebe83390
|
4
|
+
data.tar.gz: 720aa1cca6181a3d7f0dad51270f8a9d4fec6b89bd992ae0897d596c09fac65a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9484a54906adc8e1554399110aebf64c380b4595ad8922b21e0d5ab92028954ca9004196ffbf7efef38029ee005c1396b579f07badb87611291dc2483af426f
|
7
|
+
data.tar.gz: 5e7291b02efbdad1c9b4daeee7e8b5ce592ae23e448fdc90e91ae8a31a6e8ca8f0156b0257989a9f979b7897599ab0fb4c7132ea6285327d8fb40029bd053e8f
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
<%= pb_rails("rich_text_editor", props: { id: "content-preview-editor" }) %>
|
3
3
|
<div id="card-obfuscation" style="display:none">
|
4
|
-
<%= pb_rails("card", props: { margin_top: "md" }) do %>
|
4
|
+
<%= pb_rails("card", props: { margin_top: "md", max_width: "md", padding: "sm" }) do %>
|
5
5
|
<div id="content-preview" class="trix-content">
|
6
6
|
</div>
|
7
7
|
<% end %>
|
@@ -11,15 +11,25 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<script>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
const previewArea = document.getElementById('content-preview');
|
19
|
-
const cardDiv = document.getElementById('card-obfuscation');
|
14
|
+
document.addEventListener('DOMContentLoaded', () => {
|
15
|
+
function handleButtonClick() {
|
16
|
+
const editorContainer = [...document.querySelectorAll('[data-react-props]')]
|
17
|
+
.find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
const editorElement = editorContainer?.querySelector('trix-editor')
|
20
|
+
const inputId = editorElement?.getAttribute('input')
|
21
|
+
const inputElement = inputId && document.getElementById(inputId)
|
22
|
+
|
23
|
+
const editorContent = inputElement?.value || ''
|
24
|
+
const previewArea = document.getElementById('content-preview')
|
25
|
+
const cardDiv = document.getElementById('card-obfuscation')
|
26
|
+
|
27
|
+
if (previewArea && cardDiv) {
|
28
|
+
previewArea.innerHTML = editorContent
|
29
|
+
cardDiv.style.display = 'block'
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
document.getElementById('preview-button')?.addEventListener('click', handleButtonClick)
|
34
|
+
})
|
25
35
|
</script>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<br>
|
9
9
|
|
10
10
|
<%= pb_rails("timestamp", props: {
|
11
|
-
timestamp: DateTime.now
|
11
|
+
timestamp: DateTime.now,
|
12
12
|
variant: "elapsed",
|
13
13
|
show_user: false
|
14
14
|
}) %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<br>
|
17
17
|
|
18
18
|
<%= pb_rails("timestamp", props: {
|
19
|
-
timestamp: DateTime.now
|
19
|
+
timestamp: DateTime.now,
|
20
20
|
variant: "elapsed",
|
21
21
|
show_user: false,
|
22
22
|
hide_updated: true
|