更新
15
README.md
@ -1,15 +0,0 @@
|
||||
Typecho Joe 主题新一代版本
|
||||
|
||||
SCSS 本地编译方式(如果需要修改样式):
|
||||
1、安装 Node.js
|
||||
2、node.js 安装完成后,安装 node-scss(npm i -g node-sass)
|
||||
3、安装 VSCode
|
||||
4、VSCode 软件安装 `scss-to-css` 插件(https://github.com/yutent/scss-to-css/blob/master/README_ZH.md)
|
||||
5、上面步骤安装完成后,在编写 SCSS 文件时,直接保存,即可生成编译后的 CSS 文件
|
||||
|
||||
|
||||
1. 主题开源免费 + 持续更新
|
||||
2. 将主题上传到Typecho博客usr/themes文件夹后,确保主题文件夹名为:Joe (J是大写的J,不要改成小写)
|
||||
3. 主题QQ群:198963776(有问题在群内艾特我QQ:2323333339)
|
||||
|
||||
欢迎各位对主题的PR
|
@ -3,8 +3,8 @@
|
||||
|
||||
<head>
|
||||
<?php $this->need('public/include.php'); ?>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.archive.min.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/wowjs@1.1.3/dist/wow.min.js"></script>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.archive.min.css'); ?>">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.archive.min.js'); ?>"></script>
|
||||
</head>
|
||||
|
||||
|
2
assets/css/joe.global.min.css
vendored
2
assets/css/joe.live.min.css
vendored
@ -133,7 +133,7 @@
|
||||
height: 50px;
|
||||
margin: -25px 0 0 -25px;
|
||||
opacity: 0;
|
||||
background: url(../img/play.png) no-repeat;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAA1VBMVEUcHBwAAAD8/PwpKSn///////+SkpL6+vrMzMx6enrj4+Pf39+4uLhkZGRhYWFTU1P///9DQ0P////////////////+/v5bW1v39/fz8/P////////a2tpoaGj////19fXY2Nizs7Oqqqr///+VlZU8PDz///////////////////+9vb3///+xsbH///////////////////////////+Ojo7////////v7+/s7Oz////////////q6url5eXc3Nzc3NzJycnCwsKgoKCLi4v////////8X/FsAAAARnRSTlNmAPtq77qS9r2F1NGsfHt2k3BWHQsG+3ny69rWy35f7sinopeUbiHcxr2wr6qmpaF9LxoWmJAyH+jig3tj3dnOzLmzmo4z4F1A4QAAAdxJREFUSMellmlX6jAQhod0X1gKlLKDILjgLuj17veq7///SaLgoZm02OjzsTlPTyaZmQyVFBrDmtU1Wy2za9WGDXWdK42rHiR6V/d7leszAE4QrgaRYUSDVRg4AM6uc5XbS0CMbYNSGPZYAJe32UrdhHCrpFB1Bcx6hhJPAT+hTBIfmMZcaVoQB5TLgYDVlJXmMdoe7cFr47iZVuITdCq0l0oHJ3FKmWLEDdUZYbpT6hAefYgnUH9XbkycUwHOYd5slQv4VAgfFxvlDqJcTCkL3L0pp3CpIC5OX5V7iGpRpSowXys/0CeZp7/9xSDb6eP7WunBVn615mFikIqNbokacNjaf2zoTFTFcDCnIQKSecA7vzziBPhJNYTsR9jRWvDdhaiRhUOSGCDN74gkDmHREcr8o8S3RL5NHJGJmaxMINOR1iOYBPACBKMvR9pSlQUYgit8Y6oSsI2p4YfMaCc8fH7IPPyRxw9ZvUqbnzG/SjVhykgxnqkJk5GWzi6Mx8y0VJP/DzYId5ad/GqJrbZCkltic6WQ/wnHn0R5hfy5dlF61mtK+q1Pv8Hqt3G9xyIZYfmVJ0n/4dN/XrfES8Cv5GzKB5ax/qjw9YGEjz32Zuyx2djz+eFKf4R7ATsDgJd2KvNDAAAAAElFTkSuQmCC) no-repeat;
|
||||
transform: scale(2);
|
||||
transition: transform 0.25s ease-out, opacity 0.25s ease-out;
|
||||
z-index: 3;
|
||||
|
2
assets/css/joe.responsive.min.css
vendored
@ -573,6 +573,9 @@ html {
|
||||
.content {
|
||||
height: 109px;
|
||||
line-height: 18px;
|
||||
.owo_image {
|
||||
max-height: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
assets/css/joe.video.min.css
vendored
@ -122,7 +122,7 @@
|
||||
height: 50px;
|
||||
margin: -25px 0 0 -25px;
|
||||
opacity: 0;
|
||||
background: url(../img/play.png) no-repeat;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAA1VBMVEUcHBwAAAD8/PwpKSn///////+SkpL6+vrMzMx6enrj4+Pf39+4uLhkZGRhYWFTU1P///9DQ0P////////////////+/v5bW1v39/fz8/P////////a2tpoaGj////19fXY2Nizs7Oqqqr///+VlZU8PDz///////////////////+9vb3///+xsbH///////////////////////////+Ojo7////////v7+/s7Oz////////////q6url5eXc3Nzc3NzJycnCwsKgoKCLi4v////////8X/FsAAAARnRSTlNmAPtq77qS9r2F1NGsfHt2k3BWHQsG+3ny69rWy35f7sinopeUbiHcxr2wr6qmpaF9LxoWmJAyH+jig3tj3dnOzLmzmo4z4F1A4QAAAdxJREFUSMellmlX6jAQhod0X1gKlLKDILjgLuj17veq7///SaLgoZm02OjzsTlPTyaZmQyVFBrDmtU1Wy2za9WGDXWdK42rHiR6V/d7leszAE4QrgaRYUSDVRg4AM6uc5XbS0CMbYNSGPZYAJe32UrdhHCrpFB1Bcx6hhJPAT+hTBIfmMZcaVoQB5TLgYDVlJXmMdoe7cFr47iZVuITdCq0l0oHJ3FKmWLEDdUZYbpT6hAefYgnUH9XbkycUwHOYd5slQv4VAgfFxvlDqJcTCkL3L0pp3CpIC5OX5V7iGpRpSowXys/0CeZp7/9xSDb6eP7WunBVn615mFikIqNbokacNjaf2zoTFTFcDCnIQKSecA7vzziBPhJNYTsR9jRWvDdhaiRhUOSGCDN74gkDmHREcr8o8S3RL5NHJGJmaxMINOR1iOYBPACBKMvR9pSlQUYgit8Y6oSsI2p4YfMaCc8fH7IPPyRxw9ZvUqbnzG/SjVhykgxnqkJk5GWzi6Mx8y0VJP/DzYId5ad/GqJrbZCkltic6WQ/wnHn0R5hfy5dlF61mtK+q1Pv8Hqt3G9xyIZYfmVJ0n/4dN/XrfES8Cv5GzKB5ax/qjw9YGEjz32Zuyx2djz+eFKf4R7ATsDgJd2KvNDAAAAAElFTkSuQmCC) no-repeat;
|
||||
transform: scale(2);
|
||||
transition: transform 0.25s ease-out, opacity 0.25s ease-out;
|
||||
z-index: 3;
|
||||
|
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 840 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 100 KiB |
1
assets/js/joe.extend.min.js
vendored
@ -1 +0,0 @@
|
||||
(function(e){e.fn.extend({insertContent:function(t,n){var a=e(this)[0];if(document.selection){this.focus();var s=document.selection.createRange();s.text=t,this.focus(),s.moveStart("character",-i);var c=s.text.length;if(2==arguments.length){var i=a.value.length;s.moveEnd("character",c+n),n<=0?s.moveStart("character",c-2*n-t.length):s.moveStart("character",c-n-t.length),s.select()}}else if(a.selectionStart||"0"==a.selectionStart){var o=a.selectionStart,r=a.selectionEnd,l=a.scrollTop;a.value=a.value.substring(0,o)+t+a.value.substring(r,a.value.length),this.focus(),a.selectionStart=o+t.length,a.selectionEnd=o+t.length,a.scrollTop=l,2==arguments.length&&(a.setSelectionRange(o-n,a.selectionEnd+n),this.focus())}else this.value+=t,this.focus()},selectionRange:function(e,t){var n="",a=this[0];if(void 0===e)n=/input|textarea/i.test(a.tagName)&&/firefox/i.test(navigator.userAgent)?a.value.substring(a.selectionStart,a.selectionEnd):document.selection?document.selection.createRange().text:document.getSelection().toString();else{if(!/input|textarea/.test(a.tagName.toLowerCase()))return!1;if(void 0===t&&(t=e),a.setSelectionRange)a.setSelectionRange(e,t),this.focus();else{var s=a.createTextRange();s.move("character",e),s.moveEnd("character",t-e),s.select()}}return void 0===e?n:this}})})(jQuery);
|
@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
/* 动态背景 */
|
||||
{
|
||||
if (!Joe.IS_MOBILE && Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) {
|
||||
$.getScript(`https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);
|
||||
$.getScript(`/usr/themes/Joe/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
{
|
||||
if ($('.joe_owo__contain').length > 0 && $('.joe_owo__target').length > 0) {
|
||||
$.ajax({
|
||||
url: 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.owo.json',
|
||||
url: '/usr/themes/Joe/assets/json/joe.owo.json',
|
||||
success(res) {
|
||||
let barStr = '';
|
||||
let scrollStr = '';
|
||||
|
2
assets/js/joe.global.min.js
vendored
@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
renderLiveType();
|
||||
function renderLiveType() {
|
||||
$.ajax({
|
||||
url: 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.live.json',
|
||||
url: '/usr/themes/Joe/assets/json/joe.live.json',
|
||||
success(res) {
|
||||
const item = res[queryData.index];
|
||||
$('.joe_live__type-title .text').html(item.name);
|
||||
|
2
assets/js/joe.live.min.js
vendored
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 29 KiB |
118
core/factory.php
@ -1,62 +1,4 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* 加强后台编辑器功能 */
|
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('Editor', 'edit');
|
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('Editor', 'edit');
|
||||
|
||||
class Editor
|
||||
{
|
||||
public static function edit()
|
||||
{
|
||||
echo "<link rel='stylesheet' href='" . Helper::options()->themeUrl . '/typecho/editor/css/joe.editor.min.css' . "'>\n";
|
||||
echo "<script src='" . Helper::options()->themeUrl . '/typecho/editor/js/joe.extend.min.js' . "'></script>\n";
|
||||
echo "<script src='" . Helper::options()->themeUrl . '/typecho/editor/js/joe.editor.min.js' . "'></script>\n";
|
||||
if (Helper::options()->JPasteUpload === "on") { ?>
|
||||
<script>
|
||||
$("#text").on("paste", event => {
|
||||
let clipboardData = event.clipboardData || window.clipboardData || event.originalEvent.clipboardData;
|
||||
if (!clipboardData || !clipboardData.items) return;
|
||||
let items = clipboardData.items;
|
||||
let file = null;
|
||||
if (items.length === 0) return;
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (items[i].kind === 'file' && items[i].type.match(/^image/)) {
|
||||
event.preventDefault(), file = items[i].getAsFile()
|
||||
}
|
||||
}
|
||||
if (!file) return;
|
||||
let uploadUrl = '<?php Helper::security()->index('/action/upload'); ?>';
|
||||
let cid = $('input[name="cid"]').val()
|
||||
cid && (uploadUrl = uploadUrl + '&cid=' + cid);
|
||||
let random = Date.now().toString(36);
|
||||
let fileName = random + '.png'
|
||||
let uploadText = '[图片上传中...(' + random + ')]';
|
||||
$('#text').insertContent(uploadText)
|
||||
let formData = new FormData();
|
||||
formData.append('name', fileName);
|
||||
formData.append('file', file, fileName);
|
||||
$.ajax({
|
||||
url: uploadUrl,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success(res) {
|
||||
$("#text").val($("#text").val().replace(uploadText, '![' + res[1].title + '](' + res[0] + ')'))
|
||||
},
|
||||
error() {
|
||||
$("#text").val($("#text").val().replace(uploadText, '[图片上传失败!(' + random + ')]'))
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 加强评论拦截功能 */
|
||||
Typecho_Plugin::factory('Widget_Feedback')->comment = array('Intercept', 'message');
|
||||
class Intercept
|
||||
@ -78,3 +20,63 @@ class Intercept
|
||||
return $comment;
|
||||
}
|
||||
}
|
||||
|
||||
/* 加强后台编辑器功能 */
|
||||
Typecho_Plugin::factory('admin/write-post.php')->richEditor = array('Editor', 'Edit');
|
||||
Typecho_Plugin::factory('admin/write-page.php')->richEditor = array('Editor', 'Edit');
|
||||
|
||||
class Editor
|
||||
{
|
||||
public static function Edit()
|
||||
{ ?>
|
||||
<script>
|
||||
var JoeUploadURL = '<?php Helper::security()->index('/action/upload'); ?>';
|
||||
</script>
|
||||
<?php
|
||||
/* 编辑器核心 */
|
||||
echo '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/lib/codemirror.min.css">';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/lib/codemirror.min.js"></script>';
|
||||
/* 编辑器语法高亮 */
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/markdown/markdown.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/javascript/javascript.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/css/css.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/xml/xml.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/gfm/gfm.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/pug/pug.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/sass/sass.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/stylus/stylus.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/clike/clike.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/htmlmixed/htmlmixed.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/vue/vue.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/swift/swift.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/sql/sql.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/shell/shell.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/python/python.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/php/php.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/go/go.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/yaml/yaml.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/yaml-frontmatter/yaml-frontmatter.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/mode/meta.min.js"></script>';
|
||||
/* 编辑器附加功能 */
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/edit/continuelist.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/selection/active-line.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/edit/matchbrackets.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/edit/closebrackets.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/selection/selection-pointer.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/display/fullscreen.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/edit/closetag.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/mode/overlay.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/edit/matchtags.min.js"></script>';
|
||||
/* 代码折行 */
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/fold/foldcode.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/fold/foldgutter.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/fold/xml-fold.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/fold/markdown-fold.min.js"></script>';
|
||||
echo '<script src="https://cdn.jsdelivr.net/npm/codemirror@5.59.4/addon/fold/brace-fold.min.js"></script>';
|
||||
/* 引入本地文件 */
|
||||
echo '<link rel="stylesheet" href="/usr/themes/Joe/typecho/editor/css/joe.editor.min.css?v=2021314">';
|
||||
echo '<script src="/usr/themes/Joe/typecho/editor/js/joe.editor.min.js?v=2021314"></script>';
|
||||
echo '<script src="/usr/themes/Joe/typecho/editor/js/joe.constructor.min.js?v=2021314"></script>';
|
||||
echo '<script src="/usr/themes/Joe/typecho/editor/js/joe.instance.min.js?v=2021314"></script>';
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
/* 获取主题当前版本号 */
|
||||
function _getVersion()
|
||||
{
|
||||
return "5.6.6";
|
||||
return "6.0.5";
|
||||
};
|
||||
|
||||
/* 判断是否是手机 */
|
||||
@ -112,8 +111,9 @@ function _getLazyload($type = true)
|
||||
/* 获取头像懒加载图 */
|
||||
function _getAvatarLazyload($type = true)
|
||||
{
|
||||
if ($type) echo "https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/lazyload_avatar.gif";
|
||||
else return "https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/lazyload_avatar.gif";
|
||||
$str = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAC/VBMVEUAAAD87++g2veg2ff++fmg2feg2fb75uag2fag2fag2fag2fag2feg2vah2fef2POg2feg2vag2fag2fag2fag2fag2vah2fag2vb7u3Gg2fag2fb0tLSg2fb3vHig2ff0s7P2wMD0s7Og2fXzs7Pzs7Of2fWh2veh2vf+/v7///+g2vf9/f2e1/ag2fSg2/mg3PT3r6+30tSh2fb+0Hj76ev4u3P6u3K11dr60H3UyKr+/v766On80Hz49vj2xcXm5u3z0IfUx6v2u7vazKTn0pfi6PKg2fbztLT///+g2faf2fag2vf///+g2feg2fe63O6l3vb///+g2fb80Kb8um+x1uD80Hv86er+0Hf73tb0s7P10YX/0Hiq2Or+/v6g2vbe0qL60YT+/v6y1NzuvoS20dSz09ru0Y6z3fTI1MDbxp+h2fag2fb////O4PDuv4XA3/LOz7bh06Du0o/1t7ex3PP+/v6h2ffSzrLdxZ3s5u3/2qag2fb7+/z40NCg2fb9/f2f2PWf2PX0tLT+/v70s7P+/v7M7Pyf1/b1s7P////zs7P0tbWZ2fL20dH+/v7+0Hep2vWl2O+x2/P+/v641tbI1b7C1cf8xpCz0tj1wMD1x8fTya392KPo0ZT56ez4vXbN1bn26Orh0p3x8/jbxZ/CzcT8xo7327DV1tHt0Y7u8/n759661tLyy6L049710IK8z870s7PX1a3xvX/y6OzA1cvBzsXI1cG30dP+38D73Mn/0oX3ysrpwYzv5+zo0pXv5+zH4PDW4e/n5O3+/v786+vN4vP9/f30s7P9/f2f2fSu0er//Pzgu8X///+4zOD////z8/OW0vCq1f+g2fb86er0s7P+z3f8um/+/v72xcX948ym2O/85+T839D8v3v86ej54eH828X+3Kz80qz8w4T8u3Oq2/Wq1ees2Ob64OCx1d/F2N785tv529v94MH82b/1vb382bj93LD91pf91ZH+04b+0X2p2er+2aH8zJ78yZX8yJU3IRXQAAAA1nRSTlMA8PbEz5vhv1X6Y0wzrX9A8/DJt6mHsnH98uzo4NzY19DJwKGAf3tpZmVVSD86LysgIP787ejn4uHf29jW1M3MysnHxcK+vbywn5ONg39wW0AlIBr8+/f29PTx7+rm5eTj4+Df29nX1tLR0dHQz8zKyMXFxcPCwL+9u7u5t7KsqaObmH1wbWBcVVJQSUAwFA34+Pbz8vHx8O7u7ero6Ofl4ODf3t7d3Nvb2djY19fU1NLS0M/NzcrJycjHx8LCwcHAwL68uraxr5SSkId4X1NTNTItFREGybAGmgAABQNJREFUWMOl13N0HEEcwPFp2lzTpElq20jTpLZt27Zt27Zt27b7m9vbpqlt+3Xvdvd2ZncWufv+e+993t7saJFJ0wL8M1UKjJ4yTpyU0QMrZfIPmIa8qLZ/edBU3r+2Z1pY5qGg09DMYVHmsicCwxJljxIXnABMSxBsmcsxAiw1IoclLtQXLOcbau75tYAo1MLPzMsEUSyTsZceolx6Iy86eFB0fS8ZeFQyPS85eFhythcfPC4+y0sIXpRQ6yUGr0qs9vzBy/xpLwC8LsDghXj/YvzApJdgHrmsB4BuzfaXKVkwT6u6+VL1KNXOEBygeNVBrwJlm3LOlj13OEtV6r6BWN10Cc/rwEl9rOMQy1fIYFGbTZk9Mzm5iEYOubYFTKdOPPa/LckpvccP3WLSUnpgPOkIAVb1CnJEGP9xKHXWE8VDpgowekt5PzD+5CDSG8gqLrALaHvdhCP7hnHkQ1Jcyga7OL3YwGgNR/UUY1yHBOvmYouxdbatBRzdRwF84CBrq7+NpQZN91vR3s9HWOifw3wYUyOUE7St4uh+Y6x5xHzALCeaCNo2q8AI7OoZJbJHcSLKDJp+cepXIhb5nATXMcHMKAg0zedUc0buATl1kjLBIOQLmlqqn08RXxAic+PxRYyL5XLS+4rJnhD/+hXzIsraGYhV8j0C00U+kx7yxd937P3BBprqu5fw10dY04Mnn748exKJMRO0oVhA16l3h40u8ef3L5HYqO2DetXTgLGQD1CVFajDOCIi4j02a6HDkb+NGvRR3ZA4Z0OwlcQtd5Hm3pRSO2GOWvKKiLNRNXlSoq7kLsi5arjVCniEuXt3pU68Thxn/T9vEMGVqpOPWinysVTUgrfDIdVetVKygFIeGTxhDm6SwYEUmIU8AZpxUgN7mnqnIL8EHqfPAPKmflDy8syGwSZe3n4wSAJTUfd36ibXWwJPAtiKGINnANo4pHKTdzrqLrxT9PqAUD9D7ywIHUgqgu2omzF5qDR0eWXB1WkDb7W4XneJw1iGPFLIu9c2J9dU+DkJOCunP4A2EGu/1wn2UN+/RoNYH2G+9PIRPBGEnnnZXom4irA+lSAeArnRiHF1SOIe5DklGNyK7kCV6+2r+8qkYX2C5iZ2yI6DG9BcgxIvLXyYBtNbpAASZDllAj3a130WGBWMpAIpkNpyEwTVrnmh3Ja1xYoVG3atFgqtVl7fC2R/9vj4EFz2kKojeaL+VW/FrhTH/NNnFBP0rZExBq/pfMabVeKyvFFIKcxGgNIYpr6asbFdAh9/XlxRBmPaG2cMDdR6tjACJDexONLjXU9ht8vgG3sK1NoN2u27p1bTgFkQVaAK9Btutysg/jA8K6+AQuP8NG+ErqaNAoOz3ZNBORpMN5YWbTWRKvfvcV0erwKbt6bBvvz4YPrLUVNCBQzKxtPg48/pkBrkswWRd2tGCWQwdY3CIki9FBoszfOFa8R1z1fEzFecNlC9Iq8C8YfHvAbkR1ZzH3U6VRaveJN5AqSiQX6yuJVWRrq5RiWgmwJG09bI7iwtL9QtQLwFG5QYIN54XgbZKSCf1QaxsiPDYkPl/tbBYVfi3UEm3Z3AWwfnTkDmjbUEFuddVUUWylrYKtg8K7LU7cszLIEXpyOr1arILzEGj/HnQswUmgyZeimNnpZmTHjIDeRB4WMYZoVx4ciLwqdMypChQroUwmOlq5Ahw6QpZuP2HxxXd11eM9wcAAAAAElFTkSuQmCC";
|
||||
if ($type) echo $str;
|
||||
else return $str;
|
||||
}
|
||||
|
||||
/* 查询文章浏览量 */
|
||||
@ -226,7 +226,7 @@ function _getThumbnails($item)
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$result[] = 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/thumb/' . rand(1, 42) . '.jpg';
|
||||
$result[] = 'https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/thumb/' . rand(1, 42) . '.jpg';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,14 +21,14 @@ function _parseReply($text)
|
||||
$text = preg_replace_callback(
|
||||
'/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/is',
|
||||
function ($match) {
|
||||
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/owo/paopao/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="表情"/>';
|
||||
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="/usr/themes/Joe/assets/owo/paopao/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="表情"/>';
|
||||
},
|
||||
$text
|
||||
);
|
||||
$text = preg_replace_callback(
|
||||
'/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/is',
|
||||
function ($match) {
|
||||
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/owo/aru/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="表情"/>';
|
||||
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="/usr/themes/Joe/assets/owo/aru/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="表情"/>';
|
||||
},
|
||||
$text
|
||||
);
|
||||
|
BIN
favicon.ico
Before Width: | Height: | Size: 9.4 KiB |
@ -17,7 +17,7 @@
|
||||
<!-- 友联页面需要用到的CSS及JS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/prism/prism.js"></script>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
|
||||
</head>
|
||||
|
||||
|
@ -41,7 +41,7 @@ function themeConfig($form)
|
||||
$JFavicon = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JFavicon',
|
||||
NULL,
|
||||
'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/favicon.ico',
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAaVBMVEUAAAA2Jyc2Jyc2Jyc2JyfWngc2Jyc2Jyc2Jyc2Jyc2Jyc2JydGMiSSbhU2Jyc2JydvUhs3Jyc2KCg2JyeYchRWPyCmexE2Jyc2JyfurwOKZhfEkQs2Jyd4Who2KCg2KCg2Jyf9ugD3tgL5+sE2AAAAIHRSTlMA6gsW9vuGMcTQtEb9+JNp+6lQKPz7+55y/fv7OvrZXtrXQoIAAAGdSURBVEjHxdXrcoIwEAXgBSJXi4oXVLwcfP+HbAyRQzrtLE6n0+8XagjZsyHKr8VZwg/ZVjRZhKjx10kOk4qiBBD56yMs7RkFABOLU8O6yE84a+uvLwYoYlHc2+M4pmrTZFZQI5llZfBkjIlmzZ9EGLWi8Nns187SZaTJDJan3umAXFQlcOi9NbASRWMX9Oi9BaDVHd+Arh+dgfr7cXU+KIB1T6elLcO7B9GDFv3Ejt+bbRh95Bjg3NNj//rBjiiD6FPeOnnEwQ6Lh0UXQMXoGcbqWQRL4EKqyc4tGbebqWNI/skcxXtfKjYibMP2uQ6ujjbAdefsw0anvil3Vz8lBqPiyzY2ybCGm5D9TFwR1+SqOYrFqg8L58qNwaqZ6jRXpppxWzKbmjOFnTv48pgNq8nY9HOwMxqeP+V0GXnmNAboFqMPG8jF/VDZSbdBobo0iFIXvntNOmgBfNDVjku9TD0DeArop4zXqYcxc2WqGte5h8O+qf8QS8e9+JqwKbXMUW1e2kT+zKYo8remXzGgeeIIlbwlzeU9SSP/5RPis0lhQ1CXpwAAAABJRU5ErkJggg==',
|
||||
'网站 Favicon 设置',
|
||||
'介绍:用于设置网站 Favicon,一个好的 Favicon 可以给用户一种很专业的观感 <br />
|
||||
格式:图片 URL地址 或 Base64 地址 <br />
|
||||
@ -53,7 +53,7 @@ function themeConfig($form)
|
||||
$JLogo = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JLogo',
|
||||
NULL,
|
||||
'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/logo.png',
|
||||
'data:image/png;base64,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',
|
||||
'网站 Logo 设置',
|
||||
'介绍:用于设置网站 Logo,一个好的 Logo 能为网站带来有效的流量 <br />
|
||||
格式:图片 URL地址 或 Base64 地址 <br />
|
||||
@ -371,7 +371,7 @@ function themeConfig($form)
|
||||
$JAside_Author_Image = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JAside_Author_Image',
|
||||
NULL,
|
||||
"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/aside_author_image.jpg",
|
||||
"https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/img/aside_author_image.jpg",
|
||||
'博主栏背景壁纸 - PC',
|
||||
'介绍:用于修改PC端博主栏的背景壁纸 <br/>
|
||||
格式:图片地址 或 Base64地址'
|
||||
@ -382,7 +382,7 @@ function themeConfig($form)
|
||||
$JAside_Wap_Image = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JAside_Wap_Image',
|
||||
NULL,
|
||||
"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/wap_aside_image.jpg",
|
||||
"https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/img/wap_aside_image.jpg",
|
||||
'博主栏背景壁纸 - WAP',
|
||||
'介绍:用于修改WAP端博主栏的背景壁纸 <br/>
|
||||
格式:图片地址 或 Base64地址'
|
||||
@ -609,7 +609,6 @@ function themeConfig($form)
|
||||
'侧边栏广告 - PC',
|
||||
'介绍:用于设置侧边栏广告 <br />
|
||||
格式:广告图片 || 跳转链接 (中间使用两个竖杠分隔)<br />
|
||||
例如:https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/thumb/1.jpg || https://as.js.cn <br />
|
||||
注意:如果您只想显示图片不想跳转,可填写:广告图片 || javascript:void(0)'
|
||||
);
|
||||
$JADContent->setAttribute('class', 'joe_content joe_aside');
|
||||
@ -644,7 +643,7 @@ function themeConfig($form)
|
||||
$JLazyload = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JLazyload',
|
||||
NULL,
|
||||
"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/lazyload.jpg",
|
||||
"https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/img/lazyload.jpg",
|
||||
'自定义懒加载图',
|
||||
'介绍:用于修改主题默认懒加载图 <br/>
|
||||
格式:图片地址'
|
||||
@ -697,7 +696,7 @@ function themeConfig($form)
|
||||
$JShare_QQ_Image = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JShare_QQ_Image',
|
||||
NULL,
|
||||
"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/link.png",
|
||||
"data:image/png;base64,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",
|
||||
'QQ分享链接图片',
|
||||
'介绍:用于修改在QQ内分享时卡片链接显示的图片 <br/>
|
||||
格式:图片地址'
|
||||
@ -783,7 +782,7 @@ function themeConfig($form)
|
||||
$JFriends = new Typecho_Widget_Helper_Form_Element_Textarea(
|
||||
'JFriends',
|
||||
NULL,
|
||||
'Joe的博客 || https://as.js.cn || https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/link.png || Eternity is not a distance but a decision',
|
||||
'Joe的博客 || https://as.js.cn || https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/img/link.png || Eternity is not a distance but a decision',
|
||||
'友情链接(非必填)',
|
||||
'介绍:用于填写友情链接 <br />
|
||||
注意:您需要先增加友联链接页面(新增独立页面-右侧模板选择友联),该项才会生效 <br />
|
||||
@ -840,17 +839,6 @@ function themeConfig($form)
|
||||
$JLimitOneChinese->setAttribute('class', 'joe_content joe_other');
|
||||
$form->addInput($JLimitOneChinese->multiMode());
|
||||
|
||||
$JPasteUpload = new Typecho_Widget_Helper_Form_Element_Select(
|
||||
'JPasteUpload',
|
||||
array('off' => '关闭(默认)', 'on' => '开启'),
|
||||
'off',
|
||||
'是否开启编辑器粘贴上传图片功能',
|
||||
'介绍:开启后文章编辑器将拥有图片上传功能 <br />
|
||||
其他:Typecho开发版已实现粘贴上传,如果您使用的是开发版,请关闭此项'
|
||||
);
|
||||
$JPasteUpload->setAttribute('class', 'joe_content joe_other');
|
||||
$form->addInput($JPasteUpload->multiMode());
|
||||
|
||||
$JSiteMap = new Typecho_Widget_Helper_Form_Element_Select(
|
||||
'JSiteMap',
|
||||
array(
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* “ Eternity is not a distance but a decision - Joe ” <br /> “ 环境要求:PHP 5.4 + ”
|
||||
* “ Eternity is not a distance but a decision - Joe ” <br /> “ 环境要求:PHP 5.4 ~ 7.2 ”
|
||||
* @package Joe
|
||||
* @author Joe
|
||||
* @link https://as.js.cn
|
||||
@ -13,10 +13,10 @@
|
||||
|
||||
<head>
|
||||
<?php $this->need('public/include.php'); ?>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.index.min.css'); ?>">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@5.4.5/css/swiper.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/swiper@5.4.5/js/swiper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/wowjs@1.1.3/dist/wow.min.js"></script>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.index.min.css'); ?>">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.index.min.js'); ?>"></script>
|
||||
</head>
|
||||
|
||||
|
1438
library/files.php
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "typecho-joe-next",
|
||||
"version": "6.0.5",
|
||||
"description": "A Theme Of Typecho",
|
||||
"main": "index.php",
|
||||
"keywords": [
|
||||
"joe",
|
||||
"typecho",
|
||||
"joe theme",
|
||||
"typecho joe",
|
||||
"typecho joe theme"
|
||||
],
|
||||
"author": "Joe",
|
||||
"license": "ISC"
|
||||
}
|
2
page.php
@ -6,7 +6,7 @@
|
||||
<!-- 独立页面需要用到CSS及JS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/prism/prism.js"></script>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
|
||||
</head>
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
.qmsg.qmsg-wrapper{color:#909399;position:fixed;top:16px;left:0;z-index:9999;width:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:20px}.qmsg .qmsg-item{padding:8px;text-align:center;-webkit-animation-duration:0.3s;animation-duration:0.3s;position:relative}.qmsg .qmsg-item .qmsg-count{position:absolute;left:-4px;top:-4px;background-color:red;color:#fff;font-size:12px;text-align:center;border-radius:2px;min-width:16px;height:16px;line-height:16px;-webkit-animation-duration:0.3s;animation-duration:0.3s}.qmsg .qmsg-item:first-child{margin-top:-8px}.qmsg .qmsg-content{text-align:left;position:relative;display:inline-block;padding:10px 16px;background:#fff;border-radius:4px;box-shadow:0 4px 12px rgba(0,0,0,0.15);pointer-events:all;max-width:80%;min-width:80px}.qmsg .qmsg-content [class^='qmsg-content-']{display:flex;align-items:center}.qmsg .qmsg-content .qmsg-content-with-close{padding-right:20px}.qmsg .qmsg-icon{display:flex;align-items:center;margin-right:8px}.qmsg .qmsg-icon svg{vertical-align:unset;width:20px;height:20px}.qmsg .qmsg-content-info .qmsg-icon{color:#1890ff}.qmsg .qmsg-icon-close{position:absolute;top:11px;right:5px;padding:0;overflow:hidden;font-size:12px;line-height:22px;background-color:transparent;border:none;outline:none;cursor:pointer;color:rgba(0,0,0,0.45);transition:color 0.3s}.qmsg .qmsg-icon-close:hover>svg path{stroke:#555}.qmsg .animate-turn{-webkit-animation:MessageTurn 1s linear infinite;animation:MessageTurn 1s linear infinite}@-webkit-keyframes MessageTurn{0%{-webkit-transform:rotate(0deg)}25%{-webkit-transform:rotate(90deg)}50%{-webkit-transform:rotate(180deg)}75%{-webkit-transform:rotate(270deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes MessageTurn{0%{-webkit-transform:rotate(0deg)}25%{-webkit-transform:rotate(90deg)}50%{-webkit-transform:rotate(180deg)}75%{-webkit-transform:rotate(270deg)}100%{-webkit-transform:rotate(360deg)}}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}@-webkit-keyframes MessageMoveIn{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@keyframes MessageMoveIn{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);-webkit-transform-origin:0 0;transform-origin:0 0;opacity:1}}@-webkit-keyframes MessageShake{0%,100%{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1}25%,75%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:0.75}50%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:0.25}}@keyframes MessageShake{0%,100%{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1}25%,75%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:0.75}50%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:0.25}}
|
@ -1,147 +0,0 @@
|
||||
.qmsg.qmsg-wrapper {
|
||||
color: #909399;
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
line-height: 20px;
|
||||
}
|
||||
.qmsg .qmsg-item {
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
animation-duration: 0.3s;
|
||||
position: relative;
|
||||
}
|
||||
.qmsg .qmsg-item .qmsg-count {
|
||||
position: absolute;
|
||||
left: -4px;
|
||||
top: -4px;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
.qmsg .qmsg-item:first-child {
|
||||
margin-top: -8px;
|
||||
}
|
||||
.qmsg .qmsg-content {
|
||||
text-align: left;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 10px 16px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
pointer-events: all;
|
||||
max-width: 80%;
|
||||
min-width: 80px;
|
||||
}
|
||||
.qmsg .qmsg-content [class^='qmsg-content-'] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
.qmsg .qmsg-content .qmsg-content-with-close {
|
||||
padding-right: 20px;
|
||||
}
|
||||
.qmsg .qmsg-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.qmsg .qmsg-icon svg {
|
||||
vertical-align: unset;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.qmsg .qmsg-content-info .qmsg-icon {
|
||||
color: #1890ff;
|
||||
}
|
||||
.qmsg .qmsg-icon-close {
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
right: 5px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
line-height: 22px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
transition: color 0.3s;
|
||||
}
|
||||
.qmsg .qmsg-icon-close:hover > svg path {
|
||||
stroke: #555;
|
||||
}
|
||||
.qmsg .animate-turn {
|
||||
animation: MessageTurn 1s linear infinite;
|
||||
}
|
||||
@keyframes MessageTurn {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: rotate(90deg);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: rotate(180deg);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: rotate(270deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes MessageMoveOut {
|
||||
0% {
|
||||
max-height: 150px;
|
||||
padding: 8px;
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
max-height: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MessageMoveIn {
|
||||
0% {
|
||||
transform: translateY(-100%);
|
||||
transform-origin: 0 0;
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
transform-origin: 0 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MessageShake {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
25%,
|
||||
75% {
|
||||
transform: translateX(-4px);
|
||||
opacity: 0.75;
|
||||
}
|
||||
50% {
|
||||
transform: translateX(4px);
|
||||
opacity: 0.25;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
"use strict";function polyfill(){function o(o){var t=["MSIE ","Trident/","Edge/"];return new RegExp(t.join("|")).test(o)}function t(o,t){this.scrollLeft=o,this.scrollTop=t}function e(o){return.5*(1-Math.cos(Math.PI*o))}function l(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function r(o,t){return"Y"===t?o.clientHeight+b<o.scrollHeight:"X"===t?o.clientWidth+b<o.scrollWidth:void 0}function i(o,t){var e=u.getComputedStyle(o,null)["overflow"+t];return"auto"===e||"scroll"===e}function n(o){var t=r(o,"Y")&&i(o,"Y"),e=r(o,"X")&&i(o,"X");return t||e}function c(o){for(;o!==m.body&&!1===n(o);)o=o.parentNode||o.host;return o}function s(o){var t,l,r,i=y(),n=(i-o.startTime)/h;n=n>1?1:n,t=e(n),l=o.startX+(o.x-o.startX)*t,r=o.startY+(o.y-o.startY)*t,o.method.call(o.scrollable,l,r),l===o.x&&r===o.y||u.requestAnimationFrame(s.bind(u,o))}function a(o,e,l){var r,i,n,c,a=y();o===m.body?(r=u,i=u.scrollX||u.pageXOffset,n=u.scrollY||u.pageYOffset,c=w.scroll):(r=o,i=o.scrollLeft,n=o.scrollTop,c=t),s({scrollable:r,method:c,startTime:a,startX:i,startY:n,x:e,y:l})}for(var f=0,p=["ms","moz","webkit","o"],d=0;d<p.length&&!window.requestAnimationFrame;++d)window.requestAnimationFrame=window[p[d]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[p[d]+"CancelAnimationFrame"]||window[p[d]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(o,t){var e=(new Date).getTime(),l=Math.max(0,16-(e-f)),r=window.setTimeout(function(){o(e+l)},l);return f=e+l,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(o){clearTimeout(o)});var u=window,m=document;if(!("scrollBehavior"in m.documentElement.style&&!0!==u.__forceSmoothScrollPolyfill__)){var v=u.HTMLElement||u.Element,h=468,w={scroll:u.scroll||u.scrollTo,scrollBy:u.scrollBy,elementScroll:v.prototype.scroll||t,scrollIntoView:v.prototype.scrollIntoView},y=u.performance&&u.performance.now?u.performance.now.bind(u.performance):Date.now,b=o(u.navigator.userAgent)?1:0;u.scroll=u.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?a.call(u,m.body,void 0!==arguments[0].left?~~arguments[0].left:u.scrollX||u.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:u.scrollY||u.pageYOffset):w.scroll.call(u,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:u.scrollX||u.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:u.scrollY||u.pageYOffset))},u.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?w.scrollBy.call(u,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):a.call(u,m.body,~~arguments[0].left+(u.scrollX||u.pageXOffset),~~arguments[0].top+(u.scrollY||u.pageYOffset)))},v.prototype.scroll=v.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var o=arguments[0].left,t=arguments[0].top;a.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");w.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},v.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):w.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},v.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var o=c(this),t=o.getBoundingClientRect(),e=this.getBoundingClientRect();o!==m.body?(a.call(this,o,o.scrollLeft+e.left-t.left,o.scrollTop+e.top-t.top),"fixed"!==u.getComputedStyle(o).position&&u.scrollBy({left:t.left,top:t.top,behavior:"smooth"})):u.scrollBy({left:e.left,top:e.top,behavior:"smooth"})}else w.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:polyfill}:polyfill();
|
5
post.php
@ -3,11 +3,10 @@
|
||||
|
||||
<head>
|
||||
<?php $this->need('public/include.php'); ?>
|
||||
<!-- 文章页需要用到的CSS及JS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.css">
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.post.min.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/prism/prism.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/prism/prism.js"></script>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.post.min.css'); ?>">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.post&page.min.js'); ?>"></script>
|
||||
</head>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.normalize.min.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css'); ?>">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/qmsg/qmsg.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/qmsg/qmsg.css">
|
||||
<?php if ($this->options->JAside_Weather_Key) : ?>
|
||||
<link rel="stylesheet" href="https://apip.weatherdt.com/standard/static/css/weather-standard.css">
|
||||
<?php endif; ?>
|
||||
@ -28,16 +28,16 @@
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/scroll/joe.scroll.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/scroll/joe.scroll.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/lazysizes@5.3.0/lazysizes.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/sketchpad/joe.sketchpad.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/sketchpad/joe.sketchpad.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/qmsg/qmsg.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/js/joe.extend.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/assets/js/joe.extend.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/qmsg/qmsg.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/smooth/joe.smooth.js" async></script>
|
||||
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
|
||||
<script src="<?php $this->options->themeUrl('assets/cursor/' . $this->options->JCursorEffects); ?>" async></script>
|
||||
<?php endif; ?>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js'); ?>"></script>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js'); ?>"></script>
|
||||
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/smooth/joe.smooth.js"></script>
|
||||
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
|
||||
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/cursor/<?php $this->options->JCursorEffects() ?>"></script>
|
||||
<?php endif; ?>
|
||||
<?php $this->options->JCustomHeadEnd() ?>
|
2
typecho/editor/css/joe.editor.min.css
vendored
@ -1,117 +1,343 @@
|
||||
table.typecho-list-table {
|
||||
textarea[name='fields[thumb]'],
|
||||
textarea[name='fields[abstract]'],
|
||||
textarea[name='fields[description]'],
|
||||
textarea[name='fields[video]'] {
|
||||
input[name="fields[keywords]"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
textarea[name="fields[description]"],
|
||||
textarea[name="fields[abstract]"],
|
||||
textarea[name="fields[thumb]"],
|
||||
textarea[name="fields[video]"] {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
}
|
||||
input[name='fields[keywords]'] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
body.fullscreen {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#wmd-button-row {
|
||||
height: auto;
|
||||
.wmd-button {
|
||||
.icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
vertical-align: middle;
|
||||
fill: #9b9b9b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.joe_owo {
|
||||
&__contain {
|
||||
position: relative;
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.seat {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.box {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 0;
|
||||
width: 300px;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
transform: scale(0.5);
|
||||
opacity: 0;
|
||||
transition: visibility, 0.35s, opacity 0.35s, transform 0.35s;
|
||||
&.show {
|
||||
visibility: visible;
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
.scroll {
|
||||
textarea[id="text"],
|
||||
span[class="resize"] {
|
||||
display: none;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: none;
|
||||
padding: 5px;
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 4px;
|
||||
background: #c0c4cc;
|
||||
|
||||
.CodeMirror {
|
||||
&-progress {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 6688;
|
||||
right: 100%;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
border-radius: 1px;
|
||||
background: linear-gradient(to right, #4cd964, #5ac8fa, #007aff);
|
||||
transition: right 1s linear;
|
||||
}
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
&-fullscreen {
|
||||
position: fixed;
|
||||
top: 35px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
z-index: 999;
|
||||
}
|
||||
&:nth-child(3) .item {
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 50%;
|
||||
&-foldmarker {
|
||||
cursor: pointer;
|
||||
padding-left: 3px;
|
||||
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
|
||||
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
|
||||
transition: color 0.25s;
|
||||
user-select: none;
|
||||
}
|
||||
.item {
|
||||
width: 20%;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: background 0.25s;
|
||||
margin: 0;
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
&:hover {
|
||||
background: #f2f6fc;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bar {
|
||||
&-foldgutter {
|
||||
width: 12px;
|
||||
user-select: none;
|
||||
&-open,
|
||||
&-folded {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1px solid #f2f6fc;
|
||||
.item {
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 22px;
|
||||
cursor: pointer;
|
||||
color: var(--routine);
|
||||
transition: background 0.25s;
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAA1ElEQVRIS+3UwQnCMBQG4Bc6gzePnvTiNF1CWnhZQJ0gEHEJXcIRvOgYTpBQSWlCqEleGumthd7Kx5/3/pTBTA+byYUFdpPtRyGlXGumN9jg45+Zi6vY4wGfxuhhcRFHADiZFxs8l+CecccGa5t4q5m+AcCuBPfQV9VVddu2b9cKKWURHkLdKOzRp+Ix9AceFpmVPIUG4RycQqNwCs9Bk3AIH3Zhaum2H6sm+a8YLdQ4JEomDrQFbE+pS0Qm9vCVUkpzzj8Ump04Bxp/k514Kr7AbmJf6nCLF7D+r3IAAAAASUVORK5CYII=);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
&-folded {
|
||||
&::before {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
&.cm-s-joe {
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
||||
background: #2d2d2d;
|
||||
color: #ccc;
|
||||
/* 占位符 */
|
||||
.CodeMirror-placeholder {
|
||||
color: #666;
|
||||
}
|
||||
/* 选择文字时候的颜色 */
|
||||
.CodeMirror-selected {
|
||||
background: rgba(221, 240, 255, 0.2);
|
||||
}
|
||||
/* 行号 */
|
||||
.CodeMirror-gutters {
|
||||
background: #2d2d2d;
|
||||
border-right: none;
|
||||
padding: 0 3px;
|
||||
}
|
||||
/* 行号字体色 */
|
||||
.CodeMirror-linenumber {
|
||||
color: #8f938f;
|
||||
}
|
||||
/* 光标颜色 */
|
||||
.CodeMirror-cursor {
|
||||
border-left: 1px solid #a7a7a7;
|
||||
}
|
||||
/* 当前行高亮 */
|
||||
.CodeMirror-activeline-background {
|
||||
background: rgba(255, 255, 255, 0.031);
|
||||
}
|
||||
/* 括号匹配 */
|
||||
.CodeMirror-matchingbracket {
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
color: #8f938f;
|
||||
margin: -1px -1px 0 -1px;
|
||||
}
|
||||
/* 1 - 6级标题样式 */
|
||||
.cm-header-1,
|
||||
.cm-header-2,
|
||||
.cm-header-3,
|
||||
.cm-header-4,
|
||||
.cm-header-5,
|
||||
.cm-header-6 {
|
||||
font-size: 18px;
|
||||
color: #569cd6 !important;
|
||||
}
|
||||
/* 加粗/倾斜 */
|
||||
.cm-strong,
|
||||
.cm-em {
|
||||
color: #569cd6;
|
||||
}
|
||||
/* 代码高亮样式 */
|
||||
.cm-keyword {
|
||||
color: #cc99cd;
|
||||
}
|
||||
.cm-string {
|
||||
color: #7ec699;
|
||||
}
|
||||
.cm-operator {
|
||||
color: #67cdcc;
|
||||
}
|
||||
.cm-number {
|
||||
color: #f08d49;
|
||||
}
|
||||
.cm-def {
|
||||
color: #f08d49;
|
||||
}
|
||||
.cm-tag {
|
||||
color: #e2777a;
|
||||
}
|
||||
.cm-attribute {
|
||||
color: #e2777a;
|
||||
}
|
||||
.cm-bracket {
|
||||
color: #ccc;
|
||||
}
|
||||
.cm-qualifier {
|
||||
color: #cc99cd;
|
||||
}
|
||||
.cm-property {
|
||||
color: #f8c555;
|
||||
}
|
||||
.cm-comment {
|
||||
color: #666;
|
||||
}
|
||||
/* 文本引用 */
|
||||
.cm-quote {
|
||||
color: #ae81ff;
|
||||
}
|
||||
/* 列表 */
|
||||
.cm-variable-2 {
|
||||
color: #de8e30;
|
||||
}
|
||||
/* 超链接 */
|
||||
.cm-image,
|
||||
.cm-link {
|
||||
color: #f56c6c;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
&-means {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background: #222;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
&.fullscreen {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
&-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
list-style: none;
|
||||
width: 40px;
|
||||
height: 35px;
|
||||
cursor: pointer;
|
||||
border-right: 1px solid #2d2d2d;
|
||||
border-bottom: 1px solid #2d2d2d;
|
||||
box-sizing: border-box;
|
||||
&:hover {
|
||||
background: #2d2d2d;
|
||||
}
|
||||
&.active {
|
||||
background: #f2f6fc;
|
||||
background: #2d2d2d;
|
||||
.CodeMirror-means__dropdown {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) rotateX(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
&__dropdown {
|
||||
position: absolute;
|
||||
top: 42px;
|
||||
left: 50%;
|
||||
z-index: 1000;
|
||||
color: #bfbfbf;
|
||||
background: #222;
|
||||
padding: 5px 0;
|
||||
border-radius: 4px;
|
||||
visibility: hidden;
|
||||
transform-origin: top;
|
||||
opacity: 0;
|
||||
transform: translateX(-50%) rotateX(-90deg);
|
||||
transition: visibility 0.25s, transform 0.25s, opacity 0.25s;
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #222;
|
||||
}
|
||||
&-item {
|
||||
padding: 0 20px;
|
||||
line-height: 34px;
|
||||
transition: background 0.25s;
|
||||
&:hover {
|
||||
color: #f2f2f2;
|
||||
background: #2d2d2d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-dialog {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 6666;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
visibility: hidden;
|
||||
transition: background 0.25s, visibility 0.25s;
|
||||
&__wrapper {
|
||||
width: 380px;
|
||||
background: #fff;
|
||||
color: #606266;
|
||||
border-radius: 4px;
|
||||
opacity: 0;
|
||||
transform: translateY(-30%);
|
||||
transition: opacity 0.25s, transform 0.25s;
|
||||
&-header {
|
||||
padding: 12px 20px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
&-bodyer {
|
||||
padding: 20px;
|
||||
.fitem {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
input {
|
||||
width: auto;
|
||||
flex: 1;
|
||||
-webkit-appearance: none;
|
||||
outline: none;
|
||||
border: 1px solid #dcdfe6;
|
||||
height: 34px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
border-radius: 3px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 0 20px 10px;
|
||||
&--cancle,
|
||||
&--confirm {
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
outline: none;
|
||||
margin-left: 5px;
|
||||
background: #fff;
|
||||
color: #606266;
|
||||
-webkit-appearance: none;
|
||||
padding: 7px 15px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
&--confirm {
|
||||
color: #fff;
|
||||
background: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
visibility: visible;
|
||||
background: rgba(0, 0, 0, 0.75);
|
||||
.CodeMirror-dialog__wrapper {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.CodeMirror {
|
||||
&-dialog {
|
||||
&__wrapper {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
380
typecho/editor/js/joe.constructor.js
Normal file
@ -0,0 +1,380 @@
|
||||
class JoeInstance {
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
$(".CodeMirror-wrap").before('<ul class="CodeMirror-means"></ul>');
|
||||
$(".CodeMirror-wrap").append('<div class="CodeMirror-progress"></div>');
|
||||
$("body").append(`
|
||||
<div class="CodeMirror-dialog">
|
||||
<div class="CodeMirror-dialog__wrapper">
|
||||
<div class="CodeMirror-dialog__wrapper-header"></div>
|
||||
<div class="CodeMirror-dialog__wrapper-bodyer"></div>
|
||||
<div class="CodeMirror-dialog__wrapper-footer">
|
||||
<button class="CodeMirror-dialog__wrapper-footer--cancle">取消</button>
|
||||
<button class="CodeMirror-dialog__wrapper-footer--confirm">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
$(".CodeMirror-dialog__wrapper-footer--cancle").on("click", () => {
|
||||
this.options.cancel();
|
||||
$(".CodeMirror-dialog").removeClass("active");
|
||||
$("body").css("overflow", "");
|
||||
});
|
||||
$(".CodeMirror-dialog__wrapper-footer--confirm").on("click", () => {
|
||||
this.options.confirm();
|
||||
$(".CodeMirror-dialog").removeClass("active");
|
||||
$("body").css("overflow", "");
|
||||
});
|
||||
}
|
||||
|
||||
/* 打开弹窗 */
|
||||
__OpenTheDialog(options = {}) {
|
||||
const _options = {
|
||||
title: "提示",
|
||||
innerHtml: "内容",
|
||||
cancel: () => {},
|
||||
confirm: () => {},
|
||||
};
|
||||
this.options = Object.assign(_options, options);
|
||||
$(".CodeMirror-dialog__wrapper-header").html(this.options.title);
|
||||
$(".CodeMirror-dialog__wrapper-bodyer").html(this.options.innerHtml);
|
||||
$(".CodeMirror-dialog").addClass("active");
|
||||
$("body").css("overflow", "hidden");
|
||||
}
|
||||
|
||||
/* 初始化插入标题功能 - 已测试 √ */
|
||||
initTitleText(tool) {
|
||||
const item = $(`
|
||||
<li class="CodeMirror-means-item" title="${tool.title}">
|
||||
${tool.icon}
|
||||
<div class="CodeMirror-means__dropdown">
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="# "> H1 </div>
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="## "> H2 </div>
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="### "> H3 </div>
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="#### "> H4 </div>
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="##### "> H5 </div>
|
||||
<div class="CodeMirror-means__dropdown-item" data-text="###### "> H6 </div>
|
||||
</div>
|
||||
</li>
|
||||
`);
|
||||
item.on("click", function (e) {
|
||||
e.stopPropagation();
|
||||
$(this).toggleClass("active");
|
||||
});
|
||||
item.on("click", ".CodeMirror-means__dropdown-item", function (e) {
|
||||
e.stopPropagation();
|
||||
const text = $(this).attr("data-text");
|
||||
const cursor = JoeEditor.getCursor();
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection(text);
|
||||
else JoeEditor.replaceSelection("\n\n" + text);
|
||||
item.removeClass("active");
|
||||
JoeEditor.focus();
|
||||
});
|
||||
$(document).on("click", () => item.removeClass("active"));
|
||||
$(".CodeMirror-means").append(item);
|
||||
}
|
||||
|
||||
/* 全屏/取消全屏 - 已测试 √ */
|
||||
handleFullscreen(tool) {
|
||||
const toolsHeight = $(".CodeMirror-means").height();
|
||||
const item = $(
|
||||
`<li class="CodeMirror-means-item" title="${tool.title}">${tool.icon}</li>`
|
||||
);
|
||||
item.on("click", function () {
|
||||
const bool = JoeEditor.getOption("fullScreen");
|
||||
if (bool) {
|
||||
JoeEditor.setOption("fullScreen", false);
|
||||
$(".CodeMirror-wrap").css("top", "");
|
||||
$(".CodeMirror-means").removeClass("fullscreen");
|
||||
$(item).removeClass("active");
|
||||
} else {
|
||||
JoeEditor.setOption("fullScreen", true);
|
||||
$(".CodeMirror-wrap").css("top", toolsHeight);
|
||||
$(".CodeMirror-means").addClass("fullscreen");
|
||||
$(item).addClass("active");
|
||||
}
|
||||
});
|
||||
$(".CodeMirror-means").append(item);
|
||||
}
|
||||
|
||||
/* 加粗 - 已测试 √ */
|
||||
insertBoldText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
JoeEditor.replaceSelection("**" + selection + "**");
|
||||
if (selection === "") JoeEditor.setCursor(cursor.line, cursor.ch + 2);
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 倾斜 - 已测试 √ */
|
||||
insertItalicText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
JoeEditor.replaceSelection("*" + selection + "*");
|
||||
if (selection === "") JoeEditor.setCursor(cursor.line, cursor.ch + 1);
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 删除线 - 已测试 √ */
|
||||
insertDeleteText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
JoeEditor.replaceSelection("~~" + selection + "~~");
|
||||
if (selection === "") JoeEditor.setCursor(cursor.line, cursor.ch + 2);
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 引用 - 已测试 √ */
|
||||
insertQuoteText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
if (cursor.ch === 0) {
|
||||
JoeEditor.replaceSelection("> " + selection);
|
||||
} else {
|
||||
JoeEditor.setCursor(cursor.line, 0);
|
||||
JoeEditor.replaceSelection("> " + selection);
|
||||
JoeEditor.setCursor(cursor.line, cursor.ch + 2);
|
||||
}
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 空格 - 已测试 √ */
|
||||
insertSpaceText() {
|
||||
JoeEditor.replaceSelection(" ");
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 行内代码 - 已测试 √ */
|
||||
insertCodeInlineText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
JoeEditor.replaceSelection("`" + selection + "`");
|
||||
if (selection === "") JoeEditor.setCursor(cursor.line, cursor.ch + 1);
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 横线 - 已测试 √ */
|
||||
insertHrText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection("\n------------\n\n");
|
||||
else JoeEditor.replaceSelection("\n\n------------\n\n");
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 无序列表 - 已测试 √ */
|
||||
insertUnorderedListText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
if (cursor.ch === 0) {
|
||||
if (selection === "") {
|
||||
JoeEditor.replaceSelection("- ");
|
||||
} else {
|
||||
const selectionText = selection.split("\n");
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] =
|
||||
selectionText[i] === "" ? "" : "- " + selectionText[i];
|
||||
}
|
||||
JoeEditor.replaceSelection(selectionText.join("\n"));
|
||||
}
|
||||
} else {
|
||||
if (selection === "") {
|
||||
JoeEditor.replaceSelection("\n- ");
|
||||
} else {
|
||||
const selectionText = selection.split("\n");
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] =
|
||||
selectionText[i] === "" ? "" : "- " + selectionText[i];
|
||||
}
|
||||
JoeEditor.replaceSelection("\n" + selectionText.join("\n"));
|
||||
}
|
||||
}
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 有序列表 - 已测试 √ */
|
||||
insertOrderedListText() {
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const selection = JoeEditor.getSelection();
|
||||
if (cursor.ch === 0) {
|
||||
if (selection === "") {
|
||||
JoeEditor.replaceSelection("1. ");
|
||||
} else {
|
||||
const selectionText = selection.split("\n");
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] =
|
||||
selectionText[i] === ""
|
||||
? ""
|
||||
: i + 1 + ". " + selectionText[i];
|
||||
}
|
||||
JoeEditor.replaceSelection(selectionText.join("\n"));
|
||||
}
|
||||
} else {
|
||||
if (selection === "") {
|
||||
JoeEditor.replaceSelection("\n\n1. ");
|
||||
} else {
|
||||
const selectionText = selection.split("\n");
|
||||
for (let i = 0, len = selectionText.length; i < len; i++) {
|
||||
selectionText[i] =
|
||||
selectionText[i] === ""
|
||||
? ""
|
||||
: i + 1 + ". " + selectionText[i];
|
||||
}
|
||||
JoeEditor.replaceSelection("\n" + selectionText.join("\n"));
|
||||
}
|
||||
}
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 插入时间 - 已测试 √ */
|
||||
insertTimeText() {
|
||||
const time = new Date();
|
||||
const _Year = time.getFullYear();
|
||||
const _Month = String(time.getMonth() + 1).padStart(2, 0);
|
||||
const _Date = String(time.getDate()).padStart(2, 0);
|
||||
const _Hours = String(time.getHours()).padStart(2, 0);
|
||||
const _Minutes = String(time.getMinutes()).padStart(2, 0);
|
||||
const _Seconds = String(time.getSeconds()).padStart(2, 0);
|
||||
const _Day = [
|
||||
"星期日",
|
||||
"星期一",
|
||||
"星期二",
|
||||
"星期三",
|
||||
"星期四",
|
||||
"星期五",
|
||||
"星期六",
|
||||
][time.getDay()];
|
||||
const _time = `${_Year}-${_Month}-${_Date} ${_Hours}:${_Minutes}:${_Seconds} ${_Day}`;
|
||||
const cursor = JoeEditor.getCursor();
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection(_time);
|
||||
else JoeEditor.replaceSelection("\n" + _time);
|
||||
JoeEditor.focus();
|
||||
}
|
||||
|
||||
/* 插入URL链接 - 已测试 √ */
|
||||
insertLinkText() {
|
||||
this.__OpenTheDialog({
|
||||
title: "插入链接",
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>链接标题</label>
|
||||
<input autocomplete="off" name="title" placeholder="请输入链接标题"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>链接地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入链接地址"/>
|
||||
</div>
|
||||
`,
|
||||
confirm() {
|
||||
const title = $(".CodeMirror-dialog input[name='title']").val();
|
||||
const url = $(".CodeMirror-dialog input[name='url']").val();
|
||||
JoeEditor.replaceSelection(
|
||||
`[${title || "默认标题"}](${url || "默认地址"})`
|
||||
);
|
||||
JoeEditor.focus();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/* 插入图片 - 已测试 √ */
|
||||
insertImageText() {
|
||||
this.__OpenTheDialog({
|
||||
title: "插入图片",
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>图片名称</label>
|
||||
<input autocomplete="off" name="title" placeholder="请输入图片名称"/>
|
||||
</div>
|
||||
<div class="fitem">
|
||||
<label>图片地址</label>
|
||||
<input autocomplete="off" name="url" placeholder="请输入图片地址"/>
|
||||
</div>
|
||||
`,
|
||||
confirm() {
|
||||
const title = $(".CodeMirror-dialog input[name='title']").val();
|
||||
const url = $(".CodeMirror-dialog input[name='url']").val();
|
||||
JoeEditor.replaceSelection(
|
||||
`![${title || "默认图片"}](${url || "默认地址"})`
|
||||
);
|
||||
JoeEditor.focus();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/* 插入表格 - 已测试 √ */
|
||||
insertTableText() {
|
||||
this.__OpenTheDialog({
|
||||
title: "插入表格",
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>表格行</label>
|
||||
<input style="width: 50px; flex: none; margin-right: 10px;" value="3" autocomplete="off" name="row"/>
|
||||
<label>表格列</label>
|
||||
<input style="width: 50px; flex: none;" value="3" autocomplete="off" name="column"/>
|
||||
</div>
|
||||
`,
|
||||
confirm() {
|
||||
let row = $(".CodeMirror-dialog input[name='row']").val();
|
||||
let column = $(".CodeMirror-dialog input[name='column']").val();
|
||||
if (isNaN(row)) row = 3;
|
||||
if (isNaN(column)) column = 3;
|
||||
let rowStr = "";
|
||||
let rangeStr = "";
|
||||
let columnlStr = "";
|
||||
for (let i = 0; i < column; i++) {
|
||||
rowStr += "| 表头 ";
|
||||
rangeStr += "| :--: ";
|
||||
}
|
||||
for (let i = 0; i < row; i++) {
|
||||
for (let j = 0; j < column; j++) columnlStr += "| 表格 ";
|
||||
columnlStr += "|\n";
|
||||
}
|
||||
const htmlStr = `${rowStr}|\n${rangeStr}|\n${columnlStr}\n`;
|
||||
const cursor = JoeEditor.getCursor();
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection(htmlStr);
|
||||
else JoeEditor.replaceSelection("\n\n" + htmlStr);
|
||||
JoeEditor.focus();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/* 插入代码块 - 已测试 √ */
|
||||
insertCodeBlockText() {
|
||||
this.__OpenTheDialog({
|
||||
title: "插入代码块",
|
||||
innerHtml: `
|
||||
<div class="fitem">
|
||||
<label>语言类型</label>
|
||||
<input autocomplete="off" name="type" placeholder="请输入语言类型(英文)"/>
|
||||
</div>
|
||||
`,
|
||||
confirm() {
|
||||
const type = $(".CodeMirror-dialog input[name='type']").val();
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const htmlStr = `\`\`\`${
|
||||
type || "html"
|
||||
}\ncode here...\n\`\`\`\n\n`;
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection(htmlStr);
|
||||
else JoeEditor.replaceSelection("\n\n" + htmlStr);
|
||||
JoeEditor.focus();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/* 关于 */
|
||||
handleAbout() {
|
||||
this.__OpenTheDialog({
|
||||
title: "关于",
|
||||
innerHtml: `
|
||||
<ul>
|
||||
<li>文件读取教程(将文件推拽至编辑器即可)</li>
|
||||
<li>图片粘贴上传教程(不支持本地文件复制粘贴,支持网络图片复制、截图等)</li>
|
||||
<li>本编辑器仅为Joe主题使用,未经允许不得移植至其他主题!</li>
|
||||
</ul>
|
||||
`,
|
||||
});
|
||||
}
|
||||
}
|
||||
window.JoeInstance = JoeInstance;
|
1
typecho/editor/js/joe.constructor.min.js
vendored
Normal file
@ -1,233 +1,134 @@
|
||||
$(function () {
|
||||
$('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(开启粘贴上传功能后,支持图片粘贴上传哦~)');
|
||||
$('#wmd-button-bar .wmd-edittab').remove();
|
||||
$('#wmd-button-row .wmd-spacer').remove();
|
||||
$('#wmd-button-row #wmd-code-button').remove();
|
||||
$('#wmd-button-row #wmd-more-button').remove();
|
||||
$('#wmd-fullscreen-button').on('click', function () {
|
||||
$('.fullscreen #text').css('top', $('.fullscreen #wmd-button-bar').outerHeight());
|
||||
});
|
||||
/* 增加自定义功能 */
|
||||
const items = [
|
||||
{
|
||||
title: '默认卡片',
|
||||
id: 'wmd-card-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M928.775 187.554H94.113c-15.364 0-27.822 12.49-27.822 27.895v585.79c0 15.405 12.458 27.895 27.822 27.895h834.662c15.363 0 27.821-12.49 27.821-27.895v-585.79c0-15.405-12.458-27.895-27.821-27.895zm-35.77 577.428H129.882V251.706h763.123v513.276z" fill="#9b9b9b"/><path d="M808.546 380.025H214.352c-11.532 0-20.865 9.37-20.865 20.922v22.323c0 11.55 9.333 20.922 20.865 20.922h594.194c11.522 0 20.867-9.372 20.867-20.922v-22.323c-.001-11.55-9.345-20.922-20.867-20.922zM363.38 636.662H214.352c-11.532 0-20.865 9.356-20.865 20.92v22.312c0 11.564 9.333 20.921 20.865 20.921H363.38c11.534 0 20.866-9.358 20.866-20.921v-22.311c0-11.565-9.332-20.92-20.866-20.92z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '回复可见',
|
||||
id: 'wmd-hide-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M554.667 438.101V277.333h-85.334v160.768l-139.221-80.384-42.667 73.899L426.667 512l-139.222 80.384 42.667 73.899 139.221-80.384v160.768h85.334V585.899l139.221 80.384 42.667-73.899L597.333 512l139.222-80.384-42.667-73.899-139.221 80.384z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '网易云歌单',
|
||||
id: 'wmd-mlist-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M806.3 435.8L553.8 320c-17.4-8-38.2-.9-46.5 15.8l-123.2 248c-8.2-7.9-17.7-14.9-28.8-20-52.3-24-114.8-2.7-139.8 47.5-25 50.2-2.8 110.3 49.4 134.3 52.3 24 114.8 2.7 139.8-47.5l120.5-242.4c8.3-16.7 29.1-23.8 46.5-15.8L698 497.7c17.4 8 24.7 28 16.4 44.7l-78.1 157.1c-8.2-7.9-17.7-14.9-28.8-20-52.3-24-114.8-2.7-139.8 47.5-25 50.2-2.8 110.3 49.4 134.3 52.3 24 114.8 2.7 139.8-47.5l165.7-333.2c8.4-16.8 1.1-36.8-16.3-44.8zM269.7 358c-28.8 17.1-37.8 53.5-19.9 81.2 17.8 27.7 55.7 36.3 84.5 19.1 28.8-17.1 37.8-53.5 19.9-81.2L268 243.4c-5.9-9.2-3-21.3 6.6-27l17.4-10.3c9.6-5.7 12.6-17.9 6.7-27.1L288 162.3c-6-9.2-18.6-12.1-28.2-6.4l-52.2 31c-9.6 5.7-12.6 17.8-6.6 27l88 136.9c-6.6 1.3-13.2 3.6-19.3 7.2z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '网易云音乐',
|
||||
id: 'wmd-music-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M263.715 756.045a111.411 141.312 83.299 1 0 280.693-32.979 111.411 141.312 83.299 1 0-280.693 32.98z" fill="#9b9b9b"/><path d="M497.664 228.966h23.757c13.107 0 23.757 10.65 23.757 23.757V737.28h-47.514V228.966z" fill="#9b9b9b"/><path d="M593.92 294.298c-32.768-14.746-55.706-47.719-55.706-86.426 0-28.672 13.108-54.477 33.383-71.68-42.394 9.42-73.933 47.104-73.933 92.16 0 52.224 41.78 94.413 94.003 94.413h2.253v-28.467z" fill="#9b9b9b"/><path d="M681.984 422.912c0-76.39-61.85-138.24-138.24-138.24-16.18 0-31.744 2.867-46.08 7.782v38.912c9.83-2.457 20.07-3.686 30.72-3.686 71.27 0 129.024 57.754 129.024 129.024 0 24.166-6.758 46.9-18.227 66.15 26.419-25.19 42.803-60.62 42.803-99.942z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: 'HTML代码',
|
||||
id: 'wmd-html-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M832 832V320L640 128H256c-38.4 0-64 25.6-64 64v640c0 38.4 25.6 64 64 64h512c32 0 64-25.6 64-64zM614.4 192L768 352v480H256V192h358.4z" fill="#9b9b9b"/><path d="M550.4 403.2c-12.8 0-25.6 6.4-32 19.2l-51.2 204.8c-6.4 12.8 6.4 25.6 19.2 32h6.4c12.8 0 19.2-6.4 25.6-19.2l51.2-204.8c6.4-12.8-6.4-25.6-19.2-32zm-140.8 38.4c-6.4-12.8-25.6-12.8-38.4 0L300.8 512c-12.8 12.8-12.8 25.6 0 38.4l70.4 70.4c6.4 6.4 12.8 6.4 19.2 6.4 6.4 0 12.8 0 19.2-6.4 12.8-12.8 12.8-25.6 0-38.4l-51.2-51.2 51.2-51.2c12.8-12.8 12.8-32 0-38.4zm256 0c-12.8-12.8-25.6-12.8-38.4 0s-12.8 25.6 0 38.4l51.2 51.2-51.2 51.2c-12.8 12.8-12.8 25.6 0 38.4 6.4 6.4 12.8 6.4 19.2 6.4s12.8 0 19.2-6.4l70.4-70.4c12.8-12.8 12.8-25.6 0-38.4l-70.4-70.4z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: 'H1 ~ H6标题',
|
||||
id: 'wmd-title-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M341.333 213.333v277.334h341.334V213.333H768v640h-85.333V576H341.333v277.333H256v-640h85.333z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '表格',
|
||||
id: 'wmd-table-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1025 1024" xmlns="http://www.w3.org/2000/svg"><path d="M874.725 393.106c4.438 0 8.064-3.627 8.064-8.06v-60.454c0-4.438-3.626-8.063-8.064-8.063H709.484v-167.26c0-4.432-3.627-8.058-8.06-8.058h-64.483c-4.438 0-8.064 3.626-8.064 8.059v167.259H399.152v-167.26c0-4.432-3.626-8.058-8.065-8.058h-64.483c-4.432 0-8.058 3.626-8.058 8.059v167.259H149.27c-4.433 0-8.059 3.625-8.059 8.063v60.455c0 4.432 3.626 8.059 8.059 8.059h169.276v237.789H149.27c-4.433 0-8.059 3.625-8.059 8.058v60.455c0 4.432 3.626 8.063 8.059 8.063h169.276v167.252c0 4.44 3.627 8.065 8.058 8.065h64.483c4.439 0 8.065-3.626 8.065-8.065V707.471h229.725v167.252c0 4.44 3.627 8.065 8.064 8.065h64.483c4.433 0 8.06-3.626 8.06-8.065V707.471h165.24c4.439 0 8.064-3.63 8.064-8.063v-60.455c0-4.433-3.626-8.058-8.063-8.058H709.484v-237.79h165.241zM628.877 630.895H399.152v-237.79h229.725v237.79zm0 0" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '代码段',
|
||||
id: 'wmd-snippet-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M768 128a128 128 0 0 1 128 128v512a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128h512zm0 64H256a64 64 0 0 0-63.84 59.2L192 256v512a64 64 0 0 0 59.2 63.84l4.8.16h512a64 64 0 0 0 63.84-59.2l.16-4.8V256a64 64 0 0 0-59.2-63.84L768 192zM562.08 328.064a32 32 0 0 1 21.344 36.8l-.96 3.616-94.88 288a32 32 0 0 1-61.76-16.416l.96-3.616 94.88-288a32 32 0 0 1 40.416-20.384zm-183.68 35.36a32 32 0 0 1 8.608 41.44l-2.24 3.36-77.28 103.04 77.312 103.04a32 32 0 0 1-3.36 42.24l-3.04 2.56a32 32 0 0 1-42.208-3.296l-2.592-3.072-91.712-122.24a32 32 0 0 1-2.304-34.88l2.304-3.52 91.712-122.24a32 32 0 0 1 44.8-6.4zm267.2 0a32 32 0 0 1 42.208 3.36l2.624 3.04 91.68 122.24 2.304 3.52a32 32 0 0 1 0 31.36l-2.304 3.52-91.68 122.24-2.624 3.104a32 32 0 0 1-38.816 5.536l-3.36-2.24-3.072-2.56a32 32 0 0 1-5.568-38.848l2.24-3.36 77.28-103.072-77.28-103.04-2.24-3.36a32 32 0 0 1 8.64-41.44z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '行内代码',
|
||||
id: 'wmd-code-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M920.887 527.046l-206.45 206.45c-8.142 8.146-21.347 8.146-29.493 0l-29.493-29.493c-8.146-8.142-8.146-21.347 0-29.493l162.213-162.213-162.212-162.208c-8.146-8.146-8.146-21.351 0-29.497l29.493-29.493c8.146-8.146 21.351-8.146 29.493 0l206.45 206.45c8.15 8.146 8.15 21.351-.001 29.497zM434.759 857.498l-37.643-10.54c-10.394-2.911-16.788-13.193-14.281-22.969L550.47 179.251c2.682-10.01 13.877-15.712 25.001-12.73l40.287 10.794c11.128 2.982 17.973 13.514 15.287 23.528L458.12 845.068c-2.511 9.777-12.967 15.341-23.361 12.43zm-66.214-153.495l-29.493 29.493c-8.142 8.146-21.347 8.146-29.493 0l-206.45-206.45c-8.146-8.146-8.146-21.351 0-29.497l206.45-206.45c8.146-8.146 21.351-8.146 29.493 0l29.493 29.493c8.146 8.146 8.146 21.351 0 29.497L206.332 512.297 368.545 674.51c8.146 8.146 8.146 21.351 0 29.493z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '缩进空格',
|
||||
id: 'wmd-nbsp-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M192 672h640v-96h64v256h-64v-96H192v96h-64V576h64v96zm285.504-480h69.056l141.504 370.176h-64.896l-33.664-92.8H434.496l-33.664 92.8H336L477.504 192zm-24.832 227.584h118.656l-58.048-162.24h-2.048l-58.56 162.24z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '删除线',
|
||||
id: 'wmd-delete-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M926.952 468.969H566.87a1576.89 1576.89 0 0 0-29.776-5.655c-14.986-2.733-20.923-3.861-29.026-5.467-48.343-9.424-77.465-18.848-100.649-32.228-33.073-19.317-49.187-45.518-49.187-80.195 0-34.87 14.323-63.798 41.464-83.87 26.761-19.791 64.834-30.255 110.066-30.255 51.642 0 91.51 13.575 118.551 40.336 13.759 13.57 23.844 30.25 29.97 49.567 1.223 3.865 2.636 9.424 4.054 16.777.846 4.524 4.9 7.726 9.326 7.726h68.608c5.273 0 9.516-4.335 9.516-9.516v-.944c-.659-6.41-1.224-11.402-1.886-15.079-6.88-40.994-26.385-76.991-56.258-103.942-41.84-38.169-103.38-58.24-177.826-58.24-68.134 0-129.48 17.057-172.739 47.965-24.125 17.343-42.785 38.827-55.223 63.798-12.723 25.539-19.128 55.039-19.128 87.548 0 27.801 5.37 51.361 16.304 72.09 7.817 14.799 18.469 27.803 32.131 39.583H97.66c-4.145 0-7.536 3.39-7.536 7.537v56.542c0 4.15 3.392 7.542 7.536 7.542h408.242c1.978.377 3.671.754 5.558 1.132 29.118 5.838 46.65 9.796 62.764 14.324 21.673 6.124 38.261 12.53 52.02 20.26 33.737 19.037 50.229 46.365 50.229 83.87 0 33.264-14.61 62.952-41.091 83.682-28.741 22.525-71.244 34.304-122.98 34.304-41.18 0-76.045-8.01-103.849-23.559-27.423-15.36-46.27-37.506-56.26-65.497-.75-2.07-1.602-4.9-2.546-8.48-1.127-4.146-4.992-7.068-9.137-7.068H265.5c-5.279 0-9.516 4.335-9.516 9.52v.94c.19 2.167.378 3.962.567 5.374 6.124 45.987 28.552 83.682 66.624 111.953 44.384 32.795 106.863 50.134 180.748 50.134 79.347 0 145.879-18.66 192.431-53.998 23.56-17.808 41.653-39.766 53.81-65.023 12.25-25.538 18.562-54.565 18.562-86.227 0-29.968-5.462-55.032-16.772-76.71-5.466-10.556-12.345-20.26-20.545-29.026H926.95c4.15 0 7.541-3.392 7.541-7.537v-56.543c.001-4.054-3.39-7.445-7.54-7.445zm0 0" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '任务列表',
|
||||
id: 'wmd-task-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M593.92 215.04c112.64 0 204.8 92.16 204.8 204.8v204.8c0 112.64-92.16 204.8-204.8 204.8h-204.8c-112.64 0-204.8-92.16-204.8-204.8v-204.8c0-112.64 92.16-204.8 204.8-204.8h204.8m0-51.2h-204.8c-143.36 0-256 112.64-256 256v204.8c0 143.36 112.64 256 256 256h204.8c143.36 0 256-112.64 256-256v-204.8c0-138.24-112.64-256-256-256z" fill="#9b9b9b"/><path d="M527.36 762.88L230.4 460.8l76.8-61.44 174.08 133.12c71.68-81.92 230.4-250.88 445.44-384l20.48 40.96C747.52 373.76 583.68 634.88 527.36 762.88m0 0" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: 'DPlayer视频',
|
||||
id: 'wmd-dplayer-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M858.88 244.48H676.864l61.184-61.184a25.6 25.6 0 0 0-36.096-36.096l-97.536 97.28H421.888l-97.28-97.28a25.6 25.6 0 0 0-36.352 0 25.6 25.6 0 0 0 0 36.096l61.184 61.184H167.68a25.6 25.6 0 0 0-25.6 25.6v490.752a25.6 25.6 0 0 0 25.6 25.6h691.2a25.6 25.6 0 0 0 25.6-25.6V270.08a25.6 25.6 0 0 0-25.6-25.6zm-25.6 490.752h-640V295.68h640zm-89.6 97.024h-460.8a25.6 25.6 0 0 0 0 51.2h460.8a25.6 25.6 0 1 0 0-51.2z" fill="#9b9b9b"/><path d="M439.808 623.104a25.6 25.6 0 0 0 12.8 3.584 25.6 25.6 0 0 0 12.8-3.584l171.008-98.56a25.6 25.6 0 0 0 0-44.544l-171.008-98.56a25.6 25.6 0 0 0-38.4 22.016v197.632a25.6 25.6 0 0 0 12.8 22.016zM478.208 448l94.208 54.272-94.208 54.272z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: 'BiliBili视频',
|
||||
id: 'wmd-bili-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M776.192 239.552H640.8l61.344-61.344c10.592-10.592 10.592-25.376 0-35.968s-25.376-10.592-35.968 0L562.528 245.92H460.992l-103.68-103.648c-8.448-10.592-21.152-12.704-33.856-6.336-2.112 0-2.112 2.112-4.224 4.224-10.592 10.592-10.592 25.376 0 35.968l63.456 63.456H247.296c-74.048 0-135.392 61.344-135.392 135.392V711.36c0 71.936 61.344 133.28 135.392 133.28h21.152c0 25.376 21.152 44.416 44.416 44.416s44.416-21.152 44.416-44.416H670.4c2.112 25.376 23.264 44.416 48.672 42.304a45.504 45.504 0 0 0 42.304-42.304h16.928c74.048 0 135.392-61.344 135.392-135.392V372.864c-2.112-74.048-63.456-133.28-137.504-133.28zm-4.256 522.56H255.712c-27.488 0-48.672-23.264-50.784-50.784l-2.112-342.72a51.52 51.52 0 0 1 50.784-50.784h516.224c27.488 0 48.672 23.264 50.784 50.784l2.112 342.72c-2.112 29.6-23.264 50.784-50.784 50.784zM422.88 434.176l12.704 63.456-169.248 31.744-12.704-63.456 169.248-31.744zm162.88 63.488l12.704-63.456 169.248 31.744-12.704 63.456-169.248-31.744zm33.856 133.28c0 2.112 0 6.336-2.112 8.448-10.592 23.264-33.856 38.08-61.344 40.192a59.456 59.456 0 0 1-44.416-21.152c-12.704 12.704-27.488 21.152-44.416 21.152a77.344 77.344 0 0 1-61.344-40.192c0-2.112-2.112-4.224-2.112-8.448 0-8.448 6.336-14.816 14.816-16.928h2.112c6.336 0 10.592 2.112 12.704 8.448 0 0 16.928 23.264 31.744 23.264 29.632 0 29.632-25.376 46.528-44.416 19.04 21.152 19.04 44.416 46.528 44.416 19.04 0 31.744-23.264 31.744-23.264 2.112-4.224 8.448-8.448 12.704-8.448 8.448-2.112 14.816 4.224 16.928 12.704v4.224h.032z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '点击复制',
|
||||
id: 'wmd-copy-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M817.521 690.221H766.6V333.78c0-40.735-35.644-76.38-76.38-76.38H333.779v-50.921H690.22c71.289 0 127.3 56.012 127.3 127.3V690.22z" fill="#9b9b9b"/><path d="M639.3 817.521H282.859c-40.735 0-76.38-35.644-76.38-76.38V384.7c0-40.735 35.644-76.38 76.38-76.38H639.3c40.735 0 76.38 35.644 76.38 76.38v356.441c0 40.735-35.644 76.38-76.38 76.38zm-356.441-458.28c-15.277 0-25.461 10.185-25.461 25.46v356.441c0 15.277 10.185 25.461 25.461 25.461H639.3c15.277 0 25.46-10.185 25.46-25.461V384.701c0-15.277-10.185-25.46-25.46-25.46H282.859z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '居中标题',
|
||||
id: 'wmd-mtitle-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M921.6 460.8H655.36c-20.48-61.44-76.8-102.4-143.36-102.4s-122.88 40.96-143.36 102.4H102.4c-30.72 0-51.2 20.48-51.2 51.2s20.48 51.2 51.2 51.2h266.24c20.48 61.44 76.8 102.4 143.36 102.4s122.88-40.96 143.36-102.4H921.6c30.72 0 51.2-20.48 51.2-51.2s-20.48-51.2-51.2-51.2zM512 563.2c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2 51.2 20.48 51.2 51.2-20.48 51.2-51.2 51.2z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '消息提示',
|
||||
id: 'wmd-message-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M669.133 281.6a307.456 307.456 0 0 0-428.083 0 295.68 295.68 0 0 0 31.744 445.44v27.085a29.645 29.645 0 0 0 59.29 0v-40.397a30.72 30.72 0 0 0-1.076-7.526 30.157 30.157 0 0 0-12.442-18.893 236.493 236.493 0 0 1-104.345-196.403c0-130.56 110.745-236.8 241.305-236.8s241.306 106.24 241.306 236.8c0 6.195 0 12.646-.666 19.097a235.52 235.52 0 0 1-104.96 178.176 30.362 30.362 0 0 0-12.646 32.205v33.946a29.645 29.645 0 0 0 59.29 0V727.5a299.213 299.213 0 0 0 76.185-84.838 291.277 291.277 0 0 0 40.96-128c.666-7.936.87-15.872.87-23.808A295.117 295.117 0 0 0 669.134 281.6zM513.485 880.333l-118.938.87a29.747 29.747 0 1 0 .615 59.443l118.937-.87a29.747 29.747 0 1 0-.614-59.443zm89.958-75.981h-298.24a29.645 29.645 0 0 0 0 59.238h298.24a29.645 29.645 0 0 0 0-59.238z" fill="#666"/><path d="M485.325 342.118a29.542 29.542 0 0 0-29.645-29.798A178.688 178.688 0 0 0 277.3 490.906a29.645 29.645 0 0 0 59.289 0A118.938 118.938 0 0 1 455.68 371.968a29.747 29.747 0 0 0 29.645-29.85z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '便条按钮',
|
||||
id: 'wmd-anote-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M910.222 227.556A113.778 113.778 0 0 1 1024 341.333v341.334a113.778 113.778 0 0 1-113.778 113.777H113.778A113.778 113.778 0 0 1 0 682.667V341.333a113.778 113.778 0 0 1 113.778-113.777h796.444zm0 56.888H113.778a56.889 56.889 0 0 0-56.89 56.89v341.333a56.889 56.889 0 0 0 56.89 56.889h796.444a56.889 56.889 0 0 0 56.89-56.89V341.334a56.889 56.889 0 0 0-56.89-56.889zm-627.996 85.448c25.486 0 45.938 5.83 61.326 17.521 15.388 11.663 23.097 29.327 23.097 52.964 0 14.336-3.527 26.624-10.553 36.835-7.026 10.24-17.067 18.12-30.066 23.695v.796c17.522 3.698 30.806 12.004 39.822 24.889 9.017 12.885 13.54 29.013 13.54 48.384 0 11.15-1.991 21.56-5.973 31.26-3.983 9.672-10.24 18.063-18.717 25.088-8.505 7.026-19.37 12.601-32.654 16.726-13.284 4.124-29.07 6.172-47.388 6.172H144.043v-284.33h138.183zm345.258 0V412.9h-90.396v241.322H487.31V412.9h-89.998v-43.008h230.172zm83.627 0l129.82 209.464h.797V369.892h47.388v284.33h-52.565L707.13 445.156h-1.195v209.066h-47.388v-284.33h52.565zM281.828 524.8H193.82v88.804h88.008c15.132 0 26.88-3.926 35.242-11.748 8.363-7.822 12.544-18.916 12.544-33.252 0-14.08-4.181-24.888-12.544-32.455-8.362-7.566-20.11-11.349-35.242-11.349zm-6.77-114.29H193.82v78.45h81.238c11.946 0 21.902-3.385 29.866-10.155s11.947-16.526 11.947-29.269c0-14.336-3.584-24.434-10.752-30.265-7.168-5.831-17.522-8.76-31.061-8.76z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '多彩按钮',
|
||||
id: 'wmd-abtn-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M360 651c-74.1 0-134.3-60.3-134.3-134.3 0-74.1 60.3-134.3 134.3-134.3s134.3 60.3 134.3 134.3c0 74-60.2 134.3-134.3 134.3zm0-204.6c-38.8 0-70.3 31.5-70.3 70.3S321.2 587 360 587s70.3-31.5 70.3-70.3-31.5-70.3-70.3-70.3z" fill="#9b9b9b"/><path d="M666.9 778.9H360c-70 0-135.9-27.3-185.4-76.8S97.8 586.7 97.8 516.7s27.3-135.9 76.8-185.4S290 254.5 360 254.5h306.9c70 0 135.9 27.3 185.4 76.8s76.8 115.4 76.8 185.4-27.3 135.9-76.8 185.4-115.3 76.8-185.4 76.8zM360 318.5c-109.3 0-198.2 88.9-198.2 198.2S250.7 714.9 360 714.9h306.9c109.3 0 198.2-88.9 198.2-198.2s-88.9-198.2-198.2-198.2H360z" fill="#9b9b9b"/></svg>'
|
||||
},
|
||||
{
|
||||
title: '时间轴',
|
||||
id: 'wmd-timeline-button',
|
||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="10" height="10"><path d="M312.584 565.872V444.936c33.752-14.064 56.248-45 56.248-81.56s-22.504-67.504-56.248-78.752V138.376c0-16.872-11.248-28.128-28.128-28.128s-28.128 11.248-28.128 28.128v146.248c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v120.936c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v149.064c0 16.872 11.248 28.128 28.128 28.128s28.128-11.248 28.128-28.128V723.376c33.752-11.248 56.248-42.184 56.248-78.752s-22.496-67.496-56.248-78.752zm-28.128-230.624c16.872 0 28.128 11.248 28.128 28.128s-11.248 28.128-28.128 28.128-28.128-11.248-28.128-28.128 11.256-28.128 28.128-28.128zm0 337.504c-16.872 0-28.128-11.248-28.128-28.128s11.248-28.128 28.128-28.128 28.128 11.248 28.128 28.128-11.248 28.128-28.128 28.128zm476.416 8H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128H760.88c16.952 0 33.904-11.248 33.904-28.128s-13.56-28.128-33.912-28.128zM828.696 287h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128S849.032 287 828.696 287zm-67.824 168.752c16.952 0 33.904-11.248 33.904-28.128s-13.552-28.128-33.904-28.128H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h271.216zm67.824 112.496h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128s-13.56-28.128-33.896-28.128z" fill="#9b9b9b"/></svg>'
|
||||
}
|
||||
];
|
||||
$("head").append(
|
||||
`<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover">`
|
||||
);
|
||||
|
||||
/* 用于设置插入到文章的短代码内容 */
|
||||
function getInsertTextById(id) {
|
||||
let str = '';
|
||||
switch (id) {
|
||||
case 'wmd-card-button':
|
||||
str = `\n{card-default width="100%" label="默认标题"}\n ${$('#text').selectionRange() ? $('#text').selectionRange() : '默认内容'}\n{/card-default}\n`;
|
||||
break;
|
||||
case 'wmd-hide-button':
|
||||
str = `\n{hide}\n ${$('#text').selectionRange() ? $('#text').selectionRange() : '默认隐藏的内容'}\n{/hide}\n`;
|
||||
break;
|
||||
case 'wmd-mlist-button':
|
||||
str = `\n{music-list id="网易云歌单ID" width="100%" height="450px" autoplay="autoplay" /}\n`;
|
||||
break;
|
||||
case 'wmd-music-button':
|
||||
str = `\n{music id="网易云歌曲ID" width="100%" height="86px" autoplay="autoplay" /}\n`;
|
||||
break;
|
||||
case 'wmd-html-button':
|
||||
str = `\n!!!\n<span class="test">Hello Joe</span>\n<style>\n .test { color: #ff6800 }\n</style>\n!!!\n`;
|
||||
break;
|
||||
case 'wmd-title-button':
|
||||
str = `\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n`;
|
||||
break;
|
||||
case 'wmd-table-button':
|
||||
str = `\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n`;
|
||||
break;
|
||||
case 'wmd-snippet-button':
|
||||
str = `\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n`;
|
||||
break;
|
||||
case 'wmd-code-button':
|
||||
str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `;
|
||||
break;
|
||||
case 'wmd-nbsp-button':
|
||||
str = ' ';
|
||||
break;
|
||||
case 'wmd-delete-button':
|
||||
str = ` ~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~ `;
|
||||
break;
|
||||
case 'wmd-task-button':
|
||||
str = `{x} 任务已完成\n{ } 任务未完成`;
|
||||
break;
|
||||
case 'wmd-dplayer-button':
|
||||
str = `\n{dplayer src="M3U8或MP4地址" /}\n`;
|
||||
break;
|
||||
case 'wmd-bili-button':
|
||||
str = `\n{bilibili bvid="哔哩哔哩的Bvid" /}\n`;
|
||||
break;
|
||||
case 'wmd-copy-button':
|
||||
str = `{copy text="默认文本"}${$('#text').selectionRange() ? $('#text').selectionRange() : '点击复制'}{/copy}`;
|
||||
break;
|
||||
case 'wmd-mtitle-button':
|
||||
str = `\n{mtitle}${$('#text').selectionRange() ? $('#text').selectionRange() : '居中标题'}{/mtitle}\n`;
|
||||
break;
|
||||
case 'wmd-message-button':
|
||||
str = `\n{message type="success|info|warning|error(选择其一)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '提示内容'}{/message}\n`;
|
||||
break;
|
||||
case 'wmd-anote-button':
|
||||
str = `{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info(选择其一)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '便条按钮'}{/anote}`;
|
||||
break;
|
||||
case 'wmd-abtn-button':
|
||||
str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(最大17.5px)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`;
|
||||
break;
|
||||
case 'wmd-timeline-button':
|
||||
str = `\n{timeline}\n {timeline-item}时间轴内容{/timeline-item}\n {timeline-item}时间轴内容{/timeline-item}\n{/timeline}\n`;
|
||||
break;
|
||||
window.JoeEditor = CodeMirror.fromTextArea(
|
||||
document.querySelector("textarea#text"),
|
||||
{
|
||||
theme: "joe",
|
||||
mode: "gfm",
|
||||
/* Tab大小 */
|
||||
indentUnit: 4,
|
||||
/* 显示行号 */
|
||||
lineNumbers: true,
|
||||
/* 超出宽度自动换行 */
|
||||
lineWrapping: true,
|
||||
/* 当前行背景高亮 */
|
||||
styleActiveLine: true,
|
||||
/* 匹配括号 */
|
||||
matchBrackets: true,
|
||||
/* 自动闭合括号 */
|
||||
autoCloseBrackets: true,
|
||||
/* 自动闭合标签 */
|
||||
autoCloseTags: true,
|
||||
/* 折行 */
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
/* 匹配标签 */
|
||||
matchTags: { bothTags: true },
|
||||
/* 按键 */
|
||||
extraKeys: {
|
||||
/* 换行时自动联想输入的类型 */
|
||||
Enter: "newlineAndIndentContinueMarkdownList",
|
||||
/* 匹配标签 */
|
||||
"Ctrl-J": "toMatchingTag",
|
||||
},
|
||||
/* 双击鼠标选中后,可以拖拽被选择的文本 */
|
||||
selectionPointer: true,
|
||||
}
|
||||
return str;
|
||||
}
|
||||
/* 此处无需修改 */
|
||||
items.forEach(_ => {
|
||||
let item = $(`<li class="wmd-button" id="${_.id}" title="${_.title}">${_.svg}</li>`);
|
||||
item.on('mousedown', () => $('#text').insertContent(getInsertTextById(_.id)));
|
||||
$('#wmd-button-row').append(item);
|
||||
);
|
||||
|
||||
/* 设置高度 */
|
||||
JoeEditor.setSize("100%", "550");
|
||||
|
||||
/* 实时预览 */
|
||||
JoeEditor.on("change", function () {
|
||||
// console.log(JoeEditor.getValue());
|
||||
});
|
||||
|
||||
/* 节流,防止傻逼疯狂ctrl + v上传 */
|
||||
let _flag = false;
|
||||
/* 实现粘贴上传图片 */
|
||||
JoeEditor.on("paste", function (editor, event) {
|
||||
let clipboardData =
|
||||
event.clipboardData ||
|
||||
window.clipboardData ||
|
||||
event.originalEvent.clipboardData;
|
||||
if (!clipboardData || !clipboardData.items) return;
|
||||
let items = clipboardData.items;
|
||||
let file = null;
|
||||
if (items.length === 0) return;
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (items[i].kind === "file" && items[i].type.match(/^image/)) {
|
||||
event.preventDefault(), (file = items[i].getAsFile());
|
||||
}
|
||||
}
|
||||
if (!file) return;
|
||||
/* 节流,防止傻逼疯狂ctrl + v上传 */
|
||||
if (_flag) return;
|
||||
_flag = true;
|
||||
let uploadUrl = JoeUploadURL;
|
||||
let cid = $('input[name="cid"]').val();
|
||||
cid && (uploadUrl = uploadUrl + "&cid=" + cid);
|
||||
let random = Date.now().toString(36);
|
||||
let fileName = random + ".png";
|
||||
let formData = new FormData();
|
||||
formData.append("name", fileName);
|
||||
formData.append("file", file, fileName);
|
||||
$.ajax({
|
||||
url: 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.owo.json',
|
||||
url: uploadUrl,
|
||||
method: "post",
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
xhr: () => {
|
||||
let xhr = $.ajaxSettings.xhr();
|
||||
if (!xhr.upload) return;
|
||||
$(".CodeMirror-progress").show();
|
||||
xhr.upload.addEventListener(
|
||||
"progress",
|
||||
(e) => {
|
||||
let percent = (e.loaded / e.total) * 100;
|
||||
$(".CodeMirror-progress").css("right", -percent + "%");
|
||||
},
|
||||
false
|
||||
);
|
||||
return xhr;
|
||||
},
|
||||
success(res) {
|
||||
let barStr = '';
|
||||
let scrollStr = '';
|
||||
for (let key in res) {
|
||||
barStr += `<div class="item" data-index="${res[key].index}">${key}</div>`;
|
||||
scrollStr += `
|
||||
<ul class="scroll" data-index="${res[key].index}">
|
||||
${res[key].container.map(_ => `<li class="item" data-text="${_.data}">${_.icon}</li>`).join('')}
|
||||
</ul>
|
||||
`;
|
||||
}
|
||||
$('#wmd-button-row').append(`
|
||||
<li class="wmd-button joe_owo__contain" title="插入表情">
|
||||
<div class="seat">
|
||||
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M512 160c194.4 0 352 157.6 352 352S706.4 864 512 864 160 706.4 160 512s157.6-352 352-352zm0 64a288 288 0 1 0 0 576 288 288 0 0 0 0-576zm122.08 326.624l61.024 19.264a191.488 191.488 0 0 1-28.736 56.288A191.744 191.744 0 0 1 512 704a191.744 191.744 0 0 1-179.648-124.096l-3.456-10.016 61.024-19.264a127.19 127.19 0 0 0 19.136 37.44A127.744 127.744 0 0 0 512 640a127.744 127.744 0 0 0 119.264-81.408l2.816-8zM400 352a48 48 0 1 1 0 96 48 48 0 0 1 0-96zm224 0a48 48 0 1 1 0 96 48 48 0 0 1 0-96z" fill="#9b9b9b"/></svg>
|
||||
</div>
|
||||
<div class="box">
|
||||
${scrollStr}
|
||||
<div class="bar">${barStr}</div>
|
||||
</div>
|
||||
</li>
|
||||
`);
|
||||
$(document).on('click', function () {
|
||||
$('.joe_owo__contain .box').removeClass('show');
|
||||
});
|
||||
$('.joe_owo__contain .seat').on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
$(this).siblings('.box').toggleClass('show');
|
||||
});
|
||||
$('.joe_owo__contain .box .bar .item').on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
const scrollIndx = '.joe_owo__contain .box .scroll[data-index="' + $(this).attr('data-index') + '"]';
|
||||
$(scrollIndx).show().siblings('.scroll').hide();
|
||||
});
|
||||
/* 点击表情,向文本框插入内容 */
|
||||
$('.joe_owo__contain .scroll .item').on('click', function () {
|
||||
const text = $(this).attr('data-text');
|
||||
$('#text').insertContent(text);
|
||||
});
|
||||
/* 默认激活第一个 */
|
||||
$('.joe_owo__contain .box .bar .item').first().click();
|
||||
}
|
||||
const text = `![${res[1].title}](${res[0]})`;
|
||||
let timer = setTimeout(function () {
|
||||
$(".CodeMirror-progress").hide();
|
||||
$(".CodeMirror-progress").css("right", "100%");
|
||||
/* 节流,防止傻逼疯狂ctrl + v上传 */
|
||||
_flag = false;
|
||||
const cursor = JoeEditor.getCursor();
|
||||
if (cursor.ch === 0) JoeEditor.replaceSelection(text);
|
||||
else JoeEditor.replaceSelection("\n\n" + text);
|
||||
JoeEditor.focus();
|
||||
clearTimeout(timer);
|
||||
}, 1000);
|
||||
},
|
||||
error() {
|
||||
let timer = setTimeout(function () {
|
||||
$(".CodeMirror-progress").hide();
|
||||
$(".CodeMirror-progress").css("right", "100%");
|
||||
/* 节流,防止傻逼疯狂ctrl + v上传 */
|
||||
_flag = false;
|
||||
clearTimeout(timer);
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Typecho.insertFileToEditor = function (file, url, isImage) {
|
||||
const htmlStr = isImage
|
||||
? "![" + file + "](" + url + ")"
|
||||
: "[" + file + "](" + url + ")";
|
||||
const cursor = JoeEditor.getCursor();
|
||||
const n = cursor.ch === 0 ? "" : "\n";
|
||||
JoeEditor.replaceSelection(n + htmlStr);
|
||||
JoeEditor.focus();
|
||||
};
|
||||
});
|
||||
|
2
typecho/editor/js/joe.editor.min.js
vendored
1
typecho/editor/js/joe.extend.min.js
vendored
@ -1 +0,0 @@
|
||||
(function(e){e.fn.extend({insertContent:function(t,n){var a=e(this)[0];if(document.selection){this.focus();var s=document.selection.createRange();s.text=t,this.focus(),s.moveStart("character",-i);var c=s.text.length;if(2==arguments.length){var i=a.value.length;s.moveEnd("character",c+n),n<=0?s.moveStart("character",c-2*n-t.length):s.moveStart("character",c-n-t.length),s.select()}}else if(a.selectionStart||"0"==a.selectionStart){var o=a.selectionStart,r=a.selectionEnd,l=a.scrollTop;a.value=a.value.substring(0,o)+t+a.value.substring(r,a.value.length),this.focus(),a.selectionStart=o+t.length,a.selectionEnd=o+t.length,a.scrollTop=l,2==arguments.length&&(a.setSelectionRange(o-n,a.selectionEnd+n),this.focus())}else this.value+=t,this.focus()},selectionRange:function(e,t){var n="",a=this[0];if(void 0===e)n=/input|textarea/i.test(a.tagName)&&/firefox/i.test(navigator.userAgent)?a.value.substring(a.selectionStart,a.selectionEnd):document.selection?document.selection.createRange().text:document.getSelection().toString();else{if(!/input|textarea/.test(a.tagName.toLowerCase()))return!1;if(void 0===t&&(t=e),a.setSelectionRange)a.setSelectionRange(e,t),this.focus();else{var s=a.createTextRange();s.move("character",e),s.moveEnd("character",t-e),s.select()}}return void 0===e?n:this}})})(jQuery);
|
199
typecho/editor/js/joe.instance.js
Normal file
@ -0,0 +1,199 @@
|
||||
$(function () {
|
||||
const Joe = new JoeInstance();
|
||||
[
|
||||
{
|
||||
type: "bold",
|
||||
title: "文本加粗",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 469.333h192a106.667 106.667 0 1 0 0-213.333h-192v213.333zm426.667 192a192 192 0 0 1-192 192H256V170.667h277.333a192 192 0 0 1 138.923 324.522A191.915 191.915 0 0 1 768 661.333zM341.333 554.667V768H576a106.667 106.667 0 1 0 0-213.333H341.333z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "italic",
|
||||
title: "文本倾斜",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M640 853.333H298.667V768h124.885l90.283-512H384v-85.333h341.333V256H600.448l-90.283 512H640z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
title: "文本删除",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M731.904 597.333c9.813 22.016 14.763 46.507 14.763 73.387 0 57.259-22.358 102.059-67.03 134.272-44.757 32.213-106.496 48.341-185.301 48.341-69.973 0-139.221-16.256-207.787-48.81v-96.256c64.854 37.418 131.2 56.149 199.083 56.149 108.843 0 163.413-31.232 163.797-93.739a94.293 94.293 0 0 0-27.648-68.394l-5.12-4.992H128v-85.334h768v85.334H731.904zm-173.995-128H325.504a174.336 174.336 0 0 1-20.523-22.272c-18.432-23.808-27.648-52.565-27.648-86.442 0-52.736 19.883-97.579 59.606-134.528 39.808-36.95 101.29-55.424 184.533-55.424 62.763 0 122.837 13.994 180.139 41.984v91.818c-51.2-29.312-107.307-43.946-168.363-43.946-105.813 0-158.677 33.365-158.677 100.096 0 17.92 9.301 33.536 27.904 46.89 18.602 13.355 41.557 23.979 68.821 32 26.453 7.68 55.339 17.664 86.613 29.824z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "space",
|
||||
title: "空格",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M170.667 384v170.667h682.666V384h85.334v213.333A42.667 42.667 0 0 1 896 640H128a42.667 42.667 0 0 1-42.667-42.667V384h85.334z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "code-inline",
|
||||
title: "行内代码",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M723.2 361.13l60.33-60.33L994.73 512l-211.2 211.2-60.33-60.33L874.027 512 723.2 361.13zm-422.4 0L149.973 512 300.8 662.87l-60.33 60.33L29.27 512l211.2-211.2 60.33 60.33z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "hr",
|
||||
title: "横线",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M85.333 469.333h85.334v85.334H85.333v-85.334zm170.667 0h512v85.334H256v-85.334zm597.333 0h85.334v85.334h-85.334v-85.334z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "quote",
|
||||
title: "文本引用",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M195.541 739.03C151.595 692.351 128 640 128 555.135c0-149.333 104.832-283.179 257.28-349.355l38.101 58.795c-142.293 76.97-170.112 176.853-181.205 239.83 22.912-11.862 52.907-16 82.304-13.27 76.97 7.125 137.643 70.315 137.643 148.864a149.333 149.333 0 0 1-149.334 149.333 165.163 165.163 0 0 1-117.248-50.304zm426.667 0c-43.947-46.678-67.541-99.03-67.541-183.894 0-149.333 104.832-283.179 257.28-349.355l38.101 58.795c-142.293 76.97-170.112 176.853-181.205 239.83 22.912-11.862 52.906-16 82.304-13.27 76.97 7.125 137.642 70.315 137.642 148.864a149.333 149.333 0 0 1-149.333 149.333 165.163 165.163 0 0 1-117.248-50.304z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
title: "超链接",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M879.2 131.6c-103-95.5-264.1-88-361.4 11.2L474.7 184c-13.1 13.1-3.7 35.6 13.1 37.5 26.2 1.9 52.4 7.5 78.7 15 7.5 1.9 16.9 0 22.5-5.6l9.4-9.4c54.3-54.3 142.3-59.9 198.5-11.2 63.7 54.3 65.5 151.7 7.5 209.7L662 562.3c-18.7 18.7-41.2 30-63.7 37.5-30 7.5-61.8 5.6-89.9-5.6-16.9-7.5-33.7-16.9-48.7-31.8-7.5-7.5-13.1-15-18.7-24.3-7.5-13.1-24.3-15-33.7-3.7l-52.4 52.4c-7.5 7.5-7.5 18.7-1.9 28.1 7.5 11.2 16.9 20.6 26.2 30 13.1 13.1 30 26.2 44.9 35.6 26.2 16.9 56.2 28.1 86.1 33.7 58.1 11.2 121.7 1.9 174.2-26.2 20.6-11.2 41.2-26.2 58.1-43.1l142.3-142.3c104.9-103.2 101.2-271.8-5.6-371zM534.7 803.9l-39.3-5.6s-26.2-5.6-39.3-11.2c-7.5-1.9-16.9 0-22.5 5.6l-9.4 9.4c-54.3 54.3-142.3 59.9-198.5 11.2-63.7-54.3-65.5-151.7-7.5-209.7l142.3-142.3c18.7-18.7 41.2-30 63.7-37.5 30-7.5 61.8-5.6 89.9 5.6 16.9 7.5 33.7 16.9 48.7 31.8 7.5 7.5 13.1 15 18.7 24.3 7.5 13.1 24.3 15 33.7 3.7l52.4-52.4c7.5-7.5 7.5-18.7 1.9-28.1-7.5-11.2-16.9-20.6-26.2-30-13.1-13.1-28.1-26.2-44.9-35.6-26.2-16.9-56.2-28.1-88-33.7-58.1-11.2-121.7-1.9-174.2 26.2-20.6 11.2-41.2 26.2-58.1 43.1L141.4 515.5c-99.3 99.3-106.7 260.3-11.2 361.4C229.5 985.5 398 987.4 501 884.4l46.8-46.8c13.1-9.4 3.7-31.9-13.1-33.7z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "image",
|
||||
title: "插入图片",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M46.545 977.455V46.545h930.91v930.91zm93.091-186.182v93.09h744.728V717.918l-214.11-228.305zm0-107.055l548.585-311.854 196.143 209.454V139.636H139.636zm99.282-376.227a82.758 82.758 0 0 1 82.758-82.758 82.758 82.758 0 0 1 82.757 82.758 82.758 82.758 0 0 1-82.757 82.805 82.804 82.804 0 0 1-82.758-82.898z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "ordered-list",
|
||||
title: "有序列表",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 170.667H896V256H341.333v-85.333zm-128-42.667v128H256v42.667H128V256h42.667v-85.333H128V128h85.333zM128 597.333V490.667h85.333v-21.334H128v-42.666h128v106.666h-85.333v21.334H256v42.666H128zM213.333 832H128v-42.667h85.333V768H128v-42.667h128V896H128v-42.667h85.333V832zm128-362.667H896v85.334H341.333v-85.334zm0 298.667H896v85.333H341.333V768z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "title",
|
||||
title: "标题",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="22" height="22"><path d="M256 213.333h104.875v267.094h324.48V213.333h104.874v640H685.355V570.07h-324.48v283.264H256z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "unordered-list",
|
||||
title: "无序列表",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M341.333 170.667H896V256H341.333v-85.333zM192 277.333a64 64 0 1 1 0-128 64 64 0 0 1 0 128zM192 576a64 64 0 1 1 0-128 64 64 0 0 1 0 128zm0 294.4a64 64 0 1 1 0-128 64 64 0 0 1 0 128zm149.333-401.067H896v85.334H341.333v-85.334zm0 298.667H896v85.333H341.333V768z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
|
||||
{
|
||||
type: "undo",
|
||||
title: "撤销",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M76 463.7l294.8 294.9c19.5 19.4 52.8 5.6 52.8-21.9V561.5c202.5-8.2 344.1 59.5 501.6 338.3 8.5 15 31.5 7.9 30.6-9.3-30.5-554.7-453-571.4-532.3-569.6v-174c0-27.5-33.2-41.3-52.7-21.8L75.9 420c-12 12.1-12 31.6.1 43.7z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "redo",
|
||||
title: "回退",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M946.8 420L651.9 125.1c-19.5-19.5-52.7-5.7-52.7 21.8v174c-79.3-1.8-501.8 14.9-532.3 569.6-.9 17.2 22.1 24.3 30.6 9.3C255 621 396.6 553.3 599.1 561.5v175.2c0 27.5 33.3 41.3 52.8 21.9l294.8-294.9c12.1-12.1 12.1-31.6.1-43.7z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
|
||||
{
|
||||
type: "table",
|
||||
title: "表格",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M892.8 108h-763c-26.2 0-47.5 21.3-47.5 47.5v714c0 26.2 21.3 47.5 47.5 47.5h763c26.2 0 47.5-21.3 47.5-47.5v-714c0-26.2-21.3-47.5-47.5-47.5zm-291 294.7v172.1H411.7V402.7h190.1zm76 0h186.5v172.1H677.8V402.7zM864.3 184v142.7h-706V184h706zM158.4 841V402.7h177.3v172.1H159.8v76h175.9v188.9h76V650.8h190.1v188.9h76V650.8h186.5V841H158.4z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "code-block",
|
||||
title: "代码块",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M958.17 447.4L760.69 249.92l-65.82 65.83 197.47 197.47L694.87 710.7l65.82 65.82 197.48-197.47 65.83-65.83zM263.3 249.92L65.82 447.4 0 513.22l65.82 65.83L263.3 776.52l65.82-65.82-197.47-197.48 197.47-197.47zm79.947 699.563L590.96 52.19l89.72 24.768-247.713 897.295z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "time",
|
||||
title: "当前时间",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.163 1023.69a511.838 511.838 0 1 1 511.527-511.528 512.148 512.148 0 0 1-511.527 511.528zm0-930.05a418.833 418.833 0 1 0 418.522 418.522A419.143 419.143 0 0 0 512.163 93.641z" fill="#bfbfbf"/><path d="M509.683 233.148q46.502 0 46.502 46.503v279.014q0 46.502-46.502 46.502-46.503 0-46.503-46.502V279.651q0-46.503 46.503-46.503z" fill="#bfbfbf"/><path d="M674.172 734.953q-32.883 32.882-65.765 0l-131.529-131.53q-32.882-32.88 0-65.764 32.882-32.882 65.765 0l131.53 131.53q32.881 32.881 0 65.764z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "clean",
|
||||
title: "清屏",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M479.3 863.6L899.9 443c37.4-37.4 37.4-98.3 0-135.8L716.7 124.1C698.5 106 674.4 96 648.7 96c-25.8 0-50.4 10.8-68.6 29l-455 455c-18.2 18.2-29 42.8-29 68.6 0 25.7 9.9 49.9 28.1 68l183.1 183.2c18.1 18.1 42.2 28.1 67.9 28.1 3 0 5.9-.1 8.8-.4v.1h512c17.7 0 32-14.3 32-32s-14.3-32-32-32H479.3zm-126.8-9L169.4 671.5c-6-6-9.4-14.1-9.4-22.6 0-8.5 3.3-16.6 9.4-22.6l104.9-104.9 228.4 228.4-104.9 104.8c-6 6-14.1 9.4-22.6 9.4-8.6 0-16.6-3.3-22.7-9.4z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "fullscreen",
|
||||
title: "全屏/取消全屏",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M181.2 803.4V637H98v208c0 45.9 37.2 83.2 83.2 83.2h208V845H222.8c-23 0-41.6-18.6-41.6-41.6zM844.8 98.6h-208v83.2h166.4c23 0 41.6 18.6 41.6 41.6v166.4H928v-208c0-46-37.3-83.2-83.2-83.2zm-746.6 83v208h83.2V223.2c0-23 18.6-41.6 41.6-41.6h166.4V98.4h-208c-46 0-83.2 37.3-83.2 83.2zm746.4 455.6v166.4c0 23-18.6 41.6-41.6 41.6H636.6v83.2h208c45.9 0 83.2-37.2 83.2-83.2v-208h-83.2z" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
{
|
||||
type: "about",
|
||||
title: "关于",
|
||||
icon:
|
||||
'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M881.6 512.1c0 203.7-165.7 369.5-369.5 369.5S142.6 715.8 142.6 512.1s165.7-369.5 369.5-369.5 369.5 165.8 369.5 369.5m77.7 0c0-246.6-200.6-447.2-447.2-447.2S64.9 265.5 64.9 512.1s200.6 447.2 447.2 447.2 447.2-200.6 447.2-447.2M582.5 318.2c9-9 14.2-21.6 14.2-34.3 0-12.8-5.2-25.4-14.2-34.4s-21.6-14.2-34.4-14.2c-12.7 0-25.3 5.2-34.3 14.2-9.1 9-14.3 21.6-14.3 34.4 0 12.7 5.2 25.3 14.3 34.3 9 9 21.5 14.3 34.3 14.3s25.3-5.3 34.4-14.3m-96.6 464.3c-7.6 0-15.2-2.6-21.3-7.5-9.9-7.9-14.5-20.7-12.1-33.1l47.9-243.1-26.4 14.8c-16.4 9.2-37.1 3.4-46.3-13-9.2-16.4-3.4-37.1 12.9-46.3l90.7-51.1c11.6-6.5 25.9-5.7 36.6 2.1 10.8 7.8 16 21.1 13.4 34.1l-49.6 251.9 40.7-17.7c17.2-7.5 37.3.4 44.8 17.6 7.5 17.2-.4 37.3-17.6 44.8l-100.2 43.7c-4.3 1.9-8.9 2.8-13.5 2.8" fill="#bfbfbf"/></svg>',
|
||||
},
|
||||
].forEach((tool) => {
|
||||
if (tool.type === "title") {
|
||||
Joe.initTitleText(tool);
|
||||
} else if (tool.type === "fullscreen") {
|
||||
Joe.handleFullscreen(tool);
|
||||
} else {
|
||||
const item = $(
|
||||
`<li class="CodeMirror-means-item" title="${tool.title}">${tool.icon}</li>`
|
||||
);
|
||||
item.on("click", () => {
|
||||
switch (tool.type) {
|
||||
case "bold":
|
||||
Joe.insertBoldText();
|
||||
break;
|
||||
case "italic":
|
||||
Joe.insertItalicText();
|
||||
break;
|
||||
case "delete":
|
||||
Joe.insertDeleteText();
|
||||
break;
|
||||
case "quote":
|
||||
Joe.insertQuoteText();
|
||||
break;
|
||||
case "space":
|
||||
Joe.insertSpaceText();
|
||||
break;
|
||||
case "code-inline":
|
||||
Joe.insertCodeInlineText();
|
||||
break;
|
||||
case "hr":
|
||||
Joe.insertHrText();
|
||||
break;
|
||||
case "unordered-list":
|
||||
Joe.insertUnorderedListText();
|
||||
break;
|
||||
case "ordered-list":
|
||||
Joe.insertOrderedListText();
|
||||
break;
|
||||
case "undo":
|
||||
JoeEditor.undo();
|
||||
JoeEditor.focus();
|
||||
break;
|
||||
case "redo":
|
||||
JoeEditor.redo();
|
||||
JoeEditor.focus();
|
||||
break;
|
||||
case "clean":
|
||||
JoeEditor.setValue("");
|
||||
JoeEditor.focus();
|
||||
break;
|
||||
case "time":
|
||||
Joe.insertTimeText();
|
||||
break;
|
||||
case "link":
|
||||
Joe.insertLinkText();
|
||||
break;
|
||||
case "image":
|
||||
Joe.insertImageText();
|
||||
break;
|
||||
case "table":
|
||||
Joe.insertTableText();
|
||||
break;
|
||||
case "code-block":
|
||||
Joe.insertCodeBlockText();
|
||||
break;
|
||||
case "about":
|
||||
Joe.handleAbout();
|
||||
break;
|
||||
}
|
||||
});
|
||||
$(".CodeMirror-means").append(item);
|
||||
}
|
||||
});
|
||||
});
|