更新
This commit is contained in:
parent
a8c87e941b
commit
f8df5884c8
@ -209,7 +209,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
url: $(item).attr('data-url'),
|
||||
target: '_blank',
|
||||
fontColor: colors[random(0, colors.length - 1)],
|
||||
fontSize: random(15, 20)
|
||||
fontSize: 15
|
||||
});
|
||||
});
|
||||
$('.joe_aside__item-contain .tag').svg3DTagCloud({
|
||||
|
2
assets/js/joe.global.min.js
vendored
2
assets/js/joe.global.min.js
vendored
File diff suppressed because one or more lines are too long
@ -48,7 +48,8 @@ class Editor
|
||||
uploadAPI: '<?php Helper::security()->index('/action/upload'); ?>',
|
||||
emojiAPI: '<?php Helper::options()->themeUrl('typecho/write/json/emoji.json') ?>',
|
||||
characterAPI: '<?php Helper::options()->themeUrl('typecho/write/json/character.json') ?>',
|
||||
playerAPI: '<?php Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer() : Helper::options()->themeUrl('library/player.php?url=') ?>'
|
||||
playerAPI: '<?php Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer() : Helper::options()->themeUrl('library/player.php?url=') ?>',
|
||||
autoSave: <?php Helper::options()->autoSave(); ?>
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.2.4/plugin/prism/prism.min.js"></script>
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* 获取主题当前版本号 */
|
||||
function _getVersion()
|
||||
{
|
||||
return "6.2.6";
|
||||
return "6.2.7";
|
||||
};
|
||||
|
||||
/* 判断是否是手机 */
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "typecho-joe-next",
|
||||
"version": "6.2.6",
|
||||
"version": "6.2.7",
|
||||
"description": "A Theme Of Typecho",
|
||||
"main": "index.php",
|
||||
"keywords": [
|
||||
|
2
typecho/write/css/joe.write.min.css
vendored
2
typecho/write/css/joe.write.min.css
vendored
File diff suppressed because one or more lines are too long
@ -116,6 +116,7 @@ body.fullscreen {
|
||||
}
|
||||
}
|
||||
.cm-mainer {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
@ -432,6 +433,38 @@ body.fullscreen {
|
||||
}
|
||||
}
|
||||
}
|
||||
.cm-autosave {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 0;
|
||||
height: 2px;
|
||||
transition: width 0.5s;
|
||||
}
|
||||
&::before {
|
||||
border-radius: 1px 0 0 1px;
|
||||
left: 50%;
|
||||
background: linear-gradient(to right, #4cd964, #5ac8fa, #007aff);
|
||||
}
|
||||
&::after {
|
||||
border-radius: 0 1px 1px 0;
|
||||
right: 50%;
|
||||
background: linear-gradient(to left, #4cd964, #5ac8fa, #007aff);
|
||||
}
|
||||
&.active {
|
||||
&::before,
|
||||
&::after {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.cm-progress-left {
|
||||
position: absolute;
|
||||
|
File diff suppressed because one or more lines are too long
@ -19,6 +19,7 @@ class Joe extends JoeAction {
|
||||
this.init_Preview();
|
||||
this.init_Tools();
|
||||
this.init_Insert();
|
||||
this.init_AutoSave();
|
||||
}
|
||||
|
||||
/* 已测 √ */
|
||||
@ -35,6 +36,7 @@ class Joe extends JoeAction {
|
||||
<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>
|
||||
@ -285,6 +287,36 @@ class Joe extends JoeAction {
|
||||
this.cm.focus();
|
||||
};
|
||||
}
|
||||
|
||||
init_AutoSave() {
|
||||
if (window.JoeConfig.autoSave !== 1) return;
|
||||
const formEl = $('#text')[0].form;
|
||||
let cid = $('input[name="cid"]').val();
|
||||
let temp = null;
|
||||
const saveFn = () => {
|
||||
$('input[name="cid"]').val(cid);
|
||||
$('#text').val(this.cm.state.doc.toString());
|
||||
let data = $(formEl).serialize();
|
||||
if (data !== temp) {
|
||||
$('.cm-autosave').addClass('active');
|
||||
$.ajax({
|
||||
url: formEl.action,
|
||||
type: 'POST',
|
||||
data: data + '&do=save',
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
cid = res.cid;
|
||||
temp = data;
|
||||
let timer = setTimeout(() => {
|
||||
$('.cm-autosave').removeClass('active');
|
||||
clearTimeout(timer);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
setInterval(saveFn, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => new Joe());
|
||||
|
Loading…
Reference in New Issue
Block a user