/[Frey]/trunk/lib/Frey/Web/IFrame.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Frey/Web/IFrame.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 905 - (hide annotations)
Thu Dec 25 21:59:20 2008 UTC (15 years, 4 months ago) by dpavlin
File size: 1048 byte(s)
import old and crufty iframe opener
1 dpavlin 905 package Frey::Web::IFrame;
2     use Moose;
3    
4     extends 'Frey';
5     with 'Frey::Web';
6     #with 'Frey::Storage';
7    
8     has skeleton => (
9     is => 'rw',
10     isa => 'Str',
11     required => 1,
12     default => 'skeleton',
13     );
14    
15     sub as_markup {
16     my ($self) = @_;
17    
18     $self->add_js( 'static/Frey/Web/IFrame.js' );
19    
20     $self->add_js(q/
21     function ifr_close() {
22     var e = self.document.getElementById('frey_iframe') || null;
23     if (!e) return;
24     e.style.height = '0px';
25     }
26     function ifr_show() {
27     self.document.getElementById('ifr_close').style.display='';
28     }
29     /);
30    
31     my $html = qq|
32     <a href="#" id="ifr_close" style="display:none;" onclick="ifr_close();this.style.display='none';return false;">close</a>
33     <iframe id="frey_iframe" name="frey_iframe" width="100%" height="0" frameborder="0" border="0" onload="top.ifr_resize(this);">
34     </iframe>
35     |;
36    
37     $html .= $self->iframe_open('/Frey::Web::IFrame','introspect in iframe');
38    
39     return $html;
40     }
41    
42     sub iframe_open {
43     my ($self,$url,$text) = @_;
44    
45     qq|
46     <a href="$url" target="frey_iframe" onclick="ifr_show(); return true;">$text</a>
47     |
48     }
49    
50     1;

  ViewVC Help
Powered by ViewVC 1.1.26