| 1 | package Kwiki::BrowserDetect; | ||
| 2 | use Kwiki::Plugin -Base; | ||
| 3 | use HTTP::BrowserDetect; | ||
| 4 | |||
| 5 | const class_id => 'browser_detect'; | ||
| 6 | |||
| 7 | field 'browser_detect'; | ||
| 8 | |||
| 9 | sub AUTOLOAD { | ||
| 10 | our $AUTOLOAD; | ||
| 11 | my ($method) = $AUTOLOAD =~ /::(\w+)$/; | ||
| 12 | return if $method eq 'DESTROY'; | ||
| 13 | $self->browser_detect(HTTP::BrowserDetect->new) | ||
| 14 | unless $self->browser_detect; | ||
| 15 | $self->browser_detect->$method(@_); | ||
| 16 | } |