This commit is contained in:
杜恒 2021-04-01 14:46:20 +08:00
parent 94d4f4fea6
commit 7e374149f0
9 changed files with 27 additions and 5 deletions

View File

@ -47,6 +47,7 @@ class Editor
window.JoeConfig = {
uploadAPI: '<?php Helper::security()->index('/action/upload'); ?>',
emojiAPI: '<?php Helper::options()->themeUrl('typecho/write/json/emoji.json') ?>',
expressionAPI: '<?php Helper::options()->themeUrl('typecho/write/json/expression.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=') ?>',
autoSave: <?php Helper::options()->autoSave(); ?>

View File

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

View File

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

View File

@ -418,4 +418,13 @@ export default class JoeAction {
handleDraft() {
$('#btn-save').click();
}
handleExpression(cm) {
$.ajax({
url: window.JoeConfig.expressionAPI,
dataType: 'json',
success: res => {
console.log(res);
}
});
}
}

View File

@ -1,6 +1,8 @@
const parser = new HyperDown();
const player = window.JoeConfig.playerAPI;
export default function createPreviewHtml(str) {
str = str.replace(/ /g, '&emsp;');
str = parser.makeHtml(str);
/* 任务 - 完成 */

View File

@ -84,6 +84,11 @@ export default [
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: '任务 - 未完成',

File diff suppressed because one or more lines are too long

View File

@ -272,6 +272,9 @@ class Joe extends JoeAction {
case 'draft':
super.handleDraft();
break;
case 'expression':
super.handleExpression(this.cm);
break;
}
});
$('.cm-tools').append(el);
@ -288,6 +291,7 @@ class Joe extends JoeAction {
};
}
/* 已测 √ */
init_AutoSave() {
if (window.JoeConfig.autoSave !== 1) return;
const formEl = $('#text')[0].form;

View File

@ -0,0 +1 @@
{}