Fix #879 align multimedia search results to the left

This commit is contained in:
Kijin Sung 2017-08-16 23:20:08 +09:00
parent 73c09ce876
commit c714c3629a
3 changed files with 6 additions and 6 deletions

View file

@ -536,9 +536,9 @@ function _displayMultimedia(src, width, height, options) {
height = parseInt(height, 10);
if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){
html = '<img src="'+src+'" width="'+width+'" height="'+height+'" />';
html = '<img src="'+src+'" width="'+width+'" height="'+height+'" class="thumb" />';
} else {
html = '<span style="display:inline-block;position:relative;background:black;width:' + width + 'px;height:' + height + 'px;border:0;margin:0;padding:0">';
html = '<span style="position:relative;background:black;width:' + width + 'px;height:' + height + 'px" class="thumb">';
html += '<img style="width:24px;height:24px;position:absolute;left:50%;top:50%;border:0;margin:-12px 0 0 -12px;padding:0" src="./common/img/play.png" alt="" />';
html += '</span>';
}

View file

@ -194,13 +194,13 @@ class integration_searchModel extends module
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, 120, 120, 'crop');
$thumbnail_url = Context::getRequestUri().$thumbnail_file;
if(!file_exists($thumbnail_file)) FileHandler::createImageFile($val->uploaded_filename, $thumbnail_file, 120, 120, 'jpg', 'crop');
$obj->src = sprintf('<img src="%s" alt="%s" width="%d" height="%d" />', $thumbnail_url, htmlspecialchars($obj->filename, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 120, 120);
$obj->src = sprintf('<img src="%s" alt="%s" width="%d" height="%d" class="thumb" />', $thumbnail_url, htmlspecialchars($obj->filename, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 120, 120);
// Videos
}
else if(preg_match('/\.(swf|flv|wmv|avi|mpg|mpeg|asx|asf|mp3)$/i', $val->source_filename))
{
$obj->type = 'multimedia';
$obj->src = sprintf('<script>displayMultimedia("%s",120,120);</script>', $val->uploaded_filename);
$obj->src = sprintf('<script>displayMultimedia("%s",80,80);</script>', $val->uploaded_filename);
// Others
}
else

View file

@ -5,10 +5,10 @@
<!--@if(!count($output->data))-->
<span class="noResult">{$lang->msg_no_result}</span>
<!--@else-->
<ul class="searchImageResult">
<ul class="searchResult">
<!--@foreach($output->data as $no => $image)-->
<li>
<a href="{$image->url}">{$image->src}</a>
<a href="{$image->url}" onclick="window.open(this.href);return false;">{$image->src}</a>
<dl>
<dt><a href="{$image->url}">{$image->filename}</a></dt>
</dl>