This commit is contained in:
杜恒
2021-04-21 16:07:59 +08:00
parent 8056d8c0e8
commit b57276ffa2
16 changed files with 120 additions and 39 deletions

File diff suppressed because one or more lines are too long

View File

@@ -910,8 +910,8 @@ body.fullscreen {
height: 100%;
border-radius: 6px;
transition: width 0.35s;
&::before{
content: "";
&::before {
content: '';
opacity: 0;
position: absolute;
top: 0;
@@ -928,6 +928,17 @@ body.fullscreen {
color: #909399;
}
}
.joe_detail__article-callout {
display: block;
padding: 12px;
border: 1px solid #ebeef5;
border-left-width: 4px;
border-radius: 4px;
color: #606266;
*:last-child {
margin-bottom: 0 !important;
}
}
@media (max-width: 768px) {
.cm-modal__wrapper {
@@ -936,12 +947,12 @@ body.fullscreen {
}
@keyframes progress-active {
0% {
opacity: .3;
width: 0
}
to {
opacity: 0;
width: 100%
}
}
0% {
opacity: 0.3;
width: 0;
}
to {
opacity: 0;
width: 100%;
}
}

View File

@@ -661,4 +661,22 @@ export default class JoeAction {
}
});
}
handleCallout(cm) {
this._openModal({
title: '插入标注',
innerHtml: `
<div class="fitem">
<label>边框颜色</label>
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#f0ad4e" name="color" type="color"/>
</div>
`,
confirm: () => {
const color = $(".cm-modal input[name='color']").val();
const str = `\n{callout color="${color}"}\n标注内容\n{/callout}\n\n`;
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
else this._replaceSelection(cm, str);
cm.focus();
}
});
}
}

View File

@@ -28,6 +28,7 @@ export default function createPreviewHtml(str) {
str = str.replace(/{progress([^}]*)\/}/g, '<joe-progress $1></joe-progress>');
str = str.replace(/{hide[^}]*}([\s\S]*?){\/hide}/g, '<joe-hide></joe-hide>');
str = str.replace(/{card-default([^}]*)}([\s\S]*?){\/card-default}/g, '<section style="margin-bottom: 15px"><joe-card-default $1><span class="_temp" style="display: none">$2</span></joe-card-default></section>');
str = str.replace(/{callout([^}]*)}([\s\S]*?){\/callout}/g, '<section style="margin-bottom: 15px"><joe-callout $1><span class="_temp" style="display: none">$2</span></joe-callout></section>');
const div = document.createElement('div');
div.innerHTML = str;

View File

@@ -175,6 +175,11 @@ export default [
title: '进度条',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M757.76 323.482a188.518 188.518 0 0 1 0 377.036H266.24a188.518 188.518 0 1 1 0-377.036h491.52zm0 66.56H502.63l-72.96 243.814H757.71a121.958 121.958 0 0 0 8.397-243.558l-8.397-.308z"/></svg>'
},
{
type: 'callout',
title: '标注',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M842.13 910h-72.36c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.36c19.88 0 36 16.12 36 36s-16.11 36-36 36zm-177.69 0h-72.23c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.12 36-36 36zm-177.57 0h-72.23c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.11 36-36 36zm-177.56 0h-72.23c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.12 36-36 36zM150 878.02c-19.88 0-36-16.1-36-35.98V769.8c0-19.88 16.12-36 36-36s36 16.12 36 36V842c0 19.88-16.12 36.02-36 36.02zm724-55.2c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.88-16.12 36-36 36zM150 700.47c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.88-16.12 36-36 36zm724-55.22c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.89-16.12 36-36 36zM150 522.91c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.88-16.12 36-36 36zm724-55.22c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.88-16.12 36-36 36zM150 345.34c-19.88 0-36-16.12-36-36v-72.23c0-19.88 16.12-36 36-36s36 16.12 36 36v72.23c0 19.89-16.12 36-36 36zm724-55.21c-19.88 0-36-16.12-36-36V182c0-19.88 16.12-36.05 36-36.05s36 16.07 36 35.95v72.23c0 19.88-16.12 36-36 36zM786.85 186h-72.23c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.12 36-36 36zm-177.56 0h-72.23c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.12 36-36 36zm-177.56 0H359.5c-19.88 0-36-16.12-36-36s16.12-36 36-36h72.23c19.88 0 36 16.12 36 36s-16.12 36-36 36zm-177.57 0H182c-19.88 0-36.03-16.12-36.03-36s16.08-36 35.97-36h72.23c19.88 0 36 16.12 36 36s-16.13 36-36.01 36z"/><path d="M213 120v784c0 4.42-3.58 8-8 8h-84c-4.42 0-8-3.58-8-8V120c0-4.42 3.58-8 8-8h84c4.42 0 8 3.58 8 8z"/></svg>'
},
/* --------------------------- 短代码结束 --------------------------- */
{
type: 'clean',

File diff suppressed because one or more lines are too long

View File

@@ -301,6 +301,9 @@ class Joe extends JoeAction {
case 'progress':
super.handleProgress(this.cm);
break;
case 'callout':
super.handleCallout(this.cm);
break;
}
});
$('.cm-tools').append(el);