| 1 | package Devel::IPerl::Display::JS; | ||||||||||||||
| 2 | 2 | $Devel::IPerl::Display::JS::VERSION = '0.012'; | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 2 | ▶ | use Moo; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 2 | with qw(Devel::IPerl::Display::Role::Displayable Devel::IPerl::Display::Role::Source); | |||||||||||||
| 8 | |||||||||||||||
| 9 | 2 | ▶ | sub iperl_data_representations { | ||||||||||||
|
Subroutine
iperl_data_representations: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 10 | 2 | my ($self) = @_; | |||||||||||||
| 11 | 2 | my $html; | |||||||||||||
| 12 | 2 | ▶ | if( $self->uri ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 13 | 1 | $html = <<"HTML"; | |||||||||||||
| 14 | 1 | <script src="@{[$self->uri]}" type="text/javascript"></script> | |||||||||||||
| 15 | HTML | ||||||||||||||
| 16 | } elsif( $self->bytestream ) { | ||||||||||||||
| 17 | 1 | $html = <<"HTML"; | |||||||||||||
| 18 | <script type="text/javascript"> | ||||||||||||||
| 19 | 1 | @{[ $self->bytestream ]} | |||||||||||||
| 20 | </script> | ||||||||||||||
| 21 | HTML | ||||||||||||||
| 22 | } | ||||||||||||||
| 23 | return { | ||||||||||||||
| 24 | 2 | "text/html" => $html, | |||||||||||||
| 25 | }; | ||||||||||||||
| 26 | } | ||||||||||||||
| 27 | |||||||||||||||
| 28 | 2 | 1; | |||||||||||||
| 29 | |||||||||||||||
| 30 | __END__ | ||||||||||||||