百度首页 | 百度空间
 
查看文章
 
百度空间文章编辑工具beta
2008-05-13 13:39

由于在插件整合上存在些问题,原计划编写的东西可能会占用更长的时间发布,但为了不扫大家的兴,所以把其中的文章编辑功能作为单独的插件公布出来。

这样做对我自己来说是有百害而无一利的——会有很多人直接把我的劳动成果拿去,或进行版权更改后声明是自己的,或者稍加修改去卖钱等等,这样的事情不止一次了,只是这次会尤为令自己心痛——这个东西是在父亲病重之前抽时间做的。

前几天,突然有人从QQ上问我,百度空间插视频的始作俑者是不是我。我说:不出意外,应该是吧。然后他就列出某某些人插过视频等等......我没有同他理论,因为过去的事情已经没有意义。只是还记得那天大半夜52abc兄弟看见居然在我的文章列表里test出视频这么个东西而兴奋异常...

然后有某大学的网络实验室把我的UDISK直接拿去说成是他们的最新成果;某“黑客”把MonyerEn拿过去宣布是他研发的“黑软”;某网站把hi的文章提取工具直接拿过来集成在他们的产品里;某些人把我博客里的文章拿过去稍加修改发表等等......

Monyer既然肯拿出来,就不怕抄袭,也不怕翻版

但把我的东西拿过去后,反过来说是我抄袭我翻版,这就变成了一件十分可耻的事情了。

话点到为此,希望一些人不要得了便宜还卖乖,用网人的话说:做人不能太CCTV,不是么。

好,进入主题:

百度空间里的文章编辑器是FCKeditor的,不管你认不认同。

而Monyer的这个百度空间文章编辑工具是直接仿FCKeditor的,但代码是自己写的,所以相应的功能未必有FCKeditor强大。工具条图片直接调用的百度的图片,一共有两张,一张在css里,一张在editor的函数里(这意味着这个插件是非脱机的)。

目前“字体”和“大小”功能还没有完成。工具只有编辑功能,没有譬如文章发表或者文章修改功能,这些功能将来有可能一起集成到主工具里。所以也只好定义为beta版。

大家仍然可以在我网站上下载http://monyer.cn/down/http://monyer.cn/down/百度空间文章编辑工具.rar

而且Monyer只建议大家到我的提供的站点去下载,否则后果自负

