360百科中那个回复的编辑器是什么编辑器,是什么产品,可以在网上下载吗 360百科中那个回复的编辑器是什么编辑器,是什么产品,可以在网上下载吗http://baike.360.cn/4066573/vote_11368867.html,网易论坛的编辑器好像与这相似,这是一个可以公共使用的编辑器产品吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 从页面html源码来看,这是个定制的UBB编辑器,载入的代码是:<script type="text/javascript">$(function(){qihoo_module_ubbEditor.init("content" , "controlPanel" , "/img");});</script>另外,根据qihoo_module_ubbEditor.init搜索到下面一篇博文,是不是奇虎用的编辑器的代码就不得而知了..一个基于jquery的简易ubb编辑器【支持IE&FF】http://liuguanyu.blog.hexun.com/14906123_d.htmlvar qihoo_module_ubbEditor = { _codeContainer : {}, _controllBar : {}, _imagePath : "." , _defaultConfigData : [ {"imgFile":"bold.gif" , "replaceText":"加粗" , "eventFun":function (){qihoo_module_ubbEditor.onBold();} , "idName":"ctlBold"}, {"imgFile":"italic.gif" , "replaceText":"斜体" , "eventFun":function (){qihoo_module_ubbEditor.onItalic();}, "idName":"ctlItalic"}, {"imgFile":"under.gif" , "replaceText":"下划线" , "eventFun":function (){qihoo_module_ubbEditor.onUnderLine();}, "idName":"ctlUnder"}, {"imgFile":"link.gif" , "replaceText":"加入链接" , "eventFun":function (){qihoo_module_ubbEditor.onLink();}, "idName":"ctlLink"}, {"imgFile":"image.gif" , "replaceText":"插入图片" , "eventFun":function (){qihoo_module_ubbEditor.onImage();}, "idName":"ctlImg"}, {"imgFile":"rm.gif" , "replaceText":"插入视频" , "eventFun":function (){qihoo_module_ubbEditor.onVideo();}, "idName":"ctlVideo"}, {"replaceText":"自动排版" , "eventFun":function (){qihoo_module_ubbEditor.onFormat();}, "idName":"ctlFormat"} ], _clientVer : parseInt(navigator.appVersion) , _isIe : ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) && (navigator.userAgent.toLowerCase().indexOf("opera") == -1)) , init : function (containerId , controlBarlId ,imagePath ,configData) { this._codeContainer = $("#"+containerId); this._controlBar = $("#"+controlBarlId); if (typeof(imagePath) != "undefined") this._imagePath = imagePath; if (typeof(configData) == "undefined") configData = this._defaultConfigData; for( var i in configData){ tmp = $("#"+configData["idName"]); if (typeof(configData[i]["imgFile"]) != "undefined" ){ tmp.attr("src" , this._imagePath+"/"+configData[i]["imgFile"]); if (typeof(configData[i]["replaceText"]) != "undefined") tmp.attr("alt" , configData[i]["replaceText"]); } else{ tmp.html(configData[i]["replaceText"]); } eventKey = (typeof(configData[i]["eventKey"]) == "undefined") ? "click" : configData[i]["eventKey"]; tmp.bind(eventKey , configData[i]["eventFun"]); } this._controlBar.insertBefore(this._codeContainer); } , getControlBar : function(){ return this._controlBar; } , setSelectionText : function (openTag , closeTag ){ this._codeContainer[0].focus(); if ((this._clientVer >= 4) && this._isIe){ theSelection = document.selection.createRange().text; if (theSelection != ''){ document.selection.createRange().text = openTag + theSelection + closeTag; } else{ this.insertAtCursor(openTag + closeTag); } } else { if (this._codeContainer[0].selectionEnd && (this._codeContainer[0].selectionEnd - this._codeContainer[0].selectionStart > 0)) { var startPos = this._codeContainer[0].selectionStart; var endPos = this._codeContainer[0].selectionEnd; var prevValue = this._codeContainer.val(); this._codeContainer.val(prevValue.substring( 0 , startPos ) + openTag + prevValue.substring(startPos,endPos) + closeTag + prevValue.slice(endPos)); } else{ this.insertAtCursor(openTag + closeTag); } } }, getSelectionText : function (){ this._codeContainer[0].focus(); if ((this._clientVer >= 4) && this._isIe){ return document.selection.createRange().text; } else { if (this._codeContainer[0].selectionEnd && (this._codeContainer[0].selectionEnd - this._codeContainer[0].selectionStart > 0)) { var startPos = this._codeContainer[0].selectionStart; var endPos = this._codeContainer[0].selectionEnd; var prevValue = this._codeContainer.val(); return prevValue.substring(startPos,endPos) + closeTag + prevValue.slice(endPos); } } return ""; }, insertAtCursor : function (text){ this._codeContainer[0].focus(); if( document.selection ){ sel = document.selection.createRange(); sel.text = text ; } else if( this._codeContainer[0].selectionStart || this._codeContainer[0].selectionStart == '0' ){ var startPos = this._codeContainer[0].selectionStart; var endPos = this._codeContainer[0].selectionEnd; var prevValue = this._codeContainer.val(); this._codeContainer.val(prevValue.substring(0, startPos) + text + prevValue.substring(endPos, prevValue.length)); } else{ this._codeContainer.val( this._codeContainer.val() + text); } }, onFormat : function (){ this._codeContainer.val("\n"+ this._codeContainer.val().replace(/ | /ig,"").replace(/\r\n/ig,"\n").replace(/\n{2,}/ig,"\n").replace(/\n/ig,"\n\n ").replace("\n\n","")); }, onBold : function (){ this.setSelectionText("",""); }, onItalic : function (){ this.setSelectionText("[i]",""); }, onUnderLine : function () { this.setSelectionText("",""); }, onLink : function (){ var myUrl = prompt("请输入超链接地址):", "http:\/\/"); if (( myUrl != null ) && ( myUrl != "http://" )){ selectText = this.getSelectionText(); if (selectText){ this.setSelectionText ( "",""); } else{ this.insertAtCursor(""+myUrl+""); } } }, onImage : function () { var myPic = prompt("输入图片的地址", "http:\/\/"); if ((myPic != null) && (myPic != "http://")){ myPic = "\n\n"; this.insertAtCursor(myPic); } }, onVideo : function (){ var myVideo = prompt("输入视频的超链接", "http:\/\/"); if ((myVideo != null) && (myVideo != "http://")){ myVideo = "\n[swf]"+myVideo+"[/swf]\n"; this.insertAtCursor(myVideo); } } } 请问一下新手看什么样的开源代码比较好 一般PHP的博客系统是基于什么架构的? thinkphp 关于文件上传的时候出现的诡异问题 一个关于view的问题 LAMP兄弟连培训课件索引 企业内部网FLASH播放器的安装问题? PHP如何发展 Discuz 部署起来访问样式都加载不出来 脑袋短路了,麻烦大佬帮我数组入库,谢谢 Discuz 登录Uncaught TypeError: Cannot read property 'indexOf' of undefined PHP 工作流 自定义表单 用php实现类似淘宝,拍拍,易趣的最近浏览商品的功能模型代码
<script type="text/javascript">
$(function(){qihoo_module_ubbEditor.init("content" , "controlPanel" , "/img");});
</script>另外,根据qihoo_module_ubbEditor.init搜索到下面一篇博文,是不是奇虎用的编辑器的代码就不得而知了..一个基于jquery的简易ubb编辑器【支持IE&FF】
http://liuguanyu.blog.hexun.com/14906123_d.html
var qihoo_module_ubbEditor = {
_codeContainer : {}, _controllBar : {}, _imagePath : "." , _defaultConfigData : [
{"imgFile":"bold.gif" , "replaceText":"加粗" , "eventFun":function (){qihoo_module_ubbEditor.onBold();} , "idName":"ctlBold"},
{"imgFile":"italic.gif" , "replaceText":"斜体" , "eventFun":function (){qihoo_module_ubbEditor.onItalic();}, "idName":"ctlItalic"},
{"imgFile":"under.gif" , "replaceText":"下划线" , "eventFun":function (){qihoo_module_ubbEditor.onUnderLine();}, "idName":"ctlUnder"},
{"imgFile":"link.gif" , "replaceText":"加入链接" , "eventFun":function (){qihoo_module_ubbEditor.onLink();}, "idName":"ctlLink"},
{"imgFile":"image.gif" , "replaceText":"插入图片" , "eventFun":function (){qihoo_module_ubbEditor.onImage();}, "idName":"ctlImg"},
{"imgFile":"rm.gif" , "replaceText":"插入视频" , "eventFun":function (){qihoo_module_ubbEditor.onVideo();}, "idName":"ctlVideo"},
{"replaceText":"自动排版" , "eventFun":function (){qihoo_module_ubbEditor.onFormat();}, "idName":"ctlFormat"}
], _clientVer : parseInt(navigator.appVersion) ,
_isIe : ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) && (navigator.userAgent.toLowerCase().indexOf("opera") == -1)) , init : function (containerId , controlBarlId ,imagePath ,configData) {
this._codeContainer = $("#"+containerId); this._controlBar = $("#"+controlBarlId); if (typeof(imagePath) != "undefined") this._imagePath = imagePath; if (typeof(configData) == "undefined") configData = this._defaultConfigData; for( var i in configData){
tmp = $("#"+configData["idName"]);
if (typeof(configData[i]["imgFile"]) != "undefined" ){
tmp.attr("src" , this._imagePath+"/"+configData[i]["imgFile"]);
if (typeof(configData[i]["replaceText"]) != "undefined") tmp.attr("alt" , configData[i]["replaceText"]);
}
else{
tmp.html(configData[i]["replaceText"]);
} eventKey = (typeof(configData[i]["eventKey"]) == "undefined") ? "click" : configData[i]["eventKey"]; tmp.bind(eventKey , configData[i]["eventFun"]);
} this._controlBar.insertBefore(this._codeContainer);
} , getControlBar : function(){
return this._controlBar;
} , setSelectionText : function (openTag , closeTag ){
this._codeContainer[0].focus();
if ((this._clientVer >= 4) && this._isIe){
theSelection = document.selection.createRange().text; if (theSelection != ''){
document.selection.createRange().text = openTag + theSelection + closeTag;
}
else{
this.insertAtCursor(openTag + closeTag);
}
}
else {
if (this._codeContainer[0].selectionEnd && (this._codeContainer[0].selectionEnd - this._codeContainer[0].selectionStart > 0)) {
var startPos = this._codeContainer[0].selectionStart;
var endPos = this._codeContainer[0].selectionEnd;
var prevValue = this._codeContainer.val(); this._codeContainer.val(prevValue.substring( 0 , startPos ) + openTag + prevValue.substring(startPos,endPos) + closeTag + prevValue.slice(endPos));
} else{
this.insertAtCursor(openTag + closeTag);
}
}
}, getSelectionText : function (){
this._codeContainer[0].focus();
if ((this._clientVer >= 4) && this._isIe){
return document.selection.createRange().text;
}
else {
if (this._codeContainer[0].selectionEnd && (this._codeContainer[0].selectionEnd - this._codeContainer[0].selectionStart > 0)) {
var startPos = this._codeContainer[0].selectionStart;
var endPos = this._codeContainer[0].selectionEnd;
var prevValue = this._codeContainer.val(); return prevValue.substring(startPos,endPos) + closeTag + prevValue.slice(endPos);
}
} return ""; }, insertAtCursor : function (text){
this._codeContainer[0].focus();
if( document.selection ){
sel = document.selection.createRange();
sel.text = text ;
}
else if( this._codeContainer[0].selectionStart || this._codeContainer[0].selectionStart == '0' ){
var startPos = this._codeContainer[0].selectionStart;
var endPos = this._codeContainer[0].selectionEnd;
var prevValue = this._codeContainer.val();
this._codeContainer.val(prevValue.substring(0, startPos) + text + prevValue.substring(endPos, prevValue.length));
}
else{
this._codeContainer.val( this._codeContainer.val() + text);
}
}, onFormat : function (){
this._codeContainer.val("\n"+ this._codeContainer.val().replace(/ | /ig,"").replace(/\r\n/ig,"\n").replace(/\n{2,}/ig,"\n").replace(/\n/ig,"\n\n ").replace("\n\n",""));
}, onBold : function (){
this.setSelectionText("","");
}, onItalic : function (){
this.setSelectionText("[i]","");
}, onUnderLine : function () {
this.setSelectionText("","");
}, onLink : function (){
var myUrl = prompt("请输入超链接地址):", "http:\/\/"); if (( myUrl != null ) && ( myUrl != "http://" )){
selectText = this.getSelectionText();
if (selectText){
this.setSelectionText ( "","");
}
else{
this.insertAtCursor(""+myUrl+"");
}
}
},
onImage : function () {
var myPic = prompt("输入图片的地址", "http:\/\/");
if ((myPic != null) && (myPic != "http://")){
myPic = "\n\n";
this.insertAtCursor(myPic);
}
},
onVideo : function (){
var myVideo = prompt("输入视频的超链接", "http:\/\/"); if ((myVideo != null) && (myVideo != "http://")){
myVideo = "\n[swf]"+myVideo+"[/swf]\n";
this.insertAtCursor(myVideo);
}
}
}