先传个结果界面出来:
1.改了宽度和高度
var _toolbarStr = "\
<div id='EDiaryEditor'style='width: 692px;'>\
<div id='EDiaryEditorToolBar' style='position: relative; width: 692px; height: 69px; background-image: url(images/editor/toolbar_bg.gif);'>\
<div id='EDiaryEditorFontFamilyMenu' title='字体' style='position: absolute; left: 80px; top: 12px; width: 92px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;' action='Family' unselectable='on'>字体</div>\
<div id='EDiaryEditorFontSizeMenu' title='字号' style='position: absolute; left: 177px; top: 12px; width: 66px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;' action='Size' unselectable='on'>字号</div>\
<div id='EDiaryEditorFontStyleMenu' title='段落' style='position: absolute; left: 245px; top: 12px; width: 66px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;' action='Style' unselectable='on'>段落</div>\
</div>\
<div style='width: 692px; height: 25px; background-image: url(images/editor/title_bg.gif);'>\
</div>\
<div style='height: 390px; background-image: url(images/editor/guage.gif); padding-left: 39px; width: 653px!important ; width: 692px;' id='EDiaryEditorContent'>\
<iframe id='editor_body_area' name='editor_body_area' style='width: 652px; height: 390px; border-width: 0px; overflow-x: atuo; display: nones;' frameborder='0'></iframe>\
<textarea id='editor_body_textarea' name='editor_body' style='width: 650px; height: 390px; border-width: 0px; padding-top:8px; display: none;'></textarea>\
<input type='hidden' name='char_count' value='-1' id='EDiaryEditorStrLen'>\
</div>\
<div style='width: 692px; height: 59px; background-image: url(images/editor/editor_foot.gif)'>\
<div style='float: left; padding-top: 18px; margin-left: 18px; margin-top: 16px;'><input type='checkbox' id='ModeCheck'><label for='ModeCheck'>显示源代码</label></div>\
</div>\
</div>\
PS一下,把toolbar_bg.gif,guage.gif,editor_foot.gif的长度改一下,用PS的选区自由变换可以很容易修改
2.去掉功能
var _toolBarInfo = [
{l: 11, t: 12, w: 35, h: 51, a: "粘贴", n: "paste"},
{l: 46, t: 12, w: 21, h: 24, a: "剪切", n: "cut"},
{l: 46, t: 36, w: 21, h: 27, a: "复制", n: "copy"},
{l: 77, t: 41, w: 23, h: 23, a: "撤销", n: "undo"},
{l: 102, t: 41, w: 23, h: 23, a: "重做", n: "redo"},
{l: 133, t: 41, w: 23, h: 23, a: "粗体", n: "bold"},
{l: 158, t: 41, w: 24, h: 23, a: "斜体", n: "italic"},
{l: 184, t: 41, w: 24, h: 23, a: "下划线", n: "underline"},
{l: 210, t: 41, w: 24, h: 23, a: "文字颜色", n: "forecolor", c: "FColor"},
{l: 236, t: 41, w: 24, h: 23, a: "背景颜色", n: "hilitecolor", c: "HColor"},
{l: 262, t: 41, w: 24, h: 23, a: "横线", n: "inserthorizontalrule"},
/*{l: 288, t: 41, w: 24, h: 23, a: "插入表情", n: "face", c: "FaceBG"},*/
{l: 320, t: 41, w: 23, h: 23, a: "左对齐", n: "justifyleft"},
{l: 345, t: 41, w: 24, h: 23, a: "居中对齐", n: "justifycenter"},
{l: 371, t: 41, w: 24, h: 23, a: "右对齐", n: "justifyright"},
{l: 397, t: 41, w: 24, h: 23, a: "两端对齐", n: "justifyfull"},
{l: 429, t: 41, w: 59, h: 23, a: "图片排版", n: "justifyformat", c: "Justify"},
{l: 320, t: 10, w: 23, h: 23, a: "编号", n: "insertorderedlist"},
{l: 345, t: 10, w: 24, h: 23, a: "项目符号", n: "insertunorderedlist"},
{l: 371, t: 10, w: 24, h: 23, a: "减少缩进", n: "outdent"},
{l: 397, t: 10, w: 24, h: 23, a: "增加缩进", n: "indent"},
{l: 429, t: 10, w: 23, h: 23, a: "插入图片", n: "img"},
{l: 454, t: 10, w: 24, h: 23, a: "插入链接", n: "link"},
{l: 480, t: 10, w: 24, h: 23, a: "插入表格", n: "table"},
/*{l: 531, t: 10, w: 24, h: 23, a: "插入搜索", n: "iask"},
{l: 506, t: 10, w: 23, h: 23, a: "插入文本框", n: "textarea"},*/
{l: 496, t: 41, w: 59, h: 23, a: "预览文章", n: "view"},
{l: 563, t: 10, w: 48, h: 54, a: "段落化", n: "ParaFormatting"},
];
把代码注释掉就行,当然如果嫌代码太多也可把具体的实现函数删除,但要注意删掉的东西不被其它对象调用才行。
3.添加功能
var _toolBarInfo = [{l: 531, t: 10, w: 24, h: 23, a: "新增功能", n: "new"},];
加多这行代码之后在runCMD: function (CMD, sValue) 中加入
else if (CMD == "undo" || CMD == "redo" || CMD == "cut" || CMD == "copy" || CMD == "paste") {
if(window._isIE == true) {
this.iframe.contentWindow.focus();
this.iframe.contentWindow.document.execCommand(CMD, false, sValue);
this.iframe.contentWindow.focus();
}
else {
alert("该浏览器不支持本功能");
}
}
else if(CMD == "new"){
alert('new');
}
- 大小: 38.2 KB
分享到:
相关推荐
新浪文本编辑器,很不错的编辑器,做网站有很多地方都可能会用到 1,要下载文本编辑器。请点击新浪文本编辑器下载, 2,解压后,把文件夹中Edit文件夹夹复制到网站的根目录下, 3,在界面上引用编辑器 4,获取...
该编辑器是新浪博客的编辑器,使用很方便容易,界面美观,功能齐全,内有使用说明
新浪在线编辑器php版本新浪在线编辑器php版
好用的新浪编辑器 简洁、大方 包含php和asp两个版本
最新的新浪编辑器,NetBox.exe用于快速建立实例站点,经nod32查杀无毒,请放心。
新浪 html在线编辑器 本地上传图片和文件,方便快捷,做为后台编辑器在适合不过了
网易qq 新浪编辑器 js 版的 网易qq 新浪编辑器 js 版的
sina 新浪 博客 编辑器
一款非常好用的新浪在线编辑器,支持图片上传功能,体积小功能强
新浪编辑器、透明背景、效果比较好、感觉非常好用啊!欢迎大家下载!
javascript入门全集 + 新浪编辑器
一款从新浪博客上拉下来的编辑器,精巧,后台己经改成PHP了
从新浪提取的编辑器,大家可以测试下 调用: ...
调用: <input type="hidden" name="content" id="content"> ... 注意:id为调用参数(小写),即隐藏的内容表单项id, ReadCookie设置是否读取上次未提交的数据,1为开启,0为关闭(注意大小写)。
新浪编辑器SinaEditor应该算是最贴近网友体验的编辑器,简洁、大方,并且使用方便、功能强大。
新浪博客HtmlEditor在线编辑器
新浪htmlteditor在线编辑器完美JSP版 支持全中文名称,由smartupload组件上传文件,可完美上传预览图片。放在根目录下可以直接运行。支持按年月自动创建上传目录,支持缩略图显示。 运行环境TOMCAT1.6下通过。 ...
编辑器,各种编辑器希望大家喜欢.qqmail编辑器,fck,新浪编器,discuz编辑器