From d5a4721a204132b0b471c1954d2ec2ce1635e687 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 16 Oct 2022 10:46:59 +0800 Subject: [PATCH] feat(web/image_hosting): image preview --- web/app/controllers/image_hosting/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app/controllers/image_hosting/index.php b/web/app/controllers/image_hosting/index.php index 967be43..1d45974 100644 --- a/web/app/controllers/image_hosting/index.php +++ b/web/app/controllers/image_hosting/index.php @@ -318,8 +318,9 @@ $('#image_upload_file').change(function() { var watermark_type = $('input[name=watermark]:checked', '#image-upload-form').data('value'); var html = ''; - html += '大小:'+($(this).prop('files')[0].size / 1024).toFixed(2)+' KB。'; - + html += '
'; + html += '大小:'+($(this).prop('files')[0].size / 1024).toFixed(2)+' KB。'; + if (watermark_type === 'no_watermark') { html += '不添加水印。'; } else if (watermark_type === 'site_shortname_and_username') { @@ -328,6 +329,8 @@ $('#image_upload_file').change(function() { html += '使用水印:= UOJConfig::$data['profile']['oj-name-short'] ?>。'; } + html += '
'; + $('#modal-file-info').html(html); $('#modal-help-message').html('').hide(); image_upload_modal.show();