Skip to content

Commit

Permalink
Merge remote branch 'origin/plu/qtip2' into author-wishlist
Browse files Browse the repository at this point in the history
  • Loading branch information
monken committed Aug 5, 2011
2 parents cc1c9ec + ed2c144 commit 1f21d68
Show file tree
Hide file tree
Showing 38 changed files with 390 additions and 172 deletions.
3 changes: 2 additions & 1 deletion app.psgi
Expand Up @@ -34,9 +34,10 @@ $app = Plack::Middleware::Assets->wrap( $app,
files => [<root/static/css/*.css>] );
$app = Plack::Middleware::Assets->wrap(
$app,
# should we autoload the syntax brushes or otherwise specify which ones are needed (instead of "all")?
files => [
map {"root/static/js/$_.js"}
qw(jquery.min jquery.tablesorter jquery.cookie jquery.relatize_date jquery.ajaxQueue jquery.autocomplete.pack jquery.bubblepopup.min shCore shBrushPerl shBrushDiff cpan github)
qw(jquery.min jquery.tablesorter jquery.cookie jquery.relatize_date jquery.ajaxQueue jquery.qtip.pack jquery.autocomplete.pack shCore shBrushPerl shBrushPlain shBrushYaml shBrushJScript shBrushDiff cpan github)
],
minify => 0,
);
Expand Down
13 changes: 13 additions & 0 deletions lib/MetaCPAN/Web/Controller/Source.pm
Expand Up @@ -11,10 +11,23 @@ sub index : PathPart('source') : Chained('/') : Args {
= ( $c->model('API::Module')->source(@module)
& $c->model('API::Module')->get(@module) )->recv;
if ( $source->{raw} ) {
# could this be a method/function somewhere else?
my $filetype = do {
local $_ = $module->{path};
# what other file types can we check for?
m!\.p[ml]$!i ? 'pl' :
m!\.pod$! ? 'pl' : # no separate pod brush as of 2011-08-04
m!\.ya?ml$! ? 'yaml' :
m!\.js(on)?$! ? 'js' :
$module->{mime} =~ /perl/ ? 'pl' :
# default to plain text
'plain';
};
$c->stash(
{ template => 'source.html',
source => $source->{raw},
module => $module,
filetype => $filetype,
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion root/inc/release-info.html
@@ -1,7 +1,7 @@
<% IF release.resources.homepage %><li><a href="<% release.resources.homepage %>">Homepage</a></li><% END %>
<li><% release.resources %></li>
<% IF release.resources.repository %>
<li id="release-info-repository">
<li>
<% IF release.resources.repository.web %>
<a href="<% release.resources.repository.web %>">Repository</a>
<% END %>
Expand Down
2 changes: 1 addition & 1 deletion root/source.html
Expand Up @@ -24,7 +24,7 @@
</div>

<div class="content">
<pre class="brush: pl; class-name: 'highlight'; toolbar: false;" id="source"><% source %></pre>
<pre class="brush: <% filetype %>; class-name: 'highlight'; toolbar: false;" id="source"><% source %></pre>
</div>

<script type="text/javascript">
Expand Down
83 changes: 0 additions & 83 deletions root/static/css/jquery.bubblepopup.css

This file was deleted.

1 change: 1 addition & 0 deletions root/static/css/jquery.qtip.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion root/static/css/style.css
Expand Up @@ -599,8 +599,35 @@ code { font-family: monospace; }
width: 160px;
}

table .release-info-github th {
body div.qtip div.content {
padding: 0;
margin: 0;
height: auto; min-height: auto;
width: auto; min-width: auto;
}

.ui-tooltip, .qtip {
font-size: 12px;
max-width: 800px;
}

.ui-tooltip-content {
padding: 0;
}

div.qtip-github table {
width: 100%;
}

div.qtip-github table td, div.qtip-github table th {
padding: 3px;
border: 1px solid #F1F1F1;
}

div.qtip-github table th {
padding-right: 8px;
white-space: nowrap;
background-color: #F9F9F9;
}

.release-table {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1f21d68

Please sign in to comment.