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

📄 htmledit.js

📁 PHP留言本 设计流程: 1.需求分析: 留言本要是实现的功能是用户留言
💻 JS
字号:
function replace(string,text,by) 
{
		// from www.irt.org, supposedly..
        if (string.length==0 || text.length==0) return string;
        var i = string.indexOf(text);
        if (((!i) && (text != string.substring(0,text.length))) || (i== -1)) return string;
        var newstr = string.substring(0,i) + by;
        if (i+text.length < string.length) newstr += replace(string.substring(i+ text.length, string.length), text, by);
        return newstr;
}
/*
function c2e(text) 
{
        text=replace(text,"\r","");
        text=replace(text,"\n","<BR>\n");
        text = replace(text,"<SCRIPT>","#SCRIPT#");
        text = replace(text,"</SC"+"RIPT>","#/SCRIPT#");
        text = replace(text,"<BR>\n<UL>","\n<UL>");
        text = replace(text,"<UL><BR>","<UL>");
        text = replace(text,"</UL><BR>","</UL>");
        text = replace(text,"<BR>\n<OL>","\n<OL>");
        text = replace(text,"<OL><BR>","<OL>");
        text = replace(text,"</OL><BR>","</OL>");
        text = replace(text,"<BR>\n<LI>", "\n<LI>");
        return text;
}
*/
function e2c(text) 
{
        // first, kick out some absolute url's
        //myloc=document.URL;
        //myloc=replace(myloc, "pivot/log.php","");
        //text=replace(text, myloc, "");
        //text=replace(text, "pivot/log.php","");
        //text=replace(text,"<BR>","\n");
        //text=replace(text,"<P>","");
        //text=replace(text,"</P>","<br>");
        text=replace(text,"STRONG>","B>");
        text=replace(text,"EM>","I>");
        text=replace(text,"/UL>\r\n","/UL>");
        text=replace(text,"/OL>\r\n","/OL>");
        text=replace(text,"#SCRIPT#","<SCRIPT>");
        text=replace(text,"#/SCRIPT#","</SC"+"RIPT>");
		text=replace(text,"<A","<A target='_blank'");
        return text;
}
/*
function copycontenttoedit(){
        text=c2e(document.all.f_introduction.value)+" ";
        document.frames['edit'].setHTML(text);
}
*/
function copyedittocontent()
{
        text=e2c(document.frames['edit'].getHTML());
        document.all.Content.value=text;
}

function setInitHtml()
{
return szInitHTML;
}

function Selface(faceid)
{
document.htmlForm.Face.value=faceid;
document.all.Curface.src="images/manto/"+faceid+".gif";
}

⌨️ 快捷键说明

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