blob: 9c077b8fb8e16cf80f63378cb62b359f2b5cc8cb [file] [log] [blame]
Nils Diewald02df9912014-06-03 16:08:07 +00001% use JSON::XS;
Nils Diewaldf2e02a92014-11-12 18:31:05 +00002% use Mojo::JSON;
Nils Diewald02df9912014-06-03 16:08:07 +00003
Nils Diewaldb40ddad2014-06-23 15:39:18 +00004% if (stash('search.query') && stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +00005% my $action;
6% if (param('action') && param('action') eq 'inspect') {
7% $action = ' active" style="cursor: default';
8% };
9% state $json = JSON::XS->new->allow_blessed->pretty->canonical(1);
Nils Diewalde99d9042014-11-20 23:36:54 +000010<pre class="query serial<%== $action // '' %>" <% unless ($action) { %>onclick="this.classList.toggle('active')"<% } %>>
Nils Diewald44a72782014-06-20 16:03:21 +000011 <span>JSON-LD Serialization for <%= param 'q' %> (<%= param 'ql' %>)</span>
Nils Diewald7cad8402014-07-08 17:06:56 +000012 <code>
Nils Diewaldf2e02a92014-11-12 18:31:05 +000013%# Workaround to keep true, false, and null intact
14%= $json->encode($json->decode(Mojo::JSON::encode_json(stash('search.query'))))
Nils Diewald7cad8402014-07-08 17:06:56 +000015 </code>
16</pre>
17%= javascript begin
18hljs.initHighlightingOnLoad();
Nils Diewald7cad8402014-07-08 17:06:56 +000019% end
Nils Diewald44a72782014-06-20 16:03:21 +000020% };