This commit is contained in:
杜恒 2021-05-07 17:58:57 +08:00
parent 854f737720
commit 270301f770
7 changed files with 24 additions and 11 deletions

View File

@ -64,11 +64,12 @@ class Editor
canPreview: false canPreview: false
} }
</script> </script>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.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/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=20210506') ?>"></script> <script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=20210507') ?>"></script>
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js?v=20210506') ?>"></script> <script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js') ?>"></script>
<?php <?php
} }
} }

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "typecho-joe-next", "name": "typecho-joe-next",
"version": "6.8.5", "version": "6.8.6",
"description": "A Theme Of Typecho", "description": "A Theme Of Typecho",
"main": "index.php", "main": "index.php",
"keywords": [ "keywords": [

View File

@ -1,6 +1,19 @@
const parser = new HyperDown(); const parser = new HyperDown();
const player = window.JoeConfig.playerAPI; const player = window.JoeConfig.playerAPI;
function throttle(fn, wait) {
var pre = Date.now();
return function () {
var context = this;
var args = arguments;
var now = Date.now();
if (now - pre >= wait) {
fn.apply(context, args);
pre = Date.now();
}
};
}
export default function createPreviewHtml(str) { export default function createPreviewHtml(str) {
if (!window.JoeConfig.canPreview) return $('.cm-preview-content').html('1. 预览已默认关闭<br>2. 点击上方预览按钮启用预览<br>3. 若编辑器卡顿可尝试关闭预览'); if (!window.JoeConfig.canPreview) return $('.cm-preview-content').html('1. 预览已默认关闭<br>2. 点击上方预览按钮启用预览<br>3. 若编辑器卡顿可尝试关闭预览');

File diff suppressed because one or more lines are too long

View File

@ -51,9 +51,9 @@ class Joe extends JoeAction {
extensions: [ extensions: [
...this.plugins, ...this.plugins,
markdown({ markdown({
base: markdownLanguage, base: markdownLanguage
}), }),
keymap.of([defaultTabBinding, ...defaultKeymap, ...historyKeymap, ...closeBracketsKeymap]), keymap.of([defaultTabBinding, ...closeBracketsKeymap, ...defaultKeymap, ...historyKeymap]),
EditorView.updateListener.of(update => { EditorView.updateListener.of(update => {
if (!update.docChanged) return; if (!update.docChanged) return;
if (_temp !== update.state.doc.toString()) { if (_temp !== update.state.doc.toString()) {

View File

@ -4,11 +4,10 @@
}, },
"dependencies": { "dependencies": {
"@codemirror/closebrackets": "^0.18.0", "@codemirror/closebrackets": "^0.18.0",
"@codemirror/commands": "^0.18.1", "@codemirror/commands": "^0.18.2",
"@codemirror/highlight": "^0.18.3", "@codemirror/highlight": "^0.18.3",
"@codemirror/history": "^0.18.1", "@codemirror/history": "^0.18.1",
"@codemirror/lang-markdown": "^0.18.1", "@codemirror/lang-markdown": "^0.18.2",
"@codemirror/language-data": "^0.18.0",
"@codemirror/matchbrackets": "^0.18.0", "@codemirror/matchbrackets": "^0.18.0",
"@codemirror/state": "^0.18.7", "@codemirror/state": "^0.18.7",
"@codemirror/view": "^0.18.11", "@codemirror/view": "^0.18.11",