From a2fe24e8eb97577bf954f7716c25d48080d9f01f Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Tue, 19 Jun 2018 00:33:41 +1000 Subject: [PATCH] * merge css code for buttons of zerobin & filebin * small fixes --- public/theme/css/default.css | 33 +++++++++++++++++++------------- templates/filebin/create.html.ep | 2 +- templates/filebin/latest.html.ep | 2 +- templates/filebin/view.html.ep | 12 ++++++------ templates/zerobin/view.html.ep | 4 ++-- 5 files changed, 30 insertions(+), 23 deletions(-) diff --git a/public/theme/css/default.css b/public/theme/css/default.css index 7b93e38..116756f 100644 --- a/public/theme/css/default.css +++ b/public/theme/css/default.css @@ -144,25 +144,32 @@ div.paste { text-align: justify; } -a.zerobin { - padding-left: 18px; - background: transparent no-repeat scroll left center; - font-size: 12pt; +/* filebin */ +table.filebin.limits { + color: gray; } -a.zerobin.create { background-image: url('/theme/img/create.png'); } -a.zerobin.download { background-image: url('/theme/img/download.png'); } -a.zerobin.upload { background-image: url('/theme/img/upload.png'); } -a.zerobin.latest { background-image: url('/theme/img/images.png'); } +table.filebin.files tr:nth-of-type(even) { + background-color: #EAEAEA; +} -/* imgbin */ -div.img-preview { - margin: 5px; - display: inline-block; - vertical-align: top; +table.filebin.files td { + padding: 3px 5px; } span.filebin.error { font-size: 14pt; color: red; } + +/* common buttons for zerobin & filebin */ +a.btn { + padding-left: 18px; + background: transparent no-repeat scroll left center; + font-size: 12pt; +} + +a.btn.create { background-image: url('/theme/img/create.png'); } +a.btn.download { background-image: url('/theme/img/download.png'); } +a.btn.upload { background-image: url('/theme/img/upload.png'); } +a.btn.latest { background-image: url('/theme/img/images.png'); } diff --git a/templates/filebin/create.html.ep b/templates/filebin/create.html.ep index a67b0ff..12140e4 100644 --- a/templates/filebin/create.html.ep +++ b/templates/filebin/create.html.ep @@ -15,7 +15,7 @@ <%= select_field 'expire' => \@times %> % if (config->{filebin}->{show_latest}) { - <%= link_to l('Latest images') => "/filebin/latest", class => 'filebin latest' %> + <%= link_to l('Latest files') => "/filebin/latest", class => 'btn latest' %> % }
diff --git a/templates/filebin/latest.html.ep b/templates/filebin/latest.html.ep index 48ec9c8..d22ae1f 100644 --- a/templates/filebin/latest.html.ep +++ b/templates/filebin/latest.html.ep @@ -3,7 +3,7 @@

<%= l('Latest files') %>

- <%= link_to l('Upload') => "/filebin", class => 'filebin upload' %> + <%= link_to l('Upload') => "/filebin", class => 'btn upload' %>

diff --git a/templates/filebin/view.html.ep b/templates/filebin/view.html.ep index 72111de..31050cf 100644 --- a/templates/filebin/view.html.ep +++ b/templates/filebin/view.html.ep @@ -4,10 +4,10 @@

<%= l('View file') %>

- <%= link_to l('Upload') => "/filebin", class => 'filebin upload' %>  - <%= link_to l('Download') => $file->{path}, class => 'filebin download', download => $file->{fname} %>  + <%= link_to l('Upload') => "/filebin", class => 'btn upload' %>  + <%= link_to l('Download') => $file->{path}, class => 'btn download', download => $file->{fname} %>  % if (config->{filebin}->{show_latest}) { - <%= link_to l('Latest files') => "/filebin/latest", class => 'filebin latest' %>  + <%= link_to l('Latest files') => "/filebin/latest", class => 'btn latest' %>  % }

@@ -15,9 +15,9 @@ % if ($file->{ftype} eq 'i') { <%= image $file->{path} %> % } elsif ($file->{ftype} eq 'a') { - <%= tag audio => (src => $file->{path}, controls => 'controls', loop => 0, autoplay => 0) => l('HTML5-aware browser required') %> + <%= tag audio => (src => $file->{path}, controls => 'controls', preload => 'metadata') => l('HTML5-aware browser required') %> % } elsif ($file->{ftype} eq 'v') { - <%= tag video => (src => $file->{path}, controls => 'controls', loop => 0, autoplay => 0) => l('HTML5-aware browser required') %> + <%= tag video => (src => $file->{path}, controls => 'controls', preload => 'metadata') => l('HTML5-aware browser required') %> % }

@@ -25,7 +25,7 @@ -% if ($file->{ftype} eq 'i' or $file->{ftype} eq 'v') { +% if (($file->{ftype} eq 'i' or $file->{ftype} eq 'v') and ($file->{res_w} or $file->{res_h})) { % }
<%= l('Name') %>:<%= $file->{fname} %>
<%= l('Size') %>:<%= sprintf("%.1f kb", $file->{fsize} / 1024) %>
<%= l('Mime') %>:<%= $file->{fmime} %>
<%= l('Image size') %>:<%= sprintf("%dx%d", $file->{res_w}, $file->{res_h}) %>
diff --git a/templates/zerobin/view.html.ep b/templates/zerobin/view.html.ep index 0debae9..c31b950 100644 --- a/templates/zerobin/view.html.ep +++ b/templates/zerobin/view.html.ep @@ -5,8 +5,8 @@

<%= l('View paste') %>

- <%= link_to l('Create new') => "/zerobin", class => 'zerobin create' %> - <%= link_to l('Download') => "/zerobin/$fname", class => 'zerobin download', download => $fname %> + <%= link_to l('Create new') => "/zerobin", class => 'btn create' %> + <%= link_to l('Download') => "/zerobin/$fname", class => 'btn download', download => $fname %>
% if (not $paste->{syntax} or $paste->{syntax} eq 'plaintext') {