sage-rails 0.1.7 → 0.1.8
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/views/sage/queries/_statement_box.html.erb +11 -3
- data/lib/sage/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: 4d1bccb977fae3786227b2511a90fdb9163e497ba560a82d457fe6fc25b53153
|
|
4
|
+
data.tar.gz: 4f56781eaa2545ffd8970491d68c897897b38fdd518f05cc2ef9fe235d411db8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eac2215b633b6eeb16b707cbb74e79c081496f03748c4e98e9d9305c34896c6b2397a413c679b5eac97b68c7d436035794539fc048d6a8fc68d323ec74dcd5ca
|
|
7
|
+
data.tar.gz: 52dec8f05a2c39e85977b803dfce1d119e160ee534bf76fb4d6c528a1757c358c94a62ae4ad85d235677d22e397011b6e3588c300cb5638c7249f353ed39c881
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<%= f.hidden_field :query_id, value: query.id %>
|
|
48
48
|
<%= f.hidden_field :data_source, value: query.data_source || Blazer.data_sources.keys.first %>
|
|
49
49
|
<div id="editor-container" style="position: relative;">
|
|
50
|
-
<div id="editor" style="height: 225px;" data-initial-content="<%= local_assigns[:statement] || query.statement %>"
|
|
50
|
+
<div id="editor" style="height: 225px;" data-initial-content="<%= local_assigns[:statement] || query.statement %>"><%= local_assigns[:statement] || query.statement %></div>
|
|
51
51
|
</div>
|
|
52
52
|
<% end %>
|
|
53
53
|
</div>
|
|
@@ -223,8 +223,16 @@
|
|
|
223
223
|
|
|
224
224
|
// Set initial value from data attribute or current content
|
|
225
225
|
const editorDiv = document.getElementById("editor")
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
let initialContent = editorDiv.getAttribute("data-initial-content") || editor.getValue()
|
|
227
|
+
|
|
228
|
+
// Decode HTML entities that ERB escapes in the attribute
|
|
229
|
+
// This handles ", ', (newlines), etc.
|
|
230
|
+
if (initialContent && editorDiv.hasAttribute("data-initial-content")) {
|
|
231
|
+
const textarea = document.createElement('textarea');
|
|
232
|
+
textarea.innerHTML = initialContent;
|
|
233
|
+
initialContent = textarea.value;
|
|
234
|
+
}
|
|
235
|
+
|
|
228
236
|
if (initialContent && initialContent !== editor.getValue()) {
|
|
229
237
|
editor.setValue(initialContent, -1) // -1 moves cursor to start
|
|
230
238
|
}
|
data/lib/sage/version.rb
CHANGED