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); } } } 哎!又是字符串截取问题100分 php实现一个订货单的功能,急!急! 前辈们帮忙看看 谁给推荐一个php集成环境(win7 64bit) 帮解释下GD库这串安装命令啥意思 setcookie ladp_connect连接成功后,为什么ladp_bind绑定不成功 求高手解答,PHP代码转成C++代码!!! 使用Xheditor遇到的一个问题。 跪求好的想法 我们公司是做餐饮系统软件的怎么样才能对接到美团类上面 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);
}
}
}