Result:
found more than 457 distributions - search limited to the first 2001 files matching your query ( run in 1.494 )


Acme-Holy-Shit-Here-Come-s-An-S

 view release on metacpan or  search on metacpan

t/verify.t  view on Meta::CPAN


    local $TODO = "vianame doe'sn't know cu'stom alia'se's until 5.14" if "$]" < 5.014;
    is charnames::vianame("HOLY SHIT HERE COMES AN S"), ord("'"), "vianame";
}

is charnames::vianame("HOLY SHIT HERE COMES AN S"), undef, "not out'side 'scope";

done_testing;

 view all matches for this distribution


Acme-Hyde

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN


    $file =~ s|::|/|g;
    $file .= '.pm';

    local $@;
    return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
}

# Load CPAN.pm and it's configuration
sub _load_cpan {
    return if $CPAN::VERSION;

inc/Module/AutoInstall.pm  view on Meta::CPAN

             version->can('new') 
            ) {

            # use version.pm if it is installed.
            return (
                ( version->new($cur) >= version->new($min) ) ? $cur : undef );
        }
        elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
        {

            # use Sort::Versions as the sorting algorithm for a.b.c versions
            return ( ( Sort::Versions::versioncmp( $cur, $min ) != -1 )
                ? $cur
                : undef );
        }

        warn "Cannot reliably compare non-decimal formatted versions.\n"
          . "Please install version.pm or Sort::Versions.\n";
    }

    # plain comparison
    local $^W = 0;    # shuts off 'not numeric' bugs
    return ( $cur >= $min ? $cur : undef );
}

# nothing; this usage is deprecated.
sub main::PREREQ_PM { return {}; }

 view all matches for this distribution


Acme-ID-CompanyName

 view release on metacpan or  search on metacpan

lib/Acme/ID/CompanyName.pm  view on Meta::CPAN

                $has_added_prefix ? 0 :
                rand()*$num_words*6 > 1 ? 0 : 1;

            my $word;
            my $desired_initial = length($desired_initials) >= $j ?
                substr($desired_initials, $j-1, 1) : undef;

            if (!$will_add_prefix && $desired_initial) {
                die "There are no words that start with '$desired_initial'"
                    unless $Per_Letter_Words{$desired_initial};
                $word = $Per_Letter_Words{$desired_initial}->[

 view all matches for this distribution


Acme-IRC-Art

 view release on metacpan or  search on metacpan

lib/Acme/IRC/Art.pm  view on Meta::CPAN

 ...
 my $art = Art->new(5,5);
 $art->rectangle(0,0,4,4,2);
 for ($art->result)  {
   $connection_irc->privmsg("#channel",$_);
   select(undef,undef,undef,0.5);
 }


=head1 DESCRIPTION

 view all matches for this distribution


Acme-Ikamusume

 view release on metacpan or  search on metacpan

t/02_parser.t  view on Meta::CPAN

--- input eval
""
--- expected eval
""

=== undef
--- input eval
undef
--- expected eval
""

 view all matches for this distribution


Acme-Image-Stb

 view release on metacpan or  search on metacpan

lib/Acme/Image/Stb.pm  view on Meta::CPAN

    sub load_and_resize ( $input, $output, $scale ) {
        my ( $w, $h, $ch ) = ( 0, 0, 0 );

        # Load
        my $img = stbi_load( $input, \$w, \$h, \$ch, 4 );
        return undef if is_null($img);

        # Calculate
        my $nw      = int( $w * $scale );
        my $nh      = int( $h * $scale );
        my $out_buf = "\0" x ( $nw * $nh * 4 );

        # Resize
        my $res = stbir_resize_uint8_linear( $img, $w, $h, 0, $out_buf, $nw, $nh, 0, STBIR_RGBA );
        return undef if is_null($res);

        # Save
        stbi_write_png( $output, $nw, $nh, 4, $out_buf, 0 );
    }
}

 view all matches for this distribution


Acme-Indigest-Crypt

 view release on metacpan or  search on metacpan

lib/Acme/Indigest/Crypt.pm  view on Meta::CPAN

    my $self = shift;
    my $salt_string = shift;
    my $rounds = shift;

    defined or $_ = '' for $salt_string;
    if      ( $salt_string eq '' )  { undef $salt_string }
    elsif   ( $salt_string eq '$' ) { $salt_string = '' }
    defined and $_ = eval "$_" for $rounds;

    return ( $salt_string, $rounds );
}

 view all matches for this distribution


