This commit is contained in:
杜恒 2021-03-05 15:49:33 +08:00
parent 6445143f90
commit e740c4070c
16 changed files with 116 additions and 292 deletions

File diff suppressed because one or more lines are too long

View File

@ -1776,23 +1776,6 @@
}
}
}
span.block {
display: block;
}
&-hide {
background: repeating-linear-gradient(145deg, var(--classD), var(--classD) 15px, var(--background) 0, var(--background) 25px);
padding: 15px 0;
text-align: center;
position: relative;
user-select: none;
line-height: normal;
i {
position: relative;
font-style: normal;
cursor: pointer;
color: var(--theme);
}
}
&-player {
width: 100%;
height: 500px;
@ -2147,22 +2130,6 @@
}
}
}
&-mp3 {
.plyr {
max-width: 450px;
margin: 0 auto;
}
.plyr--audio {
box-shadow: var(--box-shadow);
background: var(--classD);
border-radius: 26px;
padding: 0 5px;
--plyr-audio-control-color: var(--routine);
.plyr__controls {
background: var(--classD);
}
}
}
}
&__agree {
display: flex;

File diff suppressed because one or more lines are too long

View File

@ -536,11 +536,6 @@ html {
}
}
}
&-mp3 {
.plyr {
max-width: 100%;
}
}
}
&__copyright {
.content {

View File

@ -58,11 +58,6 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
/* 激活复制功能 */
{
new ClipboardJS('.joe_detail__article-copy').on('success', () => Qmsg.success('复制成功!'));
}
/* 激活图片预览功能 */
{
$('.joe_detail__article img:not(img.owo_image)').each(function () {
@ -198,22 +193,10 @@ document.addEventListener('DOMContentLoaded', () => {
$('.joe_detail__article-video .episodes .item').first().click();
}
}
/* mp3播放器 */
{
$('.joe_mp3__player').each((index, item) => new Plyr(item, { settings: [], iconUrl: 'https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.svg' }));
}
});
/* 写在load事件里为了解决图片未加载完成滚动距离获取会不准确的问题 */
window.addEventListener('load', function () {
/* 激活点击回复可见的回复按钮,页面滚动到评论区 */
{
$('.joe_detail__article-hide i').on('click', function () {
const top = $('.joe_comment').offset().top - $('.joe_header').height() - 15;
window.scrollTo({ top, behavior: 'smooth' });
});
}
/* 判断地址栏是否有锚点链接,有则跳转到对应位置 */
{
const scroll = new URLSearchParams(location.search).get('scroll');

File diff suppressed because one or more lines are too long

6
assets/js/joe.short.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
return "5.5.5";
return "5.5.6";
};
/* 判断是否是手机 */

View File

@ -4,126 +4,28 @@ function _parseContent($post, $login)
{
/* 优先判断文章内是否有回复可见的内容 */
$content = $post->content;
/* 过滤表情 */
$content = _parseReply($content);
/* 过滤默认卡片 */
if (strpos($content, '{/card-default}') !== false) {
$content = preg_replace_callback(
'/\{card-default\s*width="(.*)"\s*label="(.*)"\s*\}(.*)\{\/card-default\}/sSU',
function ($matches) {
return '<span class="joe_detail__article-card block" style="width: ' . $matches[1] . '">
<span class="title block">' . $matches[2] . '</span>
<span class="content block">' . $matches[3] . '</span>
</span>
';
},
$content
);
if (strpos($content, '{card-default') !== false) {
$content = preg_replace('/{card-default(.*)}/SU', '<joe-card $1>', $content);
$content = preg_replace('/{\/card-default}/SU', '</joe-card>', $content);
}
/* 过滤消息提示 */
if (strpos($content, '{/message}') !== false) {
$content = preg_replace_callback(
'/\{message\s*type="(success|info|warning|error)"\s*\}(.*)\{\/message\}/sSU',
function ($matches) {
return '<span class="joe_detail__article-message block ' . $matches[1] . '">
<span class="icon"></span>
<span class="content">' . $matches[2] . '</span>
</span>
';
},
$content
);
}
/* 过滤note button */
if (strpos($content, '{/anote}') !== false) {
$content = preg_replace_callback(
'/\{anote\s*icon="(.*)"\s*href="(.*)"\s*type="(secondary|success|warning|error|info)"\s*}(.*)\{\/anote\}/sSU',
function ($matches) {
return '<a class="joe_detail__article-anote ' . $matches[3] . '" href="' . $matches[2] . '" target="_blank" rel="noopener noreferrer nofollow">
<span class="icon"><i class="fa ' . $matches[1] . '"></i></span><span class="content">' . $matches[4] . '</span>
</a>
';
},
$content
);
}
/* 过滤普通button */
if (strpos($content, '{/abtn}') !== false) {
$content = preg_replace_callback(
'/\{abtn\s*icon="(.*)"\s*color="(.*)"\s*href="(.*)"\s*radius="(.*)"\s*\}(.*)\{\/abtn\}/sSU',
function ($matches) {
return '<a class="joe_detail__article-abtn" style="background: ' . $matches[2] . '; border-radius: ' . $matches[4] . '" href="' . $matches[3] . '" target="_blank" rel="noopener noreferrer nofollow">
<span class="icon"><i class="' . $matches[1] . ' fa"></i></span><span class="content">' . $matches[5] . '</span>
</a>
';
},
$content
);
}
/* 过滤回复可见 */
if (strpos($content, '{/hide}') !== false) {
if (strpos($content, '{hide') !== false) {
$db = Typecho_Db::get();
$hasComment = $db->fetchAll($db->select()->from('table.comments')->where('cid = ?', $post->cid)->where('mail = ?', $post->remember('mail', true))->limit(1));
if ($hasComment || $login) {
$content = strtr($content, array("{hide}" => "", "{/hide}" => ""));
$content = strtr($content, array("{hide}" => "<joe-show>", "{/hide}" => "</joe-show>"));
} else {
$content = preg_replace_callback(
'/\{hide\}.*\{\/hide\}/sSU',
function () {
return '<span class="joe_detail__article-hide block">此处内容作者设置了 <i>回复</i> 可见</span>';
},
$content
);
$content = strtr($content, array("{hide}" => "<joe-hide>", "{/hide}" => "</joe-hide>"));
}
}
/* 过滤网易云音乐 */
if (strpos($content, '{music') !== false) {
$content = preg_replace_callback(
'/\{music-list\s*id="(\w*)"\s*\/\}/SU',
function ($matches) {
return '<iframe class="lazyload" data-src="//music.163.com/outchain/player?type=0&id=' . $matches[1] . '&auto=0&height=430" width="100%" height="450"></iframe>';
},
$content
);
$content = preg_replace_callback(
'/\{music\s*id="(\w*)"\s*\/\}/SU',
function ($matches) {
return '<iframe class="lazyload" data-src="//music.163.com/outchain/player?type=2&id=' . $matches[1] . '&auto=0&height=66" width="100%" height="86"></iframe>';
},
$content
);
$content = preg_replace('/{music-list(.*)\/}/SU', '<joe-mlist $1></joe-mlist>', $content);
$content = preg_replace('/{music(.*)\/}/SU', '<joe-music $1></joe-music>', $content);
}
/* 过滤dplayer播放器 */
if (strpos($content, '{dplayer') !== false) {
$content = preg_replace_callback(
'/\{dplayer\s*src="(.*)"\s*\/\}/sSU',
function ($matches) {
$player = Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer : '/usr/themes/Joe/library/player.php?url=';
return '<iframe class="joe_detail__article-player block lazyload" allowfullscreen="true" data-src="' . $player . $matches[1] . '"></iframe>';
},
$content
);
}
/* 过滤bilibili播放器 */
if (strpos($content, '{bilibili') !== false) {
$content = preg_replace_callback(
'/\{bilibili\s*bvid="(\w*)"\s*\/\}/sSU',
function ($matches) {
return '<iframe class="joe_detail__article-player block lazyload" allowfullscreen="true" data-src="//player.bilibili.com/player.html?bvid=' . $matches[1] . '"></iframe>';
},
$content
);
}
/* 过滤完成任务勾选 */
if (strpos($content, '{x}') !== false || strpos($content, '{ }') !== false) {
$content = strtr($content, array(
@ -131,36 +33,38 @@ function _parseContent($post, $login)
"{ }" => '<input type="checkbox" class="joe_detail__article-checkbox" disabled></input>'
));
}
/* 过滤dplayer播放器 */
if (strpos($content, '{dplayer') !== false) {
$player = Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer : '/usr/themes/Joe/library/player.php?url=';
$content = preg_replace('/{dplayer(.*)\/}/SU', '<joe-dplayer player="' . $player . '" $1></joe-dplayer>', $content);
}
/* 过滤bilibili播放器 */
if (strpos($content, '{bilibili') !== false) {
$content = preg_replace('/{bilibili(.*)\/}/SU', '<joe-bilibili $1></joe-bilibili>', $content);
}
/* 过滤复制粘贴功能 */
if (strpos($content, '{/copy}') !== false) {
$content = preg_replace_callback(
'/\{copy\s*text="(.*)"\s*\}(.*)\{\/copy\}/sSU',
function ($matches) {
return '<span data-clipboard-text="' . $matches[1] . '" class="joe_detail__article-copy">' . $matches[2] . '</span>';
},
$content
);
if (strpos($content, '{copy') !== false) {
$content = preg_replace('/{copy(.*)}/SU', '<joe-copy $1>', $content);
$content = preg_replace('/{\/copy}/SU', '</joe-copy>', $content);
}
/* 过滤居中标题 */
if (strpos($content, '{/mtitle}') !== false) {
$content = strtr($content, array(
"{mtitle}" => '<span class="joe_detail__article-mtitle"><span class="text">',
"{/mtitle}" => '</span></span>'
));
if (strpos($content, '{mtitle') !== false) {
$content = strtr($content, array("{mtitle}" => '<joe-mtitle>', "{/mtitle}" => '</joe-mtitle>'));
}
/* 过滤MP3音乐 */
if (strpos($content, '{mp3') !== false) {
$content = preg_replace_callback(
'/\{mp3\s*src="(.*)"\s*\/\}/sSU',
function ($matches) {
return '<span class="joe_detail__article-mp3 block"><audio class="joe_mp3__player" src="' . $matches[1] . '" controls></audio></span>';
},
$content
);
/* 过滤消息提示 */
if (strpos($content, '{message') !== false) {
$content = preg_replace('/{message(.*)}/SU', '<joe-message $1>', $content);
$content = preg_replace('/{\/message}/SU', '</joe-message>', $content);
}
/* 标签按钮 */
if (strpos($content, '{anote') !== false) {
$content = preg_replace('/{anote(.*)}/SU', '<joe-anote $1>', $content);
$content = preg_replace('/{\/anote}/SU', '</joe-anote>', $content);
}
/* 多彩按钮 */
if (strpos($content, '{abtn') !== false) {
$content = preg_replace('/{abtn(.*)}/SU', '<joe-abtn $1>', $content);
$content = preg_replace('/{\/abtn}/SU', '</joe-abtn>', $content);
}
echo $content;
}

View File

@ -16,10 +16,8 @@
<?php $this->need('public/include.php'); ?>
<!-- 友联页面需要用到的CSS及JS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.css">
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
<script src="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.js"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
</head>

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
</style>
<script>document.addEventListener("DOMContentLoaded", function () { setInterval(function () { let span = document.createElement("span"); span.innerHTML = "小贼!想偷代码?"; document.body.appendChild(span) }, 10) })</script>
</head>
<body></body>
</html>

View File

@ -5,10 +5,8 @@
<?php $this->need('public/include.php'); ?>
<!-- 独立页面需要用到CSS及JS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.css">
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
<script src="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.js"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
</head>

View File

@ -5,11 +5,9 @@
<?php $this->need('public/include.php'); ?>
<!-- 文章页需要用到的CSS及JS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.css">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.post.min.css'); ?>">
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
<script src="https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.min.js"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
</head>

View File

@ -35,6 +35,7 @@
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/qmsg/qmsg.js"></script>
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/js/joe.extend.min.js"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js'); ?>"></script>
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/smooth/joe.smooth.js"></script>
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/cursor/<?php $this->options->JCursorEffects() ?>"></script>

View File

@ -9,6 +9,11 @@ $(function () {
});
/* 增加自定义功能 */
const items = [
{
title: '默认卡片',
id: 'wmd-card-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M928.775 187.554H94.113c-15.364 0-27.822 12.49-27.822 27.895v585.79c0 15.405 12.458 27.895 27.822 27.895h834.662c15.363 0 27.821-12.49 27.821-27.895v-585.79c0-15.405-12.458-27.895-27.821-27.895zm-35.77 577.428H129.882V251.706h763.123v513.276z" fill="#9b9b9b"/><path d="M808.546 380.025H214.352c-11.532 0-20.865 9.37-20.865 20.922v22.323c0 11.55 9.333 20.922 20.865 20.922h594.194c11.522 0 20.867-9.372 20.867-20.922v-22.323c-.001-11.55-9.345-20.922-20.867-20.922zM363.38 636.662H214.352c-11.532 0-20.865 9.356-20.865 20.92v22.312c0 11.564 9.333 20.921 20.865 20.921H363.38c11.534 0 20.866-9.358 20.866-20.921v-22.311c0-11.565-9.332-20.92-20.866-20.92z" fill="#9b9b9b"/></svg>'
},
{
title: '回复可见',
id: 'wmd-hide-button',
@ -24,16 +29,6 @@ $(function () {
id: 'wmd-music-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M263.715 756.045a111.411 141.312 83.299 1 0 280.693-32.979 111.411 141.312 83.299 1 0-280.693 32.98z" fill="#9b9b9b"/><path d="M497.664 228.966h23.757c13.107 0 23.757 10.65 23.757 23.757V737.28h-47.514V228.966z" fill="#9b9b9b"/><path d="M593.92 294.298c-32.768-14.746-55.706-47.719-55.706-86.426 0-28.672 13.108-54.477 33.383-71.68-42.394 9.42-73.933 47.104-73.933 92.16 0 52.224 41.78 94.413 94.003 94.413h2.253v-28.467z" fill="#9b9b9b"/><path d="M681.984 422.912c0-76.39-61.85-138.24-138.24-138.24-16.18 0-31.744 2.867-46.08 7.782v38.912c9.83-2.457 20.07-3.686 30.72-3.686 71.27 0 129.024 57.754 129.024 129.024 0 24.166-6.758 46.9-18.227 66.15 26.419-25.19 42.803-60.62 42.803-99.942z" fill="#9b9b9b"/></svg>'
},
{
title: 'BiliBili视频',
id: 'wmd-bili-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M776.192 239.552H640.8l61.344-61.344c10.592-10.592 10.592-25.376 0-35.968s-25.376-10.592-35.968 0L562.528 245.92H460.992l-103.68-103.648c-8.448-10.592-21.152-12.704-33.856-6.336-2.112 0-2.112 2.112-4.224 4.224-10.592 10.592-10.592 25.376 0 35.968l63.456 63.456H247.296c-74.048 0-135.392 61.344-135.392 135.392V711.36c0 71.936 61.344 133.28 135.392 133.28h21.152c0 25.376 21.152 44.416 44.416 44.416s44.416-21.152 44.416-44.416H670.4c2.112 25.376 23.264 44.416 48.672 42.304a45.504 45.504 0 0 0 42.304-42.304h16.928c74.048 0 135.392-61.344 135.392-135.392V372.864c-2.112-74.048-63.456-133.28-137.504-133.28zm-4.256 522.56H255.712c-27.488 0-48.672-23.264-50.784-50.784l-2.112-342.72a51.52 51.52 0 0 1 50.784-50.784h516.224c27.488 0 48.672 23.264 50.784 50.784l2.112 342.72c-2.112 29.6-23.264 50.784-50.784 50.784zM422.88 434.176l12.704 63.456-169.248 31.744-12.704-63.456 169.248-31.744zm162.88 63.488l12.704-63.456 169.248 31.744-12.704 63.456-169.248-31.744zm33.856 133.28c0 2.112 0 6.336-2.112 8.448-10.592 23.264-33.856 38.08-61.344 40.192a59.456 59.456 0 0 1-44.416-21.152c-12.704 12.704-27.488 21.152-44.416 21.152a77.344 77.344 0 0 1-61.344-40.192c0-2.112-2.112-4.224-2.112-8.448 0-8.448 6.336-14.816 14.816-16.928h2.112c6.336 0 10.592 2.112 12.704 8.448 0 0 16.928 23.264 31.744 23.264 29.632 0 29.632-25.376 46.528-44.416 19.04 21.152 19.04 44.416 46.528 44.416 19.04 0 31.744-23.264 31.744-23.264 2.112-4.224 8.448-8.448 12.704-8.448 8.448-2.112 14.816 4.224 16.928 12.704v4.224h.032z" fill="#9b9b9b"/></svg>'
},
{
title: 'DPlayer视频',
id: 'wmd-dplayer-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M858.88 244.48H676.864l61.184-61.184a25.6 25.6 0 0 0-36.096-36.096l-97.536 97.28H421.888l-97.28-97.28a25.6 25.6 0 0 0-36.352 0 25.6 25.6 0 0 0 0 36.096l61.184 61.184H167.68a25.6 25.6 0 0 0-25.6 25.6v490.752a25.6 25.6 0 0 0 25.6 25.6h691.2a25.6 25.6 0 0 0 25.6-25.6V270.08a25.6 25.6 0 0 0-25.6-25.6zm-25.6 490.752h-640V295.68h640zm-89.6 97.024h-460.8a25.6 25.6 0 0 0 0 51.2h460.8a25.6 25.6 0 1 0 0-51.2z" fill="#9b9b9b"/><path d="M439.808 623.104a25.6 25.6 0 0 0 12.8 3.584 25.6 25.6 0 0 0 12.8-3.584l171.008-98.56a25.6 25.6 0 0 0 0-44.544l-171.008-98.56a25.6 25.6 0 0 0-38.4 22.016v197.632a25.6 25.6 0 0 0 12.8 22.016zM478.208 448l94.208 54.272-94.208 54.272z" fill="#9b9b9b"/></svg>'
},
{
title: 'HTML代码',
id: 'wmd-html-button',
@ -49,11 +44,6 @@ $(function () {
id: 'wmd-table-button',
svg: '<svg class="icon" viewBox="0 0 1025 1024" xmlns="http://www.w3.org/2000/svg"><path d="M874.725 393.106c4.438 0 8.064-3.627 8.064-8.06v-60.454c0-4.438-3.626-8.063-8.064-8.063H709.484v-167.26c0-4.432-3.627-8.058-8.06-8.058h-64.483c-4.438 0-8.064 3.626-8.064 8.059v167.259H399.152v-167.26c0-4.432-3.626-8.058-8.065-8.058h-64.483c-4.432 0-8.058 3.626-8.058 8.059v167.259H149.27c-4.433 0-8.059 3.625-8.059 8.063v60.455c0 4.432 3.626 8.059 8.059 8.059h169.276v237.789H149.27c-4.433 0-8.059 3.625-8.059 8.058v60.455c0 4.432 3.626 8.063 8.059 8.063h169.276v167.252c0 4.44 3.627 8.065 8.058 8.065h64.483c4.439 0 8.065-3.626 8.065-8.065V707.471h229.725v167.252c0 4.44 3.627 8.065 8.064 8.065h64.483c4.433 0 8.06-3.626 8.06-8.065V707.471h165.24c4.439 0 8.064-3.63 8.064-8.063v-60.455c0-4.433-3.626-8.058-8.063-8.058H709.484v-237.79h165.241zM628.877 630.895H399.152v-237.79h229.725v237.79zm0 0" fill="#9b9b9b"/></svg>'
},
{
title: '删除线',
id: 'wmd-delete-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M926.952 468.969H566.87a1576.89 1576.89 0 0 0-29.776-5.655c-14.986-2.733-20.923-3.861-29.026-5.467-48.343-9.424-77.465-18.848-100.649-32.228-33.073-19.317-49.187-45.518-49.187-80.195 0-34.87 14.323-63.798 41.464-83.87 26.761-19.791 64.834-30.255 110.066-30.255 51.642 0 91.51 13.575 118.551 40.336 13.759 13.57 23.844 30.25 29.97 49.567 1.223 3.865 2.636 9.424 4.054 16.777.846 4.524 4.9 7.726 9.326 7.726h68.608c5.273 0 9.516-4.335 9.516-9.516v-.944c-.659-6.41-1.224-11.402-1.886-15.079-6.88-40.994-26.385-76.991-56.258-103.942-41.84-38.169-103.38-58.24-177.826-58.24-68.134 0-129.48 17.057-172.739 47.965-24.125 17.343-42.785 38.827-55.223 63.798-12.723 25.539-19.128 55.039-19.128 87.548 0 27.801 5.37 51.361 16.304 72.09 7.817 14.799 18.469 27.803 32.131 39.583H97.66c-4.145 0-7.536 3.39-7.536 7.537v56.542c0 4.15 3.392 7.542 7.536 7.542h408.242c1.978.377 3.671.754 5.558 1.132 29.118 5.838 46.65 9.796 62.764 14.324 21.673 6.124 38.261 12.53 52.02 20.26 33.737 19.037 50.229 46.365 50.229 83.87 0 33.264-14.61 62.952-41.091 83.682-28.741 22.525-71.244 34.304-122.98 34.304-41.18 0-76.045-8.01-103.849-23.559-27.423-15.36-46.27-37.506-56.26-65.497-.75-2.07-1.602-4.9-2.546-8.48-1.127-4.146-4.992-7.068-9.137-7.068H265.5c-5.279 0-9.516 4.335-9.516 9.52v.94c.19 2.167.378 3.962.567 5.374 6.124 45.987 28.552 83.682 66.624 111.953 44.384 32.795 106.863 50.134 180.748 50.134 79.347 0 145.879-18.66 192.431-53.998 23.56-17.808 41.653-39.766 53.81-65.023 12.25-25.538 18.562-54.565 18.562-86.227 0-29.968-5.462-55.032-16.772-76.71-5.466-10.556-12.345-20.26-20.545-29.026H926.95c4.15 0 7.541-3.392 7.541-7.537v-56.543c.001-4.054-3.39-7.445-7.54-7.445zm0 0" fill="#9b9b9b"/></svg>'
},
{
title: '代码段',
id: 'wmd-snippet-button',
@ -64,26 +54,46 @@ $(function () {
id: 'wmd-code-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M920.887 527.046l-206.45 206.45c-8.142 8.146-21.347 8.146-29.493 0l-29.493-29.493c-8.146-8.142-8.146-21.347 0-29.493l162.213-162.213-162.212-162.208c-8.146-8.146-8.146-21.351 0-29.497l29.493-29.493c8.146-8.146 21.351-8.146 29.493 0l206.45 206.45c8.15 8.146 8.15 21.351-.001 29.497zM434.759 857.498l-37.643-10.54c-10.394-2.911-16.788-13.193-14.281-22.969L550.47 179.251c2.682-10.01 13.877-15.712 25.001-12.73l40.287 10.794c11.128 2.982 17.973 13.514 15.287 23.528L458.12 845.068c-2.511 9.777-12.967 15.341-23.361 12.43zm-66.214-153.495l-29.493 29.493c-8.142 8.146-21.347 8.146-29.493 0l-206.45-206.45c-8.146-8.146-8.146-21.351 0-29.497l206.45-206.45c8.146-8.146 21.351-8.146 29.493 0l29.493 29.493c8.146 8.146 8.146 21.351 0 29.497L206.332 512.297 368.545 674.51c8.146 8.146 8.146 21.351 0 29.493z" fill="#9b9b9b"/></svg>'
},
{
title: '缩进空格',
id: 'wmd-nbsp-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M192 672h640v-96h64v256h-64v-96H192v96h-64V576h64v96zm285.504-480h69.056l141.504 370.176h-64.896l-33.664-92.8H434.496l-33.664 92.8H336L477.504 192zm-24.832 227.584h118.656l-58.048-162.24h-2.048l-58.56 162.24z" fill="#9b9b9b"/></svg>'
},
{
title: '删除线',
id: 'wmd-delete-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M926.952 468.969H566.87a1576.89 1576.89 0 0 0-29.776-5.655c-14.986-2.733-20.923-3.861-29.026-5.467-48.343-9.424-77.465-18.848-100.649-32.228-33.073-19.317-49.187-45.518-49.187-80.195 0-34.87 14.323-63.798 41.464-83.87 26.761-19.791 64.834-30.255 110.066-30.255 51.642 0 91.51 13.575 118.551 40.336 13.759 13.57 23.844 30.25 29.97 49.567 1.223 3.865 2.636 9.424 4.054 16.777.846 4.524 4.9 7.726 9.326 7.726h68.608c5.273 0 9.516-4.335 9.516-9.516v-.944c-.659-6.41-1.224-11.402-1.886-15.079-6.88-40.994-26.385-76.991-56.258-103.942-41.84-38.169-103.38-58.24-177.826-58.24-68.134 0-129.48 17.057-172.739 47.965-24.125 17.343-42.785 38.827-55.223 63.798-12.723 25.539-19.128 55.039-19.128 87.548 0 27.801 5.37 51.361 16.304 72.09 7.817 14.799 18.469 27.803 32.131 39.583H97.66c-4.145 0-7.536 3.39-7.536 7.537v56.542c0 4.15 3.392 7.542 7.536 7.542h408.242c1.978.377 3.671.754 5.558 1.132 29.118 5.838 46.65 9.796 62.764 14.324 21.673 6.124 38.261 12.53 52.02 20.26 33.737 19.037 50.229 46.365 50.229 83.87 0 33.264-14.61 62.952-41.091 83.682-28.741 22.525-71.244 34.304-122.98 34.304-41.18 0-76.045-8.01-103.849-23.559-27.423-15.36-46.27-37.506-56.26-65.497-.75-2.07-1.602-4.9-2.546-8.48-1.127-4.146-4.992-7.068-9.137-7.068H265.5c-5.279 0-9.516 4.335-9.516 9.52v.94c.19 2.167.378 3.962.567 5.374 6.124 45.987 28.552 83.682 66.624 111.953 44.384 32.795 106.863 50.134 180.748 50.134 79.347 0 145.879-18.66 192.431-53.998 23.56-17.808 41.653-39.766 53.81-65.023 12.25-25.538 18.562-54.565 18.562-86.227 0-29.968-5.462-55.032-16.772-76.71-5.466-10.556-12.345-20.26-20.545-29.026H926.95c4.15 0 7.541-3.392 7.541-7.537v-56.543c.001-4.054-3.39-7.445-7.54-7.445zm0 0" fill="#9b9b9b"/></svg>'
},
{
title: '任务列表',
id: 'wmd-task-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M593.92 215.04c112.64 0 204.8 92.16 204.8 204.8v204.8c0 112.64-92.16 204.8-204.8 204.8h-204.8c-112.64 0-204.8-92.16-204.8-204.8v-204.8c0-112.64 92.16-204.8 204.8-204.8h204.8m0-51.2h-204.8c-143.36 0-256 112.64-256 256v204.8c0 143.36 112.64 256 256 256h204.8c143.36 0 256-112.64 256-256v-204.8c0-138.24-112.64-256-256-256z" fill="#9b9b9b"/><path d="M527.36 762.88L230.4 460.8l76.8-61.44 174.08 133.12c71.68-81.92 230.4-250.88 445.44-384l20.48 40.96C747.52 373.76 583.68 634.88 527.36 762.88m0 0" fill="#9b9b9b"/></svg>'
},
{
title: '默认卡片',
id: 'wmd-card-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M928.775 187.554H94.113c-15.364 0-27.822 12.49-27.822 27.895v585.79c0 15.405 12.458 27.895 27.822 27.895h834.662c15.363 0 27.821-12.49 27.821-27.895v-585.79c0-15.405-12.458-27.895-27.821-27.895zm-35.77 577.428H129.882V251.706h763.123v513.276z" fill="#9b9b9b"/><path d="M808.546 380.025H214.352c-11.532 0-20.865 9.37-20.865 20.922v22.323c0 11.55 9.333 20.922 20.865 20.922h594.194c11.522 0 20.867-9.372 20.867-20.922v-22.323c-.001-11.55-9.345-20.922-20.867-20.922zM363.38 636.662H214.352c-11.532 0-20.865 9.356-20.865 20.92v22.312c0 11.564 9.333 20.921 20.865 20.921H363.38c11.534 0 20.866-9.358 20.866-20.921v-22.311c0-11.565-9.332-20.92-20.866-20.92z" fill="#9b9b9b"/></svg>'
title: 'DPlayer视频',
id: 'wmd-dplayer-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M858.88 244.48H676.864l61.184-61.184a25.6 25.6 0 0 0-36.096-36.096l-97.536 97.28H421.888l-97.28-97.28a25.6 25.6 0 0 0-36.352 0 25.6 25.6 0 0 0 0 36.096l61.184 61.184H167.68a25.6 25.6 0 0 0-25.6 25.6v490.752a25.6 25.6 0 0 0 25.6 25.6h691.2a25.6 25.6 0 0 0 25.6-25.6V270.08a25.6 25.6 0 0 0-25.6-25.6zm-25.6 490.752h-640V295.68h640zm-89.6 97.024h-460.8a25.6 25.6 0 0 0 0 51.2h460.8a25.6 25.6 0 1 0 0-51.2z" fill="#9b9b9b"/><path d="M439.808 623.104a25.6 25.6 0 0 0 12.8 3.584 25.6 25.6 0 0 0 12.8-3.584l171.008-98.56a25.6 25.6 0 0 0 0-44.544l-171.008-98.56a25.6 25.6 0 0 0-38.4 22.016v197.632a25.6 25.6 0 0 0 12.8 22.016zM478.208 448l94.208 54.272-94.208 54.272z" fill="#9b9b9b"/></svg>'
},
{
title: '消息提示',
id: 'wmd-message-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M669.133 281.6a307.456 307.456 0 0 0-428.083 0 295.68 295.68 0 0 0 31.744 445.44v27.085a29.645 29.645 0 0 0 59.29 0v-40.397a30.72 30.72 0 0 0-1.076-7.526 30.157 30.157 0 0 0-12.442-18.893 236.493 236.493 0 0 1-104.345-196.403c0-130.56 110.745-236.8 241.305-236.8s241.306 106.24 241.306 236.8c0 6.195 0 12.646-.666 19.097a235.52 235.52 0 0 1-104.96 178.176 30.362 30.362 0 0 0-12.646 32.205v33.946a29.645 29.645 0 0 0 59.29 0V727.5a299.213 299.213 0 0 0 76.185-84.838 291.277 291.277 0 0 0 40.96-128c.666-7.936.87-15.872.87-23.808A295.117 295.117 0 0 0 669.134 281.6zM513.485 880.333l-118.938.87a29.747 29.747 0 1 0 .615 59.443l118.937-.87a29.747 29.747 0 1 0-.614-59.443zm89.958-75.981h-298.24a29.645 29.645 0 0 0 0 59.238h298.24a29.645 29.645 0 0 0 0-59.238z" fill="#666"/><path d="M485.325 342.118a29.542 29.542 0 0 0-29.645-29.798A178.688 178.688 0 0 0 277.3 490.906a29.645 29.645 0 0 0 59.289 0A118.938 118.938 0 0 1 455.68 371.968a29.747 29.747 0 0 0 29.645-29.85z" fill="#9b9b9b"/></svg>'
title: 'BiliBili视频',
id: 'wmd-bili-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M776.192 239.552H640.8l61.344-61.344c10.592-10.592 10.592-25.376 0-35.968s-25.376-10.592-35.968 0L562.528 245.92H460.992l-103.68-103.648c-8.448-10.592-21.152-12.704-33.856-6.336-2.112 0-2.112 2.112-4.224 4.224-10.592 10.592-10.592 25.376 0 35.968l63.456 63.456H247.296c-74.048 0-135.392 61.344-135.392 135.392V711.36c0 71.936 61.344 133.28 135.392 133.28h21.152c0 25.376 21.152 44.416 44.416 44.416s44.416-21.152 44.416-44.416H670.4c2.112 25.376 23.264 44.416 48.672 42.304a45.504 45.504 0 0 0 42.304-42.304h16.928c74.048 0 135.392-61.344 135.392-135.392V372.864c-2.112-74.048-63.456-133.28-137.504-133.28zm-4.256 522.56H255.712c-27.488 0-48.672-23.264-50.784-50.784l-2.112-342.72a51.52 51.52 0 0 1 50.784-50.784h516.224c27.488 0 48.672 23.264 50.784 50.784l2.112 342.72c-2.112 29.6-23.264 50.784-50.784 50.784zM422.88 434.176l12.704 63.456-169.248 31.744-12.704-63.456 169.248-31.744zm162.88 63.488l12.704-63.456 169.248 31.744-12.704 63.456-169.248-31.744zm33.856 133.28c0 2.112 0 6.336-2.112 8.448-10.592 23.264-33.856 38.08-61.344 40.192a59.456 59.456 0 0 1-44.416-21.152c-12.704 12.704-27.488 21.152-44.416 21.152a77.344 77.344 0 0 1-61.344-40.192c0-2.112-2.112-4.224-2.112-8.448 0-8.448 6.336-14.816 14.816-16.928h2.112c6.336 0 10.592 2.112 12.704 8.448 0 0 16.928 23.264 31.744 23.264 29.632 0 29.632-25.376 46.528-44.416 19.04 21.152 19.04 44.416 46.528 44.416 19.04 0 31.744-23.264 31.744-23.264 2.112-4.224 8.448-8.448 12.704-8.448 8.448-2.112 14.816 4.224 16.928 12.704v4.224h.032z" fill="#9b9b9b"/></svg>'
},
{
title: '点击复制',
id: 'wmd-copy-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M817.521 690.221H766.6V333.78c0-40.735-35.644-76.38-76.38-76.38H333.779v-50.921H690.22c71.289 0 127.3 56.012 127.3 127.3V690.22z" fill="#9b9b9b"/><path d="M639.3 817.521H282.859c-40.735 0-76.38-35.644-76.38-76.38V384.7c0-40.735 35.644-76.38 76.38-76.38H639.3c40.735 0 76.38 35.644 76.38 76.38v356.441c0 40.735-35.644 76.38-76.38 76.38zm-356.441-458.28c-15.277 0-25.461 10.185-25.461 25.46v356.441c0 15.277 10.185 25.461 25.461 25.461H639.3c15.277 0 25.46-10.185 25.46-25.461V384.701c0-15.277-10.185-25.46-25.46-25.46H282.859z" fill="#9b9b9b"/></svg>'
},
{
title: '居中标题',
id: 'wmd-mtitle-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M921.6 460.8H655.36c-20.48-61.44-76.8-102.4-143.36-102.4s-122.88 40.96-143.36 102.4H102.4c-30.72 0-51.2 20.48-51.2 51.2s20.48 51.2 51.2 51.2h266.24c20.48 61.44 76.8 102.4 143.36 102.4s122.88-40.96 143.36-102.4H921.6c30.72 0 51.2-20.48 51.2-51.2s-20.48-51.2-51.2-51.2zM512 563.2c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2 51.2 20.48 51.2 51.2-20.48 51.2-51.2 51.2z" fill="#9b9b9b"/></svg>'
},
{
title: '消息提示',
id: 'wmd-message-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M669.133 281.6a307.456 307.456 0 0 0-428.083 0 295.68 295.68 0 0 0 31.744 445.44v27.085a29.645 29.645 0 0 0 59.29 0v-40.397a30.72 30.72 0 0 0-1.076-7.526 30.157 30.157 0 0 0-12.442-18.893 236.493 236.493 0 0 1-104.345-196.403c0-130.56 110.745-236.8 241.305-236.8s241.306 106.24 241.306 236.8c0 6.195 0 12.646-.666 19.097a235.52 235.52 0 0 1-104.96 178.176 30.362 30.362 0 0 0-12.646 32.205v33.946a29.645 29.645 0 0 0 59.29 0V727.5a299.213 299.213 0 0 0 76.185-84.838 291.277 291.277 0 0 0 40.96-128c.666-7.936.87-15.872.87-23.808A295.117 295.117 0 0 0 669.134 281.6zM513.485 880.333l-118.938.87a29.747 29.747 0 1 0 .615 59.443l118.937-.87a29.747 29.747 0 1 0-.614-59.443zm89.958-75.981h-298.24a29.645 29.645 0 0 0 0 59.238h298.24a29.645 29.645 0 0 0 0-59.238z" fill="#666"/><path d="M485.325 342.118a29.542 29.542 0 0 0-29.645-29.798A178.688 178.688 0 0 0 277.3 490.906a29.645 29.645 0 0 0 59.289 0A118.938 118.938 0 0 1 455.68 371.968a29.747 29.747 0 0 0 29.645-29.85z" fill="#9b9b9b"/></svg>'
},
{
title: '便条按钮',
id: 'wmd-anote-button',
@ -93,22 +103,7 @@ $(function () {
title: '多彩按钮',
id: 'wmd-abtn-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M360 651c-74.1 0-134.3-60.3-134.3-134.3 0-74.1 60.3-134.3 134.3-134.3s134.3 60.3 134.3 134.3c0 74-60.2 134.3-134.3 134.3zm0-204.6c-38.8 0-70.3 31.5-70.3 70.3S321.2 587 360 587s70.3-31.5 70.3-70.3-31.5-70.3-70.3-70.3z" fill="#9b9b9b"/><path d="M666.9 778.9H360c-70 0-135.9-27.3-185.4-76.8S97.8 586.7 97.8 516.7s27.3-135.9 76.8-185.4S290 254.5 360 254.5h306.9c70 0 135.9 27.3 185.4 76.8s76.8 115.4 76.8 185.4-27.3 135.9-76.8 185.4-115.3 76.8-185.4 76.8zM360 318.5c-109.3 0-198.2 88.9-198.2 198.2S250.7 714.9 360 714.9h306.9c109.3 0 198.2-88.9 198.2-198.2s-88.9-198.2-198.2-198.2H360z" fill="#9b9b9b"/></svg>'
},
{
title: '点击复制',
id: 'wmd-copy-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M817.521 690.221H766.6V333.78c0-40.735-35.644-76.38-76.38-76.38H333.779v-50.921H690.22c71.289 0 127.3 56.012 127.3 127.3V690.22z" fill="#9b9b9b"/><path d="M639.3 817.521H282.859c-40.735 0-76.38-35.644-76.38-76.38V384.7c0-40.735 35.644-76.38 76.38-76.38H639.3c40.735 0 76.38 35.644 76.38 76.38v356.441c0 40.735-35.644 76.38-76.38 76.38zm-356.441-458.28c-15.277 0-25.461 10.185-25.461 25.46v356.441c0 15.277 10.185 25.461 25.461 25.461H639.3c15.277 0 25.46-10.185 25.46-25.461V384.701c0-15.277-10.185-25.46-25.46-25.46H282.859z" fill="#9b9b9b"/></svg>'
},
{
title: '插入音乐',
id: 'wmd-mp3-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M646.4 202.667c-25.6-19.2-55.467-23.467-85.333-12.8L309.333 315.733c-19.2 6.4-34.133 19.2-44.8 34.134-12.8-4.267-27.733-8.534-49.066-8.534h-27.734c-49.066 0-87.466 40.534-87.466 91.734v217.6c0 51.2 38.4 91.733 87.466 91.733h27.734c21.333 0 36.266-2.133 49.066-8.533 10.667 14.933 25.6 25.6 42.667 32l247.467 115.2h2.133c10.667 4.266 23.467 6.4 34.133 6.4 19.2 0 38.4-6.4 53.334-17.067 29.866-21.333 46.933-55.467 46.933-96V296.533c2.133-38.4-14.933-74.666-44.8-93.866zm-405.333 467.2v4.266c-2.134 0-8.534 2.134-23.467 2.134h-29.867c-12.8 0-23.466-12.8-23.466-27.734v-217.6c0-14.933 10.666-27.733 23.466-27.733h27.734c17.066 0 23.466 2.133 23.466 2.133V659.2c2.134 4.267 2.134 6.4 2.134 10.667zm388.266 106.666c0 17.067-8.533 34.134-19.2 42.667-6.4 4.267-14.933 8.533-27.733 4.267L334.933 706.133H332.8c-17.067-6.4-27.733-25.6-27.733-46.933V420.267c0-21.334 12.8-40.534 27.733-46.934l251.733-125.866c10.667-2.134 19.2 2.133 25.6 4.266 12.8 8.534 19.2 23.467 19.2 42.667v482.133zm147.2-401.066c6.4 4.266 12.8 6.4 19.2 6.4 10.667 0 19.2-4.267 25.6-12.8L902.4 258.133c10.667-14.933 6.4-34.133-6.4-44.8-14.933-10.666-34.133-6.4-44.8 6.4L768 330.667c-8.533 14.933-6.4 34.133 8.533 44.8zm44.8 358.4c-10.666-14.934-29.866-17.067-44.8-6.4-14.933 10.666-17.066 29.866-6.4 44.8L851.2 883.2c6.4 8.533 14.933 12.8 25.6 12.8 6.4 0 12.8-2.133 19.2-6.4 14.933-10.667 17.067-29.867 6.4-44.8l-81.067-110.933zm70.4-219.734h-102.4c-17.066 0-32 14.934-32 32s14.934 32 32 32h102.4c17.067 0 32-14.933 32-32s-12.8-32-32-32z" fill="#9b9b9b"/></svg>'
},
{
title: '缩进空格',
id: 'wmd-nbsp-button',
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M192 672h640v-96h64v256h-64v-96H192v96h-64V576h64v96zm285.504-480h69.056l141.504 370.176h-64.896l-33.664-92.8H434.496l-33.664 92.8H336L477.504 192zm-24.832 227.584h118.656l-58.048-162.24h-2.048l-58.56 162.24z" fill="#9b9b9b"/></svg>'
},
}
// {
// title: '时间轴',
// id: 'wmd-timeline-button',
@ -120,68 +115,62 @@ $(function () {
function getInsertTextById(id) {
let str = '';
switch (id) {
case 'wmd-card-button':
str = `\n{card-default width="100%" label="默认标题"}\n ${$('#text').selectionRange() ? $('#text').selectionRange() : '默认内容'}\n{/card-default}\n`;
break;
case 'wmd-hide-button':
str = `\n\n{hide}${$('#text').selectionRange() ? $('#text').selectionRange() : '回复可见'}{/hide}\n\n`;
str = `\n{hide}\n ${$('#text').selectionRange() ? $('#text').selectionRange() : '默认隐藏的内容'}\n{/hide}\n`;
break;
case 'wmd-mlist-button':
str = `\n\n{music-list id="网易云歌单ID" /}\n\n`;
str = `\n{music-list id="网易云歌单ID" width="100%" height="450px" autoplay="autoplay" /}\n`;
break;
case 'wmd-music-button':
str = `\n\n{music id="网易云音乐ID" /}\n\n`;
break;
case 'wmd-bili-button':
str = `\n\n{bilibili bvid="哔哩哔哩的Bvid" /}\n\n`;
break;
case 'wmd-dplayer-button':
str = `\n\n{dplayer src="M3U8或MP4地址" /}\n\n`;
str = `\n{music id="网易云歌曲ID" width="100%" height="86px" autoplay="autoplay" /}\n`;
break;
case 'wmd-html-button':
str = `\n\n!!!\n<span class="test">Hello Joe</span>\n<style>\n .test { color: #ff6800 }\n</style>\n!!!\n\n`;
str = `\n!!!\n<span class="test">Hello Joe</span>\n<style>\n .test { color: #ff6800 }\n</style>\n!!!\n`;
break;
case 'wmd-title-button':
str = `\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n`;
str = `\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n`;
break;
case 'wmd-table-button':
str = `\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n`;
break;
case 'wmd-delete-button':
str = `~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~`;
str = `\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n`;
break;
case 'wmd-snippet-button':
str = `\n\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n\n`;
str = `\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n`;
break;
case 'wmd-code-button':
str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `;
break;
case 'wmd-task-button':
str = `{x} 任务已完成\n{ } 任务未完成`;
break;
case 'wmd-card-button':
str = `\n\n{card-default width="100%" label="卡片标题"}${$('#text').selectionRange() ? $('#text').selectionRange() : '卡片内容'}{/card-default}\n\n`;
break;
case 'wmd-message-button':
str = `\n\n{message type="success|info|warning|error"}${$('#text').selectionRange() ? $('#text').selectionRange() : '提示内容'}{/message}\n\n`;
break;
case 'wmd-mtitle-button':
str = `\n\n{mtitle}${$('#text').selectionRange() ? $('#text').selectionRange() : '居中标题'}{/mtitle}\n\n`;
break;
case 'wmd-anote-button':
str = `{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info"}${$('#text').selectionRange() ? $('#text').selectionRange() : '便条按钮'}{/anote}`;
break;
case 'wmd-abtn-button':
str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角半圆17.5px"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`;
break;
case 'wmd-copy-button':
str = `{copy text="文本文本"}${$('#text').selectionRange() ? $('#text').selectionRange() : '点击复制'}{/copy}`;
break;
case 'wmd-mp3-button':
str = `\n\n{mp3 src="音乐地址" /}\n\n`;
break;
case 'wmd-nbsp-button':
str = ' ';
break;
case 'wmd-timeline-button':
str = '\n\n{timeline}\n {timeline-item}内容内容{/timeline-item}\n {timeline-item}内容内容{/timeline-item}\n{/timeline}\n\n';
case 'wmd-delete-button':
str = ` ~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~ `;
break;
case 'wmd-task-button':
str = `{x} 任务已完成\n{ } 任务未完成`;
break;
case 'wmd-dplayer-button':
str = `\n{dplayer src="M3U8或MP4地址" /}\n`;
break;
case 'wmd-bili-button':
str = `\n{bilibili bvid="哔哩哔哩的Bvid" /}\n`;
break;
case 'wmd-copy-button':
str = `{copy text="默认文本"}${$('#text').selectionRange() ? $('#text').selectionRange() : '点击复制'}{/copy}`;
break;
case 'wmd-mtitle-button':
str = `\n{mtitle}${$('#text').selectionRange() ? $('#text').selectionRange() : '居中标题'}{/mtitle}\n`;
break;
case 'wmd-message-button':
str = `\n{message type="success|info|warning|error选择其一"}${$('#text').selectionRange() ? $('#text').selectionRange() : '提示内容'}{/message}\n`;
break;
case 'wmd-anote-button':
str = `{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info选择其一"}${$('#text').selectionRange() ? $('#text').selectionRange() : '便条按钮'}{/anote}`;
break;
case 'wmd-abtn-button':
str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角最大17.5px"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`;
break;
}
return str;

File diff suppressed because one or more lines are too long