This commit is contained in:
杜恒 2021-04-15 10:33:46 +08:00
parent 92889ef834
commit 4631aab53b
8 changed files with 28 additions and 17 deletions

View File

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

View File

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

View File

@ -471,4 +471,9 @@ export default class JoeAction {
} }
}); });
} }
handleHtml(cm) {
const str = `${this._getLineCh(cm) ? '\n' : ''}!!!\n<p align="center">居中</p>\n<p align="right">居右</p>\n<font size="5" color="red">颜色大小</font>\n!!!\n`;
this._replaceSelection(cm, str);
cm.focus();
}
} }

View File

@ -89,6 +89,11 @@ export default [
title: '代码块', title: '代码块',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M902.4 454.4l-144-144a40.704 40.704 0 0 0-57.6 57.6l144 144-144 144a40.704 40.704 0 0 0 57.6 57.6l144-144a81.472 81.472 0 0 0 0-115.2zm-636.8-144l-144 144a81.472 81.472 0 0 0 0 115.2l144 144a40.704 40.704 0 0 0 57.6-57.6l-144-144 144-144a40.704 40.704 0 0 0-57.6-57.6zm109.568 544.064l195.072-706.56a40.704 40.704 0 0 1 78.528 21.632l-195.072 706.56a40.704 40.704 0 0 1-78.528-21.696z" /></svg>' innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M902.4 454.4l-144-144a40.704 40.704 0 0 0-57.6 57.6l144 144-144 144a40.704 40.704 0 0 0 57.6 57.6l144-144a81.472 81.472 0 0 0 0-115.2zm-636.8-144l-144 144a81.472 81.472 0 0 0 0 115.2l144 144a40.704 40.704 0 0 0 57.6-57.6l-144-144 144-144a40.704 40.704 0 0 0-57.6-57.6zm109.568 544.064l195.072-706.56a40.704 40.704 0 0 1 78.528 21.632l-195.072 706.56a40.704 40.704 0 0 1-78.528-21.696z" /></svg>'
}, },
{
type: 'html',
title: '原生HTML',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M128 64l69.8 791.6L511 960l315.2-104.4L896 64H128zm616.4 255.8H376.8l8.2 98.8h351.2L709 715.4l-195.8 54v.6H511l-197.4-54.6-12-151.6H397l7 76.2 107 29 107.4-29 12-124.4H296.6L271 224.4h482.2l-8.8 95.4z"/></svg>'
},
{ {
type: 'expression', type: 'expression',
title: '图片表情', title: '图片表情',

View File

@ -652,18 +652,16 @@
Parser.prototype.parseBlockShtml = function (block, key, line, state) { Parser.prototype.parseBlockShtml = function (block, key, line, state) {
var matches; var matches;
if (this.html) { if (!!(matches = line.match(/^(\s*)!!!(\s*)$/))) {
if (!!(matches = line.match(/^(\s*)!!!(\s*)$/))) { if (this.isBlock('shtml')) {
if (this.isBlock('shtml')) { this.setBlock(key).endBlock();
this.setBlock(key).endBlock(); } else {
} else { this.startBlock('shtml', key);
this.startBlock('shtml', key);
}
return false;
} else if (this.isBlock('shtml')) {
this.setBlock(key);
return false;
} }
return false;
} else if (this.isBlock('shtml')) {
this.setBlock(key);
return false;
} }
return true; return true;
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -277,6 +277,9 @@ class Joe extends JoeAction {
case 'mtitle': case 'mtitle':
super.handleMtitle(this.cm); super.handleMtitle(this.cm);
break; break;
case 'html':
super.handleHtml(this.cm);
break;
} }
}); });
$('.cm-tools').append(el); $('.cm-tools').append(el);