Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
yc-2018 committed Aug 20, 2024
2 parents 688a7b5 + 367bcd4 commit e79b90a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/pages/MemoDrawer/compontets/FormModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import modalStyle from './formModal.module.css'
import CommonStore from "../../../store/CommonStore";

const {TextArea} = Input;
/** 外部图片链接列表 */
const externalImgBedList = [
{src: 'https://playground.z.wiki/img-cloud/index.html', title: '外部图床1(可能失效,注意信息安全)'},
{src: 'https://ycimg.pages.dev/', title: '外部图床2(加载缓慢,最大支持5M)'},
]
/**
* 新增/编辑备忘录弹窗
*
Expand Down Expand Up @@ -125,7 +130,26 @@ const FormModal = ({isOpen, setOpen, data, reList, currentMemoType}) => {
}
}, 100)
}


/** 打开外部图床弹窗 */
const openExternalImgModel = (title, src) =>
modal.info({
title,
style: {top: 20},
wrapClassName:modalStyle.externalImgModel,
width: '100vh',
okText: '关闭',
maskClosable: true,
content:
<iframe
src={src}
title={title}
allow="clipboard-read; clipboard-write"
style={{width: '100%', height: '100%'}}
/>
})

/** 帮助按钮气泡 */
const help =
<div>
<p>● 点击插入时间/段,可插入时间/段在输入框光标所在位置</p>
Expand All @@ -145,6 +169,12 @@ const FormModal = ({isOpen, setOpen, data, reList, currentMemoType}) => {

/** 自定义底部按钮 */
const footerButtons = [
...externalImgBedList.map(({title, src}, index) =>
<Button
key={index}
onClick={() => openExternalImgModel(title, src)}>
外部图床{index + 1}
</Button>),
<Popover key="help" content={help} title="帮助"><Button icon={<QuestionCircleTwoTone/>} shape="circle"/></Popover>,
<Popover key="insertSymbol" content={signs} title="插入符号"><Button icon={<SmileTwoTone/>}
shape="circle"/></Popover>,
Expand Down
3 changes: 3 additions & 0 deletions src/pages/MemoDrawer/compontets/formModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
background-color: #f5f5f5; /*鼠标放上去背景变浅色*/
}

.externalImgModel [class="ant-modal-confirm-content"] {
height: 75vh;
}

0 comments on commit e79b90a

Please sign in to comment.