| Solstice documentation | Contained in the Solstice distribution. |
Solstice::JavaScriptService - Allows models at all levels to know whether the user's browser supports Javascript.
use Solstice::JavaScriptService;
No symbols exported.
Creates a new Solstice::JavaScriptService object.
Returns whether or not the current user has js enabled
Return the class name. Overridden to avoid a ref() in the superclass.
Catalyst Group, <catalyst@u.washington.edu>
$Revision: 2061 $
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| 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__