Acme-InputRecordSeparatorIsRegexp

 view release on metacpan or  search on metacpan

lib/Acme/InputRecordSeparatorIsRegexp.pm  view on Meta::CPAN

    return $irs;
}

sub open (*;$@) {
    no strict 'refs';        # or else bareword file handles will break
    my (undef,$mode,$expr,@list) = @_;
    if (!defined $_[0]) {
        $_[0] = Symbol::gensym;
    }
    my $glob = $_[0];
    if (!ref($glob) && $glob !~ /::/) {

lib/Acme/InputRecordSeparatorIsRegexp.pm  view on Meta::CPAN

}

sub READLINE {
    my $self = shift;
    if (wantarray) {
	local $/ = undef;
	$self->{buffer} .= readline($self->{handle});
	push @{$self->{records}}, $self->_split;
	$self->{buffer} = "";
	my @rec = splice @{$self->{records}};
	if (@rec && $self->{autochomp}) {

lib/Acme/InputRecordSeparatorIsRegexp.pm  view on Meta::CPAN

}

sub READ {
    my $self = shift;
    my $bufref = \$_[0];
    my (undef, $len, $offset) = @_;
    my $nread = 0;

    while ($len > 0 && @{$self->{records}}) {
	if (length($self->{records}[0])>=$len) {
	    my $rec = shift @{$self->{records}};

lib/Acme/InputRecordSeparatorIsRegexp.pm  view on Meta::CPAN

    } elsif (0 != length($self->{buffer})) {
	my $c = substr( $self->{buffer}, 0, 1, "" );
	return $c;
    } else {
	# eof?
	return undef;
    }
}

sub BINMODE {
    my $self = shift;

 view all matches for this distribution


Acme-Insult

 view release on metacpan or  search on metacpan

lib/Acme/Insult.pm  view on Meta::CPAN


=over

=item C<flavor>

If undefined, a random supported flavor is used.

Currently, supported flavors include:

=over

 view all matches for this distribution


Acme-Intraweb

 view release on metacpan or  search on metacpan

lib/Acme/Intraweb.pm  view on Meta::CPAN

        use CPANPLUS; use File::Spec; my $mod = $_[1];
        $mod =~ s./.::.g; $mod =~ s/.pm$//i;
        install($mod) or die "Could not install $mod\n";
        unless( $tried->{$mod}++ ) { for(@INC){ next if ref;
            if(-e "$_/$_[1]" and -r _){open (my $FH, "$_/$_[1]") or die $!;
            return $FH} } return undef;
        }
    }
}
1;

 view all matches for this distribution


Acme-JTM-Experiment

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

use ExtUtils::MakeMaker;
use File::Spec;

# from $version::LAX
my $lax_version_re =
    qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
            |
            (?:\.[0-9]+) (?:_[0-9]+)?
        ) | (?:
            v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
            |

t/00-report-prereqs.t  view on Meta::CPAN

            $file =~ s{::}{/}g;
            $file .= ".pm";
            my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;

            my $want = $req_hash->{$phase}{$type}{$mod};
            $want = "undef" unless defined $want;
            $want = "any" if !$want && $want == 0;

            my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";

            if ($prefix) {
                my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
                $have = "undef" unless defined $have;
                push @reports, [$mod, $want, $have];

                if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
                    if ( $have !~ /\A$lax_version_re\z/ ) {
                        push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";

 view all matches for this distribution


Acme-JWT

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

	# releases once we can make sure it won't clash with custom
	# Module::Install extensions.
	$VERSION = '0.91';

	# Storage for the pseudo-singleton
	$MAIN    = undef;

	*inc::Module::Install::VERSION = *VERSION;
	@inc::Module::Install::ISA     = __PACKAGE__;

}

inc/Module/Install.pm  view on Meta::CPAN

		defined $_[0]
		and
		! ref $_[0]
		and
		$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
	) ? $_[0] : undef;
}

1;

# Copyright 2008 - 2009 Adam Kennedy.

 view all matches for this distribution


Acme-JavaTrace

 view release on metacpan or  search on metacpan

t/00prereq.t  view on Meta::CPAN

use strict;
use File::Spec;
use Test::More tests => 1;

my $requires = undef;

# checking if this distribution is being installed using Module::Build
if(open(PREREQS, File::Spec->catfile('_build', 'prereqs'))) {
    # yep, so read the prereqs
    my $prereqs = eval do { local $/; <PREREQS> };

 view all matches for this distribution


Acme-Keyakizaka46

 view release on metacpan or  search on metacpan

lib/Acme/Keyakizaka46.pm  view on Meta::CPAN

=over 4

  # $type can be one of the values below:
  #  + kanji               : kanji Keyaki members
  #  + hiragana            : hiragana Keyaki members
  #  + undef               : all members

  my @members = $keyaki->team_members('kanji');

Returns the members as a list of the L<Acme::Keyakizaka46::Base>
based object represents each member. See also the documentation of

 view all matches for this distribution


Acme-LAUTER-DEUTSCHER

 view release on metacpan or  search on metacpan

lib/PerlIO/via/LAUTER_DEUTSCHER.pm  view on Meta::CPAN

    $fish = Lingua::Translate->new( src => 'en', dest => 'de' )
        or croak 'unable to translate from en to de';
}

sub unimport {
    undef $fish;
}

sub PUSHED {
    my $self = '';
    bless \$self, shift;
}

sub FILL {
    my ( $self, $fh ) = @_;
    return defined $fh ? $self->_translate(<$fh>) : undef;
}

sub WRITE {
    my ( $self, $text, $fh ) = @_;
    return 0 unless defined $text;

 view all matches for this distribution


Acme-LSD

 view release on metacpan or  search on metacpan

lib/Acme/LSD.pm  view on Meta::CPAN


sub TIEHANDLE { return bless geniosym, __PACKAGE__ }

sub PRINT {
    shift;
    local $\ = undef;

    foreach my $str (@_) {
        my $copy = $str;
        $copy =~ s/[^\w']/ /g;   # convert all non-words into spaces
        $copy =~ s/ +/ /g;       # convert all multiple spaces into single space

 view all matches for this distribution


Acme-Lambda-Expr

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		defined $_[0]
		and
		! ref $_[0]
		and
		$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
	) ? $_[0] : undef;
}

1;

# Copyright 2008 Adam Kennedy.

 view all matches for this distribution


Acme-LastWords

 view release on metacpan or  search on metacpan

lib/Acme/LastWords.pm  view on Meta::CPAN


 use Acme::LastWords;

 my $obj = Acme::LastWords->new;

 undef $obj; # will print e.g. "Dictionary."

Use your own last words:

 my $obj = Acme::LastWords->new("It's now or never");

 view all matches for this distribution



Acme-LifeUniverseEverything

 view release on metacpan or  search on metacpan

lib/Acme/LifeUniverseEverything.pm  view on Meta::CPAN

limitations of C<overload>, the following operations can't be altered:

    ## Nope, uses string --> number cast
    print "6" * "9", "\n";

    ## Nope, uses smart ++ on undef, no visible int constants affecting
    ## values of $six, $nine
    my($six, $nine);
    $six++ for (1 .. 6); $nine++ for (1..9);
    print $six * $nine, "\n";

 view all matches for this distribution


Acme-Lingua-EN-Inflect-Modern

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

use ExtUtils::MakeMaker;
use File::Spec;

# from $version::LAX
my $lax_version_re =
    qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
            |
            (?:\.[0-9]+) (?:_[0-9]+)?
        ) | (?:
            v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
            |

t/00-report-prereqs.t  view on Meta::CPAN

            $file =~ s{::}{/}g;
            $file .= ".pm";
            my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;

            my $want = $req_hash->{$phase}{$type}{$mod};
            $want = "undef" unless defined $want;
            $want = "any" if !$want && $want == 0;

            my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";

            if ($prefix) {
                my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
                $have = "undef" unless defined $have;
                push @reports, [$mod, $want, $have];

                if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
                    if ( $have !~ /\A$lax_version_re\z/ ) {
                        push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";

 view all matches for this distribution


Acme-Lingua-ZH-Remix

 view release on metacpan or  search on metacpan

lib/Acme/Lingua/ZH/Remix.pm  view on Meta::CPAN


has phrases => (is => "rw", isa => HashRef, lazy => 1, builder => "_build_phrases");

sub _build_phrases {
    my $self   = shift;
    local $/   = undef;
    my $corpus = <DATA>;
    my %phrase;
    my @phrases = $self->split_corpus($corpus);
    for (@phrases) {
        my $p = substr($_, -1);

 view all matches for this distribution


Acme-Locals

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN


    $file =~ s|::|/|g;
    $file .= '.pm';

    local $@;
    return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
}

# Load CPAN.pm and it's configuration
sub _load_cpan {
    return if $CPAN::VERSION;

inc/Module/AutoInstall.pm  view on Meta::CPAN

             version->can('new') 
            ) {

            # use version.pm if it is installed.
            return (
                ( version->new($cur) >= version->new($min) ) ? $cur : undef );
        }
        elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
        {

            # use Sort::Versions as the sorting algorithm for a.b.c versions
            return ( ( Sort::Versions::versioncmp( $cur, $min ) != -1 )
                ? $cur
                : undef );
        }

        warn "Cannot reliably compare non-decimal formatted versions.\n"
          . "Please install version.pm or Sort::Versions.\n";
    }

    # plain comparison
    local $^W = 0;    # shuts off 'not numeric' bugs
    return ( $cur >= $min ? $cur : undef );
}

# nothing; this usage is deprecated.
sub main::PREREQ_PM { return {}; }

 view all matches for this distribution


Acme-LookOfDisapproval

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

use Module::Metadata;
use File::Spec;

# from $version::LAX
my $lax_version_re =
    qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
            |
            (?:\.[0-9]+) (?:_[0-9]+)?
        ) | (?:
            v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
            |

t/00-report-prereqs.t  view on Meta::CPAN


        for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
            next if grep { $_ eq $mod } @exclude;

            my $want = $req_hash->{$phase}{$type}{$mod};
            $want = "undef" unless defined $want;
            $want = "any" if !$want && $want == 0;

            if ($mod eq 'perl') {
                push @reports, ['perl', $want, $]];
                next;

t/00-report-prereqs.t  view on Meta::CPAN

            $file .= ".pm";
            my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;

            if ($prefix) {
                my $have = Module::Metadata->new_from_file( File::Spec->catfile($prefix, $file) )->version;
                $have = "undef" unless defined $have;
                push @reports, [$mod, $want, $have];

                if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
                    if ( $have !~ /\A$lax_version_re\z/ ) {
                        push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";

 view all matches for this distribution


Acme-Loopy

 view release on metacpan or  search on metacpan

lib/Acme/Loopy.pm  view on Meta::CPAN

		};
	}
	
	sub unimport
	{
		Keyword::Simple::undefine loop => ();
	}
}

{
	package Acme::Loopy::Guard;

 view all matches for this distribution


Acme-Lvalue

 view release on metacpan or  search on metacpan

lib/Acme/Lvalue.pm  view on Meta::CPAN

		sub {
			$_[0]
				? defined $_[1]
					? $_[1]
					: 1
				: undef
		}
	],
	[exp       => sub { log $_[0] }],
	[hex       => sub { sprintf '%x', $_[0] }],
	[length    =>

 view all matches for this distribution


Acme-MCP

 view release on metacpan or  search on metacpan

lib/Acme/MCP.pm  view on Meta::CPAN

        while ( my $line = <STDIN> ) {
            chomp $line;
            my $request;
            try { $request = $json->decode($line) }
            catch ($e) {
                $self->_send_error( undef, -32700, 'Parse error' );
                next;
            }
            $self->_handle_request($request);
        }
    }

 view all matches for this distribution


Acme-MITHALDU-BleedingOpenGL

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN

  else
  {
    print "Destroying window.\n";
    glutDestroyWindow($Window_ID);
  }
  undef($Window_ID);
  print "Cleanup completed.\n";
}

sub ReleaseResources
{

test.pl  view on Meta::CPAN

    glDeleteFramebuffersEXT_p( $FrameBufferID ) if ($FrameBufferID);
  }

  if ($Shader)
  {
    undef($Shader);
  }
  elsif ($hasFragProg)
  {
    glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0);
    glDeleteProgramsARB_p( $VertexProgID ) if ($VertexProgID);

 view all matches for this distribution


Acme-MITHALDU-XSGrabBag

 view release on metacpan or  search on metacpan

inc/Inline.pm  view on Meta::CPAN

my $version_requested = 0;
my $version_printed = 0;
my $untaint = 0;
my $safemode = 0;

our $languages = undef;

our $did = '_Inline'; # Default Inline Directory

# This is the config file written by create_config_file().
our $configuration_file = 'config-' . $Config::Config{'archname'} . '-' . $];

inc/Inline.pm  view on Meta::CPAN

   GLOBAL =>       [GLOBAL_LOAD => 1],
   NOISY =>        [BUILD_NOISY => 1],
   TIMERS =>       [BUILD_TIMERS => 1],
   NOWARN =>       [WARNINGS => 0],
   _INSTALL_ =>    [_INSTALL_ => 1],
   SITE_INSTALL => undef,  # No longer supported.
  );

my $default_config =
  {
   NAME => '',

inc/Inline.pm  view on Meta::CPAN

sub env_untaint {
    my $o = shift;
        warn "In Inline::env_untaint() : Blindly untainting tainted fields in %ENV.\n" unless $o->{CONFIG}{NO_UNTAINT_WARN};

    {
    no warnings ('uninitialized'); # In case $ENV{$_} is set to undef.
      for (keys %ENV) {
          ($ENV{$_}) = $ENV{$_} =~ /(.*)/;
      }
    }

 view all matches for this distribution


Acme-MUDLike

 view release on metacpan or  search on metacpan

lib/Acme/MUDLike.pm  view on Meta::CPAN

  return req;
}

function do_request(url, callback) {
  var req = new_request();
  if(req != undefined) {
    req.onreadystatechange = function() {
      if (req.readyState == 4) { // only if req is "loaded"
        if (req.status == 200) { // only if "OK"
          if(callback) callback(req.responseText);
        } else {

lib/Acme/MUDLike.pm  view on Meta::CPAN

sub jquery {

return <<'EOF';

/* prevent execution of jQuery if included more than once */
if(typeof window.jQuery == "undefined") {
/*
 * jQuery 1.1.2 - New Wave Javascript
 *
 * Copyright (c) 2007 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)

lib/Acme/MUDLike.pm  view on Meta::CPAN

 *
 * $Date: 2007-02-28 12:03:00 -0500 (Wed, 28 Feb 2007) $
 * $Rev: 1465 $
 */

// Global undefined variable
window.undefined = window.undefined;
var jQuery = function(a,c) {
	// If the context is global, return a new object
	if ( window == this )
		return new jQuery(a,c);

lib/Acme/MUDLike.pm  view on Meta::CPAN

		// HANDLE: $(array)
		a.constructor == Array && a ||

		// HANDLE: $(arraylike)
		// Watch for when an array-like object is passed as the selector
		(a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||

		// HANDLE: $(*)
		[ a ] );
};

// Map over the $ in case of overwrite
if ( typeof $ != "undefined" )
	jQuery._$ = $;
	
// Map the jQuery namespace to the '$' one
var $ = jQuery;

lib/Acme/MUDLike.pm  view on Meta::CPAN

	},
	
	length: 0,

	get: function( num ) {
		return num == undefined ?

			// Return a 'clean' array
			jQuery.makeArray( this ) :

			// Return just the object

lib/Acme/MUDLike.pm  view on Meta::CPAN

	attr: function( key, value, type ) {
		var obj = key;
		
		// Look for the case where we're accessing a style value
		if ( key.constructor == String )
			if ( value == undefined )
				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
			else {
				obj = {};
				obj[ key ] = value;
			}
		

lib/Acme/MUDLike.pm  view on Meta::CPAN

			return jQuery.find(t,a);
		}), t );
	},
	clone: function(deep) {
		return this.pushStack( jQuery.map( this, function(a){
			var a = a.cloneNode( deep != undefined ? deep : true );
			a.$events = null; // drop $events expando to avoid firing incorrect events
			return a;
		}) );
	},

lib/Acme/MUDLike.pm  view on Meta::CPAN

	add: function(t) {
		return this.pushStack( jQuery.merge(
			this.get(),
			t.constructor == String ?
				jQuery(t).get() :
				t.length != undefined && (!t.nodeName || t.nodeName == "FORM") ?
					t : [t] )
		);
	},
	is: function(expr) {
		return expr ? jQuery.filter(expr,this).r.length > 0 : false;
	},

	val: function( val ) {
		return val == undefined ?
			( this.length ? this[0].value : null ) :
			this.attr( "value", val );
	},

	html: function( val ) {
		return val == undefined ?
			( this.length ? this[0].innerHTML : null ) :
			this.empty().append( val );
	},
	domManip: function(args, table, dir, fn){
		var clone = this.length > 1; 

lib/Acme/MUDLike.pm  view on Meta::CPAN


	// This may seem like some crazy code, but trust me when I say that this
	// is the only cross-browser way to do this. --John
	isFunction: function( fn ) {
		return !!fn && typeof fn != "string" && !fn.nodeName && 
			typeof fn[0] == "undefined" && /function/i.test( fn + "" );
	},
	
	// check if an element is in a XML document
	isXMLDoc: function(elem) {
		return elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;

lib/Acme/MUDLike.pm  view on Meta::CPAN

	nodeName: function( elem, name ) {
		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
	},
	// args is for internal usage only
	each: function( obj, fn, args ) {
		if ( obj.length == undefined )
			for ( var i in obj )
				fn.apply( obj[i], args || [i, obj[i]] );
		else
			for ( var i = 0, ol = obj.length; i < ol; i++ )
				if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break;

lib/Acme/MUDLike.pm  view on Meta::CPAN

			}

			if ( arg.length === 0 && !jQuery.nodeName(arg, "form") )
				return;
			
			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") )
				r.push( arg );
			else
				r = jQuery.merge( r, arg );

		});

lib/Acme/MUDLike.pm  view on Meta::CPAN

			readonly: "readOnly",
			selected: "selected"
		};
		
		// IE actually uses filters for opacity ... elem is actually elem.style
		if ( name == "opacity" && jQuery.browser.msie && value != undefined ) {
			// IE has trouble with opacity if it does not have layout
			// Force it by setting the zoom level
			elem.zoom = 1; 

			// Set the alpha filter to set the opacity

lib/Acme/MUDLike.pm  view on Meta::CPAN

			value = 0.9999;
			

		// Certain attributes only work when accessed via the old DOM 0 way
		if ( fix[name] ) {
			if ( value != undefined ) elem[fix[name]] = value;
			return elem[fix[name]];

		} else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
			return elem.getAttributeNode(name).nodeValue;

		// IE elem.getAttribute passes even for style
		else if ( elem.tagName ) {
			if ( value != undefined ) elem.setAttribute( name, value );
			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
				return elem.getAttribute( name, 2 );
			return elem.getAttribute( name );

		// elem is actually elem.style ... set the style
		} else {
			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
			if ( value != undefined ) elem[name] = value;
			return elem[name];
		}
	},
	trim: function(t){
		return t.replace(/^\s+|\s+$/g, "");

lib/Acme/MUDLike.pm  view on Meta::CPAN

		// Go through the array, translating each of the items to their
		// new value (or values).
		for ( var i = 0, el = elems.length; i < el; i++ ) {
			var val = fn(elems[i],i);

			if ( val !== null && val != undefined ) {
				if ( val.constructor != Array ) val = [val];
				result = result.concat( val );
			}
		}

lib/Acme/MUDLike.pm  view on Meta::CPAN

	};
});

jQuery.each( [ "height", "width" ], function(i,n){
	jQuery.fn[ n ] = function(h) {
		return h == undefined ?
			( this.length ? jQuery.css( this[0], n ) : null ) :
			this.css( n, h.constructor == String ? h : h + "px" );
	};
});
jQuery.extend({

lib/Acme/MUDLike.pm  view on Meta::CPAN

	// Bind an event to an element
	// Original by Dean Edwards
	add: function(element, type, handler, data) {
		// For whatever reason, IE has trouble passing the window object
		// around, causing it to be cloned in the process
		if ( jQuery.browser.msie && element.setInterval != undefined )
			element = window;

		// if data is passed, bind to handler
		if( data ) 
			handler.data = data;

lib/Acme/MUDLike.pm  view on Meta::CPAN

	},

	handle: function(event) {
		// Handle the second event of a trigger and when
		// an event is called after a page has unloaded
		if ( typeof jQuery == "undefined" || jQuery.event.triggered ) return;

		// Empty object is for triggered events with no data
		event = jQuery.event.fix( event || window.event || {} ); 

		// returned undefined or false
		var returnValue;

		var c = this.$events[event.type];

		var args = [].slice.call( arguments, 1 );

lib/Acme/MUDLike.pm  view on Meta::CPAN

		// Fix target property, if necessary
		if ( !event.target && event.srcElement )
			event.target = event.srcElement;

		// Calculate pageX/Y if missing and clientX/Y available
		if ( event.pageX == undefined && event.clientX != undefined ) {
			var e = document.documentElement, b = document.body;
			event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft);
			event.pageY = event.clientY + (e.scrollTop || b.scrollTop);
		}
				

lib/Acme/MUDLike.pm  view on Meta::CPAN

	// Determines if an XMLHttpRequest was successful or not
	httpSuccess: function( r ) {
		try {
			return !r.status && location.protocol == "file:" ||
				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
				jQuery.browser.safari && r.status == undefined;
		} catch(e){}
		return false;
	},

	// Determines if an XMLHttpRequest returns NotModified

lib/Acme/MUDLike.pm  view on Meta::CPAN

		try {
			var xmlRes = xml.getResponseHeader("Last-Modified");

			// Firefox always returns 200. check Last-Modified date
			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
				jQuery.browser.safari && xml.status == undefined;
		} catch(e){}
		return false;
	},

	/* Get the data out of an XMLHttpRequest.

 view all matches for this distribution


( run in 1.494 second using v1.01-cache-2.11-cpan-d80b1682f3f )