Parent Directory | Revision Log
make classes immutable and remove moose droppings to make Perl::Critic::Moose happy
1 | dpavlin | 792 | package Frey::OpenSearch; |
2 | use Moose; | ||
3 | |||
4 | extends 'Frey'; | ||
5 | dpavlin | 1133 | with 'Frey::Web', 'Frey::File'; |
6 | dpavlin | 792 | |
7 | use MIME::Base64; | ||
8 | |||
9 | sub grep_as_markup { | ||
10 | my $self = shift; | ||
11 | |||
12 | warn "# url ", $self->dump( $self->request_url ); | ||
13 | |||
14 | my $url = qq|http://localhost:3000/Frey::Shell::Grep/as_markup|; # FIXME don't hard-code URL | ||
15 | my $icon = encode_base64( $self->read_file( 'static/icons/Frey/Shell/Grep.png' ) ); | ||
16 | |||
17 | $self->content_type( 'text/xml' ); | ||
18 | |||
19 | qq| | ||
20 | <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" | ||
21 | xmlns:moz="http://www.mozilla.org/2006/browser/search/"> | ||
22 | <ShortName>Frey::Shell::Grep</ShortName> | ||
23 | <Description>Find something with grep</Description> | ||
24 | <InputEncoding>UTF-8</InputEncoding> | ||
25 | <Image height="16" width="16">data:image/png;base64,$icon</Image> | ||
26 | <SearchForm>$url</SearchForm> | ||
27 | <Url type="text/html" | ||
28 | method="get" | ||
29 | template="$url"> | ||
30 | <Param name="pattern" value="{searchTerms}"/> | ||
31 | </Url> | ||
32 | <!-- | ||
33 | <Url type="application/x-suggestions+json" template="suggestionURL"/> | ||
34 | <moz:SearchForm>$url</moz:SearchForm> | ||
35 | --> | ||
36 | </OpenSearchDescription> | ||
37 | |; | ||
38 | } | ||
39 | |||
40 | =head1 SEE ALSO | ||
41 | |||
42 | L<http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox> | ||
43 | |||
44 | =cut | ||
45 | |||
46 | dpavlin | 1133 | __PACKAGE__->meta->make_immutable; |
47 | no Moose; | ||
48 | |||
49 | dpavlin | 792 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |