[英]cftextarea and custom toolbar on shared hosting
I have a cftextarea on a page on a shared hosting plan. 我在共享主机计划的页面上有一个cftextarea。 On my local server, I edited fckconfig.js in the CFIDE directory for a custom toolbar tag and it works great.
在本地服务器上,我在CFIDE目录中编辑了fckconfig.js以获得自定义工具栏标签,并且效果很好。
FCKConfig.ToolbarSets["AMStools"] = [
['Bold','Italic', 'Underline', 'TextColor' ,'FontSize', 'OrderedList','UnorderedList', 'RemoveFormat', 'Undo','Redo','-',]
] ; ];
The problem is the hosting company will not let me mess with CFIDE on their server which I fully endorse. 问题在于托管公司不会让我完全赞同我服务器上的CFIDE。
I tried putting the code on my page as: 我尝试将代码放在页面上,如下所示:
<script type="text/javascript">
FCKConfig.ToolbarSets["AMStools"] = [
['Bold','Italic', 'Underline', 'TextColor' ,'FontSize', 'OrderedList','UnorderedList', 'RemoveFormat', 'Undo','Redo','-',]
] ;
</script>
and the page ignores it. 页面将忽略它。 Though it does show in view source in my browser.
虽然它确实显示在我的浏览器的视图源中。
How can I get this function to work? 我如何才能使用此功能?
For customizing ckeditor toolbar you need to redefine CKeditor object by using plain javascript you can do the following to achieve this. 为了自定义ckeditor工具栏,您需要使用纯JavaScript重新定义CKeditor对象,您可以执行以下操作来实现。
$(function(){
$(".ckeditor").each(function(){
CKEDITOR.replace($(this).attr('id'), { toolbar: [
{ name: 'styles', items: ['Format']},
{ name: 'basicstyles', items : [ 'Bold','Italic','Underline'] },
[ 'Strike'],
[ 'NumberedList', 'BulletedList'],
[ 'Link'],
['RemoveFormat'],
[ 'Source'],
[ 'Maximize']
]})
})
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.