Skip to content

Commit

Permalink
修改实例名为windsCkEditor,避免用editor与其它冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
awinds committed May 16, 2023
1 parent 841f53a commit b708d5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package WindsCkEditor
* @author 小A
* @version 1.0.1
* @version 1.0.2
* @link http://lijian.net
*/
class WindsCkEditor_Plugin implements Typecho_Plugin_Interface
Expand Down Expand Up @@ -83,8 +83,8 @@ public static function reInsert($post) {
Typecho.insertFileToEditor = function (file, url, isImage) {
var textHtml = isImage ? "<img src='"+url+"' alt='"+file+"' />" :
"<a href='"+ url +"'>" + file + "</a>";
if(editor && typeof editor.insertHtml == 'function') {
editor.insertHtml(textHtml);
if(windsCkEditor && typeof windsCkEditor.insertHtml == 'function') {
windsCkEditor.insertHtml(textHtml);
}
}
});
Expand All @@ -110,7 +110,7 @@ public static function render($post)
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ){
CKEDITOR.tools.enableHtml5Elements( document );
}
var editor = CKEDITOR.replace('text', {
var windsCkEditor = CKEDITOR.replace('text', {
language : "zh-cn",
filebrowserUploadMethod: "form",
filebrowserUploadUrl : "{$manage}/upload.php?type=Files",
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Typecho1.2编辑器插件,集成最新CkEditor4.21编辑器。
支持代码插入,支持图片,附件上传(使用系统集成的附件上传)。
支持原有附件点击添加到编辑器中
支持原有附件点击添加到编辑器中,建议大家使用原有附件管理,这样好管理文件,编辑器中上传的附件管理不了。

github:[https://github.com/awinds/WindsCkEditor](https://github.com/awinds/WindsCkEditor)

Expand All @@ -25,8 +25,9 @@ github:[https://github.com/awinds/WindsCkEditor](https://github.com/awinds/Win

- 图片上传使用toolbar上`图像`,附件上传使用toolbar上`插入/编辑超链接`,需要在`设置-允许上传的文件类型`中打开上传的类型。

- v1.0.1增加了自定义按钮插件more,可以点击插入<!--more-->,因为在wysiwyg模式下会插入到<p></p>中间,改到只能在Source模式下插入
- v1.0.1 增加了自定义按钮插件more,可以点击插入`<!--more-->`,因为在wysiwyg模式下会插入到`<p></p>`中间,改到只能在Source模式下插入

- v1.0.2 去掉了插件中的语言包(只留了中英文)。修改实例名为`windsCkEditor`,避免用`editor`与其它冲突,其实一个页面一般不太可能有多个编辑器,我听劝。

### 默认配置
```
Expand Down

0 comments on commit b708d5c

Please sign in to comment.