Solstice::JavaScriptService - Allows models at all levels to know whether the user's browser supports Javascript.


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::JavaScriptService - Allows models at all levels to know whether the user's browser supports Javascript.

SYNOPSIS

Top

  use Solstice::JavaScriptService;

DESCRIPTION

Top

Superclass

Solstice::Service

Export

No symbols exported.

Methods

new()

Creates a new Solstice::JavaScriptService object.

hasJavascript()

Returns whether or not the current user has js enabled

setHasJavascript($bool)

Private Methods

_getClassName()

Return the class name. Overridden to avoid a ref() in the superclass.

Modules Used

Solstice::Service.

AUTHOR

Top

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

VERSION

Top

$Revision: 2061 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::JavaScriptService;

# $Id:$

use 5.006_000;
use strict;
use warnings;

use base qw(Solstice::Service);

use Solstice::Session;

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

sub new {
    my $obj = shift;
    return $obj->SUPER::new(@_);
}

sub hasJavascript {
    my $self = shift;
    unless( defined $self->get('has_javascript') ){
        my $session = Solstice::Session->new();
        $self->setHasJavascript($session->hasJavascript());
    }
    return $self->get('has_javascript'); 
}

sub setHasJavascript {
    my $self = shift;
    my $has_js = shift;
    $self->set('has_javascript', $has_js);
}

sub _getClassName {
    return 'Solstice::JavaScriptService';
}


1;

__END__