⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reply.js

📁 一套设计完善、高效的web商城解决方案
💻 JS
字号:
var Web767_filterScript = true;
var Web767_charset="UTF-8";
var Web767_bLoad=false
var Web767_bTextMode=3;

//var Web767_bIsIE5=document.all
//if (Web767_bIsIE5)
//{var IframeID=frames["Web767_Composition"];}
//else
//{
//var IframeID=document.getElementById("Web767_Composition").contentWindow;
//}
//Web767_InitDocument('Body','gb2312')

function Web767_InitDocument(hiddenid, charset)
{	
//myform
	if (charset!=null){Web767_charset=charset;}
	if (Web767_bIsIE5){
		var Web767_bodyTag="<style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}\nbody{boder:0px}</style></head><BODY bgcolor=\"#FFFFFF\" title=\"Ctrl+Enter直接提交\" onkeydown=\"ctlent();\">";
	}else
	{
		var Web767_bodyTag="<style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}\nbody{boder:0px}</style></head><BODY bgcolor=\"#FFFFFF\" >";
	}
	var editor=IframeID
	var h=document.getElementById(hiddenid).value;
	if (navigator.appVersion.indexOf("MSIE 6.0",0)==-1){
	editor.document.designMode="On"
	}
	editor.document.open();
	editor.document.write ('<html><head>');
	if (Web767_bIsIE5){
	editor.document.write ('<script language="javascript">');
	editor.document.write ('var ispost=0;');
	editor.document.write ('	function ctlent()');
	editor.document.write ('	{');
	editor.document.write ('		if(event.ctrlKey && window.event.keyCode==13&&ispost==0)');
	editor.document.write ('		{');
	editor.document.write ('			ispost=1;');
	editor.document.write ('			parent.Web767_CopyData("'+hiddenid+'"); ');
	editor.document.write ('			parent.document.myform.submit();');
	editor.document.write ('		}');
	editor.document.write ('	}');
	editor.document.write ('<\/script>');
	}
	editor.document.write(Web767_bodyTag);
	if (h!="")
	{
		h=Web767_FilterScript(h);
		editor.document.write(h);
	}
	editor.document.write ("</body>");
	editor.document.write ("</html>");
	editor.document.close();
	editor.document.body.contentEditable = "True";
	editor.document.charset=Web767_charset;
	Web767_bLoad=true;
	Web767_setStyle();
}

function Web767_setStyle()
{
	//var bs = IframeID.document.body.runtimeStyle;
	var bs = IframeID.document.body.style;
	//根据mode设置iframe样式表	
	if (Web767_bTextMode==2) {
		bs.fontFamily="Arial";
		bs.fontSize="10pt";
	}else{
		bs.fontFamily="Arial";
		bs.fontSize="10.5pt";
	}
	bs.scrollbar3dLightColor= '#D4D0C8';
	bs.scrollbarArrowColor= '#000000';
	bs.scrollbarBaseColor= '#D4D0C8';
	bs.scrollbarDarkShadowColor= '#D4D0C8';
	bs.scrollbarFaceColor= '#D4D0C8';
	bs.scrollbarHighlightColor= '#808080';
	bs.scrollbarShadowColor= '#808080';
	bs.scrollbarTrackColor= '#D4D0C8';
	bs.border='1';
}

function Web767_CopyData(hiddenid)
{
	if (Web767_bTextMode==2)
	{
	cont=IframeID.document.body.innerText;
	}else{
	cont=IframeID.document.body.innerHTML;  
	}
	var ChekEmptyCode=Web767_ChekEmptyCode(cont);
	if (ChekEmptyCode=='' || ChekEmptyCode==null)
	{
		cont='';
	}
	else{
		cont=Web767_correctUrl(cont);
		if (Web767_filterScript)
		cont=Web767_FilterScript(cont);
	}
	document.getElementById(hiddenid).value = cont;
}
//格式化链接
function Web767_correctUrl(cont)
{
	var url=location.href.substring(0,location.href.lastIndexOf("/")+1);
	cont=Web767_rCode(cont,location.href+"#","#");
	//cont=Web767_rCode(cont,url,"");
	var	regExp = /<(a[^>]*) href=([^ |>]*)([^>]*)/gi
	cont = cont.replace(regExp, "<$1 href=$2 target=\"_blank\" ") ;
	return cont;
}

function Web767_FilterScript(content)
{
	content = Web767_rCode(content, 'javascript:', '<b>javascript</b> :');
	var RegExp = /<script[^>]*>(.*)<\/script>/ig;
	content = content.replace(RegExp, "<div class=HtmlCode>&lt;!-- Script 代码开始 --&gt;<br>$1<br>&lt;!-- Script 代码结束 --&gt;</div>");
	return content;
}

function Web767_rCode(s,a,b,i){
	//s原字串,a要换掉pattern,b换成字串,i是否区分大小写
	a = a.replace("?","\\?");
	if (i==null)
	{
		var r = new RegExp(a,"gi");
	}else if (i) {
		var r = new RegExp(a,"g");
	}
	else{
		var r = new RegExp(a,"gi");
	}
	return s.replace(r,b); 
}

function Web767_ChekEmptyCode(html) {
	//html = html.replace(/&nbsp;|&lt;|&gt;/gi, "");
	html = html.replace(/\<[^>]*>/g,"");        ///过滤其它所有"<...>"标签
	html = html.replace(/&nbsp;/gi, "");
	html = html.replace(/o:/gi, "");
	html = html.replace(/\s/gi, "");
	return html;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -