Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
GitHub Actions
commited on
Commit
·
e90c416
1
Parent(s):
958c204
Sync from GitHub repo
Browse files- templates/arena.html +3 -16
templates/arena.html
CHANGED
@@ -189,9 +189,6 @@
|
|
189 |
</div>
|
190 |
</div>
|
191 |
|
192 |
-
<!-- Hidden element to store fallback sentences data -->
|
193 |
-
<div id="fallback-sentences-data" data-sentences="{{ harvard_sentences | tojson | safe }}" style="display: none;"></div>
|
194 |
-
|
195 |
{% endblock %}
|
196 |
|
197 |
{% block extra_head %}
|
@@ -1027,19 +1024,9 @@
|
|
1027 |
});
|
1028 |
});
|
1029 |
|
1030 |
-
//
|
1031 |
-
|
1032 |
-
|
1033 |
-
const dataElement = document.getElementById('fallback-sentences-data');
|
1034 |
-
if (dataElement && dataElement.dataset.sentences) {
|
1035 |
-
fallbackRandomTexts = JSON.parse(dataElement.dataset.sentences);
|
1036 |
-
} else {
|
1037 |
-
console.error("Fallback sentences data element not found or empty.");
|
1038 |
-
}
|
1039 |
-
} catch (e) {
|
1040 |
-
console.error("Error parsing fallback sentences from data attribute:", e);
|
1041 |
-
// fallbackRandomTexts remains an empty array if parsing fails
|
1042 |
-
}
|
1043 |
|
1044 |
// Fetch cached sentences on load
|
1045 |
function fetchCachedSentences() {
|
|
|
189 |
</div>
|
190 |
</div>
|
191 |
|
|
|
|
|
|
|
192 |
{% endblock %}
|
193 |
|
194 |
{% block extra_head %}
|
|
|
1024 |
});
|
1025 |
});
|
1026 |
|
1027 |
+
// Load fallback sentences directly from Flask variable (JSON string)
|
1028 |
+
// Note: This might cause linter errors, but JSON is JS-compatible.
|
1029 |
+
const fallbackRandomTexts = JSON.parse({{ harvard_sentences | tojson | safe }});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1030 |
|
1031 |
// Fetch cached sentences on load
|
1032 |
function fetchCachedSentences() {
|