blob: 0eebd0c8d6b4daf4694ba101136a74c176e0e615 [file] [log] [blame]
Nils Diewald02df9912014-06-03 16:08:07 +00001% use JSON::XS;
2
Nils Diewaldb40ddad2014-06-23 15:39:18 +00003% if (stash('search.query') && stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +00004% my $action;
5% if (param('action') && param('action') eq 'inspect') {
6% $action = ' active" style="cursor: default';
7% };
8% state $json = JSON::XS->new->allow_blessed->pretty->canonical(1);
9<pre class="query serial<%== $action // '' %>">
Nils Diewald44a72782014-06-20 16:03:21 +000010 <span>JSON-LD Serialization for <%= param 'q' %> (<%= param 'ql' %>)</span>
Nils Diewald7cad8402014-07-08 17:06:56 +000011 <code>
Nils Diewald44a72782014-06-20 16:03:21 +000012<%= $json->encode(stash('search.query')) =%>
Nils Diewald7cad8402014-07-08 17:06:56 +000013 </code>
14</pre>
15%= javascript begin
16hljs.initHighlightingOnLoad();
17% unless ($action) {
18$("pre.query.serial").on("click", function () {
19 $(this).toggleClass('active');
20});
21% };
22% end
Nils Diewald44a72782014-06-20 16:03:21 +000023% };