Minor changes for code publication and persistant method to VC
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index 3dbdea1..ef590d5 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -6,6 +6,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=false, user-scalable=no" />
<link href="<%= stash 'prefix' %>/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link href="<%= stash 'prefix' %>/css/kalamar-<%= $Kalamar::VERSION %>.css" type="text/css" rel="stylesheet" />
+ %= javascript begin
+ window.KorAP = window.KorAP || {};
+ % my $api = url_for('index');
+ % $api =~ s!/$!!;
+ KorAP.URL = '<%== $api %>';
+% end
<script src="<%= (stash('prefix') // '') . '/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js') %>" async="async"></script>
</head>
% my $embedded = 0;
@@ -34,12 +40,6 @@
<%= doc_link_to 'V '. $Kalamar::VERSION, 'korap', 'kalamar' %>
</footer>
% };
-%= javascript begin
- window.KorAP = window.KorAP || {};
- % my $api = url_for('index');
- % $api =~ s!/$!!;
- KorAP.URL = '<%== $api %>';
-% end
%= notifications 'Alertify', -no_include
</body>
</html>
diff --git a/templates/query.html.ep b/templates/query.html.ep
index f6e73be..954488c 100644
--- a/templates/query.html.ep
+++ b/templates/query.html.ep
@@ -1,20 +1,5 @@
-% use JSON::XS;
% use Mojo::JSON;
-% if (search->query_jsonld && kalamar_test_port()) {
-% my $action;
-% if (param('action') && param('action') eq 'inspect') {
-% $action = ' active" style="cursor: default';
-% };
-% state $json = JSON::XS->new->allow_blessed->pretty->canonical(1);
-<pre class="query serial<%== $action // '' %>" <% unless ($action) { %>onclick="this.classList.toggle('active')"<% } %>>
- <span>JSON-LD Serialization for "<%= param 'q' %>"<% if (param('ql')) { %> (<%= param 'ql' %>)<% } %></span>
- <code>
-%# Workaround to keep true, false, and null intact
-%= $json->encode($json->decode(Mojo::JSON::encode_json(search->query_jsonld)))
- </code>
-</pre>
%= javascript begin
-hljs.initHighlightingOnLoad();
+ KorAP.currentQuery = <%== Mojo::JSON::encode_json(search->query_jsonld) %>;
% end
-% };
diff --git a/templates/search.html.ep b/templates/search.html.ep
index eeb65a9..a0e26b6 100644
--- a/templates/search.html.ep
+++ b/templates/search.html.ep
@@ -27,3 +27,5 @@
% } else {
<p id="no-results"><%== loc 'noMatches', q => search->query %></p>
% }
+
+%= include 'query'