* Finish task #64887.

This commit is contained in:
zhouxudong
2022-08-15 12:18:18 +00:00
parent 41507c49c2
commit f759bf78e5
2 changed files with 35 additions and 7 deletions
+16 -2
View File
@@ -3,6 +3,7 @@
.file-input .file-editbox{max-width:40%;}
.file-input-list .input-group-btn{float:left}
.fileAction {color: #0c64eb !important;}
.backgroundColor {background: #eff5ff; }
</style>
<?php js::set('dangerExtensions', ',' . $this->config->file->dangers . ',');?>
<?php js::set('maxUploadSize', $maxUploadSize);?>
@@ -26,8 +27,8 @@
<small class="file-size muted"></small>
</div>
<div class="input-group-btn">
<button type="button" class="fileAction btn btn-link file-input-rename"><?php echo $lang->file->edit;?></button>
<button type="button" class="fileAction btn btn-link file-input-delete"><?php echo $lang->delete;?></button>
<button type="button" class="fileAction btn btn-link file-input-rename" title="<?php echo $lang->file->edit;?>"><i class='icon icon-pencil-alt'></i></button>
<button type="button" class="fileAction btn btn-link file-input-delete hidden" title="<?php echo $lang->delete;?>"><i class='icon icon-trash'></i></button>
</div>
</div>
<input type="file" name="<?php echo $filesName;?>[]" onchange="checkDangerExtension(this)" />
@@ -37,6 +38,19 @@
var totalSize = 0;
maxUploadSize = unitConversion(maxUploadSize);
$(function(){
$('div.file-input.normal').mouseover(function(){
//$(this).children('.file-input-normal.input-group .input-group-btn .fileAction').removeClass("hidden");
//$(this).addClass('backgroundColor');
console.log(123);
});
$('div.file-input.normal').mouseout(function(){
// $(this).children('.file-input-normal.input-group .input-group-btn .fileAction').addClass("hidden");
// $(this).removeClass('backgroundColor');
console.log(456);
});
});
/**
* Conversion unit to byte.
*
+19 -5
View File
@@ -14,9 +14,22 @@
.renameFile .input-group {margin-left: 10px;}
.renameFile .icon {margin-top: 8px;}
.renameFile .input-group-addon {width: 60px;}
.backgroundColor {background: #eff5ff; }
.icon.icon-file-text {margin-left: 4px;}
</style>
<script>
/**
$(document).ready(function(){
$('li.file').mouseover(function(){
$(this).children('span.right-icon').removeClass("hidden");
$(this).addClass('backgroundColor');
});
$('li.file').mouseout(function(){
$(this).children('span.right-icon').addClass("hidden");
$(this).removeClass('backgroundColor');
});
});
/**
* Delete a file.
*
* @param int $fileID
@@ -165,7 +178,7 @@
$objectType = zget($this->config->file->objectType, $file->objectType);
if(common::hasPriv($objectType, 'edit', $object))
{
echo "<span class='right-icon'>&nbsp; ";
echo "<span class='right-icon hidden'>&nbsp; ";
/* Determines whether the file supports preview. */
if($file->extension == 'txt')
@@ -179,7 +192,7 @@
/* For the open source version of the file judgment. */
if(stripos('txt|jpg|jpeg|gif|png|bmp', $file->extension) !== false)
{
echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
echo html::a($downloadLink, "<i class='icon icon-eye'></i>", '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
}
/* For the max version of the file judgment. */
@@ -192,8 +205,9 @@
}
}
common::printLink('file', 'download', "fileID=$file->id", $lang->file->downloadFile, '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
if(common::hasPriv('file', 'edit')) echo html::a('###', $lang->file->edit, '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
common::printLink('file', 'download', "fileID=$file->id", "<i class='icon icon-download'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
if(common::hasPriv('file', 'edit')) echo html::a('###', "<i class='icon icon-pencil-alt'></i>", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'");
echo '</span>';
}
echo '</li>';?>