Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
913a3bec5e | ||
|
|
2770c13a56 | ||
|
|
0a4d94f133 | ||
|
|
3384b6abe9 |
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
@@ -98,7 +98,7 @@ export default interface ArtalkConfig {
|
||||
imgUpload: boolean
|
||||
|
||||
/** 图片上传器 */
|
||||
imgUploader?: (file: File) => Promise<{ img_url: string }>
|
||||
imgUploader?: (file: File) => Promise<string>
|
||||
|
||||
/** 版本检测 */
|
||||
versionCheck: boolean
|
||||
|
||||
Reference in new issue
Block a user