From 5b986cea0e75272fe9d69b1f89d1f50da6e30160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=81=92?= <2323333339@qq.com> Date: Thu, 4 Feb 2021 13:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 1 - core/factory.php | 1 + core/short.php | 6 +-- index.php | 2 + public/include.php | 4 +- typecho/editor/joe.editor.css | 2 +- typecho/editor/joe.editor.js | 76 +++++++++++++++++++++++++++------- typecho/editor/joe.editor.scss | 7 +++- typecho/editor/joe.extend.js | 60 +++++++++++++++++++++++++++ 9 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 typecho/editor/joe.extend.js diff --git a/core/core.php b/core/core.php index c9c1218..861e275 100644 --- a/core/core.php +++ b/core/core.php @@ -18,7 +18,6 @@ require_once('factory.php'); /* 页面加载计时 */ _startCountTime(); - /* 主题初始化 */ function themeInit($self) { diff --git a/core/factory.php b/core/factory.php index d415a58..833a595 100644 --- a/core/factory.php +++ b/core/factory.php @@ -8,6 +8,7 @@ class Editor public static function edit() { echo ""; + echo ""; echo ""; } } diff --git a/core/short.php b/core/short.php index 5293217..0a37022 100644 --- a/core/short.php +++ b/core/short.php @@ -3,7 +3,7 @@ function _parseShortCode($content) { /* 过滤网易云音乐歌单 */ - if (preg_match('/\[music-list\s{0,}id="\d{0,}"\s{0,}\/]/', $content)) { + if (preg_match('/\[music-list\s{0,}id="\d{0,}"\s{0,}\/\]/', $content)) { $content = preg_replace( '/\[music-list\s{0,}id="(\d{0,})"\s{0,}\/]/', '', @@ -11,9 +11,9 @@ function _parseShortCode($content) ); } /* 过滤网易云音乐单首歌 */ - if (preg_match('/\[music\s{0,}id="\d{0,}"\s{0,}\/]/', $content)) { + if (preg_match('/\[music\s{0,}id="\d{0,}"\s{0,}\/\]/', $content)) { $content = preg_replace( - '/\[music\s{0,}id="(\d{0,})"\s{0,}\/]/', + '/\[music\s{0,}id="(\d{0,})"\s{0,}\/\]/', '', $content ); diff --git a/index.php b/index.php index 388447d..c2e4c27 100644 --- a/index.php +++ b/index.php @@ -16,6 +16,8 @@ need('public/include.php'); ?> + + diff --git a/public/include.php b/public/include.php index 15c06ee..1e2a979 100644 --- a/public/include.php +++ b/public/include.php @@ -55,7 +55,6 @@ - @@ -65,10 +64,9 @@ - - + \ No newline at end of file diff --git a/typecho/editor/joe.editor.css b/typecho/editor/joe.editor.css index ae2fd3e..022660d 100644 --- a/typecho/editor/joe.editor.css +++ b/typecho/editor/joe.editor.css @@ -1 +1 @@ -table.typecho-list-table textarea[name='fields[thumb]'],table.typecho-list-table textarea[name='fields[abstract]']{width:100%;height:80px}#wmd-button-row{height:auto} +table.typecho-list-table textarea[name='fields[thumb]'],table.typecho-list-table textarea[name='fields[abstract]']{width:100%;height:80px}#wmd-button-row{height:auto}#wmd-button-row .wmd-button .icon{width:20px;height:20px;vertical-align:middle;fill:#9b9b9b} diff --git a/typecho/editor/joe.editor.js b/typecho/editor/joe.editor.js index 35194fe..083772e 100644 --- a/typecho/editor/joe.editor.js +++ b/typecho/editor/joe.editor.js @@ -1,18 +1,64 @@ $(function () { - $('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(支持图片粘贴上传)') - $('#wmd-button-bar .wmd-edittab').remove() - $('#wmd-button-row .wmd-spacer').remove() + $('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(支持图片粘贴上传)'); + $('#wmd-button-bar .wmd-edittab').remove(); + $('#wmd-button-row .wmd-spacer').remove(); - /* 增加自定义功能 */ - const items = [ - { - title: '回复可见', - id: 'wmd-hide-button' - } - ] + /* 增加自定义功能 */ + const items = [ + { + title: '回复可见', + id: 'wmd-hide-button', + svg: '' + }, + { + title: '网易云歌单', + id: 'wmd-mlist-button', + svg: '' + }, + { + title: '网易云音乐', + id: 'wmd-music-button', + svg: '' + }, + { + title: 'BiliBili视频', + id: 'wmd-bili-button', + svg: '' + }, + { + title: 'DPlayer视频', + id: 'wmd-dplayer-button', + svg: '' + } + ]; - items.forEach(_ => { - let item = `