MojoMojo::Formatter::Emote - MSN Smileys in your text.


MojoMojo documentation Contained in the MojoMojo distribution.

Index


Code Index:

module_loaded

Return true if the module is loaded.

NAME

Top

MojoMojo::Formatter::Emote - MSN Smileys in your text.

DESCRIPTION

Top

This formatter transforms the full range of MSN Smileys into bitmaps on your page, using Text::Emoticon::MSN.

METHODS

Top

format_content_order

Format order can be 1-99. The Emote formatter runs on 95.

format_content

Calls the formatter. Takes a ref to the content as well as the context object.

SEE ALSO

Top

MojoMojo, Module::Pluggable::Ordered, Text::Emoticon::MSN

AUTHORS

Top

Marcus Ramberg <mramberg@cpan.org>

LICENSE

Top

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.


MojoMojo documentation Contained in the MojoMojo distribution.
package MojoMojo::Formatter::Emote;

eval "use Text::Emoticon::MSN";
my $eval_res = $@;

sub module_loaded { $eval_res ? 0 : 1 }

our $VERSION = '0.01';

sub format_content_order { 95 }

sub format_content {
    my ($class, $content, $c)=@_;
    return unless $class->module_loaded && $c->pref('enable_emoticons');
    my $emoticon = Text::Emoticon::MSN->new(
        imgbase => $c->req->base.'/.static/emote',
        xhtml => 1, strict => 1
    );
    # Let textile handle the rest
    $$content = $emoticon->filter( $$content );
}

1;