Compare commits

...
4 Commits
Author SHA1 Message Date
qwqcode 913a3bec5e v2.3.2
Signed-off-by: qwqcode <qwqcode@gmail.com>
2022-05-22 01:04:27 +08:00
qwqcode 2770c13a56 fix(loading): Editor with two layers of loading not working
Signed-off-by: qwqcode <qwqcode@gmail.com>
2022-05-22 01:01:17 +08:00
qwqcode 0a4d94f133 chore(type): Update imgUploader type
Signed-off-by: qwqcode <qwqcode@gmail.com>
2022-05-21 23:48:08 +08:00
inkss 3384b6abe9 chore(conf): imgUploader just returns img_url string (#166) 2022-05-21 22:30:18 +08:00
4 changed files with 6 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artalk",
"version": "2.3.1",
"version": "2.3.2",
"backendMinVersion": "2.1.7",
"license": "LGPL-3.0",
"description": "A Selfhosted Comment System",
@@ -102,7 +102,7 @@ export default class UploadPlug extends EditorPlug {
resp = await this.ctx.getApi().imgUpload(file)
} else {
// 使用自定义的图片上传器
resp = await this.ctx.conf.imgUploader(file)
resp = {img_url: await this.ctx.conf.imgUploader(file)}
}
} catch (err: any) {
console.error(err)
+3 -2
View File
@@ -2,7 +2,8 @@ import * as Utils from './utils'
/** 显示加载 */
export function showLoading(parentElem: HTMLElement, conf?: { transparentBg?: boolean }) {
let $loading = parentElem.querySelector<HTMLElement>('.atk-loading')
// Use :scope https://developer.mozilla.org/en-US/docs/Web/CSS/:scope
let $loading = parentElem.querySelector<HTMLElement>(':scope > .atk-loading')
if (!$loading) {
$loading = Utils.createElement(
`<div class="atk-loading atk-fade-in" style="display: none;">
@@ -27,7 +28,7 @@ export function showLoading(parentElem: HTMLElement, conf?: { transparentBg?: bo
/** 隐藏加载 */
export function hideLoading(parentElem: HTMLElement) {
const $loading = parentElem.querySelector<HTMLElement>('.atk-loading')
const $loading = parentElem.querySelector<HTMLElement>(':scope > .atk-loading')
if ($loading) $loading.style.display = 'none'
}
+1 -1
View File
@@ -98,7 +98,7 @@ export default interface ArtalkConfig {
imgUpload: boolean
/** 图片上传器 */
imgUploader?: (file: File) => Promise<{ img_url: string }>
imgUploader?: (file: File) => Promise<string>
/** 版本检测 */
versionCheck: boolean