Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 1 | % use JSON::XS; |
| 2 | |
Nils Diewald | b40ddad | 2014-06-23 15:39:18 +0000 | [diff] [blame] | 3 | % if (stash('search.query') && stash('test_port')) { |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 4 | % 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 Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 10 | <span>JSON-LD Serialization for <%= param 'q' %> (<%= param 'ql' %>)</span> |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 11 | <code> |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 12 | <%= $json->encode(stash('search.query')) =%> |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 13 | </code> |
| 14 | </pre> |
| 15 | %= javascript begin |
| 16 | hljs.initHighlightingOnLoad(); |
| 17 | % unless ($action) { |
| 18 | $("pre.query.serial").on("click", function () { |
| 19 | $(this).toggleClass('active'); |
| 20 | }); |
| 21 | % }; |
| 22 | % end |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 23 | % }; |