This commit is contained in:
杜恒 2021-05-29 17:02:49 +08:00
parent 70eaaedacd
commit cbecb2a699
6 changed files with 18 additions and 6 deletions

View File

@ -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/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="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css?v=20210529') ?>">
<link rel="stylesheet" href="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css?v=202105291700') ?>">
<script>
window.JoeConfig = {
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/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.write.chunk.js?v=20210529') ?>"></script>
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=202105291700') ?>"></script>
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js') ?>"></script>
<?php
}

View File

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

View File

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

View File

@ -98,6 +98,10 @@ export default class JoeAction {
}
});
}
_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');

File diff suppressed because one or more lines are too long

View File

@ -122,6 +122,13 @@ class Joe extends JoeAction {
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'));
}
}
})
],
@ -351,6 +358,7 @@ class Joe extends JoeAction {
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;
}
});