From 53f80f74e174b700215a4d9d298183a9a2b4ed57 Mon Sep 17 00:00:00 2001
From: "m.bs" <519337479@qq.com>
Date: Mon, 4 Apr 2022 02:52:14 +0000
Subject: [PATCH] =?UTF-8?q?update=20public/static/admin.js.=20=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91uploadOneVideo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/static/admin.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/public/static/admin.js b/public/static/admin.js
index d30d628c5..84c6dd6b0 100644
--- a/public/static/admin.js
+++ b/public/static/admin.js
@@ -611,6 +611,20 @@ $(function () {
});
};
+ /*! 上传单个视频 */
+ $.fn.uploadOneVideo = function () {
+ return this.each(function () {
+ if ($(this).data('inited')) return true; else $(this).data('inited', true);
+ var $in = $(this), $bt = $('ဆ').data('input', this);
+ $bt.attr('data-size', $in.data('size') || 0).attr('data-type', $in.data('type') || 'mp4').find('span').on('click', function (event) {
+ event.stopPropagation();
+ if ($(this).index() === 0) $bt.attr('style', ''), $in.val(''); else $in.val() && $.previewImage(encodeURI($in.val()));
+ }), $in.on('change', function () {
+ if (this.value) $bt.html('');
+ }).after($bt).trigger('change');
+ });
+ };
+
/*! 标签输入插件 */
$.fn.initTagInput = function () {
return this.each(function () {