app/views/searchjoy/searches/stream.html.erb in searchjoy-1.0.0 vs app/views/searchjoy/searches/stream.html.erb in searchjoy-1.1.0
- old
+ new
@@ -1,10 +1,10 @@
<h1>Live Stream</h1>
<table id="stream"></table>
-<script>
+<%= javascript_tag nonce: true do %>
function load(element, path) {
var request = new XMLHttpRequest();
request.open("GET", path, true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
@@ -18,6 +18,6 @@
function fetchRecentSearches() {
load(document.getElementById("stream"), <%= raw json_escape(searches_recent_path.to_json) %>)
setTimeout(fetchRecentSearches, 5 * 1000);
}
fetchRecentSearches();
-</script>
+<% end %>