javascript – 一个页面中的多个CKEditor
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javascript – 一个页面中的多个CKEditor,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2554字,纯文字阅读大概需要4分钟。
内容图文
![javascript – 一个页面中的多个CKEditor](/upload/InfoBanner/zyjiaocheng/767/82f877084bb04b2bb01993f6196a684d.jpg)
我试图将两个CKEditor放在同一页面上
这就是我做的
首先是ckeditor config.js
CKEDITOR.editorConfig = function( config ) {
config.language = 'en';
// config.uiColor = '#AADC6E';
CKEDITOR.stylesSet.add('my_custom_style', [
{ name: 'Page Title', element: 'h2', attributes: {'class': 'general-title min'} }
]);
//Config the KCFinder
config.filebrowserImageBrowseUrl = "/laravel-filemanager?type=Images";
config.filebrowserImageUploadUrl = "/laravel-filemanager/upload?type=Images&_token=";
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'forms', groups: [ 'forms' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
'/',
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'others', groups: [ 'others' ] },
{ name: 'about', groups: [ 'about' ] }
];
config.removeButtons = 'Save,NewPage,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Flash,Language,About';
};
然后我在同一页面上有这两个表格,她有textarea
<form>
<div class="form-group">
{!! Form::label('details', 'Details') !!}
{!! Form::textarea('details', '', array('class'=>'form-control', 'placeholder'=>'Enter Details...', 'rows'=>3)) !!}
<script>
CKEDITOR.replace('details');
</script>
</div>
</form>
第二个
<form>
<div class="form-group">
{!! Form::label('intro', 'Intro') !!}
{!! Form::textarea('intro', '', array('class'=>'form-control', 'placeholder'=>'Enter Details...', 'rows'=>3)) !!}
<script>
CKEDITOR.replace( 'intro');
</script>
</div>
</form>
the first one working fine but the second didn’t appear.
解决方法:
我发现这里出了什么问题
CKEDITOR.stylesSet.add('my_custom_style', [
{ name: 'Page Title', element: 'h2', attributes: {'class': 'general-title min'} }
]);
这是我的风格,它不应该在主CKEDITOR.editorConfig内,它应该在外面,它的工作正常
CKEDITOR.editorConfig = function( config ) {
config.language = 'en';
config.uiColor = '#AADC6E';
...........
...........
];
config.removeButtons = 'Save,NewPage,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Flash,Language,About';
};
现在这里的主要功能是样式功能
CKEDITOR.stylesSet.add('my_custom_style', [
{ name: 'Page Title', element: 'h2', attributes: {'class': 'general-title min'} }
]);
内容总结
以上是互联网集市为您收集整理的javascript – 一个页面中的多个CKEditor全部内容,希望文章能够帮你解决javascript – 一个页面中的多个CKEditor所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。