mirror of
https://dl.bcrjl.com/ghg/HaoOuBa/Joe.git
synced 2026-02-17 13:10:05 +08:00
feat: 新增CDN资源切换
This commit is contained in:
1
assets/typecho/config/css/joe.config.min.css
vendored
Executable file
1
assets/typecho/config/css/joe.config.min.css
vendored
Executable file
@@ -0,0 +1 @@
|
||||
.col-mb-12.col-tb-8.col-tb-offset-2{margin-left:0;width:100%}.joe_config{display:flex}.joe_config *{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}.joe_config li{list-style:none}.joe_config__aside{position:-webkit-sticky;position:sticky;top:15px;width:200px;background:#fff;padding:10px;box-shadow:0px 0px 20px -5px rgba(158,158,158,0.22);border-radius:8px}.joe_config__aside .logo{color:#303133;font-weight:500;font-size:24px;text-align:center;margin-bottom:10px;border-bottom:1px solid #ebeef5;padding-bottom:10px}.joe_config__aside .tabs{margin-bottom:10px}.joe_config__aside .tabs .item{border-radius:20px;text-align:center;height:40px;line-height:40px;color:#606266;cursor:pointer;transition:background 0.35s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.joe_config__aside .tabs .item:hover{background:#f2f6fc}.joe_config__aside .tabs .item.active{color:#409eff;font-weight:500}.joe_config__aside .backup input{width:170px;height:40px;line-height:40px;margin-bottom:10px;color:#fff;font-size:14px;border-radius:20px;transition:opacity 0.35s;border:none;cursor:pointer}.joe_config__aside .backup input:hover{opacity:0.85}.joe_config__aside .backup input:nth-child(1){background:#5cb85c}.joe_config__aside .backup input:nth-child(2){background:#f0ad4e}.joe_config__aside .backup input:nth-child(3){margin-bottom:0;background:#d9534f}.joe_config>form{position:relative;display:none;background:#fff;min-width:0;flex:1;margin-left:15px;box-shadow:0px 0px 20px -5px rgba(158,158,158,0.22);border-radius:8px}.joe_config>form .typecho-option{position:-webkit-sticky;position:sticky;bottom:0;display:flex;align-items:center;justify-content:center;margin:0;padding:15px;background:#fff;border-top:1px solid #ebebeb;border-radius:0 0 8px 8px}.joe_config>form .typecho-option button{width:170px;height:40px;background-color:#409eff;border-radius:20px}.joe_config>form .typecho-option button:hover{-webkit-animation:pulse 1s;animation:pulse 1s;box-shadow:0 0 0 20px rgba(255,255,255,0)}.joe_config>form .joe_content{display:none;padding:15px}.joe_config>form .joe_content li{border:1px solid #e9e9eb;padding:15px}.joe_config>form .joe_content li .typecho-label{display:block;border-left:4px solid #409eff;background:#ecf5ff;line-height:26px;margin-bottom:15px;padding:5px 15px;color:#409eff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:0 4px 4px 0}.joe_config>form .joe_content li select{min-width:200px;height:34px;line-height:34px;border:1px solid #e9e9eb;color:#666;border-radius:4px;padding-left:5px}.joe_config>form .joe_content li .multiline{display:flex;align-items:center;color:#666}.joe_config>form .joe_content li .multiline input[type='checkbox']{margin-right:5px}.joe_config>form .joe_content li textarea,.joe_config>form .joe_content li input[type='text']{width:100%;padding:10px;color:#666;border:1px solid #e9e9eb;-webkit-appearance:none}.joe_config>form .joe_content li textarea{height:125px}.joe_config>form .joe_content li .description{background:#f8f8f8;color:#999;padding:10px 15px;margin-top:15px;line-height:26px;border-radius:4px;word-break:break-all}.joe_config__notice{display:none;margin-left:15px;background:#fff;padding:15px;flex:1;box-shadow:0px 0px 20px -5px rgba(158,158,158,0.22);border-radius:8px;line-height:28px;color:#606266}.joe_config__notice .title{text-align:center;padding-bottom:15px;border-bottom:1px solid #e4e7ed;font-weight:500;font-size:22px;margin-bottom:15px;color:#67C23A}.joe_config__notice ol{padding:0 40px;margin-bottom:15px}.joe_config__notice ol li{list-style:decimal}@-webkit-keyframes pulse{0%{box-shadow:0 0 0 0 #409eff}}@keyframes pulse{0%{box-shadow:0 0 0 0 #409eff}}@media (max-width: 768px){.joe_config{display:block}.joe_config__aside{width:100%;margin-bottom:15px}.joe_config__aside .tabs{display:flex;flex-wrap:wrap;border-bottom:1px solid #ebeef5;padding-bottom:10px}.joe_config__aside .tabs .item{width:33.33333333%;height:36px;line-height:36px;border-radius:18px}.joe_config__aside .backup{display:flex;align-items:center;justify-content:space-between}.joe_config__aside .backup input{width:auto;flex:1;margin-bottom:0;height:36px;line-height:36px;border-radius:18px}.joe_config__aside .backup input:nth-child(2){margin:0 10px}.joe_config>form{margin-left:0}.joe_config>form .typecho-option{padding:10px 0}.joe_config>form .typecho-option button{width:150px;height:38px;border-radius:19px}.joe_config__notice{margin-left:0}}
|
||||
265
assets/typecho/config/css/joe.config.min.scss
Executable file
265
assets/typecho/config/css/joe.config.min.scss
Executable file
@@ -0,0 +1,265 @@
|
||||
/* 后台设置的样式 */
|
||||
.col-mb-12.col-tb-8.col-tb-offset-2 {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.joe_config {
|
||||
display: flex;
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__aside {
|
||||
position: sticky;
|
||||
top: 15px;
|
||||
width: 200px;
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22);
|
||||
border-radius: 8px;
|
||||
.logo {
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.tabs {
|
||||
margin-bottom: 10px;
|
||||
.item {
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
transition: background 0.35s;
|
||||
user-select: none;
|
||||
&:hover {
|
||||
background: #f2f6fc;
|
||||
}
|
||||
&.active {
|
||||
color: #409eff;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
.backup {
|
||||
input {
|
||||
width: 170px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 10px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
border-radius: 20px;
|
||||
transition: opacity 0.35s;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
&:nth-child(1) {
|
||||
background: #5cb85c;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
background: #f0ad4e;
|
||||
}
|
||||
&:nth-child(3) {
|
||||
margin-bottom: 0;
|
||||
background: #d9534f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> form {
|
||||
position: relative;
|
||||
display: none;
|
||||
background: #fff;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
margin-left: 15px;
|
||||
box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22);
|
||||
border-radius: 8px;
|
||||
.typecho-option {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
background: #fff;
|
||||
border-top: 1px solid #ebebeb;
|
||||
border-radius: 0 0 8px 8px;
|
||||
button {
|
||||
width: 170px;
|
||||
height: 40px;
|
||||
background-color: #409eff;
|
||||
border-radius: 20px;
|
||||
&:hover {
|
||||
animation: pulse 1s;
|
||||
box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
.joe_content {
|
||||
display: none;
|
||||
padding: 15px;
|
||||
li {
|
||||
border: 1px solid #e9e9eb;
|
||||
padding: 15px;
|
||||
.typecho-label {
|
||||
display: block;
|
||||
border-left: 4px solid #409eff;
|
||||
background: #ecf5ff;
|
||||
line-height: 26px;
|
||||
margin-bottom: 15px;
|
||||
padding: 5px 15px;
|
||||
color: #409eff;
|
||||
user-select: none;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
select {
|
||||
min-width: 200px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
border: 1px solid #e9e9eb;
|
||||
color: #666;
|
||||
border-radius: 4px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.multiline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
input[type='checkbox'] {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
textarea,
|
||||
input[type='text'] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
color: #666;
|
||||
border: 1px solid #e9e9eb;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
textarea {
|
||||
height: 125px;
|
||||
}
|
||||
.description {
|
||||
background: #f8f8f8;
|
||||
color: #999;
|
||||
padding: 10px 15px;
|
||||
margin-top: 15px;
|
||||
line-height: 26px;
|
||||
border-radius: 4px;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__notice {
|
||||
display: none;
|
||||
margin-left: 15px;
|
||||
background: #fff;
|
||||
padding: 15px;
|
||||
flex: 1;
|
||||
box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22);
|
||||
border-radius: 8px;
|
||||
line-height: 28px;
|
||||
color: #606266;
|
||||
.title {
|
||||
text-align: center;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
font-weight: 500;
|
||||
font-size: 22px;
|
||||
margin-bottom: 15px;
|
||||
color: #67C23A;
|
||||
}
|
||||
ol {
|
||||
padding: 0 40px;
|
||||
margin-bottom: 15px;
|
||||
li {
|
||||
list-style: decimal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
box-shadow: 0 0 0 0 #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.joe_config {
|
||||
display: block;
|
||||
|
||||
&__aside {
|
||||
width: 100%;
|
||||
margin-bottom: 15px;
|
||||
.tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding-bottom: 10px;
|
||||
.item {
|
||||
width: 33.33333333%;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 18px;
|
||||
}
|
||||
}
|
||||
.backup {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
input {
|
||||
width: auto;
|
||||
flex: 1;
|
||||
margin-bottom: 0;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 18px;
|
||||
&:nth-child(2) {
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> form {
|
||||
margin-left: 0;
|
||||
.typecho-option {
|
||||
padding: 10px 0;
|
||||
button {
|
||||
width: 150px;
|
||||
height: 38px;
|
||||
border-radius: 19px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__notice {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
assets/typecho/config/js/joe.config.min.js
vendored
Executable file
1
assets/typecho/config/js/joe.config.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll(".joe_config__aside .item"),t=document.querySelector(".joe_config__notice"),s=document.querySelector(".joe_config > form"),n=document.querySelectorAll(".joe_content");if(e.forEach(function(o){o.addEventListener("click",function(){e.forEach(function(e){e.classList.remove("active")}),o.classList.add("active");var c=o.getAttribute("data-current");sessionStorage.setItem("joe_config_current",c),"joe_notice"===c?(t.style.display="block",s.style.display="none"):(t.style.display="none",s.style.display="block"),n.forEach(function(e){e.style.display="none";var t=e.classList.contains(c);t&&(e.style.display="block")})})}),sessionStorage.getItem("joe_config_current")){var o=sessionStorage.getItem("joe_config_current");"joe_notice"===o?(t.style.display="block",s.style.display="none"):(s.style.display="block",t.style.display="none"),e.forEach(function(e){var t=e.getAttribute("data-current");t===o&&e.classList.add("active")}),n.forEach(function(e){e.classList.contains(o)&&(e.style.display="block")})}else e[0].classList.add("active"),t.style.display="block",s.style.display="none";var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)if(200<=c.status&&300>c.status||304===c.status){var e=JSON.parse(c.responseText);t.innerHTML=e.success?'<p class="title">最新版本:'+e.title+"</p>"+e.content:"请求失败!"}else t.innerHTML="请求失败!"},c.open("get","https://78.al/api.php?type=collect&key=18e958d8c7fa5d435844f95c9f254fca",!0),c.send(null)});
|
||||
1
assets/typecho/write/css/joe.write.min.css
vendored
Executable file
1
assets/typecho/write/css/joe.write.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
1455
assets/typecho/write/css/joe.write.min.scss
Executable file
1455
assets/typecho/write/css/joe.write.min.scss
Executable file
File diff suppressed because one or more lines are too long
1
assets/typecho/write/dist/index.bundle.js
vendored
Executable file
1
assets/typecho/write/dist/index.bundle.js
vendored
Executable file
File diff suppressed because one or more lines are too long
873
assets/typecho/write/js/_actions.js
Executable file
873
assets/typecho/write/js/_actions.js
Executable file
@@ -0,0 +1,873 @@
|
||||
import { undo, redo } from '@codemirror/history';
|
||||
export default class JoeAction {
|
||||
constructor() {
|
||||
$('body').append(`
|
||||
<div class="cm-modal">
|
||||
<div class="cm-modal__wrapper">
|
||||
<div class="cm-modal__wrapper-header">
|
||||
<div class="cm-modal__wrapper-header--text"></div>
|
||||
<div class="cm-modal__wrapper-header--close">×</div>
|
||||
</div>
|
||||
<div class="cm-modal__wrapper-bodyer"></div>
|
||||
<div class="cm-modal__wrapper-footer">
|
||||
<button class="cm-modal__wrapper-footer--cancle">取消</button>
|
||||
<button class="cm-modal__wrapper-footer--confirm">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
$('.cm-modal__wrapper-footer--cancle, .cm-modal__wrapper-header--close').on('click', () => $('.cm-modal').removeClass('active'));
|
||||
$('.cm-modal__wrapper-footer--confirm').on('click', () => {
|
||||
this.options.confirm();
|
||||
$('.cm-modal').removeClass('active');
|
||||
});
|
||||
}
|
||||
_openModal(options = {}) {
|
||||
const _options = {
|
||||
title: '提示',
|
||||
innerHtml: '内容',
|
||||
hasFooter: true,
|
||||
confirm: () => { },
|
||||
handler: () => { }
|
||||
};
|
||||
this.options = Object.assign(_options, options);
|
||||
$('.cm-modal__wrapper-header--text').html(this.options.title);
|
||||
$('.cm-modal__wrapper-bodyer').html(this.options.innerHtml);
|
||||
this.options.hasFooter ? $('.cm-modal__wrapper-footer').show() : $('.cm-modal__wrapper-footer').hide();
|
||||
$('.cm-modal').addClass('active');
|
||||
this.options.handler();
|
||||
}
|
||||
_getLineCh(cm) {
|
||||
const head = cm.state.selection.main.head;
|
||||
const line = cm.state.doc.lineAt(head);
|
||||
return head - line.from;
|
||||
}
|
||||
_replaceSelection(cm, str) {
|
||||
cm.dispatch(cm.state.replaceSelection(str));
|
||||
}
|
||||
_setCursor(cm, pos) {
|
||||
cm.dispatch({ selection: { anchor: pos } });
|
||||
}
|
||||
_getSelection(cm) {
|
||||
return cm.state.sliceDoc(cm.state.selection.main.from, cm.state.selection.main.to);
|
||||
}
|
||||
_insetAmboText(cm, str) {
|
||||
const cursor = cm.state.selection.main.head;
|
||||
const selection = this._getSelection(cm);
|
||||
this._replaceSelection(cm, ` ${str + selection + str} `);
|
||||
if (selection === '') this._setCursor(cm, cursor + str.length + 1);
|
||||
cm.focus();
|
||||
}
|
||||
_createTableLists(cm, url, activeTab = '', modalTitle) {
|
||||
$.ajax({
|
||||
url,
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
let tabbarStr = '';
|
||||
let listsStr = '';
|
||||
for (let key in res) {
|
||||
const arr = res[key].split(' ');
|
||||
tabbarStr += `<div class="tabbar-item ${key === activeTab ? 'active' : ''}" data-show="${key}">${key}</div>`;
|
||||
listsStr += `<div class="lists ${key === activeTab ? 'active' : ''}" data-show="${key}">${arr.map(item => `<div class="lists-item" data-text="${item}">${item}</div>`).join(' ')}</div>`;
|
||||
}
|
||||
this._openModal({
|
||||
title: modalTitle,
|
||||
hasFooter: false,
|
||||
innerHtml: `<div class="tabbar">${tabbarStr}</div>${listsStr}`,
|
||||
handler: () => {
|
||||
$('.cm-modal__wrapper-bodyer .tabbar-item').on('click', function () {
|
||||
const activeTab = $(this);
|
||||
const show = activeTab.attr('data-show');
|
||||
const tabbar = $('.cm-modal__wrapper-bodyer .tabbar');
|
||||
activeTab.addClass('active').siblings().removeClass('active');
|
||||
tabbar.stop().animate({
|
||||
scrollLeft: activeTab[0].offsetLeft - tabbar[0].offsetWidth / 2 + activeTab[0].offsetWidth / 2 - 15
|
||||
});
|
||||
$('.cm-modal__wrapper-bodyer .lists').removeClass('active');
|
||||
$(".cm-modal__wrapper-bodyer .lists[data-show='" + show + "']").addClass('active');
|
||||
});
|
||||
const _this = this;
|
||||
$('.cm-modal__wrapper-bodyer .lists-item').on('click', function () {
|
||||
const text = $(this).attr('data-text');
|
||||
_this._replaceSelection(cm, ` ${text} `);
|
||||
$('.cm-modal').removeClass('active');
|
||||
cm.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
_updateScroller(el, target) {
|
||||
const percentage = el.scrollTop / (el.scrollHeight - el.offsetHeight);
|
||||
target.scrollTop = percentage * (target.scrollHeight - target.offsetHeight);
|
||||
}
|
||||
handleFullScreen(el) {
|
||||
el.toggleClass('active');
|
||||
$('body').toggleClass('fullscreen');
|
||||
$('.cm-container').toggleClass('fullscreen');
|
||||
$('.cm-preview').width(0);
|
||||
}
|
||||
handlePublish() {
|
||||
$('#btn-submit').click();
|
||||
}
|
||||
handleUndo(cm) {
|
||||
undo(cm);
|
||||
cm.focus();
|
||||
}
|
||||
handleRedo(cm) {
|
||||
redo(cm);
|
||||
cm.focus();
|
||||
}
|
||||
handleIndent(cm) {
|
||||
this._replaceSelection(cm, ' ');
|
||||
cm.focus();
|
||||
}
|
||||
handleTime(cm) {
|
||||
const time = new Date();
|
||||
const _Year = time.getFullYear();
|
||||
const _Month = String(time.getMonth() + 1).padStart(2, 0);
|
||||
const _Date = String(time.getDate()).padStart(2, 0);
|
||||
const _Hours = String(time.getHours()).padStart(2, 0);
|
||||
const _Minutes = String(time.getMinutes()).padStart(2, 0);
|
||||
const _Seconds = String(time.getSeconds()).padStart(2, 0);
|
||||
const _Day = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'][time.getDay()];
|
||||
const _time = `${this._getLineCh(cm) ? '\n' : ''}${_Year}-${_Month}-${_Date} ${_Hours}:${_Minutes}:${_Seconds} ${_Day}\n`;
|
||||
this._replaceSelection(cm, _time);
|
||||
cm.focus();
|
||||
}
|
||||
handleHr(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n' : ''}\n------------\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleClean(cm) {
|
||||
cm.dispatch({ changes: { from: 0, to: cm.state.doc.length, insert: '' } });
|
||||
cm.focus();
|
||||
}
|
||||
handleOrdered(cm) {
|
||||
const selection = this._getSelection(cm);
|
||||
if (selection === '') {
|
||||
const str = (this._getLineCh(cm) ? '\n\n' : '') + '1. ';
|
||||
this._replaceSelection(cm, str);
|
||||
} else {
|
||||
const selectionText = selection.split('\n');
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] = selectionText[i] === '' ? '' : i + 1 + '. ' + selectionText[i];
|
||||
}
|
||||
const str = (this._getLineCh(cm) ? '\n' : '') + selectionText.join('\n');
|
||||
this._replaceSelection(cm, str);
|
||||
}
|
||||
cm.focus();
|
||||
}
|
||||
handleUnordered(cm) {
|
||||
const selection = this._getSelection(cm);
|
||||
if (selection === '') {
|
||||
const str = (this._getLineCh(cm) ? '\n' : '') + '- ';
|
||||
this._replaceSelection(cm, str);
|
||||
} else {
|
||||
const selectionText = selection.split('\n');
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] = selectionText[i] === '' ? '' : '- ' + selectionText[i];
|
||||
}
|
||||
const str = (this._getLineCh(cm) ? '\n' : '') + selectionText.join('\n');
|
||||
this._replaceSelection(cm, str);
|
||||
}
|
||||
cm.focus();
|
||||
}
|
||||
handleQuote(cm) {
|
||||
const selection = this._getSelection(cm);
|
||||
if (selection === '') {
|
||||
this._replaceSelection(cm, `${this._getLineCh(cm) ? '\n' : ''}> `);
|
||||
} else {
|
||||
const selectionText = selection.split('\n');
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] = selectionText[i] === '' ? '' : '> ' + selectionText[i];
|
||||
}
|
||||
const str = (this._getLineCh(cm) ? '\n' : '') + selectionText.join('\n');
|
||||
this._replaceSelection(cm, str);
|
||||
}
|
||||
cm.focus();
|
||||
}
|
||||
handleDownload(cm) {
|
||||
const title = $('#title').val() || '新文章';
|
||||
const aTag = document.createElement('a');
|
||||
let blob = new Blob([cm.state.doc.toString()]);
|
||||
aTag.download = title + '.md';
|
||||
aTag.href = URL.createObjectURL(blob);
|
||||
aTag.click();
|
||||
URL.revokeObjectURL(blob);
|
||||
}
|
||||
handleTitle(cm, tool) {
|
||||
const item = $(`
|
||||
<div class="cm-tools-item" title="${tool.title}">
|
||||
${tool.innerHTML}
|
||||
<div class="cm-tools__dropdown">
|
||||
<div class="cm-tools__dropdown-item" data-text="# "> H1 </div>
|
||||
<div class="cm-tools__dropdown-item" data-text="## "> H2 </div>
|
||||
<div class="cm-tools__dropdown-item" data-text="### "> H3 </div>
|
||||
<div class="cm-tools__dropdown-item" data-text="#### "> H4 </div>
|
||||
<div class="cm-tools__dropdown-item" data-text="##### "> H5 </div>
|
||||
<div class="cm-tools__dropdown-item" data-text="###### "> H6 </div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
item.on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
$(this).toggleClass('active');
|
||||
});
|
||||
const _this = this;
|
||||
item.on('click', '.cm-tools__dropdown-item', function (e) {
|
||||
e.stopPropagation();
|
||||
const text = $(this).attr('data-text');
|
||||
if (_this._getLineCh(cm)) _this._replaceSelection(cm, '\n\n' + text);
|
||||
else _this._replaceSelection(cm, text);
|
||||
item.removeClass('active');
|
||||
cm.focus();
|
||||
});
|
||||
$(document).on('click', () => item.removeClass('active'));
|
||||
$('.cm-tools').append(item);
|
||||
}
|
||||
handleLink(cm) {
|
||||
this._openModal({
|
||||
title: '插入链接',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>链接标题</label>
|
||||
<input autocomplete="off" name="title" placeholder="请输入链接标题"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>链接地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入链接地址"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const title = $(".cm-modal input[name='title']").val() || 'Test';
|
||||
const url = $(".cm-modal input[name='url']").val() || 'http://';
|
||||
this._replaceSelection(cm, ` [${title}](${url}) `);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleImage(cm) {
|
||||
this._openModal({
|
||||
title: '插入图片',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>图片名称</label>
|
||||
<input autocomplete="off" name="title" placeholder="请输入图片名称"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>图片地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入图片地址"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const title = $(".cm-modal input[name='title']").val() || 'Test';
|
||||
const url = $(".cm-modal input[name='url']").val() || 'http://';
|
||||
this._replaceSelection(cm, `  `);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleTable(cm) {
|
||||
this._openModal({
|
||||
title: '插入表格',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>表格行</label>
|
||||
<input style="width: 50px; flex: none; margin-right: 10px;" value="3" autocomplete="off" name="row"/>
|
||||
<label>表格列</label>
|
||||
<input style="width: 50px; flex: none;" value="3" autocomplete="off" name="column"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
let row = $(".cm-modal input[name='row']").val();
|
||||
let column = $(".cm-modal input[name='column']").val();
|
||||
if (isNaN(row)) row = 3;
|
||||
if (isNaN(column)) column = 3;
|
||||
let rowStr = '';
|
||||
let rangeStr = '';
|
||||
let columnlStr = '';
|
||||
for (let i = 0; i < column; i++) {
|
||||
rowStr += '| 表头 ';
|
||||
rangeStr += '| :--: ';
|
||||
}
|
||||
for (let i = 0; i < row; i++) {
|
||||
for (let j = 0; j < column; j++) columnlStr += '| 表格 ';
|
||||
columnlStr += '|\n';
|
||||
}
|
||||
const htmlStr = `${rowStr}|\n${rangeStr}|\n${columnlStr}\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n\n' + htmlStr);
|
||||
else this._replaceSelection(cm, htmlStr);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleGird(cm) {
|
||||
this._openModal({
|
||||
title: '插入宫格',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>宫格列数</label>
|
||||
<input value="3" autocomplete="off" name="column" placeholder="请输入宫格列数"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>宫格间隔</label>
|
||||
<input value="15" autocomplete="off" name="gap" placeholder="请输入宫格间隔"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const column = $(".cm-modal input[name='column']").val();
|
||||
const gap = $(".cm-modal input[name='gap']").val();
|
||||
const htmlStr = `{gird column="${column}" gap="${gap}"}\n{gird-item}\n 宫格内容一\n{/gird-item}\n{gird-item}\n 宫格内容二\n{/gird-item}\n{gird-item}\n 宫格内容三\n{/gird-item}\n{/gird}`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n\n' + htmlStr);
|
||||
else this._replaceSelection(cm, htmlStr);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleCodeBlock(cm) {
|
||||
const language = 'rss+atom+ssml+mathml+svg+html+markup+css+clike+javascript+abap+abnf+actionscript+ada+agda+al+antlr4+apacheconf+apex+apl+applescript+aql+arduino+arff+asciidoc+aspnet+asm6502+autohotkey+autoit+bash+basic+batch+bbcode+birb+bison+bnf+brainfuck+brightscript+bro+bsl+c+csharp+cpp+cfscript+chaiscript+cil+clojure+cmake+cobol+coffeescript+concurnas+csp+coq+crystal+css-extras+csv+cypher+d+dart+dataweave+dax+dhall+diff+django+dns-zone-file+docker+dot+ebnf+editorconfig+eiffel+ejs+elixir+elm+etlua+erb+erlang+excel-formula+fsharp+factor+false+firestore-security-rules+flow+fortran+ftl+gml+gcode+gdscript+gedcom+gherkin+git+glsl+go+graphql+groovy+haml+handlebars+haskell+haxe+hcl+hlsl+http+hpkp+hsts+ichigojam+icon+icu-message-format+idris+ignore+inform7+ini+io+j+java+javadoc+javadoclike+javastacktrace+jexl+jolie+jq+jsdoc+js-extras+json+json5+jsonp+jsstacktrace+js-templates+julia+keyman+kotlin+kumir+latex+latte+less+lilypond+liquid+lisp+livescript+llvm+log+lolcode+lua+makefile+markdown+markup-templating+matlab+mel+mizar+mongodb+monkey+moonscript+n1ql+n4js+nand2tetris-hdl+naniscript+nasm+neon+nevod+nginx+nim+nix+nsis+objectivec+ocaml+opencl+openqasm+oz+parigp+parser+pascal+pascaligo+psl+pcaxis+peoplecode+perl+php+phpdoc+php-extras+plsql+powerquery+powershell+processing+prolog+promql+properties+protobuf+pug+puppet+pure+purebasic+purescript+python+qsharp+q+qml+qore+r+racket+jsx+tsx+reason+regex+rego+renpy+rest+rip+roboconf+robotframework+ruby+rust+sas+sass+scss+scala+scheme+shell-session+smali+smalltalk+smarty+sml+solidity+solution-file+soy+sparql+splunk-spl+sqf+sql+squirrel+stan+iecst+stylus+swift+t4-templating+t4-cs+t4-vb+tap+tcl+tt2+textile+toml+turtle+twig+typescript+typoscript+unrealscript+uri+v+vala+vbnet+velocity+verilog+vhdl+vim+visual-basic+warpscript+wasm+wiki+xeora+xml-doc+xojo+xquery+yaml+yang+zig';
|
||||
const languageArr = language.split('+').sort((a, b) => a.localeCompare(b));
|
||||
const sessionStorageType = sessionStorage.getItem('selectType') || '';
|
||||
let htmlStr = '';
|
||||
languageArr.forEach(item => {
|
||||
htmlStr += `<option ${sessionStorageType === item ? 'selected' : ''} value="${item}">${item.toUpperCase()}</option>`;
|
||||
});
|
||||
this._openModal({
|
||||
title: '插入代码块',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>语言类型</label>
|
||||
<select name="type">
|
||||
<option value="">- 请选择语言类型 -</option>
|
||||
${htmlStr}
|
||||
</select>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const type = $(".cm-modal select[name='type']").val();
|
||||
if (!type) return;
|
||||
const htmlStr = `\`\`\`${type}\ncode here...\n\`\`\``;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n\n' + htmlStr);
|
||||
else this._replaceSelection(cm, htmlStr);
|
||||
cm.focus();
|
||||
sessionStorage.setItem('selectType', type);
|
||||
}
|
||||
});
|
||||
}
|
||||
handleAbout() {
|
||||
this._openModal({
|
||||
title: '关于',
|
||||
hasFooter: false,
|
||||
innerHtml: `
|
||||
<ul>
|
||||
<li>短代码功能正在开发中...</li>
|
||||
<li>仅支持网络图片粘贴上传(截图等)</li>
|
||||
<li>本编辑器仅供Joe主题使用,未经允许不得移植至其他主题!</li>
|
||||
</ul>
|
||||
`
|
||||
});
|
||||
}
|
||||
handleTask(cm, type) {
|
||||
const str = type ? '{x}' : '{ }';
|
||||
this._replaceSelection(cm, ` ${str} `);
|
||||
cm.focus();
|
||||
}
|
||||
handleNetease(cm, type) {
|
||||
this._openModal({
|
||||
title: type ? '网易云歌单' : '网易云单首',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>歌${type ? '单' : '曲'} ID</label>
|
||||
<input autocomplete="off" name="id" placeholder="请输入歌${type ? '单' : '曲'}ID"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>主题色彩</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#1989fa" name="color" type="color"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>自动播放</label>
|
||||
<select name="autoplay">
|
||||
<option value="1" selected>是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const id = $(".cm-modal input[name='id']").val();
|
||||
const color = $(".cm-modal input[name='color']").val();
|
||||
const autoplay = $(".cm-modal select[name='autoplay']").val();
|
||||
const str = `\n{${type ? 'music-list' : 'music'} id="${id}" color="${color}" ${autoplay === '1' ? 'autoplay="autoplay"' : ''}/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleBilibili(cm) {
|
||||
this._openModal({
|
||||
title: 'BiliBili视频',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>视频Bvid</label>
|
||||
<input autocomplete="off" name="bvid" placeholder="请输入视频Bvid"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>视频选集</label>
|
||||
<input autocomplete="off" name="page" placeholder="请输入视频选集"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const bvid = $(".cm-modal input[name='bvid']").val();
|
||||
const page = $(".cm-modal input[name='page']").val();
|
||||
const str = `\n{bilibili bvid="${bvid}" page="${page}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleDplayer(cm) {
|
||||
this._openModal({
|
||||
title: 'M3U8/MP4视频',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>视频地址</label>
|
||||
<input autocomplete="off" name="src" placeholder="请输入视频地址"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const src = $(".cm-modal input[name='src']").val();
|
||||
const str = `\n{dplayer src="${src}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleDraft() {
|
||||
$('#btn-save').click();
|
||||
}
|
||||
handleExpression(cm) {
|
||||
$.ajax({
|
||||
url: window.JoeConfig.expressionAPI,
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
let tabbarStr = '';
|
||||
let listsStr = '';
|
||||
for (let key in res) {
|
||||
const arr = res[key];
|
||||
tabbarStr += `<div class="tabbar-item ${key === '泡泡' ? 'active' : ''}" data-show="${key}">${key}</div>`;
|
||||
listsStr += `<div class="lists ${key === '泡泡' ? 'active' : ''}" data-show="${key}">${arr.map(item => `<div class="lists-item" data-text="${item.data}">${key === '颜文字' ? item.icon : `<img src="${window.JoeConfig.themeURL + item.icon}">`}</div>`).join(' ')}</div>`;
|
||||
}
|
||||
this._openModal({
|
||||
title: '普通表情',
|
||||
hasFooter: false,
|
||||
innerHtml: `<div class="tabbar">${tabbarStr}</div>${listsStr}`,
|
||||
handler: () => {
|
||||
$('.cm-modal__wrapper-bodyer .tabbar-item').on('click', function () {
|
||||
const show = $(this).attr('data-show');
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
$('.cm-modal__wrapper-bodyer .lists').removeClass('active');
|
||||
$(".cm-modal__wrapper-bodyer .lists[data-show='" + show + "']").addClass('active');
|
||||
});
|
||||
const _this = this;
|
||||
$('.cm-modal__wrapper-bodyer .lists-item').on('click', function () {
|
||||
const text = $(this).attr('data-text');
|
||||
_this._replaceSelection(cm, ` ${text} `);
|
||||
$('.cm-modal').removeClass('active');
|
||||
cm.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
handleMtitle(cm) {
|
||||
this._openModal({
|
||||
title: '居中标题',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>标题内容</label>
|
||||
<input autocomplete="off" maxlength="10" name="text" placeholder="请输入标题内容(10字以内)"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const text = $(".cm-modal input[name='text']").val();
|
||||
const str = `\n{mtitle title="${text}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleHtml(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n' : ''}!!!\n<p align="center">居中</p>\n<p align="right">居右</p>\n<font size="5" color="red">颜色大小</font>\n!!!\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleHide(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{hide}\n需要隐藏的内容\n{/hide}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleAbtn(cm) {
|
||||
this._openModal({
|
||||
title: '多彩按钮',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>按钮图标</label>
|
||||
<input autocomplete="off" name="icon" placeholder="请输入fa图标,例:fa-download"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>图标大全</label>
|
||||
<a href="https://fontawesome.dashgame.com" target="_blank">fontawesome.dashgame.com</a>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>按钮颜色</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#ff6800" name="color" type="color"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>跳转链接</label>
|
||||
<input autocomplete="off" name="href" placeholder="请输入跳转链接"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>按钮圆角</label>
|
||||
<input autocomplete="off" name="radius" placeholder="请输入按钮圆角,例:17.5px"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>按钮内容</label>
|
||||
<input autocomplete="off" name="content" placeholder="请输入按钮内容"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const icon = $(".cm-modal input[name='icon']").val();
|
||||
const color = $(".cm-modal input[name='color']").val();
|
||||
const href = $(".cm-modal input[name='href']").val();
|
||||
const radius = $(".cm-modal input[name='radius']").val();
|
||||
const content = $(".cm-modal input[name='content']").val();
|
||||
const str = ` {abtn icon="${icon}" color="${color}" href="${href}" radius="${radius}" content="${content}"/} `;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleAnote(cm) {
|
||||
this._openModal({
|
||||
title: '便条按钮',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>按钮图标</label>
|
||||
<input autocomplete="off" name="icon" placeholder="请输入fa图标,例:fa-download"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>图标大全</label>
|
||||
<a href="https://fontawesome.dashgame.com" target="_blank">fontawesome.dashgame.com</a>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>跳转链接</label>
|
||||
<input autocomplete="off" name="href" placeholder="请输入跳转链接"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>按钮类型</label>
|
||||
<select name="type">
|
||||
<option value="secondary" selected>secondary</option>
|
||||
<option value="success">success</option>
|
||||
<option value="warning">warning</option>
|
||||
<option value="error">error</option>
|
||||
<option value="info">info</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>按钮内容</label>
|
||||
<input autocomplete="off" name="content" placeholder="请输入按钮内容"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const icon = $(".cm-modal input[name='icon']").val();
|
||||
const href = $(".cm-modal input[name='href']").val();
|
||||
const type = $(".cm-modal select[name='type']").val();
|
||||
const content = $(".cm-modal input[name='content']").val();
|
||||
const str = ` {anote icon="${icon}" href="${href}" type="${type}" content="${content}"/} `;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleDotted(cm) {
|
||||
this._openModal({
|
||||
title: '彩色虚线',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>开始颜色</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#ff6c6c" name="startColor" type="color"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>结束颜色</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#1989fa" name="endColor" type="color"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const startColor = $(".cm-modal input[name='startColor']").val();
|
||||
const endColor = $(".cm-modal input[name='endColor']").val();
|
||||
const str = `\n{dotted startColor="${startColor}" endColor="${endColor}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleCardDefault(cm) {
|
||||
this._openModal({
|
||||
title: '默认卡片',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>卡片标题</label>
|
||||
<input autocomplete="off" name="label" placeholder="请输入卡片标题"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>卡片宽度</label>
|
||||
<input autocomplete="off" name="width" placeholder="请输入卡片宽度,例如:100%"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const label = $(".cm-modal input[name='label']").val();
|
||||
const width = $(".cm-modal input[name='width']").val();
|
||||
const str = `\n{card-default label="${label}" width="${width}"}\n卡片内容\n{/card-default}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleMessage(cm) {
|
||||
this._openModal({
|
||||
title: '消息提示',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>消息类型</label>
|
||||
<select name="type">
|
||||
<option value="success" selected>success</option>
|
||||
<option value="info">info</option>
|
||||
<option value="warning">warning</option>
|
||||
<option value="error">error</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem" style="align-items: flex-start">
|
||||
<label>消息内容</label>
|
||||
<textarea autocomplete="off" name="content" placeholder="请输入消息内容"></textarea>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const type = $(".cm-modal select[name='type']").val();
|
||||
const content = $(".cm-modal textarea[name='content']").val();
|
||||
const str = `\n{message type="${type}" content="${content}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleProgress(cm) {
|
||||
this._openModal({
|
||||
title: '进度条',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>百分比数</label>
|
||||
<input autocomplete="off" name="percentage" placeholder="请输入百分比(最大100%)"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>自定义色</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#ff6c6c" name="color" type="color"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const percentage = $(".cm-modal input[name='percentage']").val();
|
||||
const color = $(".cm-modal input[name='color']").val();
|
||||
const str = `\n{progress percentage="${percentage}" color="${color}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleMp3(cm) {
|
||||
this._openModal({
|
||||
title: '插入音乐',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>音频名称</label>
|
||||
<input autocomplete="off" name="name" placeholder="请输入音频名称"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>音频地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入音频地址"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>音频封面</label>
|
||||
<input autocomplete="off" name="cover" placeholder="请输入图片地址"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>主题色彩</label>
|
||||
<input style="width: 44px;padding: 0 2px;flex: none" autocomplete="off" value="#f0ad4e" name="theme" type="color"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>自动播放</label>
|
||||
<select name="autoplay">
|
||||
<option value="1" selected>是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const name = $(".cm-modal input[name='name']").val();
|
||||
const url = $(".cm-modal input[name='url']").val();
|
||||
const cover = $(".cm-modal input[name='cover']").val();
|
||||
const theme = $(".cm-modal input[name='theme']").val();
|
||||
const autoplay = $(".cm-modal select[name='autoplay']").val();
|
||||
const str = `\n{mp3 name="${name}" url="${url}" cover="${cover}" theme="${theme}" ${autoplay === '1' ? 'autoplay="autoplay"' : ''}/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
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();
|
||||
}
|
||||
handleCardList(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{card-list}\n{card-list-item}\n 列表一内容\n{/card-list-item}\n{card-list-item}\n 列表二内容\n{/card-list-item}\n{/card-list}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleTimeline(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{timeline}\n{timeline-item color="#19be6b"}\n 正式上线\n{/timeline-item}\n{timeline-item color="#ed4014"}\n 删库跑路\n{/timeline-item}\n{/timeline}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleCardDescribe(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{card-describe title="卡片描述"}\n卡片内容\n{/card-describe}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleCopy(cm) {
|
||||
this._openModal({
|
||||
title: '复制文本',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>显示文案</label>
|
||||
<input autocomplete="off" name="showText" placeholder="请输入显示文案"/>
|
||||
</div>
|
||||
<div class="fitem" style="align-items: flex-start">
|
||||
<label>复制内容</label>
|
||||
<textarea autocomplete="off" name="copyText" placeholder="请输入需要复制的内容"></textarea>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const showText = $(".cm-modal input[name='showText']").val();
|
||||
const copyText = $(".cm-modal textarea[name='copyText']").val();
|
||||
const str = `\n{copy showText="${showText}" copyText="${copyText}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleLamp(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{lamp/}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleCollapse(cm) {
|
||||
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{collapse}\n{collapse-item label="折叠标题一" open}\n 折叠内容一\n{/collapse-item}\n{collapse-item label="折叠标题二"}\n 折叠内容二\n{/collapse-item}\n{/collapse}\n\n`;
|
||||
this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
handleAlert(cm) {
|
||||
this._openModal({
|
||||
title: '警告提示',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>提示类型</label>
|
||||
<select name="type">
|
||||
<option value="info" selected>info</option>
|
||||
<option value="success">success</option>
|
||||
<option value="warning">warning</option>
|
||||
<option value="error">error</option>
|
||||
</select>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const type = $(".cm-modal select[name='type']").val();
|
||||
const str = `\n{alert type="${type}"}\n警告提示\n{/alert}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
handleCloud(cm) {
|
||||
this._openModal({
|
||||
title: '网盘下载',
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>网盘类型</label>
|
||||
<select name="type">
|
||||
<option value="default" selected>默认网盘</option>
|
||||
<option value="360">360网盘</option>
|
||||
<option value="bd">百度网盘</option>
|
||||
<option value="ty">天翼网盘</option>
|
||||
<option value="ct">城通网盘</option>
|
||||
<option value="wy">微云网盘</option>
|
||||
<option value="github">Github仓库</option>
|
||||
<option value="lz">蓝奏云网盘</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>显示标题</label>
|
||||
<input autocomplete="off" name="title" placeholder="请输入显示标题"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>下载地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入网盘地址"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>提取密码</label>
|
||||
<input autocomplete="off" name="password" placeholder="请输入提取码(非必填)"/>
|
||||
</div>
|
||||
`,
|
||||
confirm: () => {
|
||||
const type = $(".cm-modal select[name='type']").val();
|
||||
const title = $(".cm-modal input[name='title']").val();
|
||||
const url = $(".cm-modal input[name='url']").val();
|
||||
const password = $(".cm-modal input[name='password']").val();
|
||||
const str = `\n{cloud title="${title}" type="${type}" url="${url}" password="${password}"/}\n\n`;
|
||||
if (this._getLineCh(cm)) this._replaceSelection(cm, '\n' + str);
|
||||
else this._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
105
assets/typecho/write/js/_create.js
Executable file
105
assets/typecho/write/js/_create.js
Executable file
@@ -0,0 +1,105 @@
|
||||
const parser = new HyperDown();
|
||||
const player = window.JoeConfig.playerAPI;
|
||||
|
||||
export default function createPreviewHtml(str) {
|
||||
if (!window.JoeConfig.canPreview) return $('.cm-preview-content').html('1. 预览已默认关闭<br>2. 点击上方预览按钮启用预览<br>3. 若编辑器卡顿可尝试关闭预览');
|
||||
|
||||
if (str.indexOf(' ') !== -1) {
|
||||
str = str.replace(/ /g, ' ');
|
||||
}
|
||||
|
||||
/* 生成html */
|
||||
str = parser.makeHtml(str);
|
||||
|
||||
str = str.replace(/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/g, function ($0, $1) {
|
||||
$1 = encodeURI($1).replace(/%/g, '');
|
||||
return `<img class="owo" src="${window.JoeConfig.themeURL}assets/owo/paopao/${$1}_2x.png" />`;
|
||||
});
|
||||
|
||||
str = str.replace(/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/g, function ($0, $1) {
|
||||
$1 = encodeURI($1).replace(/%/g, '');
|
||||
return `<img class="owo" src="${window.JoeConfig.themeURL}assets/owo/aru/${$1}_2x.png" />`;
|
||||
});
|
||||
|
||||
if (str.indexOf('{lamp') !== -1) {
|
||||
str = str.replace(/{lamp\/}/g, '<span class="joe_lamp"></span>');
|
||||
}
|
||||
if (str.indexOf('{x}') !== -1) {
|
||||
str = str.replace(/{x}/g, '<input type="checkbox" class="joe_checkbox" checked disabled></input>');
|
||||
}
|
||||
if (str.indexOf('{ }') !== -1) {
|
||||
str = str.replace(/{ }/g, '<input type="checkbox" class="joe_checkbox" disabled></input>');
|
||||
}
|
||||
if (str.indexOf('{mtitle') !== -1) {
|
||||
str = str.replace(/{mtitle([^}]*)\/}/g, '<joe-mtitle $1></joe-mtitle>');
|
||||
}
|
||||
if (str.indexOf('{dplayer') !== -1) {
|
||||
str = str.replace(/{dplayer([^}]*)\/}/g, '<joe-dplayer player="' + player + '" $1></joe-dplayer>');
|
||||
}
|
||||
if (str.indexOf('{bilibili') !== -1) {
|
||||
str = str.replace(/{bilibili([^}]*)\/}/g, '<joe-bilibili $1></joe-bilibili>');
|
||||
}
|
||||
if (str.indexOf('{music-list') !== -1) {
|
||||
str = str.replace(/{music-list([^}]*)\/}/g, '<joe-mlist $1></joe-mlist>');
|
||||
}
|
||||
if (str.indexOf('{music') !== -1) {
|
||||
str = str.replace(/{music([^}]*)\/}/g, '<joe-music $1></joe-music>');
|
||||
}
|
||||
if (str.indexOf('{mp3') !== -1) {
|
||||
str = str.replace(/{mp3([^}]*)\/}/g, '<joe-mp3 $1></joe-mp3>');
|
||||
}
|
||||
if (str.indexOf('{abtn') !== -1) {
|
||||
str = str.replace(/{abtn([^}]*)\/}/g, '<joe-abtn $1></joe-abtn>');
|
||||
}
|
||||
if (str.indexOf('{anote') !== -1) {
|
||||
str = str.replace(/{anote([^}]*)\/}/g, '<joe-anote $1></joe-anote>');
|
||||
}
|
||||
if (str.indexOf('{copy') !== -1) {
|
||||
str = str.replace(/{copy([^}]*)\/}/g, '<joe-copy $1></joe-copy>');
|
||||
}
|
||||
if (str.indexOf('{dotted') !== -1) {
|
||||
str = str.replace(/{dotted([^}]*)\/}/g, '<joe-dotted $1></joe-dotted>');
|
||||
}
|
||||
if (str.indexOf('{message') !== -1) {
|
||||
str = str.replace(/{message([^}]*)\/}/g, '<joe-message $1></joe-message>');
|
||||
}
|
||||
if (str.indexOf('{progress') !== -1) {
|
||||
str = str.replace(/{progress([^}]*)\/}/g, '<joe-progress $1></joe-progress>');
|
||||
}
|
||||
if (str.indexOf('{cloud') !== -1) {
|
||||
str = str.replace(/{cloud([^}]*)\/}/g, '<joe-cloud $1></joe-cloud>');
|
||||
}
|
||||
if (str.indexOf('{hide') !== -1) {
|
||||
str = str.replace(/{hide[^}]*}([\s\S]*?){\/hide}/g, '<joe-hide></joe-hide>');
|
||||
}
|
||||
if (str.indexOf('{card-default') !== -1) {
|
||||
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>');
|
||||
}
|
||||
if (str.indexOf('{callout') !== -1) {
|
||||
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>');
|
||||
}
|
||||
if (str.indexOf('{card-describe') !== -1) {
|
||||
str = str.replace(/{card-describe([^}]*)}([\s\S]*?){\/card-describe}/g, '<section style="margin-bottom: 15px"><joe-card-describe $1><span class="_temp" style="display: none">$2</span></joe-card-describe></section>');
|
||||
}
|
||||
if (str.indexOf('{tabs') !== -1) {
|
||||
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>');
|
||||
}
|
||||
if (str.indexOf('{card-list') !== -1) {
|
||||
str = str.replace(/{card-list}([\s\S]*?){\/card-list}/g, '<section style="margin-bottom: 15px"><joe-card-list><span class="_temp" style="display: none">$1</span></joe-card-list></section>');
|
||||
}
|
||||
if (str.indexOf('{timeline') !== -1) {
|
||||
str = str.replace(/{timeline}([\s\S]*?){\/timeline}/g, '<section style="margin-bottom: 15px"><joe-timeline><span class="_temp" style="display: none">$1</span></joe-timeline></section>');
|
||||
}
|
||||
if (str.indexOf('{collapse') !== -1) {
|
||||
str = str.replace(/{collapse}([\s\S]*?){\/collapse}/g, '<section style="margin-bottom: 15px"><joe-collapse><span class="_temp" style="display: none">$1</span></joe-collapse></section>');
|
||||
}
|
||||
if (str.indexOf('{alert') !== -1) {
|
||||
str = str.replace(/{alert([^}]*)}([\s\S]*?){\/alert}/g, '<section style="margin-bottom: 15px"><joe-alert $1><span class="_temp" style="display: none">$2</span></joe-alert></section>');
|
||||
}
|
||||
if (str.indexOf('{gird') !== -1) {
|
||||
str = str.replace(/{gird([^}]*)}([\s\S]*?){\/gird}/g, '<section style="margin-bottom: 15px"><joe-gird $1><span class="_temp" style="display: none">$2</span></joe-gird></section>');
|
||||
}
|
||||
$('.cm-preview-content').html(str);
|
||||
$('.cm-preview-content p:empty').remove();
|
||||
Prism.highlightAll();
|
||||
}
|
||||
274
assets/typecho/write/js/_tools.js
Executable file
274
assets/typecho/write/js/_tools.js
Executable file
@@ -0,0 +1,274 @@
|
||||
export default [
|
||||
{
|
||||
type: 'undo',
|
||||
title: '撤销',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M76 463.7l294.8 294.9c19.5 19.4 52.8 5.6 52.8-21.9V561.5c202.5-8.2 344.1 59.5 501.6 338.3 8.5 15 31.5 7.9 30.6-9.3-30.5-554.7-453-571.4-532.3-569.6v-174c0-27.5-33.2-41.3-52.7-21.8L75.9 420c-12 12.1-12 31.6.1 43.7z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'redo',
|
||||
title: '重做',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M946.8 420L651.9 125.1c-19.5-19.5-52.7-5.7-52.7 21.8v174c-79.3-1.8-501.8 14.9-532.3 569.6-.9 17.2 22.1 24.3 30.6 9.3C255 621 396.6 553.3 599.1 561.5v175.2c0 27.5 33.3 41.3 52.8 21.9l294.8-294.9c12.1-12.1 12.1-31.6.1-43.7z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'bold',
|
||||
title: '加粗',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 469.333h192a106.667 106.667 0 1 0 0-213.333h-192v213.333zm426.667 192a192 192 0 0 1-192 192H256V170.667h277.333a192 192 0 0 1 138.923 324.522A191.915 191.915 0 0 1 768 661.333zM341.333 554.667V768H576a106.667 106.667 0 1 0 0-213.333H341.333z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'italic',
|
||||
title: '倾斜',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M640 853.333H298.667V768h124.885l90.283-512H384v-85.333h341.333V256H600.448l-90.283 512H640z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
title: '删除',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M731.904 597.333c9.813 22.016 14.763 46.507 14.763 73.387 0 57.259-22.358 102.059-67.03 134.272-44.757 32.213-106.496 48.341-185.301 48.341-69.973 0-139.221-16.256-207.787-48.81v-96.256c64.854 37.418 131.2 56.149 199.083 56.149 108.843 0 163.413-31.232 163.797-93.739a94.293 94.293 0 0 0-27.648-68.394l-5.12-4.992H128v-85.334h768v85.334H731.904zm-173.995-128H325.504a174.336 174.336 0 0 1-20.523-22.272c-18.432-23.808-27.648-52.565-27.648-86.442 0-52.736 19.883-97.579 59.606-134.528 39.808-36.95 101.29-55.424 184.533-55.424 62.763 0 122.837 13.994 180.139 41.984v91.818c-51.2-29.312-107.307-43.946-168.363-43.946-105.813 0-158.677 33.365-158.677 100.096 0 17.92 9.301 33.536 27.904 46.89 18.602 13.355 41.557 23.979 68.821 32 26.453 7.68 55.339 17.664 86.613 29.824z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'code-inline',
|
||||
title: '行内代码',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M416.328 512.336a96 96 0 1 0 192 0 96 96 0 1 0-192 0zM336.328 860c-12.288 0-24.568-6-33.944-17.992l-224-286.584c-18.744-23.984-18.744-62.856 0-86.84l224-286.592c18.744-23.976 49.136-23.976 67.88 0 18.744 23.984 18.744 62.864 0 86.848L180.208 512l190.056 243.168c18.744 23.968 18.744 62.856 0 86.832-9.368 12-21.648 18-33.936 18zm352 0c12.28 0 24.568-6 33.936-17.992l224-286.584c18.752-23.984 18.752-62.856 0-86.84l-224-286.592c-18.744-23.976-49.136-23.976-67.872 0-18.752 23.984-18.752 62.864 0 86.848L844.448 512 654.392 755.168c-18.752 23.968-18.752 62.856 0 86.832 9.376 12 21.656 18 33.936 18z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'hr',
|
||||
title: '横线',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M896 469.333H128c-25.6 0-42.667 17.067-42.667 42.667S102.4 554.667 128 554.667h768c25.6 0 42.667-17.067 42.667-42.667S921.6 469.333 896 469.333z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'quote',
|
||||
title: '引用',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M195.541 739.03C151.595 692.351 128 640 128 555.135c0-149.333 104.832-283.179 257.28-349.355l38.101 58.795c-142.293 76.97-170.112 176.853-181.205 239.83 22.912-11.862 52.907-16 82.304-13.27 76.97 7.125 137.643 70.315 137.643 148.864a149.333 149.333 0 0 1-149.334 149.333 165.163 165.163 0 0 1-117.248-50.304zm426.667 0c-43.947-46.678-67.541-99.03-67.541-183.894 0-149.333 104.832-283.179 257.28-349.355l38.101 58.795c-142.293 76.97-170.112 176.853-181.205 239.83 22.912-11.862 52.906-16 82.304-13.27 76.97 7.125 137.642 70.315 137.642 148.864a149.333 149.333 0 0 1-149.333 149.333 165.163 165.163 0 0 1-117.248-50.304z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'title',
|
||||
title: '标题',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M256 213.333h104.875v267.094h324.48V213.333h104.874v640H685.355V570.07h-324.48v283.264H256z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'ordered-list',
|
||||
title: '有序列表',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 170.667H896V256H341.333v-85.333zm-128-42.667v128H256v42.667H128V256h42.667v-85.333H128V128h85.333zM128 597.333V490.667h85.333v-21.334H128v-42.666h128v106.666h-85.333v21.334H256v42.666H128zM213.333 832H128v-42.667h85.333V768H128v-42.667h128V896H128v-42.667h85.333V832zm128-362.667H896v85.334H341.333v-85.334zm0 298.667H896v85.333H341.333V768z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'unordered-list',
|
||||
title: '无序列表',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 170.667H896V256H341.333v-85.333zM192 277.333a64 64 0 1 1 0-128 64 64 0 0 1 0 128zM192 576a64 64 0 1 1 0-128 64 64 0 0 1 0 128zm0 294.4a64 64 0 1 1 0-128 64 64 0 0 1 0 128zm149.333-401.067H896v85.334H341.333v-85.334zm0 298.667H896v85.333H341.333V768z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
title: '超链接',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="15" height="15"><path d="M879.2 131.6c-103-95.5-264.1-88-361.4 11.2L474.7 184c-13.1 13.1-3.7 35.6 13.1 37.5 26.2 1.9 52.4 7.5 78.7 15 7.5 1.9 16.9 0 22.5-5.6l9.4-9.4c54.3-54.3 142.3-59.9 198.5-11.2 63.7 54.3 65.5 151.7 7.5 209.7L662 562.3c-18.7 18.7-41.2 30-63.7 37.5-30 7.5-61.8 5.6-89.9-5.6-16.9-7.5-33.7-16.9-48.7-31.8-7.5-7.5-13.1-15-18.7-24.3-7.5-13.1-24.3-15-33.7-3.7l-52.4 52.4c-7.5 7.5-7.5 18.7-1.9 28.1 7.5 11.2 16.9 20.6 26.2 30 13.1 13.1 30 26.2 44.9 35.6 26.2 16.9 56.2 28.1 86.1 33.7 58.1 11.2 121.7 1.9 174.2-26.2 20.6-11.2 41.2-26.2 58.1-43.1l142.3-142.3c104.9-103.2 101.2-271.8-5.6-371zM534.7 803.9l-39.3-5.6s-26.2-5.6-39.3-11.2c-7.5-1.9-16.9 0-22.5 5.6l-9.4 9.4c-54.3 54.3-142.3 59.9-198.5 11.2-63.7-54.3-65.5-151.7-7.5-209.7l142.3-142.3c18.7-18.7 41.2-30 63.7-37.5 30-7.5 61.8-5.6 89.9 5.6 16.9 7.5 33.7 16.9 48.7 31.8 7.5 7.5 13.1 15 18.7 24.3 7.5 13.1 24.3 15 33.7 3.7l52.4-52.4c7.5-7.5 7.5-18.7 1.9-28.1-7.5-11.2-16.9-20.6-26.2-30-13.1-13.1-28.1-26.2-44.9-35.6-26.2-16.9-56.2-28.1-88-33.7-58.1-11.2-121.7-1.9-174.2 26.2-20.6 11.2-41.2 26.2-58.1 43.1L141.4 515.5c-99.3 99.3-106.7 260.3-11.2 361.4C229.5 985.5 398 987.4 501 884.4l46.8-46.8c13.1-9.4 3.7-31.9-13.1-33.7z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'image',
|
||||
title: '插入图片',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M46.545 977.455V46.545h930.91v930.91zm93.091-186.182v93.09h744.728V717.918l-214.11-228.305zm0-107.055l548.585-311.854 196.143 209.454V139.636H139.636zm99.282-376.227a82.758 82.758 0 0 1 82.758-82.758 82.758 82.758 0 0 1 82.757 82.758 82.758 82.758 0 0 1-82.757 82.805 82.804 82.804 0 0 1-82.758-82.898z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'table',
|
||||
title: '表格',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M892.8 108h-763c-26.2 0-47.5 21.3-47.5 47.5v714c0 26.2 21.3 47.5 47.5 47.5h763c26.2 0 47.5-21.3 47.5-47.5v-714c0-26.2-21.3-47.5-47.5-47.5zm-291 294.7v172.1H411.7V402.7h190.1zm76 0h186.5v172.1H677.8V402.7zM864.3 184v142.7h-706V184h706zM158.4 841V402.7h177.3v172.1H159.8v76h175.9v188.9h76V650.8h190.1v188.9h76V650.8h186.5V841H158.4z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'code-block',
|
||||
title: '代码块',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M902.4 454.4l-144-144a40.704 40.704 0 0 0-57.6 57.6l144 144-144 144a40.704 40.704 0 0 0 57.6 57.6l144-144a81.472 81.472 0 0 0 0-115.2zm-636.8-144l-144 144a81.472 81.472 0 0 0 0 115.2l144 144a40.704 40.704 0 0 0 57.6-57.6l-144-144 144-144a40.704 40.704 0 0 0-57.6-57.6zm109.568 544.064l195.072-706.56a40.704 40.704 0 0 1 78.528 21.632l-195.072 706.56a40.704 40.704 0 0 1-78.528-21.696z" /></svg>'
|
||||
},
|
||||
{
|
||||
type: 'html',
|
||||
title: '原生HTML',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M128 64l69.8 791.6L511 960l315.2-104.4L896 64H128zm616.4 255.8H376.8l8.2 98.8h351.2L709 715.4l-195.8 54v.6H511l-197.4-54.6-12-151.6H397l7 76.2 107 29 107.4-29 12-124.4H296.6L271 224.4h482.2l-8.8 95.4z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'time',
|
||||
title: '当前时间',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'indent',
|
||||
title: '缩进',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M692.019 192c-22.087 0-39.992 17.935-39.992 40.059v277.192c-.638-9.212-4.471-18.244-11.522-25.286l-280.74-280.353c-15.504-15.483-40.643-15.483-56.147 0-15.505 15.483-15.505 40.587 0 56.07L556.282 512 303.617 764.316c-15.505 15.482-15.505 40.587 0 56.07 15.504 15.484 40.643 15.483 56.146 0l280.74-280.352a40.074 40.074 0 0 0 2.726-3.012c5.322-6.517 8.247-14.329 8.797-22.275V791.82c0 22.122 17.905 40.057 39.992 40.057s39.993-17.935 39.993-40.057V232.059c.001-22.124-17.906-40.059-39.992-40.059z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'character',
|
||||
title: '实体符号',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/><path d="M517.6 351.3c53 0 89 33.8 93 83.4.3 4.2 3.8 7.4 8 7.4h56.7c2.6 0 4.7-2.1 4.7-4.7 0-86.7-68.4-147.4-162.7-147.4C407.4 290 344 364.2 344 486.8v52.3C344 660.8 407.4 734 517.3 734c94 0 162.7-58.8 162.7-141.4 0-2.6-2.1-4.7-4.7-4.7h-56.8c-4.2 0-7.6 3.2-8 7.3-4.2 46.1-40.1 77.8-93 77.8-65.3 0-102.1-47.9-102.1-133.6v-52.6c.1-87 37-135.5 102.2-135.5z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'emoji',
|
||||
title: '符号表情',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="19" height="19"><path d="M512 56.889A455.111 455.111 0 0 0 56.889 512 455.111 455.111 0 0 0 512 967.111 455.111 455.111 0 0 0 967.111 512 455.111 455.111 0 0 0 512 56.889zm111.047 270.336A69.086 69.086 0 0 1 671.29 307.2c17.863 0 35.67 7.396 48.242 20.025 12.629 12.572 20.025 30.379 20.025 48.242 0 17.863-7.396 35.669-20.025 48.241-12.8 12.744-30.151 19.912-48.242 20.025a68.95 68.95 0 0 1-48.242-20.025 68.95 68.95 0 0 1-20.025-48.241c0-17.863 7.396-35.67 20.025-48.242zm-318.578 0a69.086 69.086 0 0 1 48.242-20.025c17.863 0 35.67 7.396 48.242 20.025 12.63 12.572 20.025 30.379 20.025 48.242 0 17.863-7.396 35.669-20.025 48.241-12.8 12.744-30.151 19.912-48.242 20.025a68.95 68.95 0 0 1-48.242-20.025 68.95 68.95 0 0 1-20.025-48.241c0-17.863 7.396-35.67 20.025-48.242zM786.375 566.67c-10.24 132.893-118.556 236.544-270.563 235.975-156.331 1.707-264.704-107.178-270.507-235.975a23.324 23.324 0 0 1-2.446-10.41c0-13.597 11.605-24.633 26.282-24.52h493.796c14.336 0 26.055 11.037 26.055 24.52a24.292 24.292 0 0 1-2.617 10.41z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'expression',
|
||||
title: '图片表情',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M512 63.488q93.184 0 174.592 35.328t142.336 95.744 96.256 142.336 35.328 174.08q0 93.184-35.328 174.592t-96.256 142.336-142.336 96.256T512 959.488q-92.16 0-174.08-35.328t-142.336-96.256T99.84 685.568 64.512 510.976q0-92.16 35.328-174.08t95.744-142.336T337.92 98.816 512 63.488zM247.808 274.432q13.312 43.008 28.672 78.848 13.312 30.72 29.696 59.904t33.792 37.376q17.408 9.216 36.864 1.536t35.84-20.992q18.432-15.36 37.888-38.912zm501.76 537.6q8.192-3.072 12.8-8.192t6.144-11.264 1.536-11.776-1.024-7.68q-2.048-8.192-5.12-11.264-12.288-28.672-35.84-51.712t-56.32-39.936-73.728-26.112-88.064-9.216-89.6 10.24-76.288 28.672-57.856 43.008-33.28 53.248q-1.024 1.024-1.024 3.072-2.048 6.144 1.024 20.48t18.432 18.432q23.552-29.696 57.344-53.248 29.696-20.48 73.728-36.864t105.472-16.384 107.008 16.384 75.264 36.864q34.816 23.552 59.392 53.248zM680.96 450.56q17.408-8.192 33.792-37.376t29.696-59.904q15.36-35.84 28.672-78.848l-202.752 117.76q19.456 23.552 37.888 38.912 16.384 13.312 35.84 20.992t36.864-1.536z"/></svg>'
|
||||
},
|
||||
/* --------------------------- 短代码开始 --------------------------- */
|
||||
{
|
||||
type: 'task-no',
|
||||
title: '任务 - 未完成',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M831.55 128.531c38.35 0 63.911 25.568 63.911 63.91v639.104c0 38.355-25.561 63.916-63.91 63.916H192.44c-38.34 0-63.908-25.56-63.908-63.916V192.442c0-38.343 25.567-63.91 63.908-63.91h639.11m0-63.91H192.44c-70.3 0-127.816 57.518-127.816 127.82v639.103c0 70.308 57.515 127.833 127.816 127.833h639.11c70.294 0 127.822-57.525 127.822-127.833V192.442c0-70.302-57.527-127.82-127.823-127.82zm0 0"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'task-yes',
|
||||
title: '任务 - 已完成',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M831.551 64.623h-639.11c-70.3 0-127.816 57.517-127.816 127.819v639.103c0 70.308 57.515 127.833 127.816 127.833h639.11c70.294 0 127.822-57.525 127.822-127.833V192.442c0-70.302-57.527-127.82-127.822-127.82zM646.217 486.44c-108.652 159.779-204.52 345.115-204.52 345.115L192.443 550.351l63.916-70.303 153.385 146.994s76.695-127.822 178.95-236.469c102.261-108.652 223.689-198.127 223.689-198.127l19.17 63.916c0-.001-102.255 108.646-185.337 230.078z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'mtitle',
|
||||
title: '居中标题',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M967.1 455.3H672.2c-23.5-66.1-86-113.8-160.2-113.8s-136.7 47.6-160.2 113.8H56.9C25.5 455.3 0 480.7 0 512.2c0 31.4 25.5 56.9 56.9 56.9h294.9c23.5 66.1 86 113.8 160.2 113.8s136.7-47.6 160.2-113.8h294.9c31.4 0 56.9-25.5 56.9-56.9 0-31.5-25.5-56.9-56.9-56.9zM512 569.1c-31.4 0-56.9-25.5-56.9-56.9s25.5-56.9 56.9-56.9 56.9 25.5 56.9 56.9c0 31.3-25.5 56.9-56.9 56.9z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'dplayer',
|
||||
title: 'M3U8/MP4视频',
|
||||
innerHTML: '<svg viewBox="0 0 1170 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M508.197 298.642c-39.278-20.919-69.34-5.12-69.34 35.109v211.822c0 40.301 29.989 56.027 69.12 34.889L698.88 477.257c38.985-21.065 39.57-55.442.293-76.361L508.197 298.642z"/><path d="M1060.571 877.714H109.714C49.225 877.714 0 828.562 0 768V109.714C0 49.225 49.225 0 109.714 0h950.857c60.416 0 109.715 49.225 109.715 109.714V768c0 60.562-49.299 109.714-109.715 109.714zM109.714 73.143a36.571 36.571 0 0 0-36.571 36.571V768c0 20.114 16.457 36.571 36.571 36.571h950.857c20.115 0 36.572-16.457 36.572-36.571V109.714a36.571 36.571 0 0 0-36.572-36.571H109.714zM219.43 950.857h731.428V1024H219.43v-73.143z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'bilibili',
|
||||
title: '哔哩哔哩视频',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M1023.488 344.064c-3.072-143.36-128-170.496-128-170.496s-97.28-.512-224.256-1.536l92.16-89.088s14.336-18.432-10.24-38.912-26.624-11.264-34.816-6.144c-7.68 5.632-117.76 113.664-137.216 133.12-50.176 0-102.4-.512-153.088-.512h17.92s-132.096-130.56-140.8-136.192-9.728-14.336-34.816 6.144c-24.576 20.48-10.24 38.912-10.24 38.912l94.208 91.648c-102.4 0-190.464.512-231.424 2.048C-9.728 210.944.512 344.064.512 344.064s1.536 285.696 0 429.568c14.336 144.384 125.44 167.424 125.44 167.424s44.032 1.024 76.8 1.024c3.072 9.216 6.144 54.272 56.32 54.272s56.32-54.272 56.32-54.272 369.152-1.536 399.872-1.536c1.536 15.872 9.216 57.344 59.904 56.32 50.176-1.024 53.76-59.904 53.76-59.904s17.408-1.536 68.608 0C1017.344 914.944 1024 774.656 1024 774.656s-2.048-287.232-.512-430.592zM920.576 800.768c0 22.528-17.92 40.96-39.936 40.96H153.6c-22.016 0-39.936-18.432-39.936-40.96V318.464c0-22.528 17.92-40.96 39.936-40.96h727.04c22.016 0 39.936 18.432 39.936 40.96v482.304z"/><path d="M403.968 414.208l-214.016 40.96 18.432 80.384 211.456-40.96-15.872-80.384zm115.2 212.48c-52.224 112.128-99.328 27.648-99.328 27.648l-34.816 22.528s69.12 94.208 134.656 22.528c77.312 71.68 136.704-23.04 136.704-23.04l-31.744-20.48c0-.512-55.808 79.872-105.472-29.184zM624.64 494.08l211.968 40.96 17.92-80.384-213.504-40.96-16.384 80.384z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'netease-list',
|
||||
title: '网易云列表',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M919.438 376.378c-3.328 17.214-8.767 31.228-16.254 42.043-7.487 10.815-13.822 15.87-19.005 15.166-5.248-.768-9.92-4.48-14.015-11.198-4.095-6.72-7.295-19.07-9.535-36.988-3.711-29.18-13.246-50.682-28.54-64.504-15.295-13.822-38.972-23.741-71.095-29.692-33.596-6.72-63.225-20.35-89.013-40.956-25.725-20.54-47.227-39.802-64.377-57.784-16.382-15.742-29.053-21.31-38.012-16.83s-13.437 12.734-13.437 24.7v48.25l-1.088 493.444v63.93c.768 17.916-2.048 37.946-8.383 60.023-6.335 22.077-18.302 42.81-35.836 62.264s-40.89 36.092-69.943 49.915c-29.117 13.822-65.337 21.884-108.595 24.124-44.027 2.24-83.766-5.631-119.217-23.55-35.452-17.916-62.905-40.569-82.295-67.83-19.39-27.26-28.923-57.21-28.54-89.718.384-32.508 14.335-62.967 41.98-91.38 27.644-28.413 57.464-48.25 89.589-59.45 32.06-11.197 63.03-17.405 92.916-18.492 29.884-1.088 56.505.96 80.054 6.143 23.485 5.247 40.827 10.11 52.025 14.59 0 0 .384-505.026 1.152-615.669 0-21.693 5.631-39.42 16.766-53.306 11.2-13.821 26.11-21.884 44.795-24.124 15.614-2.368 28.477.768 38.524 9.407 10.11 8.574 20.35 20.541 30.78 35.9 10.494 15.293 23.356 32.699 38.65 52.153 15.295 19.454 36.029 38.522 62.137 57.21 22.397 17.212 41.979 29.499 58.809 36.986a4986.732 4986.732 0 0 0 47.034 20.734c14.526 6.335 28.924 14.014 43.13 22.973 14.207 8.96 29.885 23.55 47.035 43.706 17.15 19.454 27.644 39.612 31.356 60.537 3.647 20.99 3.84 40.06.448 57.273z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'netease-single',
|
||||
title: '网易云单首',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M837.766 364.816c-50.828-54.107-111.313-91.2-187.245-98.706-7.324-.728-18.983-5.028-20.404-9.983-6.595-23.064-12.826-46.784-14.283-70.54-1.64-26.6 20.368-44.744 46.748-39.425 16.724 3.389 32.392 12.389 48.277 19.457 10.968 4.883 20.988 12.389 32.32 15.923 27.472 8.49 53.378-7.725 58.589-35.78 4.408-23.684-4.41-42.922-22.154-58.153-28.857-24.776-62.998-37.748-100.054-44.743-70.977-13.409-152.74 38.768-169.648 108.908-8.453 35.088-1.712 68.755 10.457 101.51 6.486 17.527 1.968 24.595-16.032 30.862-118.308 41.32-182.508 155.436-154.49 276.075 16.506 71.123 59.465 121.733 131.862 138.604 74.44 17.344 136.818-7.943 182.62-69.192 37.056-49.516 39.133-105.519 23.976-163.197-7.943-30.242-17.198-60.156-26.672-92.948 5.575 1.094 7.397 1.203 9.037 1.786 125.486 45.436 188.959 183.858 125.232 318.813-63.91 135.325-211.911 183.348-344.362 155.072-166.26-35.526-278.955-210.93-245.286-377.62 23.61-116.924 91.564-198.32 200.253-246.342 8.27-3.68 16.797-7.251 24.266-12.28 15.595-10.53 24.886-25.687 23.064-44.633-1.93-19.93-11.878-37.93-32.136-42.011-16.215-3.28-36.036-3.68-50.72 2.696-166.223 72.107-260.848 197.994-272.869 379.884-18.655 282.566 246.128 504.023 521.296 440.882 171.833-39.424 293.167-182.18 303.986-330.804 7.105-97.248-18.619-182.763-85.625-254.11zm-309.05 234.651c-39.06 3.352-71.233-23.83-77.609-65.548-11.113-72.545 19.894-127.162 85.48-151.94 12.606-4.774 18.18-2.915 21.934 10.858 8.745 32.1 19.493 63.617 28.675 95.609 3.133 10.93 3.972 22.554 5.83 33.885-.219 42.922-25.578 73.82-64.31 77.136z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'abtn',
|
||||
title: '多彩按钮',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M839.68 163.84a163.84 163.84 0 0 1 163.84 163.84v327.68A163.84 163.84 0 0 1 839.68 819.2H184.32A163.84 163.84 0 0 1 20.48 655.36V327.68a163.84 163.84 0 0 1 163.84-163.84h655.36zm0 81.92H184.32a81.92 81.92 0 0 0-81.715 75.776l-.205 6.144v327.68a81.92 81.92 0 0 0 75.776 81.715l6.144.205h655.36a81.92 81.92 0 0 0 81.715-75.776l.205-6.144V327.68a81.92 81.92 0 0 0-75.776-81.715l-6.144-.205z"/><path d="M347.013 483.574c1.639-1.925 3.236-4.014 4.792-6.185 6.759-11.141 10.322-24.371 10.322-39.199 0-20.808-6.799-37.806-20.111-50.463-13.435-12.656-31.785-18.964-54.6-18.964H197.96c-7.619 0-13.64 6.758-13.64 15.032v215.532c0 8.397 6.144 15.073 13.64 15.073h89.702c23.634 0 42.476-5.038 56.443-15.278 17.367-13.23 26.132-33.587 26.132-60.457 0-17.94-4.26-32.89-12.697-44.237a54.682 54.682 0 0 0-10.527-10.854zm-47.39-28.836c-1.557 1.393-6.882 4.506-20.726 4.506h-35.308v-31.417h35.84c13.025 0 18.31 2.785 20.316 4.26.697.573 2.867 2.417 2.867 10.24 0 6.308-1.228 10.65-2.99 12.41zm-56.034 63.693h40.182c14.582 0 20.644 3.195 22.815 5.038 2.826 2.457 4.3 7.373 4.3 14.623 0 7.454-2.498 10.444-6.266 12.861-3.236 1.966-9.462 4.383-21.668 4.383h-39.363V518.43zM586.26 368.64H426.27c-7.577 0-13.639 6.8-13.639 15.073v30.229c0 8.397 6.144 15.032 13.64 15.032h50.299v170.27c0 8.357 6.144 15.033 13.68 15.033H522.2c7.619 0 13.64-6.758 13.64-15.032V429.097h50.34c7.577 0 13.64-6.758 13.64-15.032v-30.27c.081-8.356-6.063-15.155-13.518-15.155zm239.862 0h-32.276c-7.619 0-13.64 6.8-13.64 15.073v108.503l-72.704-117.022a13.19 13.19 0 0 0-11.264-6.554H664.29c-7.618 0-13.64 6.8-13.64 15.073v215.532c0 8.356 6.145 15.032 13.64 15.032h31.95c7.618 0 13.639-6.758 13.639-15.032v-110.47l73.728 119.071c2.54 4.137 6.8 6.554 11.264 6.554H826c7.618 0 13.68-6.8 13.68-15.073V383.795c.082-8.356-6.062-15.155-13.517-15.155z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'anote',
|
||||
title: '便条按钮',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M856.73 796.7h-690c-57.9 0-105-47.1-105-105v-360c0-57.9 47.1-105 105-105h690c57.9 0 105 47.1 105 105v360c0 57.89-47.1 105-105 105zm-690-500.01c-19.3 0-35 15.7-35 35v360c0 19.3 15.7 35 35 35h690c19.3 0 35-15.7 35-35v-360c0-19.3-15.7-35-35-35h-690z"/><path d="M233.16 431.69H790.3v160H233.16z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'dotted',
|
||||
title: '彩色虚线',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M111.09 562.26a42.6 42.6 0 1 1 0-85.19h127.78a42.6 42.6 0 0 1 0 85.19zm340.75-3a42.59 42.59 0 1 1 0-85.18h127.78a42.59 42.59 0 1 1 0 85.18zm340.75 0a42.59 42.59 0 0 1 0-85.18h127.79a42.59 42.59 0 1 1 0 85.18zm0 0"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'hide',
|
||||
title: '回复可见',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M342.016 640.512a483.328 483.328 0 0 1-126.976-63.488l-104.96 102.4a51.2 51.2 0 0 1-71.168-74.24l102.4-96.256a419.328 419.328 0 0 1-84.48-133.12 51.2 51.2 0 1 1 95.744-34.816 278.016 278.016 0 0 0 15.872 32.256 378.88 378.88 0 0 0 55.808 77.312A381.952 381.952 0 0 0 512 563.2a382.464 382.464 0 0 0 286.208-112.64 378.88 378.88 0 0 0 58.368-77.312 278.016 278.016 0 0 0 13.824-32.256 51.2 51.2 0 1 1 95.744 34.816 419.328 419.328 0 0 1-84.48 133.12l102.4 96.256a51.2 51.2 0 0 1-71.168 73.216L807.936 576a460.8 460.8 0 0 1-125.952 62.976l58.368 102.4a51.2 51.2 0 0 1-88.576 51.2l-74.752-130.048A521.728 521.728 0 0 1 512 665.6q-32.256 0-62.976-3.072l-76.8 129.536a51.2 51.2 0 0 1-88.576-51.2z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'card-default',
|
||||
title: '默认卡片',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M928 160H96a32 32 0 0 0-32 32v672a32 32 0 0 0 32 32h832a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32zm-32 672H128V224h768v608zM230.592 448.096H544a32 32 0 1 0 0-64H230.592a32 32 0 0 0 0 64zm0 192H544a32 32 0 1 0 0-64H230.592a32 32 0 1 0 0 64zM768 704a32 32 0 0 0 32-32V350.016a32 32 0 1 0-64 0V672a32 32 0 0 0 32 32z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'message',
|
||||
title: '消息提示',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M195.181 164.694c-13.024-13.029-34.144-13.029-47.159 0-13.029 13.019-13.029 34.134 0 47.163l47.159 47.158c13.024 13.024 34.129 13.024 47.162 0 13.019-13.019 13.019-34.129 0-47.158l-47.162-47.163zm633.634 0l-47.162 47.163c-13.02 13.029-13.02 34.139 0 47.158 13.009 13.024 34.129 13.024 47.162 0l47.148-47.158c13.029-13.029 13.029-34.139 0-47.163-13.019-13.024-34.124-13.024-47.148 0zM111.809 428.626H45.115c-18.416 0-33.352 14.928-33.352 33.342 0 18.419 14.933 33.351 33.352 33.351h66.698c18.415 0 33.347-14.931 33.347-33.351 0-18.415-14.933-33.342-33.347-33.342h-.004zm867.072 0h-66.698c-18.416 0-33.352 14.928-33.352 33.342 0 18.419 14.933 33.351 33.352 33.351h66.693c18.419 0 33.361-14.931 33.361-33.351 0-18.415-14.941-33.342-33.361-33.342h.005zM478.648 45.108v66.698c0 18.42 14.928 33.347 33.347 33.347 18.41 0 33.351-14.928 33.351-33.347V45.108c0-18.415-14.941-33.347-33.351-33.347-18.419 0-33.347 14.933-33.347 33.347zM278.557 511.993c0-128.923 104.506-233.438 233.438-233.438 128.927 0 233.442 104.516 233.442 233.438 0 128.926-104.515 233.447-233.442 233.447-128.932 0-233.438-104.52-233.438-233.447zm-66.698 0c0 165.78 134.365 300.155 300.137 300.155 165.766 0 300.141-134.375 300.141-300.155 0-165.767-134.376-300.137-300.141-300.137-165.767.001-300.137 134.371-300.137 300.137zm233.437 466.895c0 18.405 14.933 33.351 33.352 33.351h66.698c18.419 0 33.347-14.946 33.347-33.351 0-18.429-14.928-33.347-33.347-33.347h-66.698c-18.419 0-33.352 14.918-33.352 33.347zm-66.693-100.045c0 18.405 14.933 33.346 33.342 33.346h200.096c18.419 0 33.351-14.941 33.351-33.346 0-18.434-14.931-33.357-33.351-33.357H411.945c-18.414 0-33.342 14.923-33.342 33.357zm0 0"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'progress',
|
||||
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: 'mp3',
|
||||
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: 'card-list',
|
||||
title: '卡片列表',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M359.79 156.52L189.31 330.2a68.454 68.454 0 0 0-19.6 47.95v444.68c0 37.8 30.65 68.45 68.46 68.45h547.66c37.81 0 68.46-30.65 68.46-68.45V200.77c0-37.8-30.65-68.45-68.46-68.45h-.67l-377.19 3.7a68.458 68.458 0 0 0-48.18 20.5zm-48.86-47.95a136.921 136.921 0 0 1 96.37-41l377.19-3.7c.67-.01.67-.01 1.34-.01 75.62 0 136.92 61.29 136.92 136.9v622.06c0 75.61-61.3 136.9-136.92 136.9H238.17c-75.62 0-136.92-61.29-136.92-136.9V378.15c0-35.86 14.08-70.3 39.2-95.89l170.48-173.69z"/><path d="M683.04 353.45v34.12c0 9.42-7.66 17.06-17.1 17.06H358.07c-9.45 0-17.1-7.64-17.1-17.06v-34.12c0-9.42 7.66-17.06 17.1-17.06h307.86c9.45 0 17.11 7.64 17.11 17.06zm0 171.47v34.12c0 9.42-7.66 17.06-17.1 17.06H358.07c-9.45 0-17.1-7.64-17.1-17.06v-34.12c0-9.42 7.66-17.06 17.1-17.06h307.86c9.45 0 17.11 7.64 17.11 17.06zM545.68 695.96v34.12c0 9.42-7.64 17.06-17.06 17.06h-170.6c-9.42 0-17.06-7.64-17.06-17.06v-34.12c0-9.42 7.64-17.06 17.06-17.06h170.6c9.42 0 17.06 7.63 17.06 17.06z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'timeline',
|
||||
title: '时间轴',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M365.714 329.143c0-47.543-29.257-87.772-73.143-102.4V36.57C292.571 14.63 277.943 0 256 0s-36.571 14.629-36.571 36.571v190.172c-43.886 14.628-73.143 54.857-73.143 102.4 0 47.543 29.257 87.771 73.143 102.4V588.8c-43.886 14.629-73.143 54.857-73.143 102.4 0 47.543 29.257 87.771 73.143 102.4v193.829c0 21.942 14.628 36.571 36.571 36.571s36.571-14.629 36.571-36.571V797.257c43.886-14.628 73.143-54.857 73.143-102.4 0-47.543-29.257-87.771-73.143-102.4V435.2c43.886-18.286 73.143-58.514 73.143-106.057zM256 731.429c-21.943 0-36.571-14.629-36.571-36.572s14.628-36.571 36.571-36.571 36.571 14.628 36.571 36.571S277.943 731.43 256 731.43zm0-365.715c-21.943 0-36.571-14.628-36.571-36.571S234.057 292.57 256 292.57s36.571 14.629 36.571 36.572-14.628 36.571-36.571 36.571zM768 731.43H475.429c-18.286 0-36.572 14.628-36.572 36.571s14.629 36.571 36.572 36.571H768c18.286 0 36.571-14.628 36.571-36.571S789.943 731.429 768 731.429zm73.143-512H475.429c-18.286 0-36.572 14.628-36.572 36.571s14.629 36.571 36.572 36.571h365.714c18.286 0 36.571-14.628 36.571-36.571s-14.628-36.571-36.571-36.571zM768 438.857c18.286 0 36.571-14.628 36.571-36.571S789.943 365.714 768 365.714H475.429c-18.286 0-36.572 14.629-36.572 36.572s14.629 36.571 36.572 36.571H768zm73.143 146.286H475.429c-18.286 0-36.572 14.628-36.572 36.571s14.629 36.572 36.572 36.572h365.714c18.286 0 36.571-14.629 36.571-36.572s-14.628-36.571-36.571-36.571z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'copy',
|
||||
title: '复制文本',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M731.682 676.057V183.323c0-30.233-24.512-54.746-54.748-54.746H184.216c-30.233 0-54.747 24.513-54.747 54.746v492.734c0 30.208 24.514 54.747 54.747 54.747h492.718c30.235 0 54.748-24.539 54.748-54.747zm-109.493 0H238.963c-30.234 0-54.747-24.538-54.747-54.745V238.07c0-30.233 24.513-54.747 54.747-54.747h383.226c30.234 0 54.745 24.513 54.745 54.747v383.243c0 30.206-24.512 54.744-54.745 54.744zm218.986-383.24h-54.746v54.747c30.232 0 54.746 24.513 54.746 54.76V785.55c0 30.207-24.514 54.746-54.746 54.746H403.202c-30.234 0-54.747-24.539-54.747-54.746h-54.747v54.746c0 30.208 24.513 54.748 54.747 54.748h492.72c30.234 0 54.747-24.54 54.747-54.748V347.564c0-30.235-24.514-54.747-54.747-54.747z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'card-describe',
|
||||
title: '描述卡片',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M202.667 149.333c-52.651 0-96 43.35-96 96v533.334c0 52.65 43.349 96 96 96h618.666c52.651 0 96-43.35 96-96V245.333c0-52.65-43.349-96-96-96h-448a32 32 0 0 0-5.504.427c-2.816-.213-5.653-.427-8.49-.427H202.667zm0 64h156.672a53.32 53.32 0 0 1 37.696 15.616l102.997 103.019a32 32 0 0 0 22.635 9.365h298.666c18.048 0 32 13.952 32 32v405.334c0 18.048-13.952 32-32 32H202.667c-18.048 0-32-13.952-32-32V245.333c0-18.048 13.952-32 32-32zm269.248 0h349.418c18.048 0 32 13.952 32 32v37.974a94.016 94.016 0 0 0-32-5.974H535.915l-64-64z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'lamp',
|
||||
title: '跑马灯',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M848 432a80.064 80.064 0 0 0-73.216 48H217.216A80.096 80.096 0 0 0 144 432a80.096 80.096 0 0 0-80 80c0 44.128 35.904 80 80 80a80 80 0 0 0 73.216-48h557.536a80 80 0 0 0 73.216 48c44.128 0 80-35.872 80-80A80.032 80.032 0 0 0 848 432z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'collapse',
|
||||
title: '折叠面板',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M944 128H80c-8.8 0-16 7.2-16 16v736c0 8.8 7.2 16 16 16h864c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16zm-48 64v216H128V192h768zM128 832V472h768v360H128z"/><path d="M706 340.8c6.4 7.6 18 7.6 24.4 0l58.8-69.2c8.8-10.4 1.6-26.4-12-26.4H659.6c-13.6 0-21.2 16-12 26.4l58.4 69.2z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'cloud',
|
||||
title: '云盘下载',
|
||||
innerHTML: '<svg viewBox="0 0 1462 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M1435.063 668.453a348.891 348.891 0 0 1-102.766 248.246 348.891 348.891 0 0 1-247.003 102.84H377.71a348.891 348.891 0 0 1-247.004-102.84A348.891 348.891 0 0 1 27.941 668.526c0-93.843 36.498-181.98 102.765-248.32a348.672 348.672 0 0 1 210.36-100.937c17.553-69.486 53.54-133.12 105.544-185.125a399.067 399.067 0 0 1 284.16-117.76c130.853 0 253.806 63.927 329.143 171.154a50.25 50.25 0 0 1-82.286 57.71 302.007 302.007 0 0 0-246.71-128.293 302.08 302.08 0 0 0-286.062 206.483c-5.12 15.36-8.997 40.52-11.63 61.805a37.376 37.376 0 0 1-39.058 32.915 257.902 257.902 0 0 0-65.024 4.535 251.1 251.1 0 0 0-200.631 249.782c2.194 135.607 117.467 246.492 253.074 246.492h699.831c136.631 0 249.93-108.252 252.928-244.736a250.88 250.88 0 0 0-250.514-256.512 250.807 250.807 0 0 0-250.514 249.929 51.931 51.931 0 0 1-45.861 50.688 50.322 50.322 0 0 1-54.71-50.03c0-93.842 36.497-182.052 102.765-248.32a348.891 348.891 0 0 1 248.32-102.839c93.842 0 181.98 36.572 248.32 102.84a349.623 349.623 0 0 1 102.912 248.539z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'gird',
|
||||
title: '宫格',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M156.16 896.512h711.168c15.872 0 28.672-12.8 28.672-28.672V156.16c0-15.872-12.8-28.672-28.672-28.672H156.16c-15.872 0-28.672 12.8-28.672 28.672v711.168c0 16.384 12.8 29.184 28.672 29.184zm35.328-352.256h288.768v288.256H191.488V544.256zm352.768 288.256V544.256h288.768v288.256H544.256zm288.768-352.768H544.256V191.488h288.768v288.256zm-353.28-288.256v288.256H191.488V191.488h288.256z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'alert',
|
||||
title: '提示',
|
||||
innerHTML: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M193.024 795.99c0 17.692 14.222 32.028 31.972 32.028h574.008a31.972 31.972 0 0 0 31.972-32.029V562.972a318.976 318.976 0 1 0-637.952 0V795.99zm71.964-233.018a247.012 247.012 0 0 1 494.024 0v193.024H404.025V584.988a10.012 10.012 0 0 0-10.013-10.012H349.98a10.012 10.012 0 0 0-9.955 10.012v171.008h-75.037V562.972zM216.918 310.5l39.594-39.595a8.021 8.021 0 0 0 0-11.321l-67.925-67.868a8.021 8.021 0 0 0-11.264 0l-39.595 39.594a8.021 8.021 0 0 0 0 11.264l67.868 67.926a8.021 8.021 0 0 0 11.321 0zM886.5 231.31l-39.595-39.594a8.021 8.021 0 0 0-11.321 0l-67.868 67.868a8.021 8.021 0 0 0 0 11.32L807.31 310.5a8.021 8.021 0 0 0 11.264 0l67.926-67.926a8.021 8.021 0 0 0 0-11.264zM832 892.018H192a31.972 31.972 0 0 0-32.028 31.971v24.007c0 4.38 3.64 7.965 8.02 7.965h688.015c4.38 0 7.965-3.584 7.965-7.965V923.99A31.972 31.972 0 0 0 832 892.018zM484.01 179.996h55.98a7.951 7.951 0 0 0 7.964-7.964V75.947a8.021 8.021 0 0 0-7.965-7.965h-55.978a8.021 8.021 0 0 0-7.965 7.965v95.971c0 4.438 3.527 8.022 7.965 8.022z"/></svg>'
|
||||
},
|
||||
/* --------------------------- 短代码结束 --------------------------- */
|
||||
{
|
||||
type: 'clean',
|
||||
title: '清屏',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M479.3 863.6L899.9 443c37.4-37.4 37.4-98.3 0-135.8L716.7 124.1C698.5 106 674.4 96 648.7 96c-25.8 0-50.4 10.8-68.6 29l-455 455c-18.2 18.2-29 42.8-29 68.6 0 25.7 9.9 49.9 28.1 68l183.1 183.2c18.1 18.1 42.2 28.1 67.9 28.1 3 0 5.9-.1 8.8-.4v.1h512c17.7 0 32-14.3 32-32s-14.3-32-32-32H479.3zm-126.8-9L169.4 671.5c-6-6-9.4-14.1-9.4-22.6 0-8.5 3.3-16.6 9.4-22.6l104.9-104.9 228.4 228.4-104.9 104.8c-6 6-14.1 9.4-22.6 9.4-8.6 0-16.6-3.3-22.7-9.4z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'download',
|
||||
title: '下载',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M64.3 874.8v62.6c0 4.8 3.9 8.7 8.7 8.7h878c4.8 0 8.7-3.9 8.7-8.7v-62.6c0-4.8-3.9-8.7-8.7-8.7H73c-4.8 0-8.7 3.9-8.7 8.7zm418.9-99.9c3.2 2.9 6.8 5.3 10.9 7.1 5.2 2.3 10.7 3.4 16.1 3.4 9.8 0 19.5-3.6 27-10.5l291.4-270.4c3.5-3.2 3.7-8.7.5-12.2l-42.3-46.2c-3.3-3.6-8.8-3.8-12.3-.5L550.2 654.5v-528c0-4.8-3.9-8.7-8.7-8.7h-62.6c-4.8 0-8.7 3.9-8.7 8.7v527.9L239.6 442.9c-3.5-3.2-9-3-12.3.5L185 489.7c-3.2 3.5-3 9 .5 12.3l297.7 272.9z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'fullScreen',
|
||||
title: '全屏/取消全屏',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M181.2 803.4V637H98v208c0 45.9 37.2 83.2 83.2 83.2h208V845H222.8c-23 0-41.6-18.6-41.6-41.6zM844.8 98.6h-208v83.2h166.4c23 0 41.6 18.6 41.6 41.6v166.4H928v-208c0-46-37.3-83.2-83.2-83.2zm-746.6 83v208h83.2V223.2c0-23 18.6-41.6 41.6-41.6h166.4V98.4h-208c-46 0-83.2 37.3-83.2 83.2zm746.4 455.6v166.4c0 23-18.6 41.6-41.6 41.6H636.6v83.2h208c45.9 0 83.2-37.2 83.2-83.2v-208h-83.2z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'preview',
|
||||
title: '预览/取消预览',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M832 128c70.692 0 128 57.308 128 128v512c0 70.692-57.308 128-128 128H192c-70.692 0-128-57.308-128-128V256c0-70.692 57.308-128 128-128h640zm0 72H192c-30.619 0-55.498 24.573-56 55.074V768c0 30.619 24.573 55.498 55.074 55.992L192 824h640c30.619 0 55.498-24.573 56-55.074V256c0-30.619-24.573-55.498-55.074-55.992L832 200zM693.031 450.127l.425.417 128 128c13.918 13.918 14.057 36.398.417 50.487l-.417.425-128 128c-14.059 14.059-36.853 14.059-50.912 0-13.918-13.918-14.057-36.398-.417-50.487l.417-.425L745.09 604 642.544 501.456c-13.918-13.918-14.057-36.398-.417-50.487l.417-.425c13.918-13.918 36.398-14.057 50.487-.417zM284 312c19.882 0 36 16.118 36 36s-16.118 36-36 36h-56c-19.882 0-36-16.118-36-36s16.118-36 36-36h56zm512 0c19.882 0 36 16.118 36 36s-16.118 36-36 36H420c-19.882 0-36-16.118-36-36s16.118-36 36-36h376z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'draft',
|
||||
title: '保存草稿',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M96 960a32 32 0 1 1 0-64h832a32 32 0 1 1 0 64H96zm632.96-625.152L593.088 199.104l-340.48 340.48L240 690.432l148.032-14.784 340.8-340.8zm45.184-45.248l45.248-45.248-135.744-135.744-45.248 45.248L774.144 289.6zm-45.12-226.176l135.808 135.808c31.232 31.232 24.832 65.408-.192 90.368L412.16 742.144l-247.168 24.448 20.864-250.688L638.336 63.36c25.024-24.96 59.456-31.168 90.688.064z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'publish',
|
||||
title: '发布文章',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M128 554.667h768a42.667 42.667 0 0 0 0-85.334H128a42.667 42.667 0 0 0 0 85.334z"/><path d="M469.333 128v768a42.667 42.667 0 0 0 85.334 0V128a42.667 42.667 0 0 0-85.334 0z"/></svg>'
|
||||
},
|
||||
{
|
||||
type: 'about',
|
||||
title: '关于',
|
||||
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M881.6 512.1c0 203.7-165.7 369.5-369.5 369.5S142.6 715.8 142.6 512.1s165.7-369.5 369.5-369.5 369.5 165.8 369.5 369.5m77.7 0c0-246.6-200.6-447.2-447.2-447.2S64.9 265.5 64.9 512.1s200.6 447.2 447.2 447.2 447.2-200.6 447.2-447.2M582.5 318.2c9-9 14.2-21.6 14.2-34.3 0-12.8-5.2-25.4-14.2-34.4s-21.6-14.2-34.4-14.2c-12.7 0-25.3 5.2-34.3 14.2-9.1 9-14.3 21.6-14.3 34.4 0 12.7 5.2 25.3 14.3 34.3 9 9 21.5 14.3 34.3 14.3s25.3-5.3 34.4-14.3m-96.6 464.3c-7.6 0-15.2-2.6-21.3-7.5-9.9-7.9-14.5-20.7-12.1-33.1l47.9-243.1-26.4 14.8c-16.4 9.2-37.1 3.4-46.3-13-9.2-16.4-3.4-37.1 12.9-46.3l90.7-51.1c11.6-6.5 25.9-5.7 36.6 2.1 10.8 7.8 16 21.1 13.4 34.1l-49.6 251.9 40.7-17.7c17.2-7.5 37.3.4 44.8 17.6 7.5 17.2-.4 37.3-17.6 44.8l-100.2 43.7c-4.3 1.9-8.9 2.8-13.5 2.8"/></svg>'
|
||||
}
|
||||
];
|
||||
436
assets/typecho/write/js/index.js
Executable file
436
assets/typecho/write/js/index.js
Executable file
@@ -0,0 +1,436 @@
|
||||
import { EditorView, keymap, drawSelection, highlightActiveLine } from '@codemirror/view';
|
||||
import { EditorState } from '@codemirror/state';
|
||||
import { bracketMatching } from '@codemirror/matchbrackets';
|
||||
import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets';
|
||||
import { defaultKeymap, indentLess, indentMore } from '@codemirror/commands';
|
||||
import { history, historyKeymap } from '@codemirror/history';
|
||||
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||
import { languages } from '@codemirror/language-data';
|
||||
import { lineNumbers, highlightActiveLineGutter } from "@codemirror/gutter";
|
||||
import { highlightSelectionMatches } from "@codemirror/search";
|
||||
import { commentKeymap } from "@codemirror/comment";
|
||||
import { classHighlightStyle } from '@codemirror/highlight';
|
||||
import tools from './_tools';
|
||||
import JoeAction from './_actions';
|
||||
import createPreviewHtml from './_create';
|
||||
|
||||
class Joe extends JoeAction {
|
||||
constructor() {
|
||||
super();
|
||||
this.plugins = [classHighlightStyle, history(), bracketMatching(), closeBrackets(), drawSelection(), highlightActiveLine(), lineNumbers(), highlightActiveLineGutter(), highlightSelectionMatches()];
|
||||
this.keymaps = [
|
||||
{
|
||||
key: 'Tab',
|
||||
run: ({ state, dispatch }) => {
|
||||
if (state.selection.ranges.some(r => !r.empty)) return indentMore({ state, dispatch });
|
||||
dispatch(state.update(state.replaceSelection(' ')));
|
||||
return true;
|
||||
},
|
||||
shift: indentLess
|
||||
}
|
||||
];
|
||||
this._isPasting = false;
|
||||
this.init_ViewPort();
|
||||
this.init_Editor();
|
||||
this.init_Preview();
|
||||
this.init_Tools();
|
||||
this.init_Insert();
|
||||
this.init_AutoSave();
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_ViewPort() {
|
||||
if ($('meta[name="viewport"]').length > 0) $('meta[name="viewport"]').attr('content', 'width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover');
|
||||
else $('head').append('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover">');
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_Editor() {
|
||||
$('#text').before(`
|
||||
<div class="cm-container">
|
||||
<div class="cm-tools"></div>
|
||||
<div class="cm-mainer">
|
||||
<div class="cm-resize"></div>
|
||||
<div class="cm-preview"><div class="cm-preview-content"></div></div>
|
||||
<div class="cm-autosave"></div>
|
||||
</div>
|
||||
<div class="cm-progress-left"></div>
|
||||
<div class="cm-progress-right"></div>
|
||||
</div>
|
||||
`);
|
||||
createPreviewHtml(null);
|
||||
let _temp = null;
|
||||
let _debounce = null;
|
||||
const cm = new EditorView({
|
||||
state: EditorState.create({
|
||||
doc: $('#text').val(),
|
||||
extensions: [
|
||||
...this.plugins,
|
||||
markdown({
|
||||
base: markdownLanguage,
|
||||
codeLanguages: languages
|
||||
}),
|
||||
keymap.of([...this.keymaps, ...defaultKeymap, ...commentKeymap, ...historyKeymap, ...closeBracketsKeymap,]),
|
||||
EditorView.updateListener.of(update => {
|
||||
if (!update.docChanged) return;
|
||||
if (_temp !== update.state.doc.toString()) {
|
||||
_temp = update.state.doc.toString();
|
||||
clearTimeout(_debounce);
|
||||
_debounce = setTimeout(createPreviewHtml.bind(null, update.state.doc.toString()), 350);
|
||||
}
|
||||
}),
|
||||
EditorView.domEventHandlers({
|
||||
paste: e => {
|
||||
const clipboardData = e.clipboardData;
|
||||
if (!clipboardData || !clipboardData.items) return;
|
||||
const items = clipboardData.items;
|
||||
if (!items.length) return;
|
||||
let blob = null;
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (items[i].type.indexOf('image') !== -1) {
|
||||
e.preventDefault();
|
||||
blob = items[i].getAsFile();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!blob) return;
|
||||
let api = window.JoeConfig.uploadAPI;
|
||||
if (!api) return;
|
||||
const cid = $('input[name="cid"]').val();
|
||||
cid && (api = api + '&cid=' + cid);
|
||||
if (this._isPasting) return;
|
||||
this._isPasting = true;
|
||||
const fileName = Date.now().toString(36) + '.png';
|
||||
let formData = new FormData();
|
||||
formData.append('name', fileName);
|
||||
formData.append('file', blob, fileName);
|
||||
$.ajax({
|
||||
url: api,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
xhr: () => {
|
||||
const xhr = $.ajaxSettings.xhr();
|
||||
if (!xhr.upload) return;
|
||||
xhr.upload.addEventListener(
|
||||
'progress',
|
||||
e => {
|
||||
let percent = (e.loaded / e.total) * 100;
|
||||
$('.cm-progress-left').width(percent / 2 + '%');
|
||||
$('.cm-progress-right').width(percent / 2 + '%');
|
||||
},
|
||||
false
|
||||
);
|
||||
return xhr;
|
||||
},
|
||||
success: res => {
|
||||
$('.cm-progress-left').width(0);
|
||||
$('.cm-progress-right').width(0);
|
||||
this._isPasting = false;
|
||||
const str = `${super._getLineCh(cm) ? '\n' : ''}![${res[1].title}](${res[0]})\n`;
|
||||
super._replaceSelection(cm, str);
|
||||
cm.focus();
|
||||
},
|
||||
error: () => {
|
||||
$('.cm-progress-left').width(0);
|
||||
$('.cm-progress-right').width(0);
|
||||
this._isPasting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
scroll: e => {
|
||||
if (!window.JoeConfig.canPreview) return;
|
||||
if (e && e.target && e.target.className === 'cm-scroller') {
|
||||
if (window.requestAnimationFrame) window.requestAnimationFrame(() => super._updateScroller(e.target, document.querySelector('.cm-preview')));
|
||||
else super._updateScroller(e.target, document.querySelector('.cm-preview'));
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
$('.cm-mainer').prepend(cm.dom);
|
||||
$('#text')[0].form && $('#text')[0].form.addEventListener('submit', () => $('#text').val(cm.state.doc.toString()));
|
||||
this.cm = cm;
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_Preview() {
|
||||
const move = (nowClientX, nowWidth, clientX) => {
|
||||
let moveX = nowClientX - clientX;
|
||||
let moveWidth = nowWidth + moveX;
|
||||
if (moveWidth <= 0) moveWidth = 0;
|
||||
if (moveWidth >= $('.cm-mainer').outerWidth() - 16) moveWidth = $('.cm-mainer').outerWidth() - 16;
|
||||
$('.cm-preview').width(moveWidth);
|
||||
};
|
||||
$('.cm-resize').on({
|
||||
mousedown: e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const nowWidth = $('.cm-preview').outerWidth();
|
||||
const nowClientX = e.clientX;
|
||||
$('.cm-preview').addClass('move');
|
||||
document.onmousemove = _e => {
|
||||
if (window.requestAnimationFrame) requestAnimationFrame(() => move(nowClientX, nowWidth, _e.clientX));
|
||||
else move(nowClientX, nowWidth, _e.clientX);
|
||||
};
|
||||
document.onmouseup = () => {
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
$('.cm-preview').removeClass('move');
|
||||
};
|
||||
return false;
|
||||
},
|
||||
touchstart: e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const nowWidth = $('.cm-preview').outerWidth();
|
||||
const nowClientX = e.originalEvent.targetTouches[0].clientX;
|
||||
$('.cm-preview').addClass('move');
|
||||
document.ontouchmove = _e => {
|
||||
if (window.requestAnimationFrame) requestAnimationFrame(() => move(nowClientX, nowWidth, _e.targetTouches[0].clientX));
|
||||
else move(nowClientX, nowWidth, _e.targetTouches[0].clientX);
|
||||
};
|
||||
document.ontouchend = () => {
|
||||
document.ontouchmove = null;
|
||||
document.ontouchend = null;
|
||||
$('.cm-preview').removeClass('move');
|
||||
};
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_Tools() {
|
||||
tools.forEach(item => {
|
||||
if (item.type === 'title') {
|
||||
super.handleTitle(this.cm, item);
|
||||
} else {
|
||||
const el = $(`<div class="cm-tools-item" title="${item.title}">${item.innerHTML}</div>`);
|
||||
el.on('click', e => {
|
||||
e.preventDefault();
|
||||
switch (item.type) {
|
||||
case 'fullScreen':
|
||||
super.handleFullScreen(el);
|
||||
break;
|
||||
case 'publish':
|
||||
super.handlePublish();
|
||||
break;
|
||||
case 'undo':
|
||||
super.handleUndo(this.cm);
|
||||
break;
|
||||
case 'redo':
|
||||
super.handleRedo(this.cm);
|
||||
break;
|
||||
case 'time':
|
||||
super.handleTime(this.cm);
|
||||
break;
|
||||
case 'bold':
|
||||
super._insetAmboText(this.cm, '**');
|
||||
break;
|
||||
case 'italic':
|
||||
super._insetAmboText(this.cm, '*');
|
||||
break;
|
||||
case 'delete':
|
||||
super._insetAmboText(this.cm, '~~');
|
||||
break;
|
||||
case 'code-inline':
|
||||
super._insetAmboText(this.cm, '`');
|
||||
break;
|
||||
case 'indent':
|
||||
super.handleIndent(this.cm);
|
||||
break;
|
||||
case 'hr':
|
||||
super.handleHr(this.cm);
|
||||
break;
|
||||
case 'clean':
|
||||
super.handleClean(this.cm);
|
||||
break;
|
||||
case 'ordered-list':
|
||||
super.handleOrdered(this.cm);
|
||||
break;
|
||||
case 'unordered-list':
|
||||
super.handleUnordered(this.cm);
|
||||
break;
|
||||
case 'quote':
|
||||
super.handleQuote(this.cm);
|
||||
break;
|
||||
case 'download':
|
||||
super.handleDownload(this.cm);
|
||||
break;
|
||||
case 'link':
|
||||
super.handleLink(this.cm);
|
||||
break;
|
||||
case 'image':
|
||||
super.handleImage(this.cm);
|
||||
break;
|
||||
case 'table':
|
||||
super.handleTable(this.cm);
|
||||
break;
|
||||
case 'code-block':
|
||||
super.handleCodeBlock(this.cm);
|
||||
break;
|
||||
case 'about':
|
||||
super.handleAbout();
|
||||
break;
|
||||
case 'character':
|
||||
super._createTableLists(this.cm, JoeConfig.characterAPI, '星星符号', '字符大全');
|
||||
break;
|
||||
case 'emoji':
|
||||
super._createTableLists(this.cm, JoeConfig.emojiAPI, '表情', '符号表情(需数据库支持)');
|
||||
break;
|
||||
case 'task-no':
|
||||
super.handleTask(this.cm, false);
|
||||
break;
|
||||
case 'task-yes':
|
||||
super.handleTask(this.cm, true);
|
||||
break;
|
||||
case 'netease-list':
|
||||
super.handleNetease(this.cm, true);
|
||||
break;
|
||||
case 'netease-single':
|
||||
super.handleNetease(this.cm, false);
|
||||
break;
|
||||
case 'bilibili':
|
||||
super.handleBilibili(this.cm);
|
||||
break;
|
||||
case 'dplayer':
|
||||
super.handleDplayer(this.cm);
|
||||
break;
|
||||
case 'draft':
|
||||
super.handleDraft();
|
||||
break;
|
||||
case 'expression':
|
||||
super.handleExpression(this.cm);
|
||||
break;
|
||||
case 'mtitle':
|
||||
super.handleMtitle(this.cm);
|
||||
break;
|
||||
case 'html':
|
||||
super.handleHtml(this.cm);
|
||||
break;
|
||||
case 'abtn':
|
||||
super.handleAbtn(this.cm);
|
||||
break;
|
||||
case 'anote':
|
||||
super.handleAnote(this.cm);
|
||||
break;
|
||||
case 'dotted':
|
||||
super.handleDotted(this.cm);
|
||||
break;
|
||||
case 'hide':
|
||||
super.handleHide(this.cm);
|
||||
break;
|
||||
case 'card-default':
|
||||
super.handleCardDefault(this.cm);
|
||||
break;
|
||||
case 'message':
|
||||
super.handleMessage(this.cm);
|
||||
break;
|
||||
case 'progress':
|
||||
super.handleProgress(this.cm);
|
||||
break;
|
||||
case 'callout':
|
||||
super.handleCallout(this.cm);
|
||||
break;
|
||||
case 'mp3':
|
||||
super.handleMp3(this.cm);
|
||||
break;
|
||||
case 'tabs':
|
||||
super.handleTabs(this.cm);
|
||||
break;
|
||||
case 'card-list':
|
||||
super.handleCardList(this.cm);
|
||||
break;
|
||||
case 'timeline':
|
||||
super.handleTimeline(this.cm);
|
||||
break;
|
||||
case 'copy':
|
||||
super.handleCopy(this.cm);
|
||||
break;
|
||||
case 'card-describe':
|
||||
super.handleCardDescribe(this.cm);
|
||||
break;
|
||||
case 'lamp':
|
||||
super.handleLamp(this.cm);
|
||||
break;
|
||||
case 'collapse':
|
||||
super.handleCollapse(this.cm);
|
||||
break;
|
||||
case 'cloud':
|
||||
super.handleCloud(this.cm);
|
||||
break;
|
||||
case 'gird':
|
||||
super.handleGird(this.cm);
|
||||
break;
|
||||
case 'alert':
|
||||
super.handleAlert(this.cm);
|
||||
break;
|
||||
case 'preview':
|
||||
el.toggleClass('active');
|
||||
if (el.hasClass('active')) window.JoeConfig.canPreview = true;
|
||||
else window.JoeConfig.canPreview = false;
|
||||
createPreviewHtml(this.cm.state.doc.toString());
|
||||
window.JoeConfig.canPreview && super._updateScroller(document.querySelector('.cm-scroller'), document.querySelector('.cm-preview'));
|
||||
break;
|
||||
}
|
||||
});
|
||||
$('.cm-tools').append(el);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_Insert() {
|
||||
Typecho.insertFileToEditor = (file, url, isImage) => {
|
||||
const str = `${super._getLineCh(this.cm) ? '\n' : ''}${isImage ? '!' : ''}[${file}](${url})\n`;
|
||||
super._replaceSelection(this.cm, str);
|
||||
this.cm.focus();
|
||||
};
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
init_AutoSave() {
|
||||
if (window.JoeConfig.autoSave !== 1) return;
|
||||
const formEl = $('#text')[0].form;
|
||||
let cid = $(formEl).find('input[name="cid"]').val();
|
||||
/* 临时记录 */
|
||||
let _TempTimer = null;
|
||||
let _TempTitle = $(formEl).find('input[name="title"]').val();
|
||||
let _TempText = $(formEl).find('textarea[name="text"]').val();
|
||||
const saveFn = () => {
|
||||
$(formEl).find('input[name="cid"]').val(cid);
|
||||
$(formEl).find('textarea[name="text"]').val(this.cm.state.doc.toString());
|
||||
/* 创建新记录 */
|
||||
let _NewTempTitle = $(formEl).find('input[name="title"]').val();
|
||||
let _NewTempText = $(formEl).find('textarea[name="text"]').val();
|
||||
/* 若标题为空,则直接忽略 */
|
||||
if (_NewTempTitle.trim() === '') return;
|
||||
/* 若标题或内容发生改变,触发保存草稿 */
|
||||
if (_TempTitle !== _NewTempTitle || _TempText !== _NewTempText) {
|
||||
_TempTitle = _NewTempTitle;
|
||||
_TempText = _NewTempText;
|
||||
$('.cm-autosave').addClass('active');
|
||||
$.ajax({
|
||||
url: formEl.action,
|
||||
type: 'POST',
|
||||
data: $(formEl).serialize() + '&do=save',
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
cid = res.cid;
|
||||
_TempTimer = setTimeout(() => {
|
||||
$('.cm-autosave').removeClass('active');
|
||||
clearTimeout(_TempTimer);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
setInterval(saveFn, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => new Joe());
|
||||
15
assets/typecho/write/json/character.json
Executable file
15
assets/typecho/write/json/character.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"星星符号": "★ ✰ ☆ ✩ ✫ ✬ ✭ ✮ ✡",
|
||||
"绘表符号": "─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┍ ┎ ┐ ┑ ┒ └ ┕ ┖ ┘ ┙ ┚ ├ ┝ ┞ ┟ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┩ ┪ ┫ ┬ ┭ ┮ ┰ ┱ ┲ ┴ ┵ ┶ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿ ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ║ ╒ ╕ ╖ ╘ ╙ ╛ ╜ ╞ ╟ ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╪ ╫ ╳ ╔ ╗ ╝ ╚ ╬ ═ ╓ ╩ ┠ ┨ ┯ ┷ ┏ ┓ ┗ ┛ ┳ ⊥ ﹃ ﹄ ┌ ╭ ╮ ╯ ╰",
|
||||
"编号&序号": "№ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ㈠ ㈡ ㈢ ㈣ ㈤ ㈥ ㈦ ㈧ ㈨ ㈩ ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂ ⒃ ⒄ ⒅ ⒆ ⒇ ⒈ ⒉ ⒊ ⒋ ⒌ ⒍ ⒎ ⒏ ⒐ ⒑ ⒒ ⒓ ⒔ ⒕ ⒖ ⒗ ⒘ ⒙ ⒚ ⒛ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ",
|
||||
"希腊字母": "Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω α β γ δ ε ζ ν ξ ο π ρ σ η θ ι κ λ μ τ υ φ χ ψ ω",
|
||||
"俄语字符": "А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я",
|
||||
"日语字符": "ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た だ ち ぢ っ つ づ て で と ど な に ぬ ね の は ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み む め も ゃ や ゅ ゆ ょ よ ら り る れ ろ ゎ わ ゐ ゑ を ん",
|
||||
"注音码": "ァ ア ィ イ ゥ ウ ェ エ ォ オ カ ガ キ ギ ク グ ケ ゲ コ ゴ サ ザ シ ジ ス ズ セ ゼ ソ ゾ タ ダ チ ヂ ッ ツ ヅ テ デ ト ド ナ ニ ヌ ネ ノ ハ バ パ ヒ ビ ピ フ ブ プ ヘ ベ ペ ホ ボ ポ マ ミ ム メ モ ャ ヤ ュ ユ ョ ヨ ラ リ ル レ ロ ヮ ワ ヰ ヱ ヲ ン ヴ ヵ ヶ",
|
||||
"中文字符": "夬 丅 乛 丄 丩 乚 夊 亅 亇 厃 丂 零 壹 贰 叁 肆 伍 陆 柒 捌 玖 拾 佰 仟 万 亿 吉 太 拍 艾 分 厘 毫 微 卍 卐 卄 巜 弍 弎 弐 朤 氺 曱 甴 囍 兀 々 〆 の ぁ 〡 〢 〣 〤 〥 〦 〧 〨 〩 ㊊ ㊋ ㊌ ㊍ ㊎ ㊏ ㊛ ㊚ ㊐ ㊑ ㊒ ㊓ ㊔ ㊕ ㊖ ㊗ ㊘ ㊜ ㊝ ㊞ ㊟ ㊠ ㊡ ㊢ ㊣ ㊤ ㊥ ㊦ ㊧ ㊨ ㊩ ㊪ ㊫ ㊬ ㊭ ㊮ ㊯ ㊰",
|
||||
"汉语拼音": "ā á ǎ à ō ó ǒ ò ē é ě è ī í ǐ ì ū ú ǔ ù ǖ ǘ ǚ ǜ ü ㄅ ㄆ ㄇ ㄈ ㄉ ㄊ ㄋ ㄌ ㄍ ㄎ ㄏ ㄐ ㄑ ㄒ ㄓ ㄔ ㄕ ㄖ ㄗ ㄘ ㄙ ㄚ ㄛ ㄜ ㄝ ㄞ ㄟ ㄠ ㄡ ㄢ ㄣ ㄤ ㄥ ㄦ ㄧ ㄨ ㄩ",
|
||||
"单位符号": "㎎ ㎏ ㎜ ㎝ ㎞ ㎡ ㏄ ㏎ ㏑ ㏒ ㏕ ℡ % ‰ ℃ ℉ ° ′ ″ $ £ ¥ ¢ ♂ ♀ ℅",
|
||||
"标点符号": ". 。 , 、 ; : ? ! ˉ ˇ ¨ ~ 々 ‖ ∶ \" ' ` | · … — ~ - 〃 ‘ ’ “ ” 〝 〞 〔 〕 〈 〉 《 》 「 」 『 』 〖 〗 【 】 ( ) [ ] { } ︻ ︼ ﹄ ﹃",
|
||||
"数学符号": "+ - × ÷ ± / ≌ ∽ ≦ ≧ ≒ ﹤ ﹥ ≈ ≡ ≠ = ≤ ≥ < > ≮ ≯ ∷ ∶ ∫ ∮ ∝ ∞ ∧ ∨ ∑ ∏ ∪ ∩ ∈ ∵ ∴ ⊥ ∥ ∠ ⌒ ⊙ √ ∟ ⊿ ㏒ ㏑ % ‰",
|
||||
"箭头符号": "↑ ↓ ← → ↖ ↗ ↙ ↘ ↔ ↕ ➼ ➽ ➸ ➳ ➺ ➻ ➴ ➵ ➶ ➷ ➹ ▶ ➩ ➪ ➫ ➬ ➭ ➮ ➯ ➱ ➲ ➾ ➔ ➘ ➙ ➚ ➛ ➜ ➝ ➞ ➟ ➠ ➡ ➢ ➣ ➤ ➥ ➦ ➧ ➨ ↚ ↛ ↜ ↝ ↞ ↟ ↠ ↡ ↢ ↣ ↤ ↥ ↦ ↧ ↨ ⇄ ⇅ ⇆ ⇇ ⇈ ⇉ ⇊ ⇋ ⇌ ⇍ ⇎ ⇏ ⇐ ⇑ ⇒ ⇓ ⇔ ⇖ ⇗ ⇘ ⇙ ⇜ ↩ ↪ ↫ ↬ ↭ ↮ ↯ ↰ ↱ ↲ ↳ ↴ ↵ ↶ ↷ ↸ ↹ ↺ ↻ ↼ ↽ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇞ ⇟ ⇠ ⇡ ⇢ ⇣ ⇤ ⇥ ⇦ ⇧ ⇨ ⇩ ⇪"
|
||||
}
|
||||
30
assets/typecho/write/json/emoji.json
Executable file
30
assets/typecho/write/json/emoji.json
Executable file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"表情": "😀 😁 😂 😃 😄 😅 😆 😉 😊 😋 😎 😍 😘 😗 😙 😚 ☺ 😇 😐 😑 😶 😏 😣 😥 😮 😯 😪 😫 😴 😌 😛 😜 😝 😒 😓 😔 😕 😲 😷 😖 😞 😟 😤 😢 😭 😦 😧 😨 😬 😰 😱 😳 😵 😡 😠",
|
||||
"人物": "👦 👧 👨 👩 👴 👵 👶 👱 👮 👲 👳 👷 👸 💂 🎅 👰 👼 💆 💇 🙍 🙎 🙅 🙆 💁 🙋 🙇 🙌 🙏 👤 👥 🚶 🏃 👯 💃 👫 👬 👭 💏 💑 👪",
|
||||
"箭头": "🔃 🔄 🔙 🔚 🔛 🔜 🔝",
|
||||
"办公": "📱 📲 ☎ 📞 📟 📠 🔋 🔌 💻 💽 💾 💿 📀 🎥 📺 📷 📹 📼 🔍 🔎 🔬 🔭 📡 📔 📕 📖 📗 📘 📙 📚 📓 📃 📜 📄 📰 📑 🔖 💳 ✉ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 ✏ ✒ 📝 📁 📂 📅 📆 📇 📈 📉 📊 📋 📌 📍 📎 📏 📐 ✂ 🔒 🔓 🔏 🔐 🔑",
|
||||
"建筑": "🏠 🏡 🏢 🏣 🏤 🏥 🏦 🏨 🏩 🏪 🏫 🏬 🏭 🏯 🏰 💒 🗼 🗽 ⛪ 🌆 🌇 🌉",
|
||||
"交通": "🚂 🚃 🚄 🚅 🚆 🚇 🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚏 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚚 🚛 🚜 🚲 ⛽ 🚨 🚥 🚦 🚧 ⚓ ⛵ 🚣 🚤 🚢 ✈ 💺 🚁 🚟 🚠 🚡 🚀",
|
||||
"钱币": "💴 💵 💶 💷 💰 💸 💳",
|
||||
"水果": "🍇 🍈 🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓",
|
||||
"月亮": "🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 🌝",
|
||||
"树叶": "🌿 🍀 🍁 🍂 🍃",
|
||||
"花草": "💐 🌸 💮 🌹 🌺 🌻 🌼 🌷 🌱 🌿 🍀",
|
||||
"心形": "💘 ❤ 💓 💔 💕 💖 💗 💙 💚 💛 💜 💝 💞 💟 ❣",
|
||||
"钟表": "🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 ⌛ ⏳ ⌚ ⏰ ⏱ ⏲ 🕰",
|
||||
"星座": "♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ⛎",
|
||||
"生肖": "🐁 🐂 🐅 🐇 🐉 🐍 🐎 🐐 🐒 🐓 🐕 🐖",
|
||||
"标志": "♠ ♥ ♦ ♣ 🀄 🎴 🔇 🔈 🔉 🔊 📢 📣 💤 💢 💬 💭 ♨ 🌀 🔔 🔕 ✡ ✝ 🔯 📛 🔰 🔱 ⭕ ✅ ☑ ✔ ✖ ❌ ❎ ➕ ➖ ➗ ➰ ➿ 〽 ✳ ✴ ❇ ‼ ⁉ ❓ ❔ ❕ ❗ © ® ™ 🎦 🔅 🔆 💯 🔠 🔡 🔢 🔣 🔤 🅰 🆎 🅱 🆑 🆒 🆓 ℹ 🆔 Ⓜ 🆕 🆖 🅾 🆗 🅿 🆘 🆙 🆚 🈁 🈂 🈷 🈶 🈯 🉐 🈹 🈚 🈲 🉑 🈸 🈴 🈳 ㊗ ㊙ 🈺 🈵 ▪ ▫ ◻ ◼ ◽ ◾ ⬛ ⬜ 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔲 🔳 ⚪ ⚫ 🔴 🔵",
|
||||
"物品": "💌 💎 🔪 💈 🚪 🚽 🚿 🛁 ⌛ ⏳ ⌚ ⏰ 🎈 🎉 🎊 🎎 🎏 🎐 🎀 🎁 📯 📻 📱 📲 ☎ 📞 📟 📠 🔋 🔌 💻 💽 💾 💿 📀 🎥 📺 📷 📹 📼 🔍 🔎 🔬 🔭 📡 💡 🔦 🏮 📔 📕 📖 📗 📘 📙 📚 📓 📃 📜 📄 📰 📑 🔖 💰 💴 💵 💶 💷 💸 💳 ✉ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 ✏ ✒ 📝 📁 📂 📅 📆 📇 📈 📉 📊 📋 📌 📍 📎 📏 📐 ✂ 🔒 🔓 🔏 🔐 🔑 🔨 🔫 🔧 🔩 🔗 💉 💊 🚬 🔮 🚩 🎌 💦 💨",
|
||||
"旅游": "🌋 🗻 🏠 🏡 🏢 🏣 🏤 🏥 🏦 🏨 🏩 🏪 🏫 🏬 🏭 🏯 🏰 💒 🗼 🗽 ⛪ ⛲ 🌁 🌃 🌆 🌇 🌉 🌌 🎠 🎡 🎢 🚂 🚃 🚄 🚅 🚆 🚇 🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚏 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚚 🚛 🚜 🚲 ⛽ 🚨 🚥 🚦 🚧 ⚓ ⛵ 🚤 🚢 ✈ 💺 🚁 🚟 🚠 🚡 🚀 🎑 🗿 🛂 🛃 🛄 🛅",
|
||||
"恐怖": "😈 👿 👹 👺 💀 ☠ 👻 👽 👾 💣",
|
||||
"文体": "🎪 🎭 🎨 🎰 🚣 🛀 🎫 🏆 ⚽ ⚾ 🏀 🏈 🏉 🎾 🎱 🎳 ⛳ 🎣 🎽 🎿 🏂 🏄 🏇 🏊 🚴 🚵 🎯 🎮 🎲 🎷 🎸 🎺 🎻 🎬",
|
||||
"饮食": "🍇 🍈 🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍅 🍆 🌽 🍄 🌰 🍞 🍖 🍗 🍔 🍟 🍕 🍳 🍲 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🍡 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🍫 🍬 🍭 🍮 🍯 🍼 ☕ 🍵 🍶 🍷 🍸 🍹 🍺 🍻 🍴",
|
||||
"自然": "🌍 🌎 🌏 🌐 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀ 🌝 🌞 ⭐ 🌟 🌠 ☁ ⛅ ☔ ⚡ ❄ 🔥 💧 🌊",
|
||||
"植物": "💐 🌸 💮 🌹 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 🍀 🍁 🍂 🍃",
|
||||
"动物": "🙈 🙉 🙊 🐵 🐒 🐶 🐕 🐩 🐺 🐱 😺 😸 😹 😻 😼 😽 🙀 😿 😾 🐈 🐯 🐅 🐆 🐴 🐎 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🐘 🐭 🐁 🐀 🐹 🐰 🐇 🐻 🐨 🐼 🐾 🐔 🐓 🦆 🦢 🕊 🦜 🦉 🐣 🐤 🐥 🐦 🐧 🐸 🐊 🐢 🐍 🐲 🐉 🐳 🐋 🐬 🐟 🐠 🐡 🐙 🐚 🐌 🐛 🐜 🐝 🐞 🦋",
|
||||
"公共": "♻ 🏧 🚮 🚰 ♿ 🚹 🚺 🚻 🚼 🚾 ⚠ 🚸 ⛔ 🚫 🚳 🚭 🚯 🚱 🚷 🔞 💈",
|
||||
"手机": "📱 📲 📶 📳 📴 ☎ 📞 📟 📠",
|
||||
"日常": "👣 👀 👂 👃 👅 👄 💋 👓 👔 👕 👖 👗 👘 👙 👚 👛 👜 👝 🎒 💼 👞 👟 👠 👡 👢 👑 👒 🎩 🎓 💄 💅 💍 🌂",
|
||||
"手势": "💪 👈 👉 ☝ 👆 👇 ✌ ✋ 👌 👍 👎 ✊ 👊 👋 👏 👐 ✍"
|
||||
}
|
||||
166
assets/typecho/write/json/expression.json
Executable file
166
assets/typecho/write/json/expression.json
Executable file
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"泡泡": [
|
||||
{ "icon": "assets/owo/paopao/E591B5E591B5_2x.png", "data": "::(呵呵)" },
|
||||
{ "icon": "assets/owo/paopao/E59388E59388_2x.png", "data": "::(哈哈)" },
|
||||
{ "icon": "assets/owo/paopao/E59090E8888C_2x.png", "data": "::(吐舌)" },
|
||||
{ "icon": "assets/owo/paopao/E5A4AAE5BC80E5BF83_2x.png", "data": "::(太开心)" },
|
||||
{ "icon": "assets/owo/paopao/E7AC91E79CBC_2x.png", "data": "::(笑眼)" },
|
||||
{ "icon": "assets/owo/paopao/E88AB1E5BF83_2x.png", "data": "::(花心)" },
|
||||
{ "icon": "assets/owo/paopao/E5B08FE4B996_2x.png", "data": "::(小乖)" },
|
||||
{ "icon": "assets/owo/paopao/E4B996_2x.png", "data": "::(乖)" },
|
||||
{ "icon": "assets/owo/paopao/E68D82E598B4E7AC91_2x.png", "data": "::(捂嘴笑)" },
|
||||
{ "icon": "assets/owo/paopao/E6BB91E7A8BD_2x.png", "data": "::(滑稽)" },
|
||||
{ "icon": "assets/owo/paopao/E4BDA0E68782E79A84_2x.png", "data": "::(你懂的)" },
|
||||
{ "icon": "assets/owo/paopao/E4B88DE9AB98E585B4_2x.png", "data": "::(不高兴)" },
|
||||
{ "icon": "assets/owo/paopao/E68092_2x.png", "data": "::(怒)" },
|
||||
{ "icon": "assets/owo/paopao/E6B197_2x.png", "data": "::(汗)" },
|
||||
{ "icon": "assets/owo/paopao/E9BB91E7BABF_2x.png", "data": "::(黑线)" },
|
||||
{ "icon": "assets/owo/paopao/E6B3AA_2x.png", "data": "::(泪)" },
|
||||
{ "icon": "assets/owo/paopao/E79C9FE6A392_2x.png", "data": "::(真棒)" },
|
||||
{ "icon": "assets/owo/paopao/E596B7_2x.png", "data": "::(喷)" },
|
||||
{ "icon": "assets/owo/paopao/E6838AE593AD_2x.png", "data": "::(惊哭)" },
|
||||
{ "icon": "assets/owo/paopao/E998B4E999A9_2x.png", "data": "::(阴险)" },
|
||||
{ "icon": "assets/owo/paopao/E98499E8A786_2x.png", "data": "::(鄙视)" },
|
||||
{ "icon": "assets/owo/paopao/E985B7_2x.png", "data": "::(酷)" },
|
||||
{ "icon": "assets/owo/paopao/E5958A_2x.png", "data": "::(啊)" },
|
||||
{ "icon": "assets/owo/paopao/E78B82E6B197_2x.png", "data": "::(狂汗)" },
|
||||
{ "icon": "assets/owo/paopao/what_2x.png", "data": "::(what)" },
|
||||
{ "icon": "assets/owo/paopao/E79691E997AE_2x.png", "data": "::(疑问)" },
|
||||
{ "icon": "assets/owo/paopao/E985B8E788BD_2x.png", "data": "::(酸爽)" },
|
||||
{ "icon": "assets/owo/paopao/E59180E592A9E788B9_2x.png", "data": "::(呀咩爹)" },
|
||||
{ "icon": "assets/owo/paopao/E5A794E5B188_2x.png", "data": "::(委屈)" },
|
||||
{ "icon": "assets/owo/paopao/E6838AE8AEB6_2x.png", "data": "::(惊讶)" },
|
||||
{ "icon": "assets/owo/paopao/E79DA1E8A789_2x.png", "data": "::(睡觉)" },
|
||||
{ "icon": "assets/owo/paopao/E7AC91E5B0BF_2x.png", "data": "::(笑尿)" },
|
||||
{ "icon": "assets/owo/paopao/E68C96E9BCBB_2x.png", "data": "::(挖鼻)" },
|
||||
{ "icon": "assets/owo/paopao/E59090_2x.png", "data": "::(吐)" },
|
||||
{ "icon": "assets/owo/paopao/E78A80E588A9_2x.png", "data": "::(犀利)" },
|
||||
{ "icon": "assets/owo/paopao/E5B08FE7BAA2E884B8_2x.png", "data": "::(小红脸)" },
|
||||
{ "icon": "assets/owo/paopao/E68792E5BE97E79086_2x.png", "data": "::(懒得理)" },
|
||||
{ "icon": "assets/owo/paopao/E58B89E5BCBA_2x.png", "data": "::(勉强)" },
|
||||
{ "icon": "assets/owo/paopao/E788B1E5BF83_2x.png", "data": "::(爱心)" },
|
||||
{ "icon": "assets/owo/paopao/E5BF83E7A28E_2x.png", "data": "::(心碎)" },
|
||||
{ "icon": "assets/owo/paopao/E78EABE791B0_2x.png", "data": "::(玫瑰)" },
|
||||
{ "icon": "assets/owo/paopao/E7A4BCE789A9_2x.png", "data": "::(礼物)" },
|
||||
{ "icon": "assets/owo/paopao/E5BDA9E899B9_2x.png", "data": "::(彩虹)" },
|
||||
{ "icon": "assets/owo/paopao/E5A4AAE998B3_2x.png", "data": "::(太阳)" },
|
||||
{ "icon": "assets/owo/paopao/E6989FE6989FE69C88E4BAAE_2x.png", "data": "::(星星月亮)" },
|
||||
{ "icon": "assets/owo/paopao/E992B1E5B881_2x.png", "data": "::(钱币)" },
|
||||
{ "icon": "assets/owo/paopao/E88CB6E69DAF_2x.png", "data": "::(茶杯)" },
|
||||
{ "icon": "assets/owo/paopao/E89B8BE7B395_2x.png", "data": "::(蛋糕)" },
|
||||
{ "icon": "assets/owo/paopao/E5A4A7E68B87E68C87_2x.png", "data": "::(大拇指)" },
|
||||
{ "icon": "assets/owo/paopao/E8839CE588A9_2x.png", "data": "::(胜利)" },
|
||||
{ "icon": "assets/owo/paopao/haha_2x.png", "data": "::(haha)" },
|
||||
{ "icon": "assets/owo/paopao/OK_2x.png", "data": "::(OK)" },
|
||||
{ "icon": "assets/owo/paopao/E6B299E58F91_2x.png", "data": "::(沙发)" },
|
||||
{ "icon": "assets/owo/paopao/E6898BE7BAB8_2x.png", "data": "::(手纸)" },
|
||||
{ "icon": "assets/owo/paopao/E9A699E89589_2x.png", "data": "::(香蕉)" },
|
||||
{ "icon": "assets/owo/paopao/E4BEBFE4BEBF_2x.png", "data": "::(便便)" },
|
||||
{ "icon": "assets/owo/paopao/E88DAFE4B8B8_2x.png", "data": "::(药丸)" },
|
||||
{ "icon": "assets/owo/paopao/E7BAA2E9A286E5B7BE_2x.png", "data": "::(红领巾)" },
|
||||
{ "icon": "assets/owo/paopao/E89CA1E7839B_2x.png", "data": "::(蜡烛)" },
|
||||
{ "icon": "assets/owo/paopao/E99FB3E4B990_2x.png", "data": "::(音乐)" },
|
||||
{ "icon": "assets/owo/paopao/E781AFE6B3A1_2x.png", "data": "::(灯泡)" },
|
||||
{ "icon": "assets/owo/paopao/E5BC80E5BF83_2x.png", "data": "::(开心)" },
|
||||
{ "icon": "assets/owo/paopao/E992B1_2x.png", "data": "::(钱)" },
|
||||
{ "icon": "assets/owo/paopao/E592A6_2x.png", "data": "::(咦)" },
|
||||
{ "icon": "assets/owo/paopao/E591BC_2x.png", "data": "::(呼)" },
|
||||
{ "icon": "assets/owo/paopao/E586B7_2x.png", "data": "::(冷)" },
|
||||
{ "icon": "assets/owo/paopao/E7949FE6B094_2x.png", "data": "::(生气)" },
|
||||
{ "icon": "assets/owo/paopao/E5BCB1_2x.png", "data": "::(弱)" },
|
||||
{ "icon": "assets/owo/paopao/E78B97E5A4B4_2x.png", "data": "::(狗头)" }
|
||||
],
|
||||
"阿鲁": [
|
||||
{ "icon": "assets/owo/aru/E9AB98E585B4_2x.png", "data": ":@(高兴)" },
|
||||
{ "icon": "assets/owo/aru/E5B08FE68092_2x.png", "data": ":@(小怒)" },
|
||||
{ "icon": "assets/owo/aru/E884B8E7BAA2_2x.png", "data": ":@(脸红)" },
|
||||
{ "icon": "assets/owo/aru/E58685E4BCA4_2x.png", "data": ":@(内伤)" },
|
||||
{ "icon": "assets/owo/aru/E8A385E5A4A7E6ACBE_2x.png", "data": ":@(装大款)" },
|
||||
{ "icon": "assets/owo/aru/E8B59EE4B880E4B8AA_2x.png", "data": ":@(赞一个)" },
|
||||
{ "icon": "assets/owo/aru/E5AEB3E7BE9E_2x.png", "data": ":@(害羞)" },
|
||||
{ "icon": "assets/owo/aru/E6B197_2x.png", "data": ":@(汗)" },
|
||||
{ "icon": "assets/owo/aru/E59090E8A180E58092E59CB0_2x.png", "data": ":@(吐血倒地)" },
|
||||
{ "icon": "assets/owo/aru/E6B7B1E6809D_2x.png", "data": ":@(深思)" },
|
||||
{ "icon": "assets/owo/aru/E4B88DE9AB98E585B4_2x.png", "data": ":@(不高兴)" },
|
||||
{ "icon": "assets/owo/aru/E697A0E8AFAD_2x.png", "data": ":@(无语)" },
|
||||
{ "icon": "assets/owo/aru/E4BAB2E4BAB2_2x.png", "data": ":@(亲亲)" },
|
||||
{ "icon": "assets/owo/aru/E58FA3E6B0B4_2x.png", "data": ":@(口水)" },
|
||||
{ "icon": "assets/owo/aru/E5B0B4E5B0AC_2x.png", "data": ":@(尴尬)" },
|
||||
{ "icon": "assets/owo/aru/E4B8ADE68C87_2x.png", "data": ":@(中指)" },
|
||||
{ "icon": "assets/owo/aru/E683B3E4B880E683B3_2x.png", "data": ":@(想一想)" },
|
||||
{ "icon": "assets/owo/aru/E593ADE6B3A3_2x.png", "data": ":@(哭泣)" },
|
||||
{ "icon": "assets/owo/aru/E4BEBFE4BEBF_2x.png", "data": ":@(便便)" },
|
||||
{ "icon": "assets/owo/aru/E78CAEE88AB1_2x.png", "data": ":@(献花)" },
|
||||
{ "icon": "assets/owo/aru/E79AB1E79C89_2x.png", "data": ":@(皱眉)" },
|
||||
{ "icon": "assets/owo/aru/E582BBE7AC91_2x.png", "data": ":@(傻笑)" },
|
||||
{ "icon": "assets/owo/aru/E78B82E6B197_2x.png", "data": ":@(狂汗)" },
|
||||
{ "icon": "assets/owo/aru/E59090_2x.png", "data": ":@(吐)" },
|
||||
{ "icon": "assets/owo/aru/E596B7E6B0B4_2x.png", "data": ":@(喷水)" },
|
||||
{ "icon": "assets/owo/aru/E79C8BE4B88DE8A781_2x.png", "data": ":@(看不见)" },
|
||||
{ "icon": "assets/owo/aru/E9BC93E68E8C_2x.png", "data": ":@(鼓掌)" },
|
||||
{ "icon": "assets/owo/aru/E998B4E69A97_2x.png", "data": ":@(阴暗)" },
|
||||
{ "icon": "assets/owo/aru/E995BFE88D89_2x.png", "data": ":@(长草)" },
|
||||
{ "icon": "assets/owo/aru/E78CAEE9BB84E7939C_2x.png", "data": ":@(献黄瓜)" },
|
||||
{ "icon": "assets/owo/aru/E982AAE681B6_2x.png", "data": ":@(邪恶)" },
|
||||
{ "icon": "assets/owo/aru/E69C9FE5BE85_2x.png", "data": ":@(期待)" },
|
||||
{ "icon": "assets/owo/aru/E5BE97E6848F_2x.png", "data": ":@(得意)" },
|
||||
{ "icon": "assets/owo/aru/E59090E8888C_2x.png", "data": ":@(吐舌)" },
|
||||
{ "icon": "assets/owo/aru/E596B7E8A180_2x.png", "data": ":@(喷血)" },
|
||||
{ "icon": "assets/owo/aru/E697A0E68980E8B093_2x.png", "data": ":@(无所谓)" },
|
||||
{ "icon": "assets/owo/aru/E8A782E5AF9F_2x.png", "data": ":@(观察)", "text": "观察" },
|
||||
{ "icon": "assets/owo/aru/E69A97E59CB0E8A782E5AF9F_2x.png", "data": ":@(暗地观察)" },
|
||||
{ "icon": "assets/owo/aru/E882BFE58C85_2x.png", "data": ":@(肿包)" },
|
||||
{ "icon": "assets/owo/aru/E4B8ADE69EAA_2x.png", "data": ":@(中枪)" },
|
||||
{ "icon": "assets/owo/aru/E5A4A7E59BA7_2x.png", "data": ":@(大囧)" },
|
||||
{ "icon": "assets/owo/aru/E591B2E78999_2x.png", "data": ":@(呲牙)" },
|
||||
{ "icon": "assets/owo/aru/E68AA0E9BCBB_2x.png", "data": ":@(抠鼻)" },
|
||||
{ "icon": "assets/owo/aru/E4B88DE8AFB4E8AF9D_2x.png", "data": ":@(不说话)" },
|
||||
{ "icon": "assets/owo/aru/E592BDE6B094_2x.png", "data": ":@(咽气)" },
|
||||
{ "icon": "assets/owo/aru/E6ACA2E591BC_2x.png", "data": ":@(欢呼)" },
|
||||
{ "icon": "assets/owo/aru/E99481E79C89_2x.png", "data": ":@(锁眉)" },
|
||||
{ "icon": "assets/owo/aru/E89CA1E7839B_2x.png", "data": ":@(蜡烛)" },
|
||||
{ "icon": "assets/owo/aru/E59D90E7AD89_2x.png", "data": ":@(坐等)" },
|
||||
{ "icon": "assets/owo/aru/E587BBE68E8C_2x.png", "data": ":@(击掌)" },
|
||||
{ "icon": "assets/owo/aru/E6838AE5969C_2x.png", "data": ":@(惊喜)" },
|
||||
{ "icon": "assets/owo/aru/E5969CE69E81E8808CE6B3A3_2x.png", "data": ":@(喜极而泣)" },
|
||||
{ "icon": "assets/owo/aru/E68ABDE7839F_2x.png", "data": ":@(抽烟)" },
|
||||
{ "icon": "assets/owo/aru/E4B88DE587BAE68980E69699_2x.png", "data": ":@(不出所料)" },
|
||||
{ "icon": "assets/owo/aru/E684A4E68092_2x.png", "data": ":@(愤怒)" },
|
||||
{ "icon": "assets/owo/aru/E697A0E5A588_2x.png", "data": ":@(无奈)" },
|
||||
{ "icon": "assets/owo/aru/E9BB91E7BABF_2x.png", "data": ":@(黑线)" },
|
||||
{ "icon": "assets/owo/aru/E68A95E9998D_2x.png", "data": ":@(投降)" },
|
||||
{ "icon": "assets/owo/aru/E79C8BE783ADE997B9_2x.png", "data": ":@(看热闹)" },
|
||||
{ "icon": "assets/owo/aru/E68987E880B3E58589_2x.png", "data": ":@(扇耳光)" },
|
||||
{ "icon": "assets/owo/aru/E5B08FE79CBCE79D9B_2x.png", "data": ":@(小眼睛)" },
|
||||
{ "icon": "assets/owo/aru/E4B8ADE58880_2x.png", "data": ":@(中刀)" }
|
||||
],
|
||||
"颜文字": [
|
||||
{ "icon": "|´・ω・)ノ", "data": "|´・ω・)ノ" },
|
||||
{ "icon": "ヾ(≧∇≦*)ゝ", "data": "ヾ(≧∇≦*)ゝ" },
|
||||
{ "icon": "(☆ω☆)", "data": "(☆ω☆)" },
|
||||
{ "icon": "(╯‵□′)╯︵┴─┴", "data": "(╯‵□′)╯︵┴─┴" },
|
||||
{ "icon": " ̄﹃ ̄", "data": " ̄﹃ ̄" },
|
||||
{ "icon": "(/ω\)", "data": "(/ω\)" },
|
||||
{ "icon": "∠( ᐛ 」∠)_", "data": "∠( ᐛ 」∠)_" },
|
||||
{ "icon": "(๑•̀ㅁ•́ฅ)", "data": "(๑•̀ㅁ•́ฅ)" },
|
||||
{ "icon": "→_→", "data": "→_→" },
|
||||
{ "icon": "୧(๑•̀⌄•́๑)૭", "data": "୧(๑•̀⌄•́๑)૭" },
|
||||
{ "icon": "٩(ˊᗜˋ*)و", "data": "٩(ˊᗜˋ*)و" },
|
||||
{ "icon": "(ノ°ο°)ノ", "data": "(ノ°ο°)ノ" },
|
||||
{ "icon": "(´இ皿இ`)", "data": "(´இ皿இ`)" },
|
||||
{ "icon": "⌇●﹏●⌇", "data": "⌇●﹏●⌇" },
|
||||
{ "icon": "(ฅ´ω`ฅ)", "data": "(ฅ´ω`ฅ)" },
|
||||
{ "icon": "(╯°A°)╯︵○○○", "data": "(╯°A°)╯︵○○○" },
|
||||
{ "icon": "φ( ̄∇ ̄o)", "data": "φ( ̄∇ ̄o)" },
|
||||
{ "icon": "ヾ(´・ ・`。)ノ\"", "data": "ヾ(´・ ・`。)ノ\"" },
|
||||
{ "icon": "( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃", "data": "( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃" },
|
||||
{ "icon": "(ó﹏ò。)", "data": "(ó﹏ò。)" },
|
||||
{ "icon": "Σ(っ °Д °;)っ", "data": "Σ(っ °Д °;)っ" },
|
||||
{ "icon": "( ,,´・ω・)ノ\"(´っω・`。)", "data": "( ,,´・ω・)ノ\"(´っω・`。)" },
|
||||
{ "icon": "╮(╯▽╰)╭ ", "data": "╮(╯▽╰)╭ " },
|
||||
{ "icon": "o(*////▽////*)q ", "data": "o(*////▽////*)q " },
|
||||
{ "icon": ">﹏<", "data": ">﹏<" },
|
||||
{ "icon": "( ๑´•ω•) \"(ㆆᴗㆆ)", "data": "( ๑´•ω•) \"(ㆆᴗㆆ)" },
|
||||
{ "icon": "(。•ˇ‸ˇ•。)", "data": "(。•ˇ‸ˇ•。)" }
|
||||
]
|
||||
}
|
||||
24
assets/typecho/write/package.json
Executable file
24
assets/typecho/write/package.json
Executable file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"scripts": {
|
||||
"serve": "rollup -c -w"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/closebrackets": "^0.19.0",
|
||||
"@codemirror/commands": "^0.19.5",
|
||||
"@codemirror/comment": "^0.19.0",
|
||||
"@codemirror/gutter": "^0.19.2",
|
||||
"@codemirror/highlight": "^0.19.6",
|
||||
"@codemirror/history": "^0.19.0",
|
||||
"@codemirror/lang-markdown": "^0.19.1",
|
||||
"@codemirror/language-data": "^0.19.0",
|
||||
"@codemirror/matchbrackets": "^0.19.3",
|
||||
"@codemirror/search": "^0.19.2",
|
||||
"@codemirror/state": "^0.19.2",
|
||||
"@codemirror/view": "^0.19.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^13.0.5",
|
||||
"rollup": "^2.58.0",
|
||||
"rollup-plugin-terser": "^7.0.2"
|
||||
}
|
||||
}
|
||||
1357
assets/typecho/write/parse/parse.js
Executable file
1357
assets/typecho/write/parse/parse.js
Executable file
File diff suppressed because it is too large
Load Diff
1
assets/typecho/write/parse/parse.min.js
vendored
Executable file
1
assets/typecho/write/parse/parse.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
12
assets/typecho/write/rollup.config.js
Executable file
12
assets/typecho/write/rollup.config.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
export default {
|
||||
input: './js/index.js',
|
||||
output: {
|
||||
file: './dist/index.bundle.js',
|
||||
format: 'iife',
|
||||
inlineDynamicImports: true,
|
||||
minify: true
|
||||
},
|
||||
plugins: [nodeResolve(), terser({ compress: { drop_console: true } })]
|
||||
};
|
||||
Reference in New Issue
Block a user