This commit is contained in:
杜恒
2021-04-22 15:36:33 +08:00
parent 88030a0b16
commit 593e236a02
16 changed files with 446 additions and 277 deletions

File diff suppressed because one or more lines are too long

View File

@@ -940,6 +940,60 @@ body.fullscreen {
margin-bottom: 0 !important;
}
}
.joe_detail__article-tabs {
display: block;
width: 100%;
overflow: hidden;
background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
border: 1px solid #ebeef5;
border-radius: 4px;
.heads {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
display: flex;
background: #f2f6fc;
.item {
position: relative;
padding: 0 15px;
line-height: 40px;
height: 40px;
color: #909399;
cursor: pointer;
transition: color 0.5s;
white-space: nowrap;
&::after {
content: '';
position: absolute;
background: #409eff;
bottom: 0;
left: 15px;
right: 15px;
height: 2px;
opacity: 0;
border-radius: 2px;
transform: scaleX(0.5);
transition: opacity 0.25s, transform 0.25s;
}
&.active {
color: #409eff;
&::after {
opacity: 1;
transform: scaleX(1);
}
}
}
}
.bodys {
.item {
padding: 15px;
*:last-child {
margin-bottom: 0 !important;
}
}
}
}
@media (max-width: 768px) {
.cm-modal__wrapper {

View File

@@ -720,4 +720,9 @@ export default class JoeAction {
}
});
}
handleTabs(cm) {
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{tabs}\n{tabs-pane label="标签一"}\n 标签一内容\n{/tabs-pane}\n{tabs-pane label="标签二"}\n 标签二内容\n{/tabs-pane}\n{/tabs}\n\n`;
this._replaceSelection(cm, str);
cm.focus();
}
}

View File

@@ -32,6 +32,7 @@ export default function createPreviewHtml(str) {
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>');
str = str.replace(/{tabs}([\s\S]*?){\/tabs}/g, '<section style="margin-bottom: 15px"><joe-tabs><span class="_temp" style="display: none">$1</span></joe-tabs></section>');
$('.cm-preview-content').html(str);
$('.cm-preview-content p:empty').remove();

View File

@@ -185,6 +185,11 @@ export default [
title: '外部音乐',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M736 249.6c-12.8-6.4-32-6.4-44.8 6.4-12.8 12.8-6.4 32 6.4 44.8C761.6 352 800 428.8 800 512c0 76.8-32 153.6-89.6 204.8-12.8 12.8-12.8 32 0 44.8 12.8 12.8 32 12.8 44.8 0C825.6 697.6 864 608 864 512c-6.4-102.4-51.2-198.4-128-262.4z"/><path d="M640 345.6c-12.8-6.4-32-6.4-44.8 6.4-12.8 12.8-6.4 32 6.4 44.8 38.4 25.6 57.6 70.4 57.6 115.2s-19.2 83.2-44.8 108.8c-12.8 12.8-12.8 32 0 44.8 12.8 12.8 32 12.8 44.8 0 44.8-38.4 64-96 64-153.6-6.4-64-38.4-128-83.2-166.4zM499.2 211.2L288 345.6H185.6c-12.8 0-19.2 6.4-19.2 19.2v313.6c0 12.8 12.8 25.6 19.2 25.6H288l211.2 115.2H512c12.8 0 19.2-6.4 19.2-19.2V230.4c0-6.4 0-6.4-6.4-12.8 0-6.4-19.2-12.8-25.6-6.4z"/></svg>'
},
{
type: 'tabs',
title: '标签页',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M904 788c4.31 0 7.853 2.735 8 6.12v63.548c0 3.412-3.455 6.216-7.732 6.33L904 864H120c-4.31 0-7.853-2.735-8-6.12v-63.548c0-3.412 3.455-6.216 7.732-6.33L120 788h784zm0-192c4.31 0 7.853 2.735 8 6.12v63.548c0 3.412-3.455 6.216-7.732 6.33L904 672H120c-4.31 0-7.853-2.735-8-6.12v-63.548c0-3.412 3.455-6.216 7.732-6.33L120 596h784zm-8-436c8.837 0 16 7.163 16 16v288c0 8.837-7.163 16-16 16H608c-8.837 0-16-7.163-16-16V176c0-8.837 7.163-16 16-16h288zm-384 0c8.695 0 15.828 7.03 16 15.686V464c0 8.695-7.03 15.828-15.686 16H128c-8.695 0-15.828-7.03-16-15.686V176c0-8.695 7.03-15.828 15.686-16H512zm-56 72H184v176h272V232z"/></svg>'
},
/* --------------------------- 短代码结束 --------------------------- */
{
type: 'clean',

File diff suppressed because one or more lines are too long

View File

@@ -312,6 +312,9 @@ class Joe extends JoeAction {
case 'mp3':
super.handleMp3(this.cm);
break;
case 'tabs':
super.handleTabs(this.cm);
break;
case 'preview':
el.toggleClass('active');
if (el.hasClass('active')) window.JoeConfig.canPreview = true;