提交 a5843309 编写于 作者: C Catouse

* improve kindeditor and update it's document.

上级 90add688
......@@ -5032,10 +5032,12 @@
if(self.afterFocus) {
self.afterFocus.call(self, e);
}
self.container.addClass('focus');
}).blur(function(e) {
if(self.afterBlur) {
self.afterBlur.call(self, e);
}
self.container.removeClass('focus');
});
}
......@@ -5752,8 +5754,8 @@
options.pluginsPath = _undef(options.pluginsPath, options.basePath + 'plugins/');
if(_undef(options.loadStyleMode, K.options.loadStyleMode)) {
var themeType = _undef(options.themeType, K.options.themeType);
_loadStyle('kindeditor.min.css');
_loadStyle(options.themesPath + themeType + '/' + themeType + '.css');
_loadStyle(options.basePath + '/kindeditor.min.css');
// _loadStyle(options.themesPath + themeType + '/' + themeType + '.css');
}
function create(editor) {
......
此差异已折叠。
......@@ -956,10 +956,11 @@
"icon": "icon-edit",
"desc": "使用Kineditor来编辑富文本",
"name": "富文本编辑器",
"update": "1.5.0",
"topics": [{
"name": "类型"
"name": "默认模式"
}, {
"name": "变化"
"name": "简单模式"
}],
"filter": "fuwenbenbianjiqi fwbbjq"
}, {
......
......@@ -13,15 +13,48 @@ ZUI 推荐的富文本编辑器是 [Kindeditor](http://kindeditor.net/)。
## 默认模式
<div class="example">
<example>
<textarea id="content" name="content" class="form-control kindeditor" style="height:150px;">Hello, world!</textarea>
</div>
</example>
```html
<textarea id="content" name="content" class="form-control kindeditor" style="height:150px;">Hello, world!</textarea>
```
```javascript
KindEditor.create('textarea.kindeditor', {
basePath: '/dist/lib/kindeditor/',
allowFileManager : true,
bodyClass : 'article-content'
});
```
## 简单模式
<div class="example">
自定义工具栏,禁用文件上传。
<example>
<textarea id="contentSimple" name="content" class="form-control kindeditorSimple" style="height:150px;">Hello, world!</textarea>
</div>
</example>
```html
<textarea id="contentSimple" name="content" class="form-control kindeditorSimple" style="height:150px;">Hello, world!</textarea>
```
```javascript
KindEditor.create('textarea.kindeditor', {
basePath: '/dist/lib/kindeditor/',
bodyClass : 'article-content',
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link'
]
});
```
<script>
function onPageLoad() {
......@@ -34,9 +67,7 @@ function afterPageLoad() {
K.create('textarea.kindeditor', {
basePath: '/dist/lib/kindeditor/',
allowFileManager : true,
bodyClass : 'article-content',
afterBlur: function(){$('#content').prev('.ke-container').removeClass('focus');},
afterFocus: function(){$('#content').prev('.ke-container').addClass('focus');}
bodyClass : 'article-content'
});
K.create('textarea.kindeditorSimple', {
......@@ -46,11 +77,10 @@ function afterPageLoad() {
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
afterBlur: function(){$('#contentSimple').prev('.ke-container').removeClass('focus');},
afterFocus: function(){$('#contentSimple').prev('.ke-container').addClass('focus');}
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link'
]
});
}
setTimeout($.doc.stopPageLoading, 500);
......
......@@ -159,7 +159,7 @@
display: block;
}
.ke-toolbar-icon-url {
background-image: url(default.png);
background-image: url(themes/default/default.png);
}
.ke-toolbar {
......@@ -249,8 +249,7 @@
.ke-statusbar-center-icon,
.ke-statusbar-right-icon {
height: 11px;
background-image: url(default.png);
background-image: url(themes/default/default.png);
}
.ke-statusbar-center-icon {
background-position: -0px -754px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册