最后依照惯例,提供一下源代码,仅供学习:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Monyer's Editor</title>
<style type="text/css">
body{
margin:0;
}
.editorToolsBox{
border: 1px solid #808080;
width: 100%;
text-align:left;
table-layout:fixed;
}
.editorToolsBG{
width:100%;
height:16px;
background:#ECECEC;
padding-left:2px;
vertical-align:top;
}
.editorToolsIMG{
background:url("
http://hi.baidu.com/fc/editor/skins/default/fck_strip.gif");
border:#ECECEC 2px solid;
height:16px;
}
.editorToolsFontName{
color:red;
}
.editorToolsFontSize{
color:green;
}
.editorTextBottomBG{
background:#EDEDED;
text-align:left;
border:1px solid #808080;
width: 100%;
height:23px;
}
.editorTextBG{
width:100%;
border-left: 1px solid #808080;
border-top: 1px solid #808080;
border-right: 1px solid #808080;
background-color:#CCCCCC;
}
.editorTextArea{
border:1px;
padding:0;
width:100%;
height:320px;
overflow:auto;
}
.editorSrcArea{
padding:0;
width:100%;
height:340px;
}
.editorFullmessage {
border: 0px;
position: absolute;
top:0px;
left:0px;
z-index: 65535;
width: 100%!important;
height: 100%!important;
}
.editorFullbody {
padding: 0px;
left: 0px;
margin: 0px;
overflow: hidden;
width: 0px;
position: static;
top: 0px;
height: 0px;
}
.editorTextBox {
width: 100%;
}
</style>
<script language="javascript" type="text/javascript">
function $(id){
return document.getElementById(id);
}
function $c(tag){
return document.createElement(tag);
}
function $t(tag){
return document.getElementsByTagName(tag);
}
document.getElementsByClassName = function(className){
var children = $t("*") || document.all;
var elements = new Array();
for(var i=0; i<children.length; i++){
   var child = children[i];
   var classNames = child.className.split(" ");
   for(var j=0; j<classNames.length; j++){
    if(classNames[j] == className){
     elements.push(child);
     break;
    }
   }
}
return elements;
}
function $cn(className){
return document.getElementsByClassName(className);
}
function editor(sID, sHTML){
var sRTE = "editor_area";
var posArr = [
{w: 16, y: -208, t: "撤销", func: "Undo", id: "a1"},
{w: 16, y: -224, t: "重做", func: "Redo", id: "a2"},
{w: 2, y: 0},
{w: 16, y: -96, t: "剪切", func: "Cut", id: "b1"},
{w: 16, y: -112, t: "复制", func: "Copy", id: "b2"},
{w: 16, y: -128, t: "粘贴", func: "Paste", id: "b3"},
{w: 2, y: 0},
{w: 16, y: -304, t: "粗体", func: "Bold", id: "c1"},
{w: 16, y: -320, t: "斜体", func: "Italic", id: "c2"},
{w: 16, y: -336, t: "下划线", func: "Underline", id: "c3"},
{w: 2, y: 0},
{w: 16, y: -704, t: "文本颜色", func: "forecolor", id: "f3"},
{w: 16, y: -720, t: "背景色", func: "hilitecolor", id: "f4"},
{w: 2, y: 0},
{w: 16, y: -464, t: "左对齐", func: "justifyleft", id: "d1"},
{w: 16, y: -480, t: "居中", func: "justifycenter", id: "d2"},
{w: 16, y: -496, t: "右对齐", func: "justifyright", id: "d3"},
{w: 16, y: -512, t: "两端对齐", func: "justifyfull", id: "d4"},
{w: 2, y: 0},
{w: 16, y: -528, t: "插入链接", func: "CreateLink", id: "e2"},
{w: 16, y: -544, t: "取消链接", func: "unlink", id: "e11"},
{w: 2, y: 0},
{w: 16, y: -576, t: "添加图片", func: "InsertImage", id: "e1"},
{w: 16, y: -592, t: "插入Flash", func: "flash", id: "e6"},
{w: 2, y: 0},
{w: 16, y: -432, t: "减少缩进", func: "outdent", id: "h3"},
{w: 16, y: -448, t: "增加缩进", func: "indent", id: "h4"},
{w: 2, y: 0},
{w: 16, y: -608, t: "插入表格", func: "table", id: "e3"},
{w: 16, y: -640, t: "插入UBB表情", func: "face", id: "e4"},
{w: 16, y: -624, t: "横线", func: "inserthorizontalrule", id: "f2"},
{w: 2, y: 0},
{w: 16, y: -400, t: "编号列表", func: "insertorderedlist", id: "h1"},
{w: 16, y: -416, t: "符号列表", func: "insertunorderedlist", id: "h2"}
];
//定义头
var oHead = new Object;
oHead["table"] = $c("table");
oHead["table"].cellSpacing = "0px";
oHead["table"].cellPadding = "0px";
oHead["table"].border = "0px";
oHead["table"].id = sID + "Table";
oHead["table"].className = "editorToolsBox";
oHead["tbody"] = $c("tbody");
oHead["tr"] = $c("tr");
oHead["td"] = $c("td");
oHead["td"].className = "editorToolsBG";
oHead["td"].valign="middle";
oHead["td"].id = "editorToolsBG";

for(var i = 0; i < posArr.length; i++) {
   oHead["items"] = $c("img");
   posArr[i]["id"] ? oHead["items"].id = posArr[i]["id"] : function(){};
   oHead["items"].src = "
http://hi.baidu.com/fc/editor/images/spacer.gif";
   oHead["items"].style.margin = "1px";
   oHead["items"].className = "editorToolsIMG";
   oHead["items"].style.width = posArr[i]["w"] + "px";
   oHead["items"].style.backgroundPosition = "0px " + posArr[i]["y"] + "px";
   if(posArr[i]["func"] != null) {
    oHead["items"].title = posArr[i]["t"];
    oHead["items"]["func"] = posArr[i]["func"];
    oHead["items"].onmouseover = function () { this.style.border = "#0000FF 2px solid"; }
    oHead["items"].onmouseout = function () { this.style.border = "#ECECEC 2px solid"; }
    oHead["items"].onclick = function () { wordCommand(this["func"]); }
   }
   oHead["td"].appendChild(oHead["items"]);
}
oHead["items_FontName"] = $c("span");
oHead["items_FontName"].innerHTML = "字体";
oHead["items_FontName"].title = "字体";
oHead["items_FontName"].className = "editorToolsFontName";
oHead["items_FontName"].style.fontSize = "14px";
oHead["items_FontName"].style.margin = "1px";
oHead["items_FontName"].style.cursor = "default";
oHead["items_FontName"].onmouseover = function () { this.style.border = "#0000FF 2px solid"; }
oHead["items_FontName"].onmouseout = function () { this.style.border = "#ECECEC 2px solid"; }
oHead["items_FontName"].onclick = function() {alert(event.srcElement.className);}

oHead["items_FontSize"] = $c("span");
oHead["items_FontSize"].innerHTML = "大小";
oHead["items_FontSize"].title = "大小";
oHead["items_FontSize"].className = "editorToolsFontSize";
oHead["items_FontSize"].style.fontSize = "14px";
oHead["items_FontSize"].style.margin = "1px";
oHead["items_FontSize"].style.cursor = "default";
oHead["items_FontSize"].onmouseover = function () { this.style.border = "#0000FF 2px solid"; }
oHead["items_FontSize"].onmouseout = function () { this.style.border = "#ECECEC 2px solid"; }
oHead["items_FontSize"].onclick = function() {alert(event.srcElement.className);}

oHead["td"].appendChild(oHead["items_FontName"]);
oHead["td"].appendChild(oHead["items_FontSize"]);

oHead["tr"].appendChild(oHead["td"]);
oHead["tbody"].appendChild(oHead["tr"]);
oHead["table"].appendChild(oHead["tbody"]);
$(sID).appendChild(oHead["table"]);
//定义主体
var oBody = new Object;
oBody["table"] = $c("table");
oBody["table"].cellSpacing = "0px";
oBody["table"].cellPadding = "0px";
oBody["table"].border = "0px";
oBody["table"].className = "editorTextBox";
oBody["table"].id = "editorTextBox";

oBody["tbody"] = $c("tbody");
oBody["tr"] = $c("tr");
oBody["td"] = $c("td");
oBody["td"].className = "editorTextBG";
oBody["td"].id = sID + "Iframes";
oBody["tr"].appendChild(oBody["td"]);
oBody["tbody"].appendChild(oBody["tr"]);

oBody["tr"] = $c("tr");
oBody["td"] = $c("td");
oBody["td"].className = "editorTextBottomBG";
oBody["input"] = $c("input");
oBody["input"].type = "checkbox";
oBody["input"].id = "editorCMD";
oBody["label"] = $c("label");
oBody["label"].style.fontSize = '12px';
oBody["label"].htmlFor = "editorCMD"
oBody["label"].innerHTML = "源代码&nbsp;&nbsp;";
oBody["input"].onclick = function oInputFunc(){
   var oRTE = getFrameNode(sRTE);
   var sEditBox = $(sID + "Table");
   var sEditMode = $("editorCMD").checked;
   var sEditSrc = $(sRTE+"src");
   if(!sEditMode){
    sEditSrc.style.display = "none";
    sEditBox.style.display = "";
    $("editorHtmlArea").style.display="";
    $(sRTE+"toTxt").style.display = "";
    $(sRTE+"Enter").style.display = "";
    var sOutText = escape(sEditSrc.innerText);
    oRTE.document.body.innerHTML = unescape(sOutText);
    oRTE.focus();
   }else{//text
    sEditSrc.style.display = "";
    sEditBox.style.display = "none";
    $("editorHtmlArea").style.display = "none";
    $(sRTE+"toTxt").style.display = "none";
    $(sRTE+"Enter").style.display = "none";
    var innerHTML = oRTE.document.body.innerHTML;
    sEditSrc.innerText = innerHTML;
    sEditSrc.focus();
   }
};

oBody["fulleditor"] = $c("input");
oBody["fulleditor"].type = "checkbox";
oBody["fulleditor"].id = "fulleditor";
oBody["fulllabel"] = $c("label");
oBody["fulllabel"].style.fontSize = '12px';
oBody["fulllabel"].htmlFor = "fulleditor"
oBody["fulllabel"].innerHTML = "全屏&nbsp;&nbsp;";
oBody["fulleditor"].onclick = window.onresize = function oFullFunc() {
   if($("fulleditor")){
    var fEditMode = $("fulleditor").checked;
    var dochtml = document.getElementsByTagName('html')[0];
    if(fEditMode) {
     var dHeight = document.documentElement.clientHeight;
     var dwidth = document.documentElement.clientWidth;
     $(sID).className = "editorFullmessage";
     document.body.className = "editorFullbody";
     dochtml.style.overflow='hidden';
     $(sID + "Table").style.width = $(sID + "Iframes").style.width = $(sRTE).style.width = $(sRTE+"src").style.width = dwidth +"px";
     $(sID + "Iframes").style.height = $(sRTE).style.height = dHeight-65 +"px";$(sRTE+"src").style.height = dHeight-38 +"px";
    }else {
     $(sID).className = "";
     document.body.className = "";
     dochtml.style.overflow='';
     $(sID + "Table").style.width = $(sID + "Iframes").style.width = $(sRTE).style.width = $(sRTE+"src").style.width = $("editorToolsBG").style.width = "";
     $(sID + "Iframes").style.height = $(sRTE).style.height = $(sRTE+"src").style.height = "";
    }
   }
};

oBody["cleanCode"] = $c("label");
oBody["cleanCode"].style.fontSize = '12px';
oBody["cleanCode"].style.cursor = "pointer";
oBody["cleanCode"].id = sRTE + "toTxt";
oBody["cleanCode"].innerHTML = "纯文本&nbsp;|&nbsp;";
oBody["cleanCode"].onclick = function CleanCode() {
   var oRTE = getFrameNode(sRTE);
   var body = oRTE.document.body;
   oRTE.focus();
   for (var index = 0; index < body.all.length; index++) {
    tag = body.all[index];
    tag.removeAttribute("className","",0);
    tag.removeAttribute("style","",0);
   }
   var html = oRTE.document.body.innerHTML;
   html = html.replace(/\<p>/gi,"[$p]");
   html = html.replace(/\<\/p>/gi,"[$\/p]");
   html = html.replace(/\<br[^>]*>/gi,"[$br]");
   oRTE.document.body.innerHTML = html;
   html = oRTE.document.body.innerText;
   html = html.replace(/\[\$p\]/gi,"<p>\r\n");
   html = html.replace(/\[\$\/p\]/gi,"<\/p>\r\n");
   html = html.replace(/\[\$br\]/gi,"<br>\r\n");
   oRTE.document.body.innerHTML = html;
};

oBody["explain"] = $c("label");
oBody["explain"].style.fontSize = '12px';
oBody["explain"].id = sRTE+"Enter";
oBody["explain"].innerHTML = "(换行用 Shift+Enter 键)";

oBody["td"].appendChild(oBody["input"]);
oBody["td"].appendChild(oBody["label"]);
oBody["td"].appendChild(oBody["fulleditor"]);
oBody["td"].appendChild(oBody["fulllabel"]);
oBody["td"].appendChild(oBody["cleanCode"]);
oBody["td"].appendChild(oBody["explain"]);
oBody["tr"].appendChild(oBody["td"]);
oBody["tbody"].appendChild(oBody["tr"]);
oBody["table"].appendChild(oBody["tbody"]);
$(sID).appendChild(oBody["table"]);
$(sID + "Iframes").innerHTML = "<textarea id='"+sRTE+"src' class='editorSrcArea'></textarea><div id='editorHtmlArea'><iframe frameborder='0' scrolling='yes' id='" + sRTE + "' class='editorTextArea'></iframe></div><object id='dlgHelper' classid='clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b' width='0px' height='0px'></object>";
$(sRTE+"src").style.display = "none";

function writeDesignMode(sRTE, sHTML) {
   document.frames ? document.frames[sRTE].document.designMode = "on" : $(sRTE).contentDocument.designMode = "on";//编写模式
   var sFix = window.Event ? "" : "";
   var frameHTML = "";
   frameHTML += "<html>";
   frameHTML += "<head>";
   frameHTML += "<style>";
   frameHTML += "body {";
   frameHTML += " background: #ffffff;";
   frameHTML += " margin:0px;";
   frameHTML += " padding:5px;";
   frameHTML += " font-size:12px;";
   frameHTML += " overflow:auto;";
   frameHTML += " scrollbar-face-color:#fff;";
   frameHTML += " scrollbar-highlight-color:#c1c1bb;";
   frameHTML += " scrollbar-shadow-color:#c1c1bb;";
   frameHTML += " scrollbar-3dlight-color:#ebebe4;";
   frameHTML += " scrollbar-arrow-color:#cacab7;";
   frameHTML += " scrollbar-track-color:#f4f4f0;";
   frameHTML += " scrollbar-darkshadow-color:#ebebe4;";
   frameHTML += " word-wrap: break-word;";
   frameHTML += " font-family: Arial, Helvetica, sans-serif;";
   frameHTML += "}";
   frameHTML += "</style>";
   frameHTML += "</head>";
   frameHTML += "<body>";
   frameHTML += sHTML;
   frameHTML += sFix;
   frameHTML += "</body>";
   frameHTML += "</html>";
   var oRTE = getFrameNode(sRTE).document;
   oRTE.open();
   oRTE.write(frameHTML);
   oRTE.close();
   oRTE.body.focus();
}
writeDesignMode(sRTE, sHTML);

function getFrameNode(sNode){
   return document.frames ? document.frames[sNode] : $(sNode).contentWindow;
}

var cssText = "<style type='text/css'>";
cssText += "table{ font-size:12px; }";
cssText += "body{ overflow:hidden;margin:0px;padding:0px;padding-top:1px;background:#ECE9D8; }";
cssText += "</style>";

function wordCommand(_sCmd) {
   var oRTE = getFrameNode(sRTE);
   switch(_sCmd){
   case "":
    break;
   case "face":
    var sUrl = "
http://img.baidu.com/hi/face/i_f";
    var num = 1;
    var html = "";
    html += "<title>请选择表情图标</title>"
    html += cssText;
    html += "<div align='center'><table onclick='var oRTE = dialogArguments.document.getElementById(\"editor_area\").contentWindow; oRTE.focus(); oRTE.document.execCommand(\"InsertImage\",false,\""+sUrl+"\"+event.srcElement.className+\".gif\"); oRTE.focus(); window.close();' >";
    for(var i=1;i<=5;i++){
     html += "<tr>";
     for(var j=1;j<=10;j++){
      var str = num<10 ? '0'+num : num;
      html += "<td class='" + str + "' onmouseover='this.style.background=\"#ffffbe\"' onmouseout='this.style.background=\"#d5d59d\"' style='cursor:pointer;background:d5d59d;' >";
      html += "<img class='" + str + "' style='margin:5px;' src='" + sUrl + str + ".gif' />";
      html += "</td>";
      num++;
     }
     html += "</tr>";
    }
    html += "</table></div>";
    oPenWin(400, 200, html);
    break;
   case "table":
    var html = "";
    html += "<title>请选择表格属性</title>";
    html += cssText;
    html += "<div align='center'><table>";
    html += "<tr><td>行数:</td><td>";
    html += "<input id='wordEditer_Table_ROWS' size='1' value='3'></td>";
    html += "<td>列数:";
    html += "<input id='wordEditer_Table_COLUMNS' size='1' value='3'></td>";
    html += "</tr><tr><td>表格宽度:</td><td>";
    html += "<input id='wordEditer_Table_WIDTH' size='1' value='200'></td>";
    html += "<td><select id='wordEditer_Table_WIDTHTYPE'>";
    html += "<option selected value='pixels'>象素</option>";
    html += "<option>百分比</option>";
    html += "</select></td>";
    html += "</tr><tr><td>边框粗细:</td><td>";
    html += "<input id='wordEditer_Table_BORDER' size='1' value='1'></td>";
    html += "<td>象素</td></tr><tr>";
    html += "<td>单元格边距:</td><td>";
    html += "<input id='wordEditer_Table_PADDING' size='1' value='1'></td>";
    html += "<td>&nbsp;</td></tr><tr>";
    html += "<td>单元格间距:</td><td>";
    html += "<input id='wordEditer_Table_SPACING' size='1' value='1'></td>";
    html += "<td>&nbsp;</td></tr><tr align='center'>";
    html += "<td colspan='3'>";
    html += "<input type='button' value='确定' onclick='insetTable();' />&nbsp;";
    html += "<input type='button' value='取消' onclick='window.close();' />";
    html += "</td></tr></table></div>";
    html += "<script type='text/javascript'>";
    html += "function insetTable() {";
    html += "var widthType = (document.getElementById('wordEditer_Table_WIDTHTYPE').value == 'pixels') ? '' : '%';";
    html += "var html = '<table border=\"' + document.getElementById('wordEditer_Table_BORDER').value + '\" cellpadding=\"' + document.getElementById('wordEditer_Table_PADDING').value + '\" ';";
    html += "html += 'cellspacing=\"' + document.getElementById('wordEditer_Table_SPACING').value + '\" width=\"' + document.getElementById('wordEditer_Table_WIDTH').value + widthType + '\">';";
    html += "for (var rows = 0; rows < document.getElementById('wordEditer_Table_ROWS').value; rows++) {";
    html += "html += '<tr>';";
    html += "for (var cols = 0; cols < document.getElementById('wordEditer_Table_COLUMNS').value; cols++) {";
    html += "html += '<td>&nbsp;</td>';";
    html += "}html+= '</tr>';";
    html += "}html += '</table>';";
    html += "var oRTE = dialogArguments.document.getElementById('editor_area').contentWindow;";
    html += "oRTE.focus();";
    html += "var oRng = oRTE.document.selection.createRange();";
    html += "oRng.pasteHTML(html);";
    html += "oRng.collapse(false);";
    html += "oRng.select();";
    html += "window.close();}";
    html += "<\/script>";
    oPenWin(150, 180, html);
    break;
   case "flash":
    var html = "";
    html += "<title>请输入Flash地址</title>";
    html += cssText;
    html += "<div align='center'><table>";
    html += "<tr><td>请输入Flash链接:";
    html += "<input id='wordEditer_FLASH_SRC' size='30' value='http://'></td>";
    html += "</tr><tr><td>";
    html += "对于百度空间,仅支持以下站点视频<br />";
    html += "土豆网 56.com 优酷网 酷6网 六间房 mofile.com<br />QQ播客 新浪视频 sohu视频 偶偶视频 UUME youtube</td>";
    html += "</tr><tr>";
    html += "<td align='center'>";
    html += "<input type='button' value='确定' onclick='insetIMG(document.getElementById(\"wordEditer_FLASH_SRC\").value)' />&nbsp;";
    html += "<input type='button' value='取消' onclick='window.close()'></td></tr></table></div>";
    html += "<script type='text/javascript'>";
    html += "function insetIMG(_sVal) {";
    html += "if(_sVal == '') return;";
    html += "var html = '<embed style=\"WIDTH: 450px; HEIGHT: 390px\" pluginspage=\"
http://www.macromedia.com/go/getflashplayer\" src=\"'+_sVal+'\" width=\"450\" height=\"300\" type=\"application/x-shockwave-flash\" menu=\"false\" loop=\"false\" play=\"true\" wmode=\"window\" ></embed>';";
    html += "var oRTE = dialogArguments.document.getElementById('editor_area').contentWindow;";
    html += "oRTE.focus();";
    html += "var oRng = oRTE.document.selection.createRange();";
    html += "oRng.pasteHTML(html);";
    html += "oRng.collapse(false);";
    html += "oRng.select();";
    html += "window.close();}";
    html += "<\/script>";
    oPenWin(380, 120, html);
    break;
   case "forecolor":
    var sColor = colorpicker();
    oRTE.focus();
    oRTE.document.execCommand("ForeColor", true, sColor);
   
    //oRTE.document.execCommand("FontName", true, "");
    //oRTE.document.execCommand("FontSize", true, "");
    //oRTE.document.execCommand("CreateBookmark", true, "");
    //oRTE.document.execCommand("InsertMarquee", true, "");
   
    oRTE.focus();
    break;
   case "hilitecolor":
    var sColor = colorpicker();
    oRTE.focus();
    oRTE.document.execCommand("BackColor", true, sColor);
    oRTE.focus();
    break;
   default:
    oRTE.focus();
    oRTE.document.execCommand(_sCmd, true, null);
    oRTE.focus();
    break;
   }
  
   function oPenWin(_sWidth, _sHeight, _sHtml){
    oPenWin = showModelessDialog(" ", window, "dialogHeight:"+_sHeight+"px;dialogWidth:"+_sWidth+"px;center=yes;resizable:yes;help:no;status:no;tustatus:no;");
    oPenWin.document.write(_sHtml);
   }
  
   function colorpicker() {
    var monyer = dlgHelper.ChooseColorDlg(0xffffff);
    if(monyer!=0xffffff){
     var sColor ="#"+monyer.toString(16)+new Array(7-monyer.toString(16).length).join(0);
     return sColor;
    }
   }
}

editor.prototype.gettxt = function (){
   var oRTE = getFrameNode(sRTE);
   return oRTE.document.body.innerHTML;
};
}

</script>
</head>

<body>
<div id="content" ></div>
<script type="text/javascript">
   var edit = new editor("content", "<a href='123'>正文</a>");
</script>
</body>
</html>

下载地址:http://monyer.cn/down/http://monyer.cn/down/百度空间文章编辑工具.rar

有任何好的意见或建议,欢迎留言请教!

Monyer!


类别:百度相关 | 添加到搜藏 | 浏览() | 评论 (33)
 
网友评论:
1
2008-05-13 13:45
崇拜你!!!
 
2
2008-05-13 13:52
路过。
对于那些SB级人物,随便加下密他们就傻眼了。
 
4
2008-05-13 14:09
喵喵喵!!!可恶!!!!!!!!!!
 
5
2008-05-13 14:12
对于默默奉献的人们, 大家一起祝福!~
 
6
2008-05-13 14:55
牛人,,继续学习
 
7
2008-05-13 15:34
嗯,monyer兄不用着急,好东西总会出现的嘛,呵呵!
 
8
2008-05-13 15:56
啊对了
光芒大侠(切换拼音费劲饿- -,)
能否编写个小插件呢?
ONENOTE在遨游浏览器下的插件,默认的MS只支持IE……
还有ONENOTE直接发送到BOLG的
怎么才能发送到百度空间呀?
能帮忙解决么
估计应该也有很多人关注这俩问题的嘿嘿- -,
 
9
2008-05-13 16:05
每天都来看,每天都有收获。支持monyer
 
10
2008-05-13 17:28
试试
 
11
2008-05-13 17:55
又有新东西!
 
12
2008-05-13 18:19
学习!
 
13
2008-05-13 18:36

什么人都有啊...抄袭者的脑袋里装了一堆糨糊 只知道抄袭 ...

抄袭了还得说是自己的作品...- -!!
 
14
2008-05-13 19:00
哎,我就特服这种人,怎么就能那么不要脸呢?

不要脸能到这种境界真TMD高手了。。

正所谓没脸没皮,天下无敌。

现在发现无敌的“人”越来越多。
 
15
2008-05-13 19:03
这个工具,为了方便自己使用,所以还是只能转走。作为备份,我会记一份在贴吧里,上传两份到自己的网络硬盘上。。但我会提供你的正版下载处。也会注明版权信息。
 
16
2008-05-13 19:12
已阅,很好。同意。
 
17
2008-05-13 21:01
看了也不太明白,也没有时间下载!!!
 
18
2008-05-13 21:21
弱弱地问一句,怎么用呢?
 
19
2008-05-13 23:04
近日来真是多事之秋,晚上才能有时间看到monyer的新作品...

如果能增加自动保存到本地生成草稿的功能,那就再不必怕写文章时遭遇停电或者死机带来的烦恼了。。。
 
20
2008-05-14 07:56
支持你
应该是 崇拜你
 
21
2008-05-14 08:38
HTA....很好改的哦
 
22
2008-05-14 08:44
试过了...字体和大小有问题....好像提示错误...
 
23
2008-05-14 09:01
来学习下……
 
24
2008-05-14 15:04
很好很好 Monyer的工具给我们带来不少方便 支持Monyer!
顺便BS下那些盗版的SB们 居然敢自称“黑客”
还有那什么大学网络实验室 还大学生呢 这素质 强烈BS!
Monyer!
 
25
2008-05-14 15:53
现在功能还不是特别强大,期待正式版~
 
26
2008-05-14 17:13
支持下,支持原创……
 
27
2008-05-14 21:03
兄弟的原创被很多欺世盗名之辈盗用,真是岂有此理,不过和今年的多事之秋比起来,盗版已经不算什么了~兄弟消消气
 
28
2008-05-16 21:55
支持一下!
为灾区祈福!
 
30
2008-05-18 00:16
我在网上找到一个全html的文章编辑器,建议博主不要再开发下去,想多些有创意的东西出来。
 
31
2008-05-18 08:49
回复30楼:

什么样的文章编辑器?能不能看下?
 
32
2008-05-23 14:58
支持!!!
 
33
2008-05-26 13:23
小弟来拜一个,呵呵
 
34
2008-05-26 13:32
看完了再拜一下,呵呵,期待最终完美版
 
36
2008-06-29 00:06
版权问题很难维护,我支持你。
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu