Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: perlpunk/www-module-corelist-perl
base: 0ff5e5cadb
...
head fork: perlpunk/www-module-corelist-perl
compare: 18d699a501
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
6 htdocs/css/corelist.css
@@ -247,3 +247,9 @@ hr {
border: 0px solid grey;
border-top: 1px solid grey;
}
+p.usage {
+ color: #404040;
+}
+p.usage a {
+ color: #404040;
+}
View
9 lib/WWW/Module/CoreList.pm
@@ -149,7 +149,6 @@ sub version {
my @versions;
my $found = 0;
my @list;
- my $fuzzy = $submits->{fuzzy};
my $version = Module::CoreList->first_release($module);
my $mversion;
my $removed;
@@ -170,7 +169,7 @@ sub version {
date => $date,
removed => $removed,
};
- if (not $submits->{fuzzy} and not $found) {
+ if (not $submits->{substr} and not $found) {
# try case insensitive
my $lower = lc $module;
if (exists $lc{ $lower }) {
@@ -197,9 +196,11 @@ sub version {
$found = 1;
}
}
- if ($submits->{fuzzy} or not $found) {
+ if ($submits->{substr} or not $found) {
push @list, sort Module::CoreList->find_modules(qr/\Q$module/i);
- shift @list if $found;
+ if ($found) {
+ @list = grep { $_ ne $module } @list;
+ }
}
for my $mod (@list) {
my $version = Module::CoreList->first_release($mod);
View
51 lib/WWW/Module/CoreList/Request.pm
@@ -49,9 +49,8 @@ sub from_cgi {
my ($action, @args) = $class->parse_args($cgi);
$self->path_info('/' . join '/', grep defined, $action, @args);
my %submits;
- # only set submit buttons if method is post (security)
$self->cgi($cgi);
- if ($self->is_post) {
+# if ($self->is_post) {
%submits = map {
my $key = $_;
my $value = $cgi->param($key);
@@ -60,8 +59,7 @@ sub from_cgi {
}
else { () }
} $cgi->param();
- }
- warn __PACKAGE__.':'.__LINE__.": SUBMIT: @{[ sort keys %submits ]}\n" if keys %submits;;
+# }
$self->submit(\%submits);
$self->action($action);
$self->args(\@args);
@@ -69,57 +67,16 @@ sub from_cgi {
# $cookies = $self->cgi_class->{cookie}->fetch;
#warn Data::Dumper->Dump([\$cookies], ['cookies']);
# $self->cookies($cookies);
- my %language_cookie = $self->cookie('battie_prefs_lang');
- my $preferred;
- my @lang;
- if ($language_cookie{lang}) {
- $preferred = $language_cookie{lang};
- }
- else {
- my $language = $cgi->http('Accept-language') || $default_language;
- @lang = split m/,/, $language;
- # TODO
- #warn __PACKAGE__.':'.__LINE__.": Accept-language: (@lang)\n";
- for my $lang (@lang) {
- my ($l, $weight) = split m/;/, $lang;
- $weight =~ s/^q=// if $weight;
- $lang = [$l, $weight];
- }
- $preferred = shift @lang;
- $preferred = $preferred->[0];
- $preferred =~ tr/-/_/;
- }
- $preferred = {
- de => 'de_DE',
- de_de => 'de_DE',
- en => 'en_US',
- en_gb => 'en_US',
- en_us => 'en_US',
- }->{lc $preferred} || 'en_US';
- $self->language([ $preferred, @lang ]);
return $self;
}
sub param {
my ($self, @args) = @_;
- my $is_ajax = $self->cgi->param('is_ajax');
if (wantarray) {
- my @ret;
- if ($is_ajax) {
- @ret = $self->cgi->param(@args);
- #@ret = map { Encode::encode_utf8($_) } $self->cgi->param(@args);
- }
- else {
- @ret = map { Encode::decode_utf8($_) } $self->cgi->param(@args);
- }
+ my @ret = map { Encode::decode_utf8($_) } $self->cgi->param(@args);
return @ret;
}
- if ($is_ajax) {
- return $self->cgi->param(@args);
- }
- else {
- return Encode::decode_utf8($self->cgi->param(@args));
- }
+ return Encode::decode_utf8($self->cgi->param(@args));
}
sub request_method {
my ($self, @args) = @_;
View
2  templates/index2.html
@@ -1,7 +1,7 @@
<div class="functionbox functionbox_small function_center">
<h1>First Release</h1>
-Find out if a perl module is in core and since when.
+Find out if a perl module is in core and since when. (<a href="[%= .self %]/version">help</a>)
[%include version_form.html %]
</div>
View
11 templates/version.html
@@ -1,5 +1,16 @@
<h3>Find out if a perl module is in core and since when.</h3>
+<p class="usage">
+You can enter the full name of the module. Search is case insensitive.
+If the module is not found, a search for the substring is started. If you
+choose substring search, a search for the substring is done in any case.<br>
+Examples:
+<a href="[%= .self %]/version?module=list::util">list::util</a>,
+<a href="[%= .self %]/version?module=AutoLoader">AutoLoader</a>,
+<a href="[%= .self %]/version?module=perlio::scalar">perlio::scalar</a>,
+<a href="[%= .self %]/version?module=Test;submit.substr=1">Test (substring)</a>,
+<a href="[%= .self %]/version?module=test;submit.substr=1">test</a>
+</p>
[%include version_form.html %]
[%with .show_version %]
View
4 templates/version_form.html
@@ -2,7 +2,7 @@
<p>
Module: <input type="text" name="module" value="[%= .p.module %]" /><br /><br />
- <input class="button" type="submit" value="Show version" />
- <input class="button" type="submit" name="submit.fuzzy" value="Show version (fuzzy)" />
+ <input class="button" type="submit" value="Search" />
+ <input class="button" type="submit" name="submit.fuzzy" value="Search (substring)" />
</p>
</form>

No commit comments for this range

Something went wrong with that request. Please try again.