cvs commit: p5ee/App-Widget-JSApp/lib/App/Widget/JSApp Date.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/10/20 13:51:20

  Added:       App-Widget-JSApp/lib/App/Widget/JSApp Date.pm
  Log:
  Date.pm
  
  Revision  Changes    Path
  1.1                  p5ee/App-Widget-JSApp/lib/App/Widget/JSApp/Date.pm
  
  Index: Date.pm
  ===================================================================
  
  ######################################################################
  ## $Id: Date.pm,v 1.1 2005/10/20 20:51:20 spadkins Exp $
  ######################################################################
  
  package App::Widget::JSApp::Date;
  $VERSION = do { my @r=(q$Revision: 1.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
  
  use App::Widget::JSApp;
  @ISA = ( "App::Widget::JSApp" );
  
  use strict;
  
  =head1 NAME
  
  App::Widget::JSApp::Date - A date widget
  
  =head1 SYNOPSIS
  
     use App::Widget::JSApp::Date;
  
     ...
  
  =cut
  
  sub html {
      my $self = shift;
      my $name = $self->{name};
  
      $self->init_jsapp();
  
      my $context = $self->{context};
      my $value = $context->so_get($name);
      $value = "" if (!defined $value);
  
      my $html = <<EOF;
  <script type="text/javascript">
    context.widget("$name", {
      "serviceClass" : "DateWidget",
      "submittable" : 1,
      "default" : "$value"
    }).write();
  </script>
  EOF
  
      return($html);
  }
  
  1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.