📄 reply.js
字号:
function Dvbbs_doSelectClick(str, el)
{
var Index = el.selectedIndex;
if (Index != 0){
el.selectedIndex = 0;
FormatText(str,el.options[Index].value);
}
}
function Dvbbs_validateMode()
{
if (Dvbbs_bTextMode!=2) return true;
alert("请取消“查看HTML源代码”选项再使用系统编辑功能或者提交!");
IframeID.focus();
return false;
}
function Dvbbs_foreColor()
{
if (!Dvbbs_validateMode()) return;
if (Dvbbs_bIsIE5){
var arr = showModalDialog("images/post/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
if (arr != null){
if(Dvbbs_bTextMode==3){
Dv_ubb("color",arr);
}else{
FormatText('forecolor', arr);
}
}
else{ IframeID.focus();}
}else
{
FormatText('forecolor', '');
}
}
function Dvbbs_backColor()
{
if (!Dvbbs_validateMode()) return;
if(Dvbbs_bTextMode==3){
alert('当前编辑器不支持该UBB标记。');
return ;
}
if (Dvbbs_bIsIE5)
{
var arr = showModalDialog("images/post/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
if (arr != null)
{
if(Dvbbs_bTextMode!=3){
FormatText('backcolor', arr);
}
}
else
{IframeID.focus();}
}else
{
FormatText('backcolor', '');
}
}
function Dvbbs_UserDialog(what)
{
if (!Dvbbs_validateMode()) return;
IframeID.focus();
if(what == "InsertAlipay"){
if (Dvbbs_bIsNC)
{
imagePath = prompt('请填写图片链接地址信息:', 'http://');
if ((imagePath != null) && (imagePath != "")) {
IframeID.document.execCommand('InsertImage', false, imagePath);
}
IframeID.document.body.innerHTML = (IframeID.document.body.innerHTML).replace("src=\"file://","src=\"");
}else{
Dvbbs_foralipay();
}
}
Dvbbs_pureText = false;
IframeID.focus();
}
function Dvbbs_foralipay()
{
var arr = showModalDialog("images/post/alipay.htm", window, "dialogWidth:20em; dialogHeight:34em; status:0; help:0");
if (arr)
{
IframeID.document.body.innerHTML+=arr;
}
IframeID.focus();
}
function ShowForum_Emot(thepage)
{
var Emot_PageCount;
var Emot_Count=Forum_Emot.length-2;
if(Emot_Count%Emot_PageSize==0)
{
Emot_PageCount=(Emot_Count)/Emot_PageSize
}else{
Emot_PageCount=Math.floor((Emot_Count)/Emot_PageSize)+1
}
thepage=parseInt(thepage);
if (thepage<=Emot_PageCount){
var istr
var EmotStr=' ';
var EmotPath=Forum_Emot[0];
if (thepage!=1 && Emot_PageCount>1)
{EmotStr+='<img style="cursor: pointer;" onClick="ShowForum_Emot('+(thepage-1)+');" src="Images/post/Previous.gif" width="14" height="14" title="上一页"> ';}
for(i=(thepage-1)*Emot_PageSize;i<(thepage-1)*Emot_PageSize+Emot_PageSize;i++)
{
if (i==Emot_Count){break}
if (i<9)
{istr='em0'+(i+1)}
else
{istr='em'+(i+1)}
EmotStr+='<img title="'+istr+'" style="cursor: pointer;" onClick=putEmot("'+istr+'"); src="'+EmotPath+Forum_Emot[i+1]+'"> ';
}
if (thepage!=Emot_PageCount)
{EmotStr+='<img style="cursor: pointer;" onClick="ShowForum_Emot('+(thepage+1)+');" src="Images/post/Next.gif" width="14" height="14" title="下一页"> ';}
EmotStr+='分页:<b>'+thepage+'</b>/<b>'+Emot_PageCount+'</b>,共<b>'+(Emot_Count)+'</b>个';
EmotStr+="<select id=emotpage onchange=\"ShowForum_Emot(this.value);\">";
for (i=1; i<=Emot_PageCount;i++ )
{
EmotStr+="<option value=\""+i+"\">"+i;
}
EmotStr+="<\/select>";
var Forum_EmotObj=document.getElementById("emot")
Forum_EmotObj.innerHTML=EmotStr;
document.getElementById('emotpage').options[thepage-1].selected=true;
}
}
function putEmot(thenNo)
{
var ToAdd = '['+thenNo+']';
IframeID.document.body.innerHTML+=ToAdd;
}
function CheckCount(message,total)
{
//onkeydown
//onkeyup
Dvbbs_CopyData(message);
var Getmessage=document.getElementById(message);
var Gettotal=document.getElementById(total);
var max;
max = Gettotal.value;
if (Getmessage.value.length > max) {
Getmessage.value = Getmessage.value.substring(0,max);
alert("内容不能超过 " + max + " 个字!");
document.Dvform.Submit.disabled=true;
}
else {
document.Dvform.Submit.disabled=false;
}
}
var ispost=0;
function ctlent(){
if (document.all)
{
if(event.ctrlKey && event.keyCode==13&&ispost==0)
{
ispost=1;
Dvbbs_CopyData('Body')
this.document.Dvform.submit();
}
}
}
var OSWEBXHTML=new Object();
OSWEBXHTML.GetXHTML=function(node){
if (window.ActiveXObject){
var prefix = ["MSXML3","MSXML2","MSXML","Microsoft"];
for (var i=0;i<prefix.length;i++) {
try {
this.XML=new ActiveXObject(prefix[i] + ".DOMDocument");
if (XML)
{
return XML;
}
} catch (e) {}
}
}else{
this.XML=document.implementation.createDocument('', '', null);
Node.prototype.__defineGetter__('xml', OSWEBXHTML._Node_Getxml);
};
this.MainNode=this.XML.appendChild(this.XML.createElement( 'XHTML' ));
this._AppendChildNodes(this.MainNode, node);
var sXHTML=this.MainNode.xml;
return sXHTML.substr(7, sXHTML.length - 15);
};
OSWEBXHTML._Node_Getxml=function(){
var oSerializer=new XMLSerializer();
return oSerializer.serializeToString(this);
};
OSWEBXHTML._AppendChildNodes=function(xmlNode, htmlNode){
var oChildren=htmlNode.childNodes;
var i=0;
while (i < oChildren.length){
i +=this._AppendNode(xmlNode, oChildren[i]);
};
};
OSWEBXHTML._AppendNode=function(xmlNode, htmlNode){
var iAddedNodes=1;
switch (htmlNode.nodeType){
case 1 : var sNodeName=fixtag(htmlNode.nodeName.toLowerCase());
var oNode=xmlNode.appendChild(this.XML.createElement( sNodeName ));
var oAttributes=htmlNode.attributes;
for (var n=0 ; n < oAttributes.length ; n++){
var oAttribute=oAttributes[n];
if (oAttribute.specified && oAttribute.nodeName.toLowerCase()+''!='style') this._AppendAttribute(oNode, fixtag(oAttribute.nodeName.toLowerCase()+''), oAttribute.nodeValue+'');
};
var cssText=htmlNode.style.cssText;
if (cssText!='') {
if (navigator.appVersion.indexOf("MSIE")!=-1){
cssText=cssText+';';
}
this._AppendAttribute(oNode, 'style', cssText);
}
if (htmlNode.childNodes.length == 0){
switch (sNodeName){
case "img" :case "input" :case "br" : case "hr" :break;
default : oNode.appendChild(this.XML.createTextNode( '' ));
break;
};
};
switch (sNodeName){
case "script" : case "style" : oNode.appendChild(this.XML.createTextNode( '\['+sNodeName+'\]'+ htmlNode.nodeValue +'\[\/'+ sNodeName+'\]' ));break;
case "abbr" : if (document.all){var oNextNode=htmlNode.nextSibling;
while (true){
iAddedNodes++;
if (oNextNode && oNextNode.nodeName !='/ABBR'){
this._AppendNode(oNode, oNextNode);
oNextNode=oNextNode.nextSibling;
}else
break;
};
break;
};
case "area" : if (document.all && ! oNode.attributes.getNamedItem( 'coords' )){var sCoords=htmlNode.getAttribute('coords', 2);if (sCoords && sCoords !='0,0,0') this._AppendAttribute(oNode, 'coords', sCoords);};
case "img" : if (! oNode.attributes.getNamedItem( 'alt' )) this._AppendAttribute(oNode, 'alt', '');
default :this._AppendChildNodes(oNode, htmlNode);
break;
};
case 3 : if (htmlNode.nodeValue!=null) {
xmlNode.appendChild(this.XML.createTextNode( htmlNode.nodeValue ));
};
break;
default : xmlNode.appendChild(this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ));break;
};
return iAddedNodes;
};
OSWEBXHTML._AppendAttribute=function(xmlNode, attributeName, attributeValue){
if(attributeName.indexOf('_moz') ==-1 && attributeName.indexOf('on') ==-1 && attributeValue.indexOf('_moz') ==-1 && attributeName!=''){
var oXmlAtt=this.XML.createAttribute(attributeName);
if (typeof( attributeValue )=='boolean' && attributeValue == true ){
oXmlAtt.nodeValue=attributeName;
}else{
oXmlAtt.nodeValue=attributeValue;
};
xmlNode.attributes.setNamedItem(oXmlAtt);
};
};
function fixtag(text)
{
text = text.replace(/&|\/|<|>|\*|#|:|;|=|\?|\)|\(|%|\[|\]|\$| /g, "") ;
return text ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -