ponkotsu-md-editor 0.2.20 → 0.2.22
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/assets/javascripts/markdown_editor.js +10 -6
- data/lib/ponkotsu/md/editor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97e91e79d6aa2192119c29a43d574e32b004f2af3f46e8e8b347a6143d53ecd6
|
|
4
|
+
data.tar.gz: 3e244ceb629a4d4525d63f78280cd6d3a4ec870fb03f2d09b1085106d49c3520
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a585bc891ce8718ff983e25def494e0a0f04acb0c180d0c8799b1c14a7bdec0457cf4b598ab4be02a9a39ac096d6bd36a1c0d65ae4f70ad84d76d0b0d7f29c3f
|
|
7
|
+
data.tar.gz: 9afb724fa506db1189b66b92f9ce67da831a158baad5d8b745d3b85428e81bd50c1eb4012adfce74ba2b6520bf005163c867ff4bbb974ff4c98f4eed86c3d5a6
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// _scanOffsetCacheをローカル変数として閉じる
|
|
5
5
|
let _scanOffsetCache = new Map();
|
|
6
6
|
|
|
7
|
+
const analyzeHtmlCache = new Map();
|
|
8
|
+
|
|
7
9
|
// Debounce function for delayed execution
|
|
8
10
|
function debounce(func, wait) {
|
|
9
11
|
let timeout;
|
|
@@ -29,9 +31,7 @@
|
|
|
29
31
|
|
|
30
32
|
// Wait for DOM content loaded
|
|
31
33
|
function onReady(callback) {
|
|
32
|
-
|
|
33
|
-
document.addEventListener('DOMContentLoaded', callback);
|
|
34
|
-
|
|
34
|
+
const run = () => {
|
|
35
35
|
const textarea = document.getElementById('editor_content');
|
|
36
36
|
const hiddenField = document.getElementById('content_hidden_field');
|
|
37
37
|
|
|
@@ -61,8 +61,14 @@
|
|
|
61
61
|
textarea.addEventListener('input', debounce(updatePlaceholderVisibility, 150));
|
|
62
62
|
textarea.addEventListener('blur', updatePlaceholderVisibility);
|
|
63
63
|
}
|
|
64
|
-
} else {
|
|
65
64
|
callback();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
if (document.readyState === 'loading') {
|
|
68
|
+
document.addEventListener('DOMContentLoaded', run);
|
|
69
|
+
document.addEventListener('turbo:load', run);
|
|
70
|
+
} else {
|
|
71
|
+
run();
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
|
|
@@ -735,8 +741,6 @@
|
|
|
735
741
|
}
|
|
736
742
|
}
|
|
737
743
|
|
|
738
|
-
const analyzeHtmlCache = new Map();
|
|
739
|
-
|
|
740
744
|
function analyzeHtml(target, isCountEmptyDiv = false) {
|
|
741
745
|
|
|
742
746
|
const cacheKey = `${target}_${isCountEmptyDiv}`;
|