Solstice::Button::PopIn - Create a DHTML-based popup.


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::Button::PopIn - Create a DHTML-based popup.

SYNOPSIS

Top

  use Solstice::Button:PopIn;

  See L<Solstice::Button|Solstice::Button> for usage.

DESCRIPTION

Top

ee Solstice::Button for description.

Superclass

Solstice::Button

Export

No symbols exported.

Methods

getButton()

Returns HTML for a text link.

Returns HTML for an image link.

Return HTML for a combination image/text link.

Private Methods

Modules Used

Solstice::Button, StringLibrary (StringLibrary).

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3002 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::Button::PopIn;

# $Id: PopIn.pm 3002 2006-01-24 22:57:29Z jdr99 $

use 5.006_000;
use strict;
use warnings;

use base qw(Solstice::Button);

our ($VERSION) = ('$Revision: 3002 $' =~ /^\$Revision:\s*([\d.]*)/);

sub getButton {
    my $self = shift;

    return $self->SUPER::getButton() if $self->{'_disabled'};
    return $self->getNoscriptButton() unless $self->{'_has_javascript'};

    my $name     = $self->{'_name'} || '';
    my $label    = $self->_generateLabel(); 
    my $title    = $self->_generateTitle(); 
    my $tooltip  = $self->_generateTooltip(); 
    my $tabindex = defined $self->{'_tabindex'} ? $self->{'_tabindex'} : 0;
    my $modal = $self->{'_is_modal'} || 0;
    my $draggable = defined $self->{'_is_draggable'} ? $self->{'_is_draggable'} : 1;
    my $width = $self->{'_width'} || '';

    my $script   = $self->_generateInlineScript();

    if (defined $tooltip) {
        $self->getOnloadService()->addEvent("Solstice.addToolTip('$name', '$tooltip')");
    }

    return qq|<input name="$name" type="button" id="$name" value="$label" tabindex="$tabindex" onclick="Solstice.YahooUI.raisePopIn('$name',$modal, $draggable, '$width');"/>$script|;
}

sub getTextLink {
    my $self = shift;

    return $self->SUPER::getTextLink() if $self->{'_disabled'};
    return $self->getNoscriptButton() unless $self->{'_has_javascript'};

    my $name     = $self->{'_name'} || '';
    my $label    = $self->_generateLabel(); 
    my $tooltip  = $self->_generateTooltip(); 
    my $title    = $self->_generateTitle(); 
    my $jstitle  = $self->_generateScriptTitle(); 
    my $tabindex = defined $self->{'_tabindex'} ? $self->{'_tabindex'} : 0;
    my $script   = $self->_generateInlineScript();
    my $modal = $self->{'_is_modal'} || 0;
    my $draggable = defined $self->{'_is_draggable'} ? $self->{'_is_draggable'} : 1;
    my $width = $self->{'_width'} || '';

    if (defined $tooltip) {
        $self->getOnloadService()->addEvent("Solstice.addToolTip('$name', '$tooltip')");
    }

    return qq|<a href="javascript:void(0);" name="$name" id="$name" tabindex="$tabindex" title="$title" onclick="Solstice.YahooUI.raisePopIn('$name',$modal, $draggable, '$width');" onmouseover="window.status='$jstitle'; return true;" onmouseout="window.status=''; return true;">$label</a>$script|;
}

sub getImageLink {
    my $self = shift;

    return $self->SUPER::getImageLink() if $self->{'_disabled'};
    return $self->getNoscriptImage() unless $self->{'_has_javascript'};
    
    my $name     = $self->{'_name'}  || '';
    my $tooltip  = $self->_generateTooltip(); 
    my $title    = $self->_generateTitle(); 
    my $jstitle  = $self->_generateScriptTitle(); 
    my $tabindex = defined $self->{'_tabindex'} ? $self->{'_tabindex'} : 0;
    my $image    = $self->{'_image'} || '';
    my $alt      = $self->{'_title'}  || '';
    my $script   = $self->_generateInlineScript();  
    my $modal = $self->{'_is_modal'} || 0;
    my $draggable = defined $self->{'_is_draggable'} ? $self->{'_is_draggable'} : 1;
    my $width = $self->{'_width'} || '';

    if (defined $tooltip) {
        $self->getOnloadService()->addEvent("Solstice.addToolTip('$name', '$tooltip')");
    }
    return qq|<a href="javascript:void(0);" name="$name" id="$name" tabindex="$tabindex" title="$title" onclick="Solstice.YahooUI.raisePopIn('$name',$modal, $draggable, '$width');" onmouseover="window.status='$jstitle'; return true;" onmouseout="window.status=''; return true;"><img src="$image" alt=""/></a>$script|;
}

sub getImageTextLink {
    my $self = shift;
    
    return $self->SUPER::getImageTextLink() if $self->{'_disabled'};
    unless ($self->{'_has_javascript'}) {
        return ($self->getNoscriptImage().' '.$self->getNoscriptButton());
    }
    
    my $name     = $self->{'_name'}  || '';
    my $label    = $self->_generateLabel(); 
    my $tooltip  = $self->_generateTooltip();
    my $title    = $self->_generateTitle(); 
    my $jstitle  = $self->_generateScriptTitle(); 
    my $tabindex = defined $self->{'_tabindex'} ? $self->{'_tabindex'} : 0;
    my $image    = $self->{'_image'} || '';
    my $script   = $self->_generateInlineScript();
    my $modal = $self->{'_is_modal'} || 0;
    my $draggable = defined $self->{'_is_draggable'} ? $self->{'_is_draggable'} : 1;
    my $width = $self->{'_width'} || '';
    
    if (defined $tooltip) {
        $self->getOnloadService()->addEvent("Solstice.addToolTip('text_link_$name', '$tooltip')");
        $self->getOnloadService()->addEvent("Solstice.addToolTip('$name', '$tooltip')");
    }
    return qq|<a href="javascript:void(0);" name="$name" id="text_link_$name" title="$title" onclick="Solstice.YahooUI.raisePopIn('$name',$modal, $draggable, '$width');" onmouseover="window.status='$jstitle'; return true;" onmouseout="window.status=''; return true;"><img src="$image" alt=""/></a> <a href="javascript:void(0);" id="$name" tabindex="$tabindex" title="$title" onclick="Solstice.YahooUI.raisePopIn('$name',$modal, $draggable, '$width');" onmouseover="window.status='$jstitle'; return true;" onmouseout="window.status=''; return true;">$label</a>$script|;
}

sub _getAccessorDefinition {
    return [
        {
            name => 'IsDraggable',
            key  => '_is_draggable',
            type => 'Integer',
        },
        {
            name    => 'Width',
            key     => '_width',
            type    => 'String',
        },
        {
            name => 'IsModal',
            key  => '_is_modal',
            type => 'Integer',
        },
    ];
}

1;
__END__