% use JSON::XS; | |
% if (stash('search.query') && stash('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 // '' %>"> | |
<span>JSON-LD Serialization for <%= param 'q' %> (<%= param 'ql' %>)</span> | |
<code> | |
<%= $json->encode(stash('search.query')) =%> | |
</code> | |
</pre> | |
%= javascript begin | |
hljs.initHighlightingOnLoad(); | |
% unless ($action) { | |
$("pre.query.serial").on("click", function () { | |
$(this).toggleClass('active'); | |
}); | |
% }; | |
% end | |
% }; |