JavaScript-Toolbox

 view release on metacpan or  search on metacpan

Toolbox.pm  view on Meta::CPAN

__END__

=head1 NAME

JavaScript::Toolbox - Collection of JavaScript Tools.

=head1 SYNOPSIS

  use JavaScript::Toolbox::popUpBox;

  $popup = new JavaScript::Toolbox::popUpBox;

  $popup->content('hello');

  $popup->script();
  $popup->tag();

=head1 DESCRIPTION

Stub documentation for JavaScript::Toolbox, created by h2xs.


    .------------------.         .------------------.
    |   popUpBox       |         |   Browser        |
    |==================|<>-------|==================|
    |   javascript()   |         |   javascript()   |

Toolbox/popUpBox.pm  view on Meta::CPAN

__END__

=head1 NAME

JavaScript::Toolbox::popUpBox - JavaScript popUpBox using <div> tags.

=head1 SYNOPSIS

  use JavaScript::Toolbox::popUpBox;

  my $popup = new JavaSvript::Toolbox::popUpBox;

  $popup->javascript();
  $popup->html();


=head1 DESCRIPTION

Stub documentation for JavaScript::Toolbox, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

Toolbox/popUpBox/Browser/DOM.pm  view on Meta::CPAN

  my $code = qq{
    // -- W3C Standards Compliance -- The JavaScript::Toolbox.
    // -- DOM Level 2 JavaScript/ECMAScript language Bindings.
    function showBox(event, content) {
      var currentX,      //mouse position on X axis
          currentY,      //mouse position on X axis
          x,             //layer target position on X axis
          y,             //layer target position on Y axis
          docWidth,      //width  of current frame
          docHeight,     //height of current frame
          layerWidth,    //width  of popup layer
          layerHeight,   //height of popup layer
          popupElement;  //points to the popup element

      var name     = 'popUpBox';

      currentX     = event.clientX,
      currentY     = event.clientY;
      docHeight    = document.height;
      docWidth     = document.width;

      popupElement = document.getElementById(name);

      layerWidth   = popupElement.style.width;
      layerHeight  = popupElement.style.height;

      // -- Calculate popup new position.
      if ((currentX + layerWidth) > docWidth) {
        x = (currentX - layerWidth);
      } else {
        x = currentX;
      }

      if ((currentY + layerHeight) >= docHeight) {
        y = (currentY - layerHeight - 0);
      } else {
        y = currentY + 10;
      }

      // -- Adjust to Window Scrolling - Not part of the DOM.
      y += $scrollOffset;

      // -- Set content. Note: 'innerHTML' is not part of the
      // -- DOM Spec.  It is used here on the assumption that
      // -- it will be part of it (innerText?) and because of
      // -- its use since IE5 and Netscape 6 (this may change
      // -- to be fully standards compliant).
      //popupElement.innerHTML  = self.pageYOffset;

      // -- Set position and visibility.
      popupElement.style.left = parseInt(x);
      popupElement.style.top  = parseInt(y);

      popupElement.style.visibility = "visible";
    }
  };

  return $code;
}

sub hide {
  my $code = q{
    function hideBox() {
      var name = 'popUpBox';

Toolbox/popUpBox/Browser/IE.pm  view on Meta::CPAN

sub show {
  my $code = q{
    // -- Internet Explorer 4.x -- The JavaScript::Toolbox.
    function showBox(event, content) {
      var currentX,      //mouse position on X axis
          currentY,      //mouse position on X axis
          x,             //layer target position on X axis
          y,             //layer target position on Y axis
          docWidth,      //width  of current frame
          docHeight,     //height of current frame
          layerWidth,    //width  of popup layer
          layerHeight,   //height of popup layer
          popupElement;  //points to the popup element

      var name     = 'popUpBox';

      currentX     = event.clientX,
      currentY     = event.clientY;
      docHeight    = document.body.offsetHeight;
      docWidth     = document.body.offsetWidth;

      popupElement = document.all[name];

      layerWidth   = document.body.offsetWidth - popupElement.offsetWidth;
      layerHeight  = popupElement.offsetHeight;

      // -- Calculate popup new position.
      if ((currentX + layerWidth) > docWidth) {
        x = (currentX - layerWidth);
      } else {
        x = currentX;
      }

      if ((currentY + layerHeight) >= docHeight) {
        y = (currentY - layerHeight - 0);
      } else {
        y = currentY + 10;
      }

      y += document.body.scrollTop;

      // -- Set content.
      popupElement.innerHTML  = content;

      // -- Set position and visibility.
      popupElement.style.left = parseInt(x);
      popupElement.style.top  = parseInt(y);

      popupElement.style.visibility = "visible";
    }
  };

  return $code;
}

sub hide {
  my $code = q{
    function hideBox() {
      var name = 'popUpBox';

Toolbox/popUpBox/Browser/Netscape.pm  view on Meta::CPAN

sub show {
  my $code = q{
    // -- Netscape 4.x -- The JavaScript::Toolbox.
    function showBox(event, content) {
      var currentX,      //mouse position on X axis
          currentY,      //mouse position on X axis
          x,             //layer target position on X axis
          y,             //layer target position on Y axis
          docWidth,      //width  of current frame
          docHeight,     //height of current frame
          layerWidth,    //width  of popup layer
          layerHeight,   //height of popup layer
          popupElement;  //points to the popup element

      var name     = 'popUpBox';

      currentX     = event.pageX,
      currentY     = event.pageY;
      docHeight    = document.height;
      docWidth     = document.width;

      popupElement = document.layers[name];

      layerWidth   = popupElement.clip.width;
      layerHeight  = popupElement.clip.height;

      // -- Calculate popup new position.
      if ((currentX + layerWidth) > docWidth) {
        x = (currentX - layerWidth);
      } else {
        x = currentX;
      }

      if ((currentY + layerHeight) >= docHeight) {
        y = (currentY - layerHeight - 0);
      } else {
        y = currentY + 10;
      }

      // -- Set content.
      popupElement.document.open();
      popupElement.document.writeln(content);
      popupElement.document.close();

      // -- Set position and visibility.
      popupElement.left = parseInt(x);
      popupElement.top  = parseInt(y);

      popupElement.visibility = "show";
    }
  };

  return $code;
}

sub hide {
  my $code = q{
    function hideBox() {
      var name = 'popUpBox';



( run in 1.141 second using v1.01-cache-2.11-cpan-364913b4093 )