`
windywindy
  • 浏览: 167580 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

FCKeidtor的toolbarset的设置

阅读更多
FCKeitor默认提供了两种方式 Default,Basic.
Default:



Basic:



而他的配置文件fckconfig.js里的代码是这样的
FCKConfig.ToolbarSets["Default"] = [
    ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
    ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
    ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
    '/',
    ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
    ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
    ['Link','Unlink','Anchor'],
    ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
    '/',
    ['Style','FontFormat','FontName','FontSize'],
    ['TextColor','BGColor'],
    ['FitWindow','ShowBlocks','-','About']        // No comma for the last row.
] ;

FCKConfig.ToolbarSets["Basic"] = [
    ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;


从代码中不难看出我们可以自己手动修改要显示的内容。
我们可以把最常用的放在一起,去掉那些不常用的。我们可以有两种方法修改。
1.直接在原来的基础上增加或删除
例如我们可以在Basic里添加 ['Style','FontFormat','FontName','FontSize'],
FCKConfig.ToolbarSets["Basic"] = [
    ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About'] ,
['Style','FontFormat','FontName','FontSize']
]

这样在使用时就显示样式,字体,字体大小等。

2.新建一个自己的类型。
FCKConfig.ToolbarSets["My"] = [
    ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','Image','Flash','Table','Rule','Smiley']
] ;

这样你在fckeditor的属性toolbarset里设成My就可以使用了。



所以你可以自己设置自己喜欢的工具栏。

附:仿百度空间工具栏

要仿照(关键在于看看fck的可变性)这样一个比较简洁的功能界面 可以做如下改变

基础的改变是fckconfig.js和editor/fckeditor.html文件

可以新建两个工具界面配置
FCKConfig.ToolbarSets["Mybasic"] = [
['Bold','Italic','-','Link','Unlink','Image','-','FontSize','TextColor','-']
] ;
FCKConfig.ToolbarSets["Myall"] = [
['Bold','Italic','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','Link','Unlink','Image','-','FontName','FontSize','TextColor','BGColor','-']
] ;

然后在fckeditor.html中script中加入
function chang(ToobarStyle){

var a = document.getElementById("sptool");
var b = document.getElementById("alltool");
if(ToobarStyle == 'Mybasic'){
   ToobarStyle = 'Mybasic';
   a.style.display = "none";
   b.style.display = "inline";
}else{
   ToobarStyle = 'Myall';
   a.style.display = "inline";
   b.style.display = "none";
}
FCK.ToolbarSet.Load(ToobarStyle || 'Mybasic');
}

表格中改成
<td id="xToolbar" class="TB_ToolbarSet"></td>
       <td align="right" class="TB_ToolbarSet" width="60px">&nbsp;<a href="javascript:void(0);" id="sptool" onClick="chang('Mybasic');" style="font-size:12px;display:none;">简单功能</a><a id="alltool" href="javascript:void(0);" onClick="chang('Myall');" style="font-size:12px;">全部功能</a></td>
       <td class="TB_SideBorder" style="width: 1px"></td>


  • 大小: 27.6 KB
  • 大小: 16.4 KB
  • 大小: 12.1 KB
分享到:
评论

相关推荐

    FCKeditor添加自定义按钮

    在FCKeditor目录里的fckconfig.js打开,找到FCKConfig.ToolbarSets[“Default”] 这里的设置是配置功能按钮...($this-&gt;ToolbarSet= ‘你自己命的名name’ ;) 复制代码 代码如下:&lt;?php include(“editor/fckeditor1

    fckeditor2.6.3 完整版

    FCKEDITOR提供了一套用于定制其外观,特性及行为的设置集.主配置文件名为Fckconfig.js 你既可以编辑主配置文件,也可以自己定义单独的配置文件.配置文件使用JAVASCRIPT语法. 修改后,在建立编辑器时,可以使用以下语法:...

    php fckeditor 调用的函数

    复制代码 代码如下:/* * showfck() 编辑器调用函数 * @name 名字 (必须) * @val value默认值 * @toolbarset fck工具栏名字 * @width 宽度 * @height 高度 */ function showfck($name, $val= ”, $toolbarset = ”,...

    FCKeditor使用指南

    4.5.2 自定义ToolbarSet, 去掉一些不需要的功能 12 4.5.3 加上几种常用的字体 13 4.5.4 修改“回车” 和 “Shift + 回车”的换行行为 13 4.5.5 修改编辑区的样式文件 14 4.5.6 更换表情图片 14 4.5.7 编辑区域的...

    PHP集成FCK的函数代码

    复制代码 代码如下://定义一个函数用于调用FCKeditor function call_fck($input_name,$input_value,$w=’... $fcked-&gt;ToolbarSet = ‘Simple’ ; //工具栏设置 $fcked-&gt;InstanceName = $input_name ; $fcked-&gt;Width =

    FCKeditor_2.6.4在线编辑器

    Dim oFCKeditor Set oFCKeditor = New FCKeditor ...oFCKeditor.ToolbarSet = "Default" oFCKeditor.Width = "98%" oFCKeditor.Height = "500px" oFCKeditor.Value = "" oFCKeditor.Create "logbody" %&gt;

    FCK编辑器使用手册

    由于给FCKeditor瘦身,所以常会报缺少对象支持等错误,只要...在fckconfig.js中用这样的标签[]来划分每行的元素的多少,这样就可以控制toolbar的长短和大小了,具体示例参看:fckconfig.js中的toolbarset[”Default”]

    CI框架中集成CKEditor编辑器的教程

    1、将fckeditor目录置入CI_PATH/... $config[‘fckeditor_toolbarset_default’] = ‘Default’; 3、创建helper,在/system/application/helpers新建form_helper.php 复制代码 代码如下:&lt;?php if (!defined(‘BA

    博客系统案例

    博客系统 仿新浪的博客系统 可供演示用 1.博文修改: 是否需要从数据库中查出这篇博文,然后...在这里编辑您的博客正文吧" basePath="/user/fckeditor" toolbarSet="myToolbar" height="300" width="800"&gt;&lt;/FCK:editor&gt;

    FCKEditor for php 上传自动重命名

    使用方法 &lt;?...//FckEditor编辑器初始化 ... $ofck = new FCKeditor("content");...$ofck-&gt;ToolbarSet = "Default"; $ofck-&gt;Width = "100%"; $ofck-&gt;Height = "500px"; echo $ofck-&gt;CreateHtml(); ?&gt;

    php下安装配置fckeditor编辑器的方法

    二、JS调用fckeditor方法。 复制代码 代码如下: &lt;?... // 包含fckeditor类, $oFCKeditor = new FCKeditor... //编辑器所在目录 $oFCKeditor-&gt;ToolbarSet=”Yiyunnet”; // 默认编辑器工具栏有Basic(基本工具) Defau

    php在页面中调用fckeditor编辑器的方法

    刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的...//编辑器所在目录 $editor-&gt;ToolbarSet = “Normal”;//工具栏的名字,可以根据自己的需求加载其他的 $editor-&gt;Width = “95%”;//宽度度 $edit

    fckedit编辑器

    以允许上传功能,Connector Servlet的baseDir参数值用于设置上传文件存放的位置 在web.xml最后添加标签定义: &lt;taglib-uri&gt;/TestFCKeditor &lt;taglib-location&gt;/WEB-INF/FCKeditor.tld 现在的web.xml文件没有...

    C# for CSDN 乱七八糟的看不懂

    没法下载,到这里折腾一把试试。 本文由abc2253130贡献 doc文档可能在WAP端浏览体验不佳。建议您优先选择TXT,或下载源文件到本机查看。 C#(WINFORM)学习 一、 C#基础 基础 类型和变量 类型和变量 类型 C# 支持两...

    FCKEDIT和定时器

    oFCKeditor.ToolbarSet = 'Abc' ; oFCKeditor.Height=400; //oFCKeditor.Width=400; //oFCKeditor.Value="aaaaaa"; oFCKeditor.ReplaceTextarea() ; } 4. 不支持图片?处理办法: A. 复制fckeditor.properties 到...

    ecshop整合替换百度编辑器 ueditor,测试通过

    $editor-&gt;ToolbarSet = 'Normal'; $editor-&gt;Width = '100%'; $editor-&gt;Height = '320'; $editor-&gt;Value = $input_value; $FCKeditor = $editor-&gt;CreateHtml(); $smarty-&gt;assign('FCKeditor', $FCKeditor)...

    ecshop更换ueditor

    $editor-&gt;ToolbarSet = 'Normal'; $editor-&gt;Width = '100%'; $editor-&gt;Height = '320'; $editor-&gt;Value = $input_value; $FCKeditor = $editor-&gt;CreateHtml(); $smarty-&gt;assign('FCKeditor', $FCKeditor); } ...

Global site tag (gtag.js) - Google Analytics