From dc3b4522f6348091d779260fd16c0a36c8db33a3 Mon Sep 17 00:00:00 2001 From: Viliam Pucik Date: Sat, 16 Mar 2013 17:06:43 +0100 Subject: [PATCH 1/8] Mojolicious 3.89 sync --- Changes | 2 + MANIFEST.SKIP | 2 + lib/Mojo/Asset.pm | 5 +- lib/Mojo/Asset/File.pm | 23 +- lib/Mojo/Asset/Memory.pm | 16 +- lib/Mojo/Base.pm | 9 +- lib/Mojo/Collection.pm | 11 +- lib/Mojo/Content.pm | 10 +- lib/Mojo/EventEmitter.pm | 2 +- lib/Mojo/Exception.pm | 2 +- lib/Mojo/Headers.pm | 6 +- lib/Mojo/Home.pm | 11 +- lib/Mojo/IOLoop.pm | 6 +- lib/Mojo/IOLoop/Server.pm | 2 +- lib/Mojo/JSON.pm | 10 +- lib/Mojo/Log.pm | 2 +- lib/Mojo/Message.pm | 10 +- lib/Mojo/Message/Response.pm | 2 +- lib/Mojo/Parameters.pm | 5 +- lib/Mojo/Path.pm | 134 ++++++---- lib/Mojo/Reactor.pm | 2 +- lib/Mojo/Server/Daemon.pm | 8 +- lib/Mojo/Server/Hypnotoad.pm | 4 +- lib/Mojo/Server/Morbo.pm | 2 +- lib/Mojo/Server/Prefork.pm | 3 +- lib/Mojo/Template.pm | 34 +-- lib/Mojo/Transaction/WebSocket.pm | 13 +- lib/Mojo/URL.pm | 6 +- lib/Mojo/UserAgent.pm | 137 +++++----- lib/Mojo/UserAgent/CookieJar.pm | 4 +- lib/Mojo/UserAgent/Transactor.pm | 239 ++++++++++-------- lib/Mojo/Util.pm | 28 +- lib/Mojolicious.pm | 36 ++- lib/Mojolicious/Command/cpanify.pm | 4 +- lib/Mojolicious/Command/generate/app.pm | 2 +- lib/Mojolicious/Commands.pm | 9 +- lib/Mojolicious/Controller.pm | 13 +- lib/Mojolicious/Guides.pod | 10 +- lib/Mojolicious/Guides/Cookbook.pod | 54 +++- lib/Mojolicious/Guides/FAQ.pod | 11 +- lib/Mojolicious/Guides/Growing.pod | 9 +- lib/Mojolicious/Guides/Rendering.pod | 17 +- lib/Mojolicious/Guides/Routing.pod | 16 +- lib/Mojolicious/Lite.pm | 61 ++--- lib/Mojolicious/Plugin/Config.pm | 2 +- lib/Mojolicious/Plugin/DefaultHelpers.pm | 8 - lib/Mojolicious/Plugin/TagHelpers.pm | 4 +- lib/Mojolicious/Renderer.pm | 6 +- lib/Mojolicious/Routes.pm | 10 +- lib/Mojolicious/Routes/Pattern.pm | 6 +- lib/Mojolicious/public/css/prettify-mojo.css | 1 - lib/Mojolicious/public/css/prettify.css | 1 - lib/Mojolicious/public/js/jquery.js | 2 - lib/Mojolicious/public/js/lang-apollo.js | 2 - lib/Mojolicious/public/js/lang-clj.js | 18 -- lib/Mojolicious/public/js/lang-css.js | 2 - lib/Mojolicious/public/js/lang-go.js | 1 - lib/Mojolicious/public/js/lang-hs.js | 2 - lib/Mojolicious/public/js/lang-lisp.js | 3 - lib/Mojolicious/public/js/lang-lua.js | 2 - lib/Mojolicious/public/js/lang-ml.js | 2 - lib/Mojolicious/public/js/lang-n.js | 4 - lib/Mojolicious/public/js/lang-proto.js | 1 - lib/Mojolicious/public/js/lang-scala.js | 2 - lib/Mojolicious/public/js/lang-sql.js | 2 - lib/Mojolicious/public/js/lang-tex.js | 1 - lib/Mojolicious/public/js/lang-vb.js | 2 - lib/Mojolicious/public/js/lang-vhdl.js | 3 - lib/Mojolicious/public/js/lang-wiki.js | 2 - lib/Mojolicious/public/js/lang-xq.js | 3 - lib/Mojolicious/public/js/lang-yaml.js | 2 - lib/Mojolicious/public/js/prettify.js | 28 -- lib/Mojolicious/public/mojo/jquery/jquery.js | 9 +- .../templates/not_found.development.html.ep | 9 +- lib/Test/Mojo.pm | 66 +++-- lib/ojo.pm | 43 ++-- script/hypnotoad | 2 +- script/mojo | 2 +- script/morbo | 2 +- t/mojo/app.t | 6 +- t/mojo/asset.t | 62 +++-- t/mojo/cookiejar.t | 42 ++- t/mojo/json.t | 21 +- t/mojo/lib/Mojo/DeprecationTest.pm | 10 + t/mojo/path.t | 90 +++++-- t/mojo/template.t | 28 +- t/mojo/transactor.t | 89 ++++--- t/mojo/url.t | 3 +- t/mojo/user_agent.t | 8 +- t/mojo/user_agent_online.t | 10 +- t/mojo/util.t | 24 +- t/mojo/websocket.t | 7 +- t/mojolicious/charset_lite_app.t | 28 +- t/mojolicious/external/script/my_app | 2 +- t/mojolicious/lite_app.t | 17 +- t/mojolicious/ojo.t | 5 +- t/mojolicious/restful_lite_app.t | 50 ++-- t/mojolicious/routes.t | 33 +++ t/mojolicious/tag_helper_lite_app.t | 4 +- t/mojolicious/upload_lite_app.t | 26 +- t/mojolicious/upload_stream_lite_app.t | 4 +- t/pod_coverage.t | 5 +- 102 files changed, 998 insertions(+), 823 deletions(-) create mode 100644 t/mojo/lib/Mojo/DeprecationTest.pm diff --git a/Changes b/Changes index f1343cd..afc1509 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +v3.89 2013-03-14 00:00:00 + - Rebased on Mojolicious v3.89 v3.84 2013-02-04 00:00:00 - Rebased on Mojolicious v3.84 v3.70 2012-12-24 00:00:00 diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index aebfd65..0ca2d44 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -1,5 +1,7 @@ ^\.(?!perltidyrc) .*\.old$ +\.tar\.gz$ ^Makefile$ +^MYMETA\. ^blib ^pm_to_blib diff --git a/lib/Mojo/Asset.pm b/lib/Mojo/Asset.pm index aff4ad0..8ac4a26 100644 --- a/lib/Mojo/Asset.pm +++ b/lib/Mojo/Asset.pm @@ -83,9 +83,10 @@ subclass. =head2 get_chunk my $bytes = $asset->get_chunk($offset); + my $bytes = $asset->get_chunk($offset, $max); -Get chunk of data starting from a specific position. Meant to be overloaded -in a subclass. +Get chunk of data starting from a specific position, defaults to a maximum +chunk size of C<131072> bytes. Meant to be overloaded in a subclass. =head2 is_file diff --git a/lib/Mojo/Asset/File.pm b/lib/Mojo/Asset/File.pm index dada732..e65612e 100644 --- a/lib/Mojo/Asset/File.pm +++ b/lib/Mojo/Asset/File.pm @@ -22,7 +22,7 @@ has handle => sub { } # Open new or temporary file - my $base = catfile File::Spec::Functions::tmpdir, 'mojo.tmp'; + my $base = catfile $self->tmpdir, 'mojo.tmp'; my $name = defined $path ? $path : $base; until ($handle->open($name, O_CREAT | O_EXCL | O_RDWR)) { croak qq{Can't open file "$name": $!} if defined $path || $! != $!{EEXIST}; @@ -92,19 +92,20 @@ sub contains { } sub get_chunk { - my ($self, $start) = @_; + my ($self, $offset, $max) = @_; + $max = defined $max ? $max : 131072; - $start += $self->start_range; + $offset += $self->start_range; my $handle = $self->handle; - $handle->sysseek($start, SEEK_SET); + $handle->sysseek($offset, SEEK_SET); my $buffer; if (defined(my $end = $self->end_range)) { - my $chunk = $end + 1 - $start; + my $chunk = $end + 1 - $offset; return '' if $chunk <= 0; - $handle->sysread($buffer, $chunk > 131072 ? 131072 : $chunk); + $handle->sysread($buffer, $chunk > $max ? $max : $chunk); } - else { $handle->sysread($buffer, 131072) } + else { $handle->sysread($buffer, $max) } return $buffer; } @@ -199,7 +200,7 @@ necessary. $file = $file->tmpdir('/tmp'); Temporary directory used to generate C, defaults to the value of the -C environment variable or auto detection. +MOJO_TMPDIR environment variable or auto detection. =head1 METHODS @@ -220,9 +221,11 @@ Check if asset contains a specific string. =head2 get_chunk - my $bytes = $file->get_chunk($start); + my $bytes = $file->get_chunk($offset); + my $bytes = $file->get_chunk($offset, $max); -Get chunk of data starting from a specific position. +Get chunk of data starting from a specific position, defaults to a maximum +chunk size of C<131072> bytes. =head2 is_file diff --git a/lib/Mojo/Asset/Memory.pm b/lib/Mojo/Asset/Memory.pm index 24b20f4..206179f 100644 --- a/lib/Mojo/Asset/Memory.pm +++ b/lib/Mojo/Asset/Memory.pm @@ -32,15 +32,15 @@ sub contains { } sub get_chunk { - my ($self, $start) = @_; + my ($self, $offset, $max) = @_; + $max = defined $max ? $max : 131072; - $start += $self->start_range; - my $size = 131072; + $offset += $self->start_range; if (my $end = $self->end_range) { - $size = $end + 1 - $start if ($start + $size) > $end; + $max = $end + 1 - $offset if ($offset + $max) > $end; } - return substr shift->{content}, $start, $size; + return substr shift->{content}, $offset, $max; } sub move_to { @@ -110,7 +110,7 @@ automatically upgrade to a L object. Maximum size in bytes of data to keep in memory before automatically upgrading to a L object, defaults to the value of the -C environment variable or C<262144>. +MOJO_MAX_MEMORY_SIZE environment variable or C<262144>. =head1 METHODS @@ -139,8 +139,10 @@ Check if asset contains a specific string. =head2 get_chunk my $bytes = $mem->get_chunk($offset); + my $bytes = $mem->get_chunk($offset, $max); -Get chunk of data starting from a specific position. +Get chunk of data starting from a specific position, defaults to a maximum +chunk size of C<131072> bytes. =head2 move_to diff --git a/lib/Mojo/Base.pm b/lib/Mojo/Base.pm index f4c34d4..78a60d2 100644 --- a/lib/Mojo/Base.pm +++ b/lib/Mojo/Base.pm @@ -35,7 +35,7 @@ sub import { push @{"${caller}::ISA"}, $flag; *{"${caller}::has"} = sub { attr($caller, @_) }; } - + my $caller = caller; *{"${caller}::say"} = sub { say(@_) }; @@ -43,7 +43,6 @@ sub import { strict->import; warnings->import; utf8->import; - feature->import(':5.10'); } sub new { @@ -224,13 +223,9 @@ argument. K combinator, tap into a method chain to perform operations on an object within the chain. -=head2 C - -Backported from perl-5.10.1 - =head1 DEBUGGING -You can set the C environment variable to get some advanced +You can set the MOJO_BASE_DEBUG environment variable to get some advanced diagnostics information printed to C. MOJO_BASE_DEBUG=1 diff --git a/lib/Mojo/Collection.pm b/lib/Mojo/Collection.pm index 4e006a1..9e9a2c7 100644 --- a/lib/Mojo/Collection.pm +++ b/lib/Mojo/Collection.pm @@ -28,16 +28,15 @@ sub each { sub first { my ($self, $cb) = @_; - return $cb ? do { (ref $cb) eq 'CODE' ? List::Util::first { $cb->($_) } @$self : List::Util::first { $_ =~ $cb } @$self } : $self->[0]; + return $self->[0] unless $cb; + return List::Util::first { $cb->($_) } @$self if ref $cb eq 'CODE'; + return List::Util::first { $_ =~ $cb } @$self; } sub grep { my ($self, $cb) = @_; - if ((ref $cb) eq 'CODE') { - return $self->new(grep { $cb->($_) } @$self); - } else { - return $self->new(grep { $_ =~ $cb } @$self); - } + return $self->new(grep { $cb->($_) } @$self) if ref $cb eq 'CODE'; + return $self->new(grep { $_ =~ $cb } @$self); } sub join { diff --git a/lib/Mojo/Content.pm b/lib/Mojo/Content.pm index 08a7f83..159d487 100644 --- a/lib/Mojo/Content.pm +++ b/lib/Mojo/Content.pm @@ -72,7 +72,7 @@ sub is_chunked { !!shift->headers->transfer_encoding } sub is_compressed { (shift->headers->content_encoding || '') =~ /^gzip$/i } -sub is_dynamic { $_[0]->{dynamic} && !defined $_[0]->headers->content_length } +sub is_dynamic { $_[0]{dynamic} && !defined $_[0]->headers->content_length } sub is_finished { my $tmp = shift->{state}; (defined $tmp ? $tmp : '') eq 'finished' } @@ -293,13 +293,13 @@ sub _uncompress { # Uncompress $self->{post_buffer} .= $chunk; my $gz = $self->{gz} = defined $self->{gz} ? $self->{gz} : - Compress::Raw::Zlib::Inflate->new(WindowBits => WANT_GZIP()); + Compress::Raw::Zlib::Inflate->new(WindowBits => WANT_GZIP); my $status = $gz->inflate(\$self->{post_buffer}, my $out); $self->emit(read => $out) if defined $out; # Replace Content-Encoding with Content-Length $self->headers->content_length($gz->total_out)->remove('Content-Encoding') - if $status == Z_STREAM_END(); + if $status == Z_STREAM_END; # Check buffer size $self->{limit} = $self->{state} = 'finished' @@ -398,7 +398,7 @@ Content headers, defaults to a L object. $content = $content->max_buffer_size(1024); Maximum size in bytes of buffer for content parser, defaults to the value of -the C environment variable or C<262144>. +the MOJO_MAX_BUFFER_SIZE environment variable or C<262144>. =head2 max_leftover_size @@ -406,7 +406,7 @@ the C environment variable or C<262144>. $content = $content->max_leftover_size(1024); Maximum size in bytes of buffer for pipelined HTTP requests, defaults to the -value of the C environment variable or C<262144>. +value of the MOJO_MAX_LEFTOVER_SIZE environment variable or C<262144>. =head2 relaxed diff --git a/lib/Mojo/EventEmitter.pm b/lib/Mojo/EventEmitter.pm index f9ecb08..4e20235 100644 --- a/lib/Mojo/EventEmitter.pm +++ b/lib/Mojo/EventEmitter.pm @@ -198,7 +198,7 @@ Unsubscribe from event. =head1 DEBUGGING -You can set the C environment variable to get some +You can set the MOJO_EVENTEMITTER_DEBUG environment variable to get some advanced diagnostics information printed to C. MOJO_EVENTEMITTER_DEBUG=1 diff --git a/lib/Mojo/Exception.pm b/lib/Mojo/Exception.pm index a42d858..d8f8581 100644 --- a/lib/Mojo/Exception.pm +++ b/lib/Mojo/Exception.pm @@ -177,7 +177,7 @@ Exception message. $e = $e->verbose(1); Activate verbose rendering, defaults to the value of the -C environment variable or C<0>. +MOJO_EXCEPTION_VERBOSE environment variable or C<0>. =head1 METHODS diff --git a/lib/Mojo/Headers.pm b/lib/Mojo/Headers.pm index 4d3d02c..d8740b3 100644 --- a/lib/Mojo/Headers.pm +++ b/lib/Mojo/Headers.pm @@ -201,7 +201,7 @@ L implements the following attributes. $headers = $headers->max_line_size(1024); Maximum header line size in bytes, defaults to the value of the -C environment variable or C<10240>. +MOJO_MAX_LINE_SIZE environment variable or C<10240>. =head1 METHODS @@ -500,8 +500,8 @@ Shortcut for the C header from RFC 6455. =head2 sec_websocket_protocol - my $protocol = $headers->sec_websocket_protocol; - $headers = $headers->sec_websocket_protocol('sample'); + my $proto = $headers->sec_websocket_protocol; + $headers = $headers->sec_websocket_protocol('sample'); Shortcut for the C header from RFC 6455. diff --git a/lib/Mojo/Home.pm b/lib/Mojo/Home.pm index 2fd932e..1643de3 100644 --- a/lib/Mojo/Home.pm +++ b/lib/Mojo/Home.pm @@ -10,7 +10,7 @@ use File::Basename 'dirname'; use File::Find 'find'; use File::Spec::Functions qw(abs2rel catdir catfile splitdir); use FindBin; -use Mojo::Util qw(class_to_path slurp); +use Mojo::Util qw(class_to_path deprecated slurp); sub new { shift->SUPER::new->parse(@_) } @@ -82,9 +82,8 @@ sub rel_file { catfile(@{shift->{parts} || []}, split '/', shift) } # DEPRECATED in Rainbow! sub slurp_rel_file { - warn <slurp_rel_file is DEPRECATED in favor of Mojo::Util->slurp!!! -EOF + deprecated + 'Mojo::Home::slurp_rel_file is DEPRECATED in favor of Mojo::Util::slurp'; slurp shift->rel_file(@_); } @@ -128,8 +127,8 @@ Construct a new L object. $home = $home->detect; $home = $home->detect('My::App'); -Detect home directory from the value of the C environment variable -or application class. +Detect home directory from the value of the MOJO_HOME environment variable or +application class. =head2 lib_dir diff --git a/lib/Mojo/IOLoop.pm b/lib/Mojo/IOLoop.pm index 9561a3b..15457cd 100644 --- a/lib/Mojo/IOLoop.pm +++ b/lib/Mojo/IOLoop.pm @@ -334,8 +334,8 @@ solid and scalable non-blocking TCP clients and servers. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently, and used if installed. -Individual features can also be disabled with the C and -C environment variables. +Individual features can also be disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS +environment variables. A TLS certificate and key are also built right in, to make writing test servers as easy as possible. Also note that for convenience the C signal @@ -614,7 +614,7 @@ seconds. =head1 DEBUGGING -You can set the C environment variable to get some advanced +You can set the MOJO_IOLOOP_DEBUG environment variable to get some advanced diagnostics information printed to C. MOJO_IOLOOP_DEBUG=1 diff --git a/lib/Mojo/IOLoop/Server.pm b/lib/Mojo/IOLoop/Server.pm index 21cd794..4650334 100644 --- a/lib/Mojo/IOLoop/Server.pm +++ b/lib/Mojo/IOLoop/Server.pm @@ -109,7 +109,7 @@ sub start { $self->{handle} => sub { $self->_accept for 1 .. $self->multi_accept }); } -sub stop { $_[0]->reactor->remove($_[0]->{handle}) } +sub stop { $_[0]->reactor->remove($_[0]{handle}) } sub _accept { my $self = shift; diff --git a/lib/Mojo/JSON.pm b/lib/Mojo/JSON.pm index f08d17a..644fa20 100644 --- a/lib/Mojo/JSON.pm +++ b/lib/Mojo/JSON.pm @@ -98,7 +98,7 @@ sub decode { sub encode { my ($self, $ref) = @_; - return Mojo::Util::encode 'UTF-8', _encode_values($ref); + return Mojo::Util::encode 'UTF-8', _encode_value($ref); } sub false {$FALSE} @@ -251,12 +251,12 @@ sub _decode_value { sub _encode_array { my $array = shift; - return '[' . join(',', map { _encode_values($_) } @$array) . ']'; + return '[' . join(',', map { _encode_value($_) } @$array) . ']'; } sub _encode_object { my $object = shift; - my @pairs = map { _encode_string($_) . ':' . _encode_values($object->{$_}) } + my @pairs = map { _encode_string($_) . ':' . _encode_value($object->{$_}) } keys %$object; return '{' . join(',', @pairs) . '}'; } @@ -267,7 +267,7 @@ sub _encode_string { return "\"$string\""; } -sub _encode_values { +sub _encode_value { my $value = shift; # Reference @@ -285,7 +285,7 @@ sub _encode_values { # Blessed reference with TO_JSON method if (blessed $value && (my $sub = $value->can('TO_JSON'))) { - return _encode_values($value->$sub); + return _encode_value($value->$sub); } } diff --git a/lib/Mojo/Log.pm b/lib/Mojo/Log.pm index bb33ffe..e870479 100644 --- a/lib/Mojo/Log.pm +++ b/lib/Mojo/Log.pm @@ -131,7 +131,7 @@ or C. my $level = $log->level; $log = $log->level('debug'); -Active log level, defaults to the value of the C environment +Active log level, defaults to the value of the MOJO_LOG_LEVEL environment variable or C. These levels are currently available: diff --git a/lib/Mojo/Message.pm b/lib/Mojo/Message.pm index f988d8e..0330679 100644 --- a/lib/Mojo/Message.pm +++ b/lib/Mojo/Message.pm @@ -436,7 +436,7 @@ Default charset used for form data parsing, defaults to C. $msg = $msg->max_line_size(1024); Maximum start line size in bytes, defaults to the value of the -C environment variable or C<10240>. +MOJO_MAX_LINE_SIZE environment variable or C<10240>. =head2 max_message_size @@ -444,10 +444,10 @@ C environment variable or C<10240>. $msg = $msg->max_message_size(1024); Maximum message size in bytes, defaults to the value of the -C environment variable or C<5242880>. Note that -increasing this value can also drastically increase memory usage, should you -for example attempt to parse an excessively large message body with the -C, C or C methods. +MOJO_MAX_MESSAGE_SIZE environment variable or C<5242880>. Note that increasing +this value can also drastically increase memory usage, should you for example +attempt to parse an excessively large message body with the C, +C or C methods. =head2 version diff --git a/lib/Mojo/Message/Response.pm b/lib/Mojo/Message/Response.pm index 9f0ceb7..dd8382a 100644 --- a/lib/Mojo/Message/Response.pm +++ b/lib/Mojo/Message/Response.pm @@ -214,7 +214,7 @@ Generate default response message for code. =head2 extract_start_line - my $success = $req->extract_start_line(\$string); + my $success = $res->extract_start_line(\$string); Extract status line from string. diff --git a/lib/Mojo/Parameters.pm b/lib/Mojo/Parameters.pm index 1bc5017..9f9a622 100644 --- a/lib/Mojo/Parameters.pm +++ b/lib/Mojo/Parameters.pm @@ -280,7 +280,10 @@ Merge L objects. my $foo = $params->param(foo => 'ba;r'); my @foo = $params->param(foo => qw(ba;r ba;z)); -Check and replace parameter values. +Check and replace parameter value. Be aware that if you request a parameter by +name in scalar context, you will receive only the I value for that +parameter, if there are multiple values for that name. In list context you +will receive I of the values for that name. =head2 params diff --git a/lib/Mojo/Path.pm b/lib/Mojo/Path.pm index a0b6388..a8e453f 100644 --- a/lib/Mojo/Path.pm +++ b/lib/Mojo/Path.pm @@ -8,8 +8,6 @@ use overload use Mojo::Util qw(decode encode url_escape url_unescape); has charset => 'UTF-8'; -has [qw(leading_slash trailing_slash)]; -has parts => sub { [] }; sub new { shift->SUPER::new->parse(@_) } @@ -37,25 +35,25 @@ sub canonicalize { } sub clone { - my $self = shift; - my $clone = Mojo::Path->new; - $clone->leading_slash($self->leading_slash); - $clone->trailing_slash($self->trailing_slash); - return $clone->charset($self->charset)->parts([@{$self->parts}]); + my $self = shift; + + my $clone = Mojo::Path->new->charset($self->charset); + if (my $parts = $self->{parts}) { + $clone->{$_} = $self->{$_} for qw(leading_slash trailing_slash); + $clone->{parts} = [@$parts]; + } + else { $clone->{path} = $self->{path} } + + return $clone; } sub contains { my ($self, $path) = @_; - - my $parts = $self->new($path)->parts; - for my $part (@{$self->parts}) { - return 1 unless defined(my $try = shift @$parts); - return undef unless $part eq $try; - } - - return !@$parts; + return $path eq '/' || $self->to_route =~ m!^\Q$path\E(?:/|$)!; } +sub leading_slash { shift->_parse(leading_slash => @_) } + sub merge { my ($self, $path) = @_; @@ -70,19 +68,19 @@ sub merge { } sub parse { - my ($self, $path) = @_; + my $self = shift; + $self->{path} = shift; + delete $self->{$_} for qw(leading_slash parts trailing_slash); + return $self; +} - $path = url_unescape defined $path ? $path : ''; - my $charset = $self->charset; - $path = do { my $tmp = decode($charset, $path); defined $tmp ? $tmp : $path } if $charset; - $self->leading_slash($path =~ s!^/!! ? 1 : undef); - $self->trailing_slash($path =~ s!/$!! ? 1 : undef); +sub parts { shift->_parse(parts => @_) } - return $self->parts([split '/', $path, -1]); +sub to_abs_string { + my $path = shift->to_string; + return $path =~ m!^/! ? $path : "/$path"; } -sub to_abs_string { $_[0]->leading_slash ? "$_[0]" : "/$_[0]" } - sub to_dir { my $clone = shift->clone; pop @{$clone->parts} unless $clone->trailing_slash; @@ -90,24 +88,50 @@ sub to_dir { } sub to_route { - my $self = shift; - return '/' . join('/', @{$self->parts}) . ($self->trailing_slash ? '/' : ''); + my $clone = shift->clone; + my $route = join '/', @{$clone->parts}; + return "/$route" . ($clone->trailing_slash ? '/' : ''); } sub to_string { my $self = shift; - my @parts = @{$self->parts}; + # Path my $charset = $self->charset; + if (defined(my $path = $self->{path})) { + $path = encode $charset, $path if $charset; + return url_escape $path, '^A-Za-z0-9\-._~!$&\'()*+,;=%:@/'; + } + + # Build path + my @parts = @{$self->parts}; @parts = map { encode $charset, $_ } @parts if $charset; my $path = join '/', map { url_escape $_, '^A-Za-z0-9\-._~!$&\'()*+,;=:@' } @parts; $path = "/$path" if $self->leading_slash; $path = "$path/" if $self->trailing_slash; - return $path; } +sub trailing_slash { shift->_parse(trailing_slash => @_) } + +sub _parse { + my ($self, $name) = (shift, shift); + + unless ($self->{parts}) { + my $path = url_unescape do {my $tmp = delete($self->{path}); defined $tmp ? $tmp : ''}; + my $charset = $self->charset; + $path = do {my $tmp = decode($charset, $path); defined $tmp ? $tmp : $path} if $charset; + $self->{leading_slash} = $path =~ s!^/!! ? 1 : undef; + $self->{trailing_slash} = $path =~ s!/$!! ? 1 : undef; + $self->{parts} = [split '/', $path, -1]; + } + + return $self->{$name} unless @_; + $self->{$name} = shift; + return $self; +} + 1; =encoding utf8 @@ -126,7 +150,9 @@ Mojo::Path - Path =head1 DESCRIPTION -L is a container for URL paths. +L is a container for URL paths. Note that C<%2F> will be treated +as C for security reasons if the path has to be normalized for an +operation. =head1 ATTRIBUTES @@ -142,30 +168,6 @@ Charset used for encoding and decoding, defaults to C. # Disable encoding and decoding $path->charset(undef); -=head2 leading_slash - - my $leading_slash = $path->leading_slash; - $path = $path->leading_slash(1); - -Path has a leading slash. - -=head2 parts - - my $parts = $path->parts; - $path = $path->parts([qw(foo bar baz)]); - -The path parts. - - # Part with slash - push @{$path->parts}, 'foo/bar'; - -=head2 trailing_slash - - my $trailing_slash = $path->trailing_slash; - $path = $path->trailing_slash(1); - -Path has a trailing slash. - =head1 METHODS L inherits all methods from L and implements the @@ -209,6 +211,13 @@ Check if path contains given prefix. Mojo::Path->new('/foo/bar')->contains('/bar'); Mojo::Path->new('/foo/bar')->contains('/whatever'); +=head2 leading_slash + + my $slash = $path->leading_slash; + $path = $path->leading_slash(1); + +Path has a leading slash. + =head2 merge $path = $path->merge('/foo/bar'); @@ -230,7 +239,7 @@ Merge paths. $path = $path->parse('/foo%2Fbar%3B/baz.html'); -Parse path. Note that C<%2F> will be treated as C for security reasons. +Parse path. =head2 to_abs_string @@ -241,6 +250,16 @@ Turn path into an absolute string. # "/i/%E2%99%A5/mojolicious" Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_abs_string; +=head2 parts + + my $parts = $path->parts; + $path = $path->parts([qw(foo bar baz)]); + +The path parts. + + # Part with slash + push @{$path->parts}, 'foo/bar'; + =head2 to_dir my $dir = $route->to_dir; @@ -269,6 +288,13 @@ Turn path into a string. # "i/%E2%99%A5/mojolicious" Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_string; +=head2 trailing_slash + + my $slash = $path->trailing_slash; + $path = $path->trailing_slash(1); + +Path has a trailing slash. + =head1 SEE ALSO L, L, L. diff --git a/lib/Mojo/Reactor.pm b/lib/Mojo/Reactor.pm index 4ebaacc..fb3c7a1 100644 --- a/lib/Mojo/Reactor.pm +++ b/lib/Mojo/Reactor.pm @@ -89,7 +89,7 @@ implements the following new ones. my $class = Mojo::Reactor->detect; Detect and load the best reactor implementation available, will try the value -of the C environment variable, L or +of the MOJO_REACTOR environment variable, L or L. # Instantiate best reactor implementation available diff --git a/lib/Mojo/Server/Daemon.pm b/lib/Mojo/Server/Daemon.pm index a3a26c9..6076fb8 100644 --- a/lib/Mojo/Server/Daemon.pm +++ b/lib/Mojo/Server/Daemon.pm @@ -298,7 +298,7 @@ multiple event loop support. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently through L, and used if installed. Individual features can also be -disabled with the C and C environment variables. +disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables. See L for more. @@ -331,7 +331,7 @@ Group for server process. $daemon = $daemon->inactivity_timeout(5); Maximum amount of time in seconds a connection can be inactive before getting -closed, defaults to the value of the C environment +closed, defaults to the value of the MOJO_INACTIVITY_TIMEOUT environment variable or C<15>. Setting the value to C<0> will allow connections to be inactive indefinitely. @@ -349,7 +349,7 @@ L singleton. $daemon = $daemon->listen(['https://localhost:3000']); List of one or more locations to listen on, defaults to the value of the -C environment variable or C. +MOJO_LISTEN environment variable or C. # Listen on IPv6 interface $daemon->listen(['http://[::1]:4000']); @@ -445,7 +445,7 @@ Stop accepting connections. =head1 DEBUGGING -You can set the C environment variable to get some advanced +You can set the MOJO_DAEMON_DEBUG environment variable to get some advanced diagnostics information printed to C. MOJO_DAEMON_DEBUG=1 diff --git a/lib/Mojo/Server/Hypnotoad.pm b/lib/Mojo/Server/Hypnotoad.pm index a7a74b5..d7e5ef0 100644 --- a/lib/Mojo/Server/Hypnotoad.pm +++ b/lib/Mojo/Server/Hypnotoad.pm @@ -181,7 +181,7 @@ C mode. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently through L, and used if installed. Individual features can also be -disabled with the C and C environment variables. +disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables. See L for more. @@ -364,7 +364,7 @@ the server has been stopped. Activate reverse proxy support, which allows for the C and C headers to be picked up automatically, defaults to the -value of the C environment variable. +value of the MOJO_REVERSE_PROXY environment variable. =head2 upgrade_timeout diff --git a/lib/Mojo/Server/Morbo.pm b/lib/Mojo/Server/Morbo.pm index c406dba..3ac7bc5 100644 --- a/lib/Mojo/Server/Morbo.pm +++ b/lib/Mojo/Server/Morbo.pm @@ -127,7 +127,7 @@ To start applications with it you can use the L script. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently through L, and used if installed. Individual features can also be -disabled with the C and C environment variables. +disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables. See L for more. diff --git a/lib/Mojo/Server/Prefork.pm b/lib/Mojo/Server/Prefork.pm index 46036e9..7144749 100644 --- a/lib/Mojo/Server/Prefork.pm +++ b/lib/Mojo/Server/Prefork.pm @@ -208,7 +208,6 @@ sub _spawn { $SIG{QUIT} = sub { $loop->max_connections(0) }; delete $self->{$_} for qw(poll reader); - # Start event loop $self->app->log->debug("Worker $$ started."); $loop->start; exit 0; @@ -261,7 +260,7 @@ applications. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently through L, and used if installed. Individual features can also be -disabled with the C and C environment variables. +disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables. See L for more. diff --git a/lib/Mojo/Template.pm b/lib/Mojo/Template.pm index 28118e8..8a1ab59 100644 --- a/lib/Mojo/Template.pm +++ b/lib/Mojo/Template.pm @@ -140,7 +140,6 @@ sub parse { my $end = $self->tag_end; my $start = $self->line_start; - # Precompile my $token_re = qr/ ( \Q$tag$replace\E # Replace @@ -177,25 +176,20 @@ sub parse { for my $line (split /\n/, $tmpl) { $trimming = 0 if $state eq 'text'; - # Perl line + # Turn Perl line into mixed line if ($state eq 'text' && $line !~ s/^(\s*)\Q$start$replace\E/$1$start/) { - $line =~ s/^(\s*)\Q$start\E(\Q$expr\E)?// - and $line = $2 ? "$1$tag$2$line $end" : "$tag$line $trim$end"; - } - - # Escaped line ending - if ($line =~ /(\\+)$/) { - my $len = length $1; + if ($line =~ s/^(\s*)\Q$start\E(?:(\Q$cmnt\E)|(\Q$expr\E))?//) { - # Newline - if ($len == 1) { $line =~ s/\\$// } + # Comment + if ($2) { $line = "$tag$2 $trim$end" } - # Backslash - elsif ($len > 1) { $line =~ s/\\\\$/\\\n/ } + # Expression or code + else { $line = $3 ? "$1$tag$3$line $end" : "$tag$line $trim$end" } + } } - # Normal line ending - else { $line .= "\n" } + # Escaped line ending + $line .= "\n" unless $line =~ s/\\\\$/\\\n/ || $line =~ s/\\$//; # Mixed line my @token; @@ -233,7 +227,7 @@ sub parse { # Comment elsif ($token =~ /^\Q$tag$cmnt\E$/) { $state = 'cmnt' } - # Value + # Text else { # Replace @@ -280,7 +274,7 @@ sub _trim { # Walk line backwards for (my $j = @$line - 4; $j >= 0; $j -= 2) { - # Skip capture + # Skip captures next if grep { $_ eq $line->[$j] } qw(cpst cpen); # Only trim text @@ -383,7 +377,7 @@ automatically enabled. % Perl code line, treated as "<% line =%>" %= Perl expression line, treated as "<%= line %>" %== Perl expression line, treated as "<%== line %>" - %# Comment line, treated as "<%# line =%>" + %# Comment line, useful for debugging %% Replaced with "%", useful for generating templates Escaping behavior can be reversed with the C attribute, this is @@ -693,8 +687,8 @@ Render template file. =head1 DEBUGGING -You can set the C environment variable to get some -advanced diagnostics information printed to C. +You can set the MOJO_TEMPLATE_DEBUG environment variable to get some advanced +diagnostics information printed to C. MOJO_TEMPLATE_DEBUG=1 diff --git a/lib/Mojo/Transaction/WebSocket.pm b/lib/Mojo/Transaction/WebSocket.pm index 446cb24..bf88292 100644 --- a/lib/Mojo/Transaction/WebSocket.pm +++ b/lib/Mojo/Transaction/WebSocket.pm @@ -7,8 +7,9 @@ use Mojo::Util qw(b64_encode decode encode sha1_bytes xor_encode); use constant DEBUG => $ENV{MOJO_WEBSOCKET_DEBUG} || 0; -# 64bit Perl -use constant MODERN => $Config{ivsize} > 4; +# Perl with support for quads +use constant MODERN => + ((defined $Config{use64bitint} ? $Config{use64bitint} : '') eq 'define' || $Config{longsize} >= 8); # Unique value from the spec use constant GUID => '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; @@ -416,7 +417,7 @@ Mask outgoing frames with XOR cipher and a random 32bit key. $ws = $ws->max_websocket_size(1024); Maximum WebSocket message size in bytes, defaults to the value of the -C environment variable or C<262144>. +MOJO_MAX_WEBSOCKET_SIZE environment variable or C<262144>. =head1 METHODS @@ -425,7 +426,7 @@ L and implements the following new ones. =head2 new - my $multi = Mojo::Content::MultiPart->new; + my $ws = Mojo::Transaction::WebSocket->new; Construct a new L object and subscribe to C event with default message parser, which also handles C and @@ -595,8 +596,8 @@ Write data server-side, used to implement web servers. =head1 DEBUGGING -You can set the C environment variable to get some -advanced diagnostics information printed to C. +You can set the MOJO_WEBSOCKET_DEBUG environment variable to get some advanced +diagnostics information printed to C. MOJO_WEBSOCKET_DEBUG=1 diff --git a/lib/Mojo/URL.pm b/lib/Mojo/URL.pm index ba442e1..85f973b 100644 --- a/lib/Mojo/URL.pm +++ b/lib/Mojo/URL.pm @@ -45,13 +45,9 @@ sub clone { my $self = shift; my $clone = Mojo::URL->new; - $clone->scheme($self->scheme); - $clone->userinfo($self->userinfo); - $clone->host($self->host); - $clone->port($self->port); + $clone->$_($self->$_) for qw(scheme userinfo host port fragment); $clone->path($self->path->clone); $clone->query($self->query->clone); - $clone->fragment($self->fragment); $clone->base($self->base->clone) if $self->{base}; return $clone; diff --git a/lib/Mojo/UserAgent.pm b/lib/Mojo/UserAgent.pm index 2a5c321..6517f48 100644 --- a/lib/Mojo/UserAgent.pm +++ b/lib/Mojo/UserAgent.pm @@ -8,7 +8,7 @@ use List::Util 'first'; use Mojo::IOLoop; use Mojo::Server::Daemon; use Mojo::URL; -use Mojo::Util 'monkey_patch'; +use Mojo::Util qw(deprecated monkey_patch); use Mojo::UserAgent::CookieJar; use Mojo::UserAgent::Transactor; use Scalar::Util 'weaken'; @@ -59,8 +59,20 @@ sub app_url { return Mojo::URL->new("$self->{proto}://localhost:$self->{port}/"); } -sub build_form_tx { shift->transactor->form(@_) } -sub build_json_tx { shift->transactor->json(@_) } +# DEPRECATED in Rainbow! +sub build_form_tx { + deprecated 'Mojo::UserAgent::build_form_tx is DEPRECATED in favor of ' + . 'Mojo::UserAgent::build_tx'; + shift->transactor->form(@_); +} + +# DEPRECATED in Rainbow! +sub build_json_tx { + deprecated 'Mojo::UserAgent::build_json_tx is DEPRECATED in favor of ' + . 'Mojo::UserAgent::build_tx'; + shift->transactor->json(@_); +} + sub build_tx { shift->transactor->tx(@_) } sub build_websocket_tx { shift->transactor->websocket(@_) } @@ -76,13 +88,19 @@ sub need_proxy { return !first { $host =~ /\Q$_\E$/ } @{$self->no_proxy || []}; } +# DEPRECATED in Rainbow! sub post_form { + deprecated 'Mojo::UserAgent::post_form is DEPRECATED in favor of ' + . 'Mojo::UserAgent::post'; my $self = shift; my $cb = ref $_[-1] eq 'CODE' ? pop : undef; return $self->start($self->build_form_tx(@_), $cb); } +# DEPRECATED in Rainbow! sub post_json { + deprecated 'Mojo::UserAgent::post_json is DEPRECATED in favor of ' + . 'Mojo::UserAgent::post'; my $self = shift; my $cb = ref $_[-1] eq 'CODE' ? pop : undef; return $self->start($self->build_json_tx(@_), $cb); @@ -114,8 +132,6 @@ sub start { delete $self->{nb}; } $self->_start($tx => sub { $tx = pop }); - - # Start event loop $self->ioloop->start; return $tx; @@ -421,7 +437,8 @@ sub _start { my $url = $req->url; if ($self->{port} || !$url->is_abs) { if (my $app = $self->app) { $self->_server->app($app) } - $url = $req->url($url->base($self->app_url)->to_abs)->url + my $base = $self->app_url; + $url->scheme($base->scheme)->authority($base->authority) unless $url->is_abs; } @@ -504,7 +521,7 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent say $ua->get('www.☃.net?hello=there' => {DNT => 1})->res->body; # Form POST with exception handling - my $tx = $ua->post_form('search.cpan.org/search' => {q => 'mojo'}); + my $tx = $ua->post('search.cpan.org/search' => form => {q => 'mojo'}); if (my $res = $tx->success) { say $res->body } else { my ($err, $code) = $tx->error; @@ -532,12 +549,7 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent # TLS certificate authentication and JSON POST my $tx = $ua->cert('tls.crt')->key('tls.key') - ->post_json('https://mojolicio.us' => {top => 'secret'}); - - # Custom JSON PUT request - my $tx = $ua->build_json_tx('http://mojolicious/foo' => {hi => 'there'}); - $tx->req->method('PUT'); - say $ua->start($tx)->res->body; + ->post('https://mojolicio.us' => json => {top => 'secret'}); # Blocking parallel requests (does not work inside a running event loop) my $delay = Mojo::IOLoop->delay; @@ -586,7 +598,7 @@ compression and multiple event loop support. Optional modules L (4.0+), L (0.16+) and L (1.75+) are supported transparently through L, and used if installed. Individual features can also be -disabled with the C and C environment variables. +disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables. See L for more. @@ -634,7 +646,7 @@ L implements the following attributes. $ua = $ua->ca('/etc/tls/ca.crt'); Path to TLS certificate authority file, defaults to the value of the -C environment variable. Also activates hostname verification. +MOJO_CA_FILE environment variable. Also activates hostname verification. # Show certificate authorities for debugging IO::Socket::SSL::set_defaults( @@ -645,7 +657,7 @@ C environment variable. Also activates hostname verification. my $cert = $ua->cert; $ua = $ua->cert('/etc/tls/client.crt'); -Path to TLS certificate file, defaults to the value of the C +Path to TLS certificate file, defaults to the value of the MOJO_CERT_FILE environment variable. =head2 connect_timeout @@ -654,7 +666,7 @@ environment variable. $ua = $ua->connect_timeout(5); Maximum amount of time in seconds establishing a connection may take before -getting canceled, defaults to the value of the C +getting canceled, defaults to the value of the MOJO_CONNECT_TIMEOUT environment variable or C<10>. =head2 cookie_jar @@ -688,7 +700,7 @@ Proxy server to use for HTTPS and WebSocket requests. $ua = $ua->inactivity_timeout(15); Maximum amount of time in seconds a connection can be inactive before getting -closed, defaults to the value of the C environment +closed, defaults to the value of the MOJO_INACTIVITY_TIMEOUT environment variable or C<20>. Setting the value to C<0> will allow connections to be inactive indefinitely. @@ -705,8 +717,8 @@ L object. my $key = $ua->key; $ua = $ua->key('/etc/tls/client.crt'); -Path to TLS key file, defaults to the value of the C -environment variable. +Path to TLS key file, defaults to the value of the MOJO_KEY_FILE environment +variable. =head2 local_address @@ -729,8 +741,7 @@ before it starts closing the oldest cached ones, defaults to C<5>. $ua = $ua->max_redirects(3); Maximum number of redirects the user agent will follow before it fails, -defaults to the value of the C environment variable or -C<0>. +defaults to the value of the MOJO_MAX_REDIRECTS environment variable or C<0>. =head2 name @@ -753,7 +764,7 @@ Domains that don't require a proxy server to be used. Maximum amount of time in seconds establishing a connection, sending the request and receiving a whole response may take before getting canceled, -defaults to the value of the C environment variable or +defaults to the value of the MOJO_REQUEST_TIMEOUT environment variable or C<0>. Setting the value to C<0> will allow the user agent to wait indefinitely. The timeout will reset for every followed redirect. @@ -802,26 +813,14 @@ Get absolute L object for C and switch protocol if necessary. # Port currently used for processing relative URLs say $ua->app_url->port; -=head2 build_form_tx - - my $tx = $ua->build_form_tx('http://kraih.com' => {a => 'b'}); - my $tx = $ua->build_form_tx('kraih.com', 'UTF-8', {a => 'b'}, {DNT => 1}); - -Generate L object with -L. - -=head2 build_json_tx - - my $tx = $ua->build_json_tx('http://kraih.com' => {a => 'b'}); - my $tx = $ua->build_json_tx('kraih.com' => {a => 'b'} => {DNT => 1}); - -Generate L object with -L. - =head2 build_tx my $tx = $ua->build_tx(GET => 'kraih.com'); my $tx = $ua->build_tx(PUT => 'http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->build_tx( + PUT => 'http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->build_tx( + PUT => 'http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Generate L object with L. @@ -843,6 +842,10 @@ L. my $tx = $ua->delete('kraih.com'); my $tx = $ua->delete('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->delete( + 'http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->delete( + 'http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -859,14 +862,16 @@ append a callback to perform requests non-blocking. $ua = $ua->detect_proxy; -Check environment variables C, C, C, -C, C and C for proxy information. Automatic -proxy detection can be enabled with the C environment variable. +Check environment variables HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy, +NO_PROXY and no_proxy for proxy information. Automatic proxy detection can be +enabled with the MOJO_PROXY environment variable. =head2 get my $tx = $ua->get('kraih.com'); my $tx = $ua->get('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->get('http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->get('http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -883,6 +888,8 @@ append a callback to perform requests non-blocking. my $tx = $ua->head('kraih.com'); my $tx = $ua->head('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->head('http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->head('http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -905,6 +912,10 @@ Check if request for domain would use a proxy server. my $tx = $ua->options('kraih.com'); my $tx = $ua->options('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->options( + 'http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->options( + 'http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -921,6 +932,8 @@ append a callback to perform requests non-blocking. my $tx = $ua->patch('kraih.com'); my $tx = $ua->patch('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->patch('http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->patch('http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -937,6 +950,8 @@ append a callback to perform requests non-blocking. my $tx = $ua->post('kraih.com'); my $tx = $ua->post('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->post('http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->post('http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -949,42 +964,12 @@ append a callback to perform requests non-blocking. }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; -=head2 post_form - - my $tx = $ua->post_form('http://kraih.com' => {a => 'b'}); - my $tx = $ua->post_form('kraih.com', 'UTF-8', {a => 'b'}, {DNT => 1}); - -Perform blocking HTTP C request with form data and return resulting -L object, takes the same arguments as -L. You can also append a callback to -perform requests non-blocking. - - $ua->post_form('http://kraih.com' => {q => 'test'} => sub { - my ($ua, $tx) = @_; - say $tx->res->body; - }); - Mojo::IOLoop->start unless Mojo::IOLoop->is_running; - -=head2 post_json - - my $tx = $ua->post_json('http://kraih.com' => {a => 'b'}); - my $tx = $ua->post_json('kraih.com' => {a => 'b'} => {DNT => 1}); - -Perform blocking HTTP C request with JSON data and return resulting -L object, takes the same arguments as -L. You can also append a callback to -perform requests non-blocking. - - $ua->post_json('http://kraih.com' => {q => 'test'} => sub { - my ($ua, $tx) = @_; - say $tx->res->body; - }); - Mojo::IOLoop->start unless Mojo::IOLoop->is_running; - =head2 put my $tx = $ua->put('kraih.com'); my $tx = $ua->put('http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $ua->put('http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $ua->put('http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Perform blocking HTTP C request and return resulting L object, takes the same arguments as @@ -1031,8 +1016,8 @@ same arguments as L. =head1 DEBUGGING -You can set the C environment variable to get some -advanced diagnostics information printed to C. +You can set the MOJO_USERAGENT_DEBUG environment variable to get some advanced +diagnostics information printed to C. MOJO_USERAGENT_DEBUG=1 diff --git a/lib/Mojo/UserAgent/CookieJar.pm b/lib/Mojo/UserAgent/CookieJar.pm index 9420a7e..0eadd97 100644 --- a/lib/Mojo/UserAgent/CookieJar.pm +++ b/lib/Mojo/UserAgent/CookieJar.pm @@ -46,8 +46,8 @@ sub extract { my $host = lc $url->ihost; my $domain = lc(defined $cookie->domain ? $cookie->domain : $host); $domain =~ s/^\.//; - next unless $host eq $domain || $host =~ /\Q.$domain\E$/; - next if $host =~ /\.\d+$/; + next + if $host ne $domain && ($host !~ /\Q.$domain\E$/ || $host =~ /\.\d+$/); $cookie->domain($domain); # Validate path diff --git a/lib/Mojo/UserAgent/Transactor.pm b/lib/Mojo/UserAgent/Transactor.pm index d79f9be..0fb5a45 100644 --- a/lib/Mojo/UserAgent/Transactor.pm +++ b/lib/Mojo/UserAgent/Transactor.pm @@ -11,7 +11,22 @@ use Mojo::Parameters; use Mojo::Transaction::HTTP; use Mojo::Transaction::WebSocket; use Mojo::URL; -use Mojo::Util 'encode'; +use Mojo::Util qw(deprecated encode); + +has generators => sub { {} }; + +sub new { + my $self = shift->SUPER::new(@_); + $self->add_generator(form => \&_form); + $self->add_generator(json => \&_json); + return $self; +} + +sub add_generator { + my ($self, $name, $cb) = @_; + $self->generators->{$name} = $cb; + return $self; +} sub endpoint { my ($self, $tx) = @_; @@ -30,47 +45,22 @@ sub endpoint { return $proto, $host, $port; } +# DEPRECATED in Rainbow! sub form { - my ($self, $url, $encoding) = (shift, shift, shift); - my $form = ref $encoding ? $encoding : shift; - $encoding = undef if ref $encoding; - - # Start with normal POST transaction - my $tx = $self->tx(POST => $url, @_); - - # Check for uploads and force multipart if necessary - my $multipart; - for my $value (map { ref $_ eq 'ARRAY' ? @$_ : $_ } values %$form) { - ++$multipart and last if ref $value eq 'HASH'; - } - my $req = $tx->req; - my $headers = $req->headers; - $headers->content_type('multipart/form-data') if $multipart; - - # Multipart - if ((defined $headers->content_type ? $headers->content_type : '') eq 'multipart/form-data') { - my $parts = $self->_multipart($encoding, $form); - $req->content( - Mojo::Content::MultiPart->new(headers => $headers, parts => $parts)); - } - - # Urlencoded - else { - $headers->content_type('application/x-www-form-urlencoded'); - my $p = Mojo::Parameters->new(map { $_ => $form->{$_} } sort keys %$form); - $p->charset($encoding) if defined $encoding; - $req->body($p->to_string); - } - - return $tx; + deprecated 'Mojo::UserAgent::Transactor::form is DEPRECATED in favor of ' + . 'Mojo::UserAgent::Transactor::tx'; + my ($self, $url, $charset) = (shift, shift, shift); + my $form = ref $charset ? $charset : shift; + $charset = undef if ref $charset; + return $self->tx(POST => $url, @_, form => $form, charset => $charset); } +# DEPRECATED in Rainbow! sub json { + deprecated 'Mojo::UserAgent::Transactor::json is DEPRECATED in favor of ' + . 'Mojo::UserAgent::Transactor::tx'; my ($self, $url, $data) = (shift, shift, shift); - my $tx = $self->tx(POST => $url, @_, Mojo::JSON->new->encode($data)); - my $headers = $tx->req->headers; - $headers->content_type('application/json') unless $headers->content_type; - return $tx; + return $self->tx(POST => $url, @_, json => $data); } sub peer { @@ -140,8 +130,14 @@ sub tx { # Headers $req->headers->from_hash(shift) if ref $_[0] eq 'HASH'; + # Generator + if (@_ > 1) { + return $tx unless my $generator = $self->generators->{shift()}; + $self->$generator($tx, @_); + } + # Body - $req->body(shift) if @_; + elsif (@_) { $req->body(shift) } return $tx; } @@ -159,10 +155,9 @@ sub websocket { # New WebSocket transaction my $tx = $self->tx(GET => @_); - my $req = $tx->req; - my $abs = $req->url->to_abs; - my $proto = $abs->protocol; - $req->url($abs->scheme($proto eq 'wss' ? 'https' : 'http')) if $proto; + my $url = $tx->req->url; + my $proto = $url->protocol; + $url->scheme($proto eq 'wss' ? 'https' : 'http') if $proto; # Handshake Mojo::Transaction::WebSocket->new(handshake => $tx)->client_handshake; @@ -170,8 +165,46 @@ sub websocket { return $tx; } +sub _form { + my ($self, $tx, $form, %options) = @_; + + # Check for uploads and force multipart if necessary + my $multipart; + for my $value (map { ref $_ eq 'ARRAY' ? @$_ : $_ } values %$form) { + ++$multipart and last if ref $value eq 'HASH'; + } + my $req = $tx->req; + my $headers = $req->headers; + $headers->content_type('multipart/form-data') if $multipart; + + # Multipart + if ((defined $headers->content_type ? $headers->content_type : '') eq 'multipart/form-data') { + my $parts = $self->_multipart($options{charset}, $form); + $req->content( + Mojo::Content::MultiPart->new(headers => $headers, parts => $parts)); + } + + # Urlencoded + else { + $headers->content_type('application/x-www-form-urlencoded'); + my $p = Mojo::Parameters->new(map { $_ => $form->{$_} } sort keys %$form); + $p->charset($options{charset}) if defined $options{charset}; + $req->body($p->to_string); + } + + return $tx; +} + +sub _json { + my ($self, $tx, $data) = @_; + $tx->req->body(Mojo::JSON->new->encode($data)); + my $headers = $tx->req->headers; + $headers->content_type('application/json') unless $headers->content_type; + return $tx; +} + sub _multipart { - my ($self, $encoding, $form) = @_; + my ($self, $charset, $form) = @_; my @parts; for my $name (sort keys %$form) { @@ -199,18 +232,18 @@ sub _multipart { # Filename and headers $filename = delete $value->{filename} || $name; - $filename = encode $encoding, $filename if $encoding; + $filename = encode $charset, $filename if $charset; $headers->from_hash($value); } # Field else { - $value = encode $encoding, $value if $encoding; + $value = encode $charset, $value if $charset; $part->asset(Mojo::Asset::Memory->new->add_chunk($value)); } # Content-Disposition - $name = encode $encoding, $name if $encoding; + $name = encode $charset, $name if $charset; my $disposition = qq{form-data; name="$name"}; $disposition .= qq{; filename="$filename"} if $filename; $headers->content_disposition($disposition); @@ -251,81 +284,49 @@ Mojo::UserAgent::Transactor - User agent transactor say $t->tx(PATCH => 'mojolicio.us' => {DNT => 1} => 'Hi!')->req->to_string; # POST request with form data - say $t->form('http://kraih.com' => {a => [1, 2], b => 3})->req->to_string; + say $t->tx(POST => 'kraih.com' => form => {a => 'b'})->req->to_string; - # POST request with JSON data - say $t->json('http://kraih.com' => {a => [1, 2], b => 3})->req->to_string; + # PUT request with JSON data + say $t->tx(PUT => 'http://kraih.com' => json => {a => 'b'})->req->to_string; =head1 DESCRIPTION L is the transaction building and manipulation framework used by L. -=head1 METHODS +=head1 ATTRIBUTES -L inherits all methods from L and -implements the following new ones. +L implements the following attributes. -=head2 endpoint +=head2 generators - my ($proto, $host, $port) = $t->endpoint(Mojo::Transaction::HTTP->new); + my $generators = $t->generators; + $t = $t->generators({foo => sub {...}}); -Actual endpoint for transaction. +Registered generators. -=head2 form +=head1 METHODS - my $tx = $t->form('kraih.com' => {a => 'b'}); - my $tx = $t->form('http://kraih.com' => {a => 'b'}); - my $tx = $t->form('http://kraih.com' => {a => [qw(b c d)]}); - my $tx = $t->form('http://kraih.com' => {mytext => {file => '/foo.txt'}}); - my $tx = $t->form('http://kraih.com' => {mytext => {content => 'lalala'}}); - my $tx = $t->form('http://kraih.com' => - {mytexts => [{content => 'first'}, {content => 'second'}]}); - my $tx = $t->form('http://kraih.com' => { - myzip => { - file => Mojo::Asset::Memory->new->add_chunk('lalala'), - filename => 'foo.zip', - DNT => 1 - } - }); - my $tx = $t->form('http://kraih.com' => 'UTF-8' => {a => 'b'}); - my $tx = $t->form('http://kraih.com' => {a => 'b'} => {DNT => 1}); - my $tx = $t->form('http://kraih.com', 'UTF-8', {a => 'b'}, {DNT => 1}); +L inherits all methods from L and +implements the following new ones. -Versatile L transaction builder for C requests -with form data. +=head2 new - # Multipart upload with filename - my $tx = $t->form( - 'mojolicio.us' => {fun => {content => 'Hello!', filename => 'test.txt'}}); + my $t = Mojo::UserAgent::Transactor->new; - # Multipart upload streamed from file - my $tx = $t->form('mojolicio.us' => {fun => {file => '/etc/passwd'}}); +Construct a new transactor and register C
and C generators. -While the "multipart/form-data" content type will be automatically used -instead of "application/x-www-form-urlencoded" when necessary, you can also -enforce it by setting the header manually. +=head2 add_generator - # Force multipart - my $tx = $t->form( - 'http://kraih.com/foo', - {a => 'b'}, - {'Content-Type' => 'multipart/form-data'} - ); + $t = $t->add_generator(foo => sub {...}); -=head2 json +Register a new generator. - my $tx = $t->json('kraih.com' => {a => 'b'}); - my $tx = $t->json('http://kraih.com' => [1, 2, 3]); - my $tx = $t->json('http://kraih.com' => {a => 'b'} => {DNT => 1}); - my $tx = $t->json('http://kraih.com' => [1, 2, 3] => {DNT => 1}); +=head2 endpoint -Versatile L transaction builder for C requests -with JSON data. + my ($proto, $host, $port) = $t->endpoint(Mojo::Transaction::HTTP->new); - # Change method - my $tx = $t->json('mojolicio.us/hello', {hello => 'world'}); - $tx->req->method('PATCH'); +Actual endpoint for transaction. =head2 peer @@ -353,10 +354,16 @@ C<307> or C<308> redirect response if possible. my $tx = $t->tx(POST => 'http://kraih.com'); my $tx = $t->tx(GET => 'http://kraih.com' => {DNT => 1}); my $tx = $t->tx(PUT => 'http://kraih.com' => 'Hi!'); + my $tx = $t->tx(PUT => 'http://kraih.com' => form => {a => 'b'}); + my $tx = $t->tx(PUT => 'http://kraih.com' => json => {a => 'b'}); my $tx = $t->tx(POST => 'http://kraih.com' => {DNT => 1} => 'Hi!'); + my $tx = $t->tx( + PUT => 'http://kraih.com' => {DNT => 1} => form => {a => 'b'}); + my $tx = $t->tx( + PUT => 'http://kraih.com' => {DNT => 1} => json => {a => 'b'}); Versatile general purpose L transaction builder for -requests. +requests, with support for generators. # Inspect generated request say $t->tx(GET => 'mojolicio.us' => {DNT => 1} => 'Bye!')->req->to_string; @@ -369,6 +376,38 @@ requests. my $tx = $t->tx(GET => 'http://mojolicio.us'); $tx->connection($sock); + # Use form generator with custom charset + my $tx = $t->tx( + PUT => 'http://kraih.com' => form => {a => 'b'} => charset => 'UTF-8'); + + # Multiple form values with the same name + my $tx = $t->tx(PUT => 'http://kraih.com' => form => {a => [qw(b c d)]}); + + # Multipart upload streamed from file + my $tx = $t->tx( + PUT => 'http://kraih.com' => form => {mytext => {file => '/foo.txt'}}); + + # Multipart upload with in-memory content + my $tx = $t->tx( + POST => 'http://kraih.com' => form => {mytext => {content => 'lalala'}}); + + # Upload multiple files + my $tx = $t->tx(POST => 'http://kraih.com' => + form => {mytext => [{content => 'first'}, {content => 'second'}]}); + + # Customized upload with filename and header + my $tx = $t->tx(POST => 'http://kraih.com' => form => { + myzip => { + file => Mojo::Asset::Memory->new->add_chunk('lalala'), + filename => 'foo.zip', + DNT => 1 + } + }); + +While the "multipart/form-data" content type will be automatically used +instead of "application/x-www-form-urlencoded" when necessary, you can also +enforce it by setting the header manually. + =head2 upgrade my $tx = $t->upgrade(Mojo::Transaction::HTTP->new); diff --git a/lib/Mojo/Util.pm b/lib/Mojo/Util.pm index 0adb3fc..cbc63a9 100644 --- a/lib/Mojo/Util.pm +++ b/lib/Mojo/Util.pm @@ -1,7 +1,7 @@ package Mojo::Util; use Mojo::Base 'Exporter'; -use Carp 'croak'; +use Carp qw(carp croak); use Digest::MD5 qw(md5 md5_hex); BEGIN {eval {require Digest::SHA; import Digest::SHA qw(sha1 sha1_hex)}} use Encode 'find_encoding'; @@ -42,10 +42,10 @@ my %CACHE; our @EXPORT_OK = ( qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize), - qw(decode encode get_line hmac_md5_sum hmac_sha1_sum html_unescape), - qw(md5_bytes md5_sum monkey_patch punycode_decode punycode_encode quote), - qw(secure_compare sha1_bytes sha1_sum slurp spurt squish trim unquote), - qw(url_escape url_unescape xml_escape xor_encode) + qw(decode deprecated encode get_line hmac_md5_sum hmac_sha1_sum), + qw(html_unescape md5_bytes md5_sum monkey_patch punycode_decode), + qw(punycode_encode quote secure_compare sha1_bytes sha1_sum slurp spurt), + qw(squish trim unquote url_escape url_unescape xml_escape xor_encode) ); # DEPRECATED in Rainbow! @@ -98,6 +98,11 @@ sub decode { return $bytes; } +sub deprecated { + local $Carp::CarpLevel = 1; + $ENV{MOJO_FATAL_DEPRECATIONS} ? croak(@_) : carp(@_); +} + sub encode { _encoding($_[0])->encode("$_[1]") } sub get_line { @@ -117,9 +122,8 @@ sub hmac_sha1_sum { _hmac(\&sha1, @_) } # DEPRECATED in Rainbow! sub html_escape { - warn <html_escape is DEPRECATED in favor of Mojo::Util->xml_escape!!! -EOF + deprecated 'Mojo::Util::html_escape is DEPRECATED in favor of ' + . 'Mojo::Util::xml_escape'; my ($string, $pattern) = @_; $pattern ||= '^\n\r\t !#$%(-;=?-~'; return $string unless $string =~ /[^$pattern]/; @@ -330,6 +334,7 @@ sub xml_escape { return $string; } + sub xor_encode { my ($input, $key) = @_; @@ -485,6 +490,13 @@ Convert camel case string to snake case and replace C<::> with C<->. Decode bytes to characters and return C if decoding failed. +=head2 deprecated + + deprecated 'foo is DEPRECATED in favor of bar'; + +Warn about deprecated feature from perspective of caller. You can also set the +MOJO_FATAL_DEPRECATIONS environment variable to make them die instead. + =head2 encode my $bytes = encode 'UTF-8', $chars; diff --git a/lib/Mojolicious.pm b/lib/Mojolicious.pm index 4293946..35f37c6 100644 --- a/lib/Mojolicious.pm +++ b/lib/Mojolicious.pm @@ -4,7 +4,7 @@ use Mojo::Base 'Mojo'; # "Fry: Shut up and take my money!" use Carp 'croak'; use Mojo::Exception; -use Mojo::Util 'decamelize'; +use Mojo::Util qw(decamelize deprecated); use Mojolicious::Commands; use Mojolicious::Controller; use Mojolicious::Plugins; @@ -40,7 +40,7 @@ has static => sub { Mojolicious::Static->new }; has types => sub { Mojolicious::Types->new }; our $CODENAME = 'Rainbow'; -our $VERSION = '3.84'; +our $VERSION = '3.89'; sub AUTOLOAD { my $self = shift; @@ -122,9 +122,9 @@ sub dispatch { # DEPRECATED in Rainbow! if ($plugins->has_subscribers('after_static_dispatch')) { - warn <emit_hook_reverse(after_static_dispatch => $c); -after_static_dispatch hook is DEPRECATED in favor of before_routes!!! -EOF + deprecated + 'after_static_dispatch hook is DEPRECATED in favor of before_routes' + and $plugins->emit_hook_reverse(after_static_dispatch => $c); } # Routes @@ -256,7 +256,7 @@ L. $app = $app->mode('production'); The operating mode for your application, defaults to the value of the -C environment variable or C. You can also add per +MOJO_MODE environment variable or C. You can also add per mode logic to your application by defining methods named C<${mode}_mode> in the application class, which will be called right before C. @@ -346,6 +346,9 @@ object. You can usually leave this alone, see L for more information about working with session data. + # Change name of cookie used for all sessions + $app->sessions->cookie_name('mysession'); + =head2 static my $static = $app->static; @@ -368,6 +371,7 @@ L object. Responsible for connecting file extensions with MIME types, defaults to a L object. + # Add custom MIME type $app->types->type(twt => 'text/tweet'); =head1 METHODS @@ -486,7 +490,8 @@ Very useful for rewriting incoming requests and other preprocessing tasks. =item after_static -Emitted after the static file server decided to serve a static file. +Emitted after a static file response has been generated by the static file +server. $app->hook(after_static => sub { my $c = shift; @@ -498,8 +503,8 @@ controller object) =item before_routes -Emitted after the static file server decided if a static file should be served -and before the router starts its work. +Emitted after the static file server determined if a static file should be +served and before the router starts its work. $app->hook(before_routes => sub { my $c = shift; @@ -657,6 +662,11 @@ have been used in the past. 0.999920, C (u2603) +=head1 SPONSORS + +Some of the work on this distribution has been sponsored by +L, thank you! + =head1 PROJECT FOUNDER Sebastian Riedel, C @@ -671,6 +681,8 @@ Abhijit Menon-Sen, C Glen Hinkle, C +Joel Berger, C + Marcus Ramberg, C =back @@ -753,6 +765,8 @@ Dmitriy Shalashov Dmitry Konstantinov +Dominik Jarmulowicz + Dominique Dumont Douglas Christopher Wilson @@ -779,8 +793,6 @@ Jaroslav Muhin Jesse Vincent -Joel Berger - Johannes Plunien John Kingsley @@ -877,8 +889,6 @@ Tatsuhiko Miyagawa Terrence Brannon -The Perl Foundation - Tomas Znamenacek Ulrich Habel diff --git a/lib/Mojolicious/Command/cpanify.pm b/lib/Mojolicious/Command/cpanify.pm index 57a6a18..447e76f 100644 --- a/lib/Mojolicious/Command/cpanify.pm +++ b/lib/Mojolicious/Command/cpanify.pm @@ -24,8 +24,8 @@ sub run { 'u|user=s' => \(my $user = ''); die $self->usage unless my $file = shift @args; - my $tx = Mojo::UserAgent->new->detect_proxy->post_form( - "https://$user:$password\@pause.perl.org/pause/authenquery" => { + my $tx = Mojo::UserAgent->new->detect_proxy->post( + "https://$user:$password\@pause.perl.org/pause/authenquery" => form => { HIDDENNAME => $user, CAN_MULTIPART => 1, pause99_add_uri_upload => basename($file), diff --git a/lib/Mojolicious/Command/generate/app.pm b/lib/Mojolicious/Command/generate/app.pm index 4c11e3b..504491e 100644 --- a/lib/Mojolicious/Command/generate/app.pm +++ b/lib/Mojolicious/Command/generate/app.pm @@ -57,7 +57,7 @@ use strict; use warnings; use FindBin; -use lib "$FindBin::Bin/../lib"; +BEGIN { unshift @INC, "$FindBin::Bin/../lib" } # Start command line interface for application require Mojolicious::Commands; diff --git a/lib/Mojolicious/Commands.pm b/lib/Mojolicious/Commands.pm index 2aa8f31..c866a8c 100644 --- a/lib/Mojolicious/Commands.pm +++ b/lib/Mojolicious/Commands.pm @@ -4,6 +4,7 @@ use Mojo::Base 'Mojolicious::Command'; use Getopt::Long 'GetOptions'; use List::Util 'max'; use Mojo::Server; +use Mojo::Util 'deprecated'; has hint => <<"EOF"; @@ -105,10 +106,8 @@ sub run { # DEPRECATED in Rainbow! sub start { - warn <start is DEPRECATED in favor of -Mojolicious::Commands->start_app!!! -EOF + deprecated 'Mojolicious::Commands::start is DEPRECATED in favor of ' + . 'Mojolicious::Commands::start_app'; my $self = shift; return $self->start_app($ENV{MOJO_APP} => @_) if $ENV{MOJO_APP}; return $self->new->app->start(@_); @@ -320,7 +319,7 @@ Try to detect environment. $commands->run(@ARGV); Load and run commands. Automatic deployment environment detection can be -disabled with the C environment variable. +disabled with the MOJO_NO_DETECT environment variable. =head2 start_app diff --git a/lib/Mojolicious/Controller.pm b/lib/Mojolicious/Controller.pm index e66f731..d5029b0 100644 --- a/lib/Mojolicious/Controller.pm +++ b/lib/Mojolicious/Controller.pm @@ -678,8 +678,8 @@ generated, all additional values get merged into the C. $c->render_data($bytes); $c->render_data($bytes, format => 'png'); -Render the given content as raw bytes, similar to C but data will -not be encoded. All additional values get merged into the C. +Render the given content as bytes, similar to C but data will not +be encoded. All additional values get merged into the C. # Longer version $c->render(data => $bytes); @@ -748,8 +748,8 @@ method does not protect from traversing to parent directories. $c->render_text('Hello World!'); $c->render_text('Hello World!', layout => 'green'); -Render the given content as Perl characters, which will be encoded to bytes. -All additional values get merged into the C. See C for an +Render the given content as characters, which will be encoded to bytes. All +additional values get merged into the C. See C for an alternative without encoding. Note that this does not change the content type of the response, which is C by default. @@ -777,7 +777,8 @@ Get L object from L. my $req = $c->tx->req; # Extract request information - my $userinfo = $c->req->url->userinfo; + my $url = $c->req->url->to_abs; + my $userinfo = $c->req->url->to_abs->userinfo; my $agent = $c->req->headers->user_agent; my $body = $c->req->body; my $foo = $c->req->json('/23/foo'); @@ -913,7 +914,7 @@ Get L object from L. # Blocking my $tx = $c->ua->get('http://mojolicio.us'); - my $tx = $c->ua->post_form('http://kraih.com/login' => {user => 'mojo'}); + my $tx = $c->ua->post('http://kraih.com/login' => form => {user => 'mojo'}); # Non-blocking $c->ua->get('http://mojolicio.us' => sub { diff --git a/lib/Mojolicious/Guides.pod b/lib/Mojolicious/Guides.pod index a965d49..1d4b326 100644 --- a/lib/Mojolicious/Guides.pod +++ b/lib/Mojolicious/Guides.pod @@ -32,10 +32,12 @@ overview of what L is all about. =item L -A really fast and fun way to get started developing web applications with -Mojolicious is the L tutorial. Almost everything you learn -there can also be applied to normal L applications and is -considered a prerequisite for the guides. You should definitely take a look! +A fast and fun way to get started developing web applications with Mojolicious +is the L tutorial. This micro web framework is only a thin +wrapper around the normal web framework, so almost everything you learn here +also applies to full L applications. The simplified notation +introduced in the tutorial is commonly used throughout the guides and is +therefore considered a prerequisite, you should definitely take a look! =back diff --git a/lib/Mojolicious/Guides/Cookbook.pod b/lib/Mojolicious/Guides/Cookbook.pod index 7777cea..ef42341 100644 --- a/lib/Mojolicious/Guides/Cookbook.pod +++ b/lib/Mojolicious/Guides/Cookbook.pod @@ -189,7 +189,7 @@ such as C, C and C. $ plackup ./script/myapp -s FCGI -l /tmp/myapp.sock If an older server adapter is not be able to correctly detect the application -home directory, you can simply use the C environment variable. +home directory, you can simply use the MOJO_HOME environment variable. $ MOJO_HOME=/home/sri/myapp plackup ./script/myapp HTTP::Server::PSGI: Accepting connections at http://0:5000/ @@ -820,6 +820,43 @@ them. This even works for proxy C requests. +=head2 Content generators + +Generators can be used to generate the same type of content repeatedly for +multiple requests. + + use Mojo::UserAgent; + use Mojo::Asset::File; + + # Add "stream" generator + my $ua = Mojo::UserAgent->new; + $ua->transactor->add_generator(stream => sub { + my ($transactor, $tx, $path) = @_; + $tx->req->content->asset(Mojo::Asset::File->new(path => $path)); + }); + + # Send multiple files streaming via PUT and POST + $ua->put('http://mojolicio.us/upload' => stream => '/home/sri/mojo.png'); + $ua->post('http://mojolicio.us/upload' => stream => '/home/sri/mango.png'); + +The C and C generators are always available. + + use Mojo::UserAgent; + + # Send JSON content via PATCH + my $ua = Mojo::UserAgent->new; + my $tx = $ua->patch('http://api.mojolicio.us' => json => {foo => 'bar'}); + + # Send "application/x-www-form-urlencoded" content via POST + my $tx2 = $ua->post('http://search.mojolicio.us' => form => {q => 'test'}); + + # Send "multipart/form-data" content via PUT + my $tx3 = $ua->put('http://upload.mojolicio.us' => + form => {test => {content => 'Hello World!'}}); + +For more information about available generators see also +L. + =head2 Streaming response Receiving a streaming response can be really tricky in most HTTP clients, but @@ -888,7 +925,7 @@ above C<250KB> into a temporary file. $tx->res->content->asset->move_to('mojo.tar.gz'); To protect you from excessively large files there is also a limit of C<5MB> by -default, which you can tweak with the C environment +default, which you can tweak with the MOJO_MAX_MESSAGE_SIZE environment variable. # Increase limit to 1GB @@ -902,21 +939,12 @@ Uploading a large file is even easier. # Upload file via POST and "multipart/form-data" my $ua = Mojo::UserAgent->new; - $ua->post_form('mojolicio.us/upload', - {image => {file => '/home/sri/hello.png'}}); + $ua->post('mojolicio.us/upload' => + form => {image => {file => '/home/sri/hello.png'}}); And once again you don't have to worry about memory usage, all data will be streamed directly from the file. - use Mojo::UserAgent; - - # Upload file via PUT - my $ua = Mojo::UserAgent->new; - my $asset = Mojo::Asset::File->new(path => '/home/sri/hello.png'); - my $tx = $ua->build_tx(PUT => 'mojolicio.us/upload'); - $tx->req->content->asset($asset); - $ua->start($tx); - =head2 Non-blocking L has been designed from the ground up to be non-blocking, diff --git a/lib/Mojolicious/Guides/FAQ.pod b/lib/Mojolicious/Guides/FAQ.pod index c4dd288..ae3ea42 100644 --- a/lib/Mojolicious/Guides/FAQ.pod +++ b/lib/Mojolicious/Guides/FAQ.pod @@ -62,7 +62,7 @@ which we already have done in the past. To protect your applications from excessively large requests and responses, our HTTP parser has a cap after which it will automatically stop accepting new data, and in most cases force the connection to be closed. This limit is -around C<5MB> by default, you can use the C environment +around C<5MB> by default, you can use the MOJO_MAX_MESSAGE_SIZE environment variable to change this value. =head2 What does the error "Maximum line size exceeded" mean? @@ -71,15 +71,15 @@ This is a very similar protection mechanism to the one described in the previous answer, but a little more specific. It limits the maximum length of any C<\x0d\x0a> terminated part of a HTTP message, such as request line, status line and headers. This limit is around C<10KB> by default, you can use -the C environment variable to change this value. +the MOJO_MAX_LINE_SIZE environment variable to change this value. =head2 What does the error "Maximum buffer size exceeded" mean? This protection mechanism is very similar to those mentioned in the two previous answers. It limits how much content the HTTP parser is allowed to buffer when parsing chunked, compressed and multipart messages. This limit is -around C<256KB> by default, you can use the C -environment variable to change this value. +around C<256KB> by default, you can use the MOJO_MAX_BUFFER_SIZE environment +variable to change this value. =head2 What does the error "EV does not work with ithreads" mean? @@ -87,8 +87,7 @@ The L user agent and web servers are based on an event loop that supports multiple reactor backends. One of these backends is L, it is very fast and will be automatically used if installed. On Windows however, the C based C emulation can interfere with it, and you may have -to use the C environment variable to enforce a more portable -one. +to use the MOJO_REACTOR environment variable to enforce a more portable one. MOJO_REACTOR=Mojo::Reactor::Poll diff --git a/lib/Mojolicious/Guides/Growing.pod b/lib/Mojolicious/Guides/Growing.pod index b81b66b..d32e472 100644 --- a/lib/Mojolicious/Guides/Growing.pod +++ b/lib/Mojolicious/Guides/Growing.pod @@ -300,7 +300,7 @@ on L. ->element_exists('form input[type="submit"]'); # Test login with valid credentials - $t->post_form_ok('/' => {user => 'sri', pass => 'secr3t'}) + $t->post_ok('/' => form => {user => 'sri', pass => 'secr3t'}) ->status_is(200)->text_like('html body' => qr/Welcome sri/); # Test accessing a protected page @@ -641,7 +641,8 @@ Finally C can be replaced with a proper L script. $ touch script/myapp $ chmod 744 script/myapp -Only a few small details change. +Only a few small details change, since installable scripts can't use L +without breaking updated dual-life modules. #!/usr/bin/env perl @@ -649,7 +650,7 @@ Only a few small details change. use warnings; use FindBin; - use lib "$FindBin::Bin/../lib"; + BEGIN { unshift @INC, "$FindBin::Bin/../lib" } # Start command line interface for application require Mojolicious::Commands; @@ -673,7 +674,7 @@ C can be simplified. ->element_exists('form input[name="pass"]') ->element_exists('form input[type="submit"]'); - $t->post_form_ok('/' => {user => 'sri', pass => 'secr3t'}) + $t->post_ok('/' => form => {user => 'sri', pass => 'secr3t'}) ->status_is(200)->text_like('html body' => qr/Welcome sri/); $t->get_ok('/protected')->status_is(200)->text_like('a' => qr/Logout/); diff --git a/lib/Mojolicious/Guides/Rendering.pod b/lib/Mojolicious/Guides/Rendering.pod index 6f0fc71..baa68e4 100644 --- a/lib/Mojolicious/Guides/Rendering.pod +++ b/lib/Mojolicious/Guides/Rendering.pod @@ -66,7 +66,7 @@ start characters. % Perl code line, treated as "<% line =%>" %= Perl expression line, treated as "<%= line %>" %== Perl expression line, treated as "<%== line %>" - %# Comment line, treated as "<%# line =%>" + %# Comment line, useful for debugging %% Replaced with "%", useful for generating templates Tags and lines work pretty much the same, but depending on context one will @@ -196,14 +196,14 @@ too. =head2 Rendering text -Perl characters can be rendered with the C stash value, the given +Characters can be rendered to bytes with the C stash value, the given content will be automatically encoded to bytes. $self->render(text => 'Hello Wörld!'); =head2 Rendering data -Raw bytes can be rendered with the C stash value, no encoding will be +Bytes can be rendered with the C stash value, no encoding will be performed. $self->render(data => $octets); @@ -217,8 +217,9 @@ renderer which get directly encoded to JSON. =head2 Partial rendering -Sometimes you might want to access the rendered result, for example to -generate emails, this can be done using the C stash value. +Sometimes you might want to use the rendered result directly instead of +generating a response, for example to send emails, this can be done using the +C stash value. my $html = $self->render('mail', partial => 1); @@ -328,10 +329,10 @@ used or an empty C<204> response rendered automatically. By now you've probably already encountered the built-in 404 (Not Found) and 500 (Server Error) pages, that get rendered automatically when you make a -mistake. Especially during development they can be a great help, the methods +mistake. Especially during development they can be a great help, you can +render them manually with the methods L and -L can be used to render them -manually. +L. use Mojolicious::Lite; use Scalar::Util 'looks_like_number'; diff --git a/lib/Mojolicious/Guides/Routing.pod b/lib/Mojolicious/Guides/Routing.pod index 0426829..9ef68a6 100644 --- a/lib/Mojolicious/Guides/Routing.pod +++ b/lib/Mojolicious/Guides/Routing.pod @@ -221,7 +221,7 @@ L. =head2 Nested routes It is also possible to build tree structures from routes to remove repetitive -code. A route with children can't match on it's own though, only the actual +code. A route with children can't match on its own though, only the actual endpoints of these nested routes can. # /foo -> undef @@ -301,7 +301,7 @@ dispatching to it. You can use the C stash value to change the namespace of a whole route with all its children. - # /bye -> MyApp::Controller::Foo->bye + # /bye -> MyApp::Controller::Foo::Bar->bye $r->route('/bye') ->to(namespace => 'MyApp::Controller::Foo::Bar', action => 'bye'); @@ -425,12 +425,12 @@ routes and allows selective re-enabling. # /foo -> {controller => 'foo', action => 'bar'} # /foo.html -> undef # /baz -> undef - # /baz.txt -> {controller => 'bar', action => 'baz', format => 'txt'} - # /baz.html -> {controller => 'bar', action => 'baz', format => 'html'} + # /baz.txt -> {controller => 'baz', action => 'yada', format => 'txt'} + # /baz.html -> {controller => 'baz', action => 'yada', format => 'html'} # /baz.xml -> undef my $inactive = $r->route(format => 0); - $inactive->route('/foo')->to('foo#none'); - $inactive->route('/baz', format => [qw(txt html)])->to('bar#baz'); + $inactive->route('/foo')->to('foo#bar'); + $inactive->route('/baz', format => [qw(txt html)])->to('baz#yada'); =head2 Named routes @@ -634,7 +634,7 @@ Same for monitoring tasks. $self->hook(after_dispatch => sub { my $self = shift; return unless my $e = $self->stash('exception'); - $self->ua->post_form('https://kraih.com/bugs' => {exception => $e}); + $self->ua->post('https://kraih.com/bugs' => form => {exception => $e}); }); For a full list of available hooks see L. @@ -682,7 +682,7 @@ Less commonly used and more powerful features. =head2 IRIs IRIs are handled transparently, that means paths are guaranteed to be -unescaped and decoded to Perl characters. +unescaped and decoded from bytes to characters. # GET /☃ (unicode snowman) -> {controller => 'foo', action => 'snowman'} $r->get('/☃')->to('foo#snowman'); diff --git a/lib/Mojolicious/Lite.pm b/lib/Mojolicious/Lite.pm index 30c7e02..2e47172 100644 --- a/lib/Mojolicious/Lite.pm +++ b/lib/Mojolicious/Lite.pm @@ -151,12 +151,13 @@ every change. =head2 Routes Routes are basically just fancy paths that can contain different kinds of -placeholders. C<$self> is a L object containing both, -the HTTP request and response. +placeholders and usually lead to an action. The first argument passed to all +actions (the invocant C<$self>) is a L object +containing both the HTTP request and response. use Mojolicious::Lite; - # /foo + # Route leading to an action get '/foo' => sub { my $self = shift; $self->render(text => 'Hello World!'); @@ -164,9 +165,12 @@ the HTTP request and response. app->start; +Response content is often generated by actions with +L, but more about that later. + =head2 GET/POST parameters -All C and C parameters are accessible via +All C and C parameters sent with the request are accessible via L. use Mojolicious::Lite; @@ -187,7 +191,7 @@ which can be inlined in the C section. use Mojolicious::Lite; - # /bar + # Route leading to an action that renders a template get '/bar' => sub { my $self = shift; $self->stash(one => 23); @@ -210,7 +214,7 @@ full access to all HTTP features and information. use Mojolicious::Lite; - # /agent + # Access response and request headers get '/agent' => sub { my $self = shift; $self->res->headers->header('X-Bender' => 'Bite my shiny metal ass!'); @@ -230,13 +234,13 @@ without non-word characters. use Mojolicious::Lite; - # / + # Render the template "index.html.ep" get '/' => sub { my $self = shift; $self->render; } => 'index'; - # /hello + # Render the template "hello.html.ep" get '/hello'; app->start; @@ -258,11 +262,7 @@ L. use Mojolicious::Lite; - # /with_layout - get '/with_layout' => sub { - my $self = shift; - $self->render('with_layout'); - }; + get '/with_layout'; app->start; __DATA__ @@ -286,7 +286,6 @@ delimited by the C and C keywords. use Mojolicious::Lite; - # /with_block get '/with_block' => 'block'; app->start; @@ -313,11 +312,7 @@ pass around blocks of captured content. use Mojolicious::Lite; - # /captured - get '/captured' => sub { - my $self = shift; - $self->render('captured'); - }; + get '/captured'; app->start; __DATA__ @@ -350,7 +345,7 @@ L. use Mojolicious::Lite; - # "whois" helper + # A helper to identify visitors helper whois => sub { my $self = shift; my $agent = $self->req->headers->user_agent || 'Anonymous'; @@ -358,7 +353,7 @@ L. return "$agent ($ip)"; }; - # /secret + # Use helper in action and template get '/secret' => sub { my $self = shift; my $user = $self->whois; @@ -434,7 +429,7 @@ C<.>. =head2 HTTP methods -Routes can be restricted to specific request methods. +Routes can be restricted to specific request methods with different keywords. use Mojolicious::Lite; @@ -542,11 +537,11 @@ are only evaluated if the callback returned a true value. return undef; }; - # / (with authentication) + # Only reached when authenticated get '/' => 'index'; app->start; - __DATA__; + __DATA__ @@ denied.html.ep You are not Bender, permission denied. @@ -567,7 +562,7 @@ Prefixing multiple routes is another good use for C. # /foo/baz get '/baz' => {text => 'foo baz'}; - # / + # / (reset) under '/' => {message => 'whatever'}; # /bar @@ -594,7 +589,7 @@ C statements. # Local logic shared only by routes in this group under '/admin' => sub { my $self = shift; - return 1 if $self->req->heaers->header('X-Awesome'); + return 1 if $self->req->headers->header('X-Awesome'); $self->render(text => "You're not awesome enough."); return undef; }; @@ -621,7 +616,6 @@ Formats can be automatically detected by looking at file extensions. $self->render('detected'); }; - app->start; __DATA__ @@ -705,13 +699,13 @@ constructs. use Mojolicious::Lite; - # /foo (Firefox) + # Firefox get '/foo' => (agent => qr/Firefox/) => sub { my $self = shift; $self->render(text => 'Congratulations, you are using a cool browser.'); }; - # /foo (Internet Explorer) + # Internet Explorer get '/foo' => (agent => qr/Internet Explorer/) => sub { my $self = shift; $self->render(text => 'Dude, you really need to upgrade to Firefox.'); @@ -733,6 +727,7 @@ L. use Mojolicious::Lite; + # Access session data in action and template get '/counter' => sub { my $self = shift; $self->session->{counter}++; @@ -797,7 +792,7 @@ temporary file. To protect you from excessively large files there is also a limit of C<5MB> by -default, which you can tweak with the C environment +default, which you can tweak with the MOJO_MAX_MESSAGE_SIZE environment variable. # Increase limit to 1GB @@ -845,11 +840,9 @@ directory. use Mojolicious::Lite; - # /external + # Render template "templates/foo/bar.html.ep" any '/external' => sub { my $self = shift; - - # templates/foo/bar.html.ep $self->render('foo/bar'); }; @@ -897,7 +890,7 @@ change the application log level directly in your test files. =head2 Mode To disable debug messages later in a production setup, you can change the -L operating mode with command line options or the C +L operating mode with command line options or the MOJO_MODE environment variable, the default will usually be C. $ ./myapp.pl daemon -m production diff --git a/lib/Mojolicious/Plugin/Config.pm b/lib/Mojolicious/Plugin/Config.pm index 58a638e..04825c8 100644 --- a/lib/Mojolicious/Plugin/Config.pm +++ b/lib/Mojolicious/Plugin/Config.pm @@ -122,7 +122,7 @@ File extension for generated configuration filenames, defaults to C. plugin Config => {file => 'myapp.conf'}; plugin Config => {file => '/etc/foo.stuff'}; -Full path to configuration file, defaults to the value of the C +Full path to configuration file, defaults to the value of the MOJO_CONFIG environment variable or C in the application home directory. =head1 METHODS diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm index 7592114..3b56e9f 100644 --- a/lib/Mojolicious/Plugin/DefaultHelpers.pm +++ b/lib/Mojolicious/Plugin/DefaultHelpers.pm @@ -57,14 +57,6 @@ sub register { } ); - # DEPRECATED in Rainbow! - $app->helper( - render_content => sub { - warn "Mojolicious::Controller->render_content is DEPRECATED!\n"; - shift->content(@_); - } - ); - $app->helper(url_with => \&_url_with); } diff --git a/lib/Mojolicious/Plugin/TagHelpers.pm b/lib/Mojolicious/Plugin/TagHelpers.pm index 476c59c..290d5ce 100644 --- a/lib/Mojolicious/Plugin/TagHelpers.pm +++ b/lib/Mojolicious/Plugin/TagHelpers.pm @@ -2,7 +2,7 @@ package Mojolicious::Plugin::TagHelpers; use Mojo::Base 'Mojolicious::Plugin'; use Mojo::ByteStream 'b'; -use Mojo::Util 'xml_escape'; +use Mojo::Util qw(deprecated xml_escape); sub register { my ($self, $app) = @_; @@ -16,7 +16,7 @@ sub register { # DEPRECATED in Rainbow! $app->helper( base_tag => sub { - warn "base_tag is DEPRECATED!!!\n"; + deprecated 'base_tag is DEPRECATED'; _tag('base', href => shift->req->url->base, @_); } ); diff --git a/lib/Mojolicious/Renderer.pm b/lib/Mojolicious/Renderer.pm index 72334e4..3c2d443 100644 --- a/lib/Mojolicious/Renderer.pm +++ b/lib/Mojolicious/Renderer.pm @@ -26,9 +26,9 @@ sub new { my $self = shift->SUPER::new(@_); $self->add_handler( - json => sub { ${$_[2]} = Mojo::JSON->new->encode($_[3]->{json}) }); - $self->add_handler(data => sub { ${$_[2]} = $_[3]->{data} }); - $self->add_handler(text => sub { ${$_[2]} = $_[3]->{text} }); + json => sub { ${$_[2]} = Mojo::JSON->new->encode($_[3]{json}) }); + $self->add_handler(data => sub { ${$_[2]} = $_[3]{data} }); + $self->add_handler(text => sub { ${$_[2]} = $_[3]{text} }); return $self; } diff --git a/lib/Mojolicious/Routes.pm b/lib/Mojolicious/Routes.pm index 46029d8..4aefcb1 100644 --- a/lib/Mojolicious/Routes.pm +++ b/lib/Mojolicious/Routes.pm @@ -4,7 +4,7 @@ use Mojo::Base 'Mojolicious::Routes::Route'; use List::Util 'first'; use Mojo::Cache; use Mojo::Loader; -use Mojo::Util 'camelize'; +use Mojo::Util qw(camelize deprecated); use Mojolicious::Routes::Match; use Scalar::Util 'weaken'; @@ -20,7 +20,7 @@ sub add_shortcut { shift->_add(shortcuts => @_) } sub auto_render { my ($self, $c) = @_; my $stash = $c->stash; - return undef if $stash->{'mojo.rendered'} || $c->tx->is_websocket; + return undef if $stash->{'mojo.rendered'}; $c->render or ($stash->{'mojo.routed'} or $c->render_not_found); } @@ -81,10 +81,8 @@ sub lookup { # DEPRECATED in Rainbow! sub namespace { - warn <namespace is DEPRECATED in favor of -Mojolicious::Routes->namespaces! -EOF + deprecated 'Mojolicious::Routes::namespace is DEPRECATED in favor of ' + . 'Mojolicious::Routes::namespaces'; my $self = shift; return $self->namespaces->[0] unless @_; $self->namespaces->[0] = shift; diff --git a/lib/Mojolicious/Routes/Pattern.pm b/lib/Mojolicious/Routes/Pattern.pm index fd3b7bd..8e399fb 100644 --- a/lib/Mojolicious/Routes/Pattern.pm +++ b/lib/Mojolicious/Routes/Pattern.pm @@ -36,8 +36,10 @@ sub render { my $format = ($values ||= {})->{format}; $values = {%{$self->defaults}, %$values}; - my $string = ''; - my $optional = 1; + # Placeholders can only be optional without a format + my $optional = !$format; + + my $string = ''; for my $token (reverse @{$self->tree}) { my $op = $token->[0]; my $rendered = ''; diff --git a/lib/Mojolicious/public/css/prettify-mojo.css b/lib/Mojolicious/public/css/prettify-mojo.css index f395f87..e69de29 100644 --- a/lib/Mojolicious/public/css/prettify-mojo.css +++ b/lib/Mojolicious/public/css/prettify-mojo.css @@ -1 +0,0 @@ -.str{color:#9daa7e}.kwd{color:#d5b57c}.com{color:#726d73}.typ{color:#dd7e5e}.lit{color:#fcf0a4}.pun,.opn,.clo{color:#a78353}.pln{color:#889dbc}.tag{color:#d5b57c}.atn{color:#dd7e5e}.atv{color:#9daa7e}.dec{color:#dd7e5e} \ No newline at end of file diff --git a/lib/Mojolicious/public/css/prettify.css b/lib/Mojolicious/public/css/prettify.css index d44b3a2..e69de29 100644 --- a/lib/Mojolicious/public/css/prettify.css +++ b/lib/Mojolicious/public/css/prettify.css @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/lib/Mojolicious/public/js/jquery.js b/lib/Mojolicious/public/js/jquery.js index 83589da..e69de29 100644 --- a/lib/Mojolicious/public/js/jquery.js +++ b/lib/Mojolicious/public/js/jquery.js @@ -1,2 +0,0 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */ -(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
t
",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/lib/Mojolicious/public/js/lang-apollo.js b/lib/Mojolicious/public/js/lang-apollo.js index 7098baf..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-apollo.js +++ b/lib/Mojolicious/public/js/lang-apollo.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, -null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); diff --git a/lib/Mojolicious/public/js/lang-clj.js b/lib/Mojolicious/public/js/lang-clj.js index 542a220..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-clj.js +++ b/lib/Mojolicious/public/js/lang-clj.js @@ -1,18 +0,0 @@ -/* - Copyright (C) 2011 Google Inc. - - Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 - - 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. -*/ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], -["typ",/^:[\dA-Za-z-]+/]]),["clj"]); diff --git a/lib/Mojolicious/public/js/lang-css.js b/lib/Mojolicious/public/js/lang-css.js index 041e1f5..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-css.js +++ b/lib/Mojolicious/public/js/lang-css.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/lib/Mojolicious/public/js/lang-go.js b/lib/Mojolicious/public/js/lang-go.js index fc18dc0..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-go.js +++ b/lib/Mojolicious/public/js/lang-go.js @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/lib/Mojolicious/public/js/lang-hs.js b/lib/Mojolicious/public/js/lang-hs.js index 9d77b08..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-hs.js +++ b/lib/Mojolicious/public/js/lang-hs.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, -null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/lib/Mojolicious/public/js/lang-lisp.js b/lib/Mojolicious/public/js/lang-lisp.js index 02a30e8..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-lisp.js +++ b/lib/Mojolicious/public/js/lang-lisp.js @@ -1,3 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], -["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); diff --git a/lib/Mojolicious/public/js/lang-lua.js b/lib/Mojolicious/public/js/lang-lua.js index e83a3c4..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-lua.js +++ b/lib/Mojolicious/public/js/lang-lua.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], -["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/lib/Mojolicious/public/js/lang-ml.js b/lib/Mojolicious/public/js/lang-ml.js index 6df02d7..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-ml.js +++ b/lib/Mojolicious/public/js/lang-ml.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], -["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/lib/Mojolicious/public/js/lang-n.js b/lib/Mojolicious/public/js/lang-n.js index 6c2e85b..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-n.js +++ b/lib/Mojolicious/public/js/lang-n.js @@ -1,4 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, -a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, -a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/lib/Mojolicious/public/js/lang-proto.js b/lib/Mojolicious/public/js/lang-proto.js index f006ad8..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-proto.js +++ b/lib/Mojolicious/public/js/lang-proto.js @@ -1 +0,0 @@ -PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/lib/Mojolicious/public/js/lang-scala.js b/lib/Mojolicious/public/js/lang-scala.js index 60d034d..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-scala.js +++ b/lib/Mojolicious/public/js/lang-scala.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], -["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/lib/Mojolicious/public/js/lang-sql.js b/lib/Mojolicious/public/js/lang-sql.js index da705b0..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-sql.js +++ b/lib/Mojolicious/public/js/lang-sql.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i, -null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/lib/Mojolicious/public/js/lang-tex.js b/lib/Mojolicious/public/js/lang-tex.js index ce96fbb..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-tex.js +++ b/lib/Mojolicious/public/js/lang-tex.js @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/lib/Mojolicious/public/js/lang-vb.js b/lib/Mojolicious/public/js/lang-vb.js index 07506b0..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-vb.js +++ b/lib/Mojolicious/public/js/lang-vb.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \xa0

"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"“”'],["com",/^['\u2018\u2019].*/,null,"'‘’"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, -null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/lib/Mojolicious/public/js/lang-vhdl.js b/lib/Mojolicious/public/js/lang-vhdl.js index 128b5b6..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-vhdl.js +++ b/lib/Mojolicious/public/js/lang-vhdl.js @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, -null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], -["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/lib/Mojolicious/public/js/lang-wiki.js b/lib/Mojolicious/public/js/lang-wiki.js index 9b0b448..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-wiki.js +++ b/lib/Mojolicious/public/js/lang-wiki.js @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); -PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/lib/Mojolicious/public/js/lang-xq.js b/lib/Mojolicious/public/js/lang-xq.js index e323ae3..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-xq.js +++ b/lib/Mojolicious/public/js/lang-xq.js @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], -["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], -["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/lib/Mojolicious/public/js/lang-yaml.js b/lib/Mojolicious/public/js/lang-yaml.js index c38729b..e69de29 100644 --- a/lib/Mojolicious/public/js/lang-yaml.js +++ b/lib/Mojolicious/public/js/lang-yaml.js @@ -1,2 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/lib/Mojolicious/public/js/prettify.js b/lib/Mojolicious/public/js/prettify.js index eef5ad7..e69de29 100644 --- a/lib/Mojolicious/public/js/prettify.js +++ b/lib/Mojolicious/public/js/prettify.js @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("