Revision 2e28a755
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/File.pm | ||
---|---|---|
317 | 317 |
sub action_ajax_get_thumbnail { |
318 | 318 |
my ($self) = @_; |
319 | 319 |
|
320 |
my $file = SL::File->get(id => $::form->{file_id}); |
|
320 |
my $id = $::form->{file_id}; |
|
321 |
my $version = $::form->{file_version}; |
|
322 |
my $file = SL::File->get(id => $id); |
|
323 |
|
|
324 |
$file->version($version) if $version; |
|
325 |
|
|
321 | 326 |
my $thumbnail = _create_thumbnail($file, $::form->{size}); |
322 | 327 |
|
323 |
my $overlay_selector = '#enlarged_thumb_' . $::form->{file_id}; |
|
328 |
my $overlay_selector = '#enlarged_thumb_' . $id; |
|
329 |
$overlay_selector .= '_' . $version if $version; |
|
324 | 330 |
$self->js |
325 | 331 |
->attr($overlay_selector, 'src', 'data:' . $thumbnail->{thumbnail_img_content_type} . ';base64,' . MIME::Base64::encode_base64($thumbnail->{thumbnail_img_content})) |
326 | 332 |
->data($overlay_selector, 'is-overlay-loaded', '1') |
js/kivi.File.js | ||
---|---|---|
303 | 303 |
|
304 | 304 |
ns.add_enlarged_thumbnail = function(e) { |
305 | 305 |
var file_id = $(e.target).data('file-id'); |
306 |
var file_version = $(e.target).data('file-version'); |
|
306 | 307 |
var overlay_img_id = 'enlarged_thumb_' + file_id; |
308 |
if (file_version) { overlay_img_id = overlay_img_id + '_' + file_version }; |
|
307 | 309 |
var overlay_img = $('#' + overlay_img_id); |
308 | 310 |
|
309 | 311 |
if (overlay_img.data('is-overlay-shown') == 1) return; |
... | ... | |
317 | 319 |
var data = { |
318 | 320 |
action: 'File/ajax_get_thumbnail', |
319 | 321 |
file_id: file_id, |
320 |
file_version: $(e.target).data('file-version'),
|
|
322 |
file_version: file_version,
|
|
321 | 323 |
size: 512 |
322 | 324 |
}; |
323 | 325 |
|
templates/webpages/file/list.html | ||
---|---|---|
70 | 70 |
data-file-id="[% file.id %]" data-file-version="[% file.version %]" |
71 | 71 |
src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]" |
72 | 72 |
alt="[% file.file_name %]"> |
73 |
<img id="enlarged_thumb_[% file.id %]" class="overlay_img"> |
|
73 |
<img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img">
|
|
74 | 74 |
</div> |
75 | 75 |
[%- ELSE %] |
76 | 76 |
- |
Auch abrufbar als: Unified diff
Dateimanagement: größere Vorschaubilder: Versionen berücksichtigen