更新
This commit is contained in:
parent
cbecb2a699
commit
31e15ebf06
@ -172,7 +172,7 @@ class Editor
|
|||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" href="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css?v=202105291700') ?>">
|
<link rel="stylesheet" href="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css') ?>">
|
||||||
<script>
|
<script>
|
||||||
window.JoeConfig = {
|
window.JoeConfig = {
|
||||||
uploadAPI: '<?php Helper::security()->index('/action/upload'); ?>',
|
uploadAPI: '<?php Helper::security()->index('/action/upload'); ?>',
|
||||||
@ -188,7 +188,7 @@ class Editor
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.2.4/plugin/prism/prism.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.2.4/plugin/prism/prism.min.js"></script>
|
||||||
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.parse.min.js') ?>"></script>
|
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.parse.min.js') ?>"></script>
|
||||||
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=202105291700') ?>"></script>
|
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=20210531') ?>"></script>
|
||||||
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js') ?>"></script>
|
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js') ?>"></script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* 获取主题当前版本号 */
|
/* 获取主题当前版本号 */
|
||||||
function _getVersion()
|
function _getVersion()
|
||||||
{
|
{
|
||||||
return "7.1.7";
|
return "7.1.8";
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 判断是否是手机 */
|
/* 判断是否是手机 */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "typecho-joe-next",
|
"name": "typecho-joe-next",
|
||||||
"version": "7.1.7",
|
"version": "7.1.8",
|
||||||
"description": "A Theme Of Typecho",
|
"description": "A Theme Of Typecho",
|
||||||
"main": "index.php",
|
"main": "index.php",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -99,8 +99,7 @@ export default function createPreviewHtml(str) {
|
|||||||
if (str.indexOf('{gird') !== -1) {
|
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>');
|
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').html(str);
|
||||||
$('.cm-preview-content p:empty').remove();
|
$('.cm-preview-content p:empty').remove();
|
||||||
$('.cm-preview-content pre code').each((i, el) => Prism.highlightElement(el));
|
Prism.highlightAll();
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -43,8 +43,9 @@ class Joe extends JoeAction {
|
|||||||
<div class="cm-progress-right"></div>
|
<div class="cm-progress-right"></div>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
createPreviewHtml($('#text').val());
|
createPreviewHtml(null);
|
||||||
let _temp = null;
|
let _temp = null;
|
||||||
|
let _debounce = null;
|
||||||
const cm = new EditorView({
|
const cm = new EditorView({
|
||||||
state: EditorState.create({
|
state: EditorState.create({
|
||||||
doc: $('#text').val(),
|
doc: $('#text').val(),
|
||||||
@ -58,8 +59,8 @@ class Joe extends JoeAction {
|
|||||||
if (!update.docChanged) return;
|
if (!update.docChanged) return;
|
||||||
if (_temp !== update.state.doc.toString()) {
|
if (_temp !== update.state.doc.toString()) {
|
||||||
_temp = update.state.doc.toString();
|
_temp = update.state.doc.toString();
|
||||||
if (window.requestAnimationFrame) window.requestAnimationFrame(() => createPreviewHtml(update.state.doc.toString()));
|
clearTimeout(_debounce);
|
||||||
else createPreviewHtml(update.state.doc.toString());
|
_debounce = setTimeout(createPreviewHtml.bind(null, update.state.doc.toString()), 150);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
EditorView.domEventHandlers({
|
EditorView.domEventHandlers({
|
||||||
|
Loading…
Reference in New Issue
Block a user