文件夹 edithtml (包含6个文件)

inputtool.html

< style > ... body{...}{margin:0px;font-size:12px;}.lv_edithtml_title{...}{background-color:#F7F8FD;}.ico{...}{border:1px solid #fff;cursor:hand;}.ico_m{...}{border:1px solid #000;cursor:hand;} </ style > < div class ="lv_edithtml_title" > < img class ="ico" src ="edithtml_include/images/bold.gif" alt ="粗体" onClick ="format('Bold','');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/italic.gif" alt ="斜体" onClick ="format('Italic','');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/underline.gif" alt ="下划线" onClick ="format('Underline','');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/fgcolor.gif" alt ="设置字体颜色" onClick ="insert('color');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/aleft.gif" alt ="格式居左" onClick ="format('justifyleft','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/center.gif" alt ="格式居中" onClick ="format('justifycenter','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/aright.gif" alt ="格式居右" onClick ="format('justifyright','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/copy.gif" alt ="复制" onClick ="format('copy','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/cut.gif" alt ="剪切" onClick ="format('cut','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/paste.gif" alt ="粘贴" onClick ="format('paste','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/delete.gif" alt ="删除" onClick ="format('delete','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/redo.gif" alt ="恢复" onClick ="format('redo','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/undo.gif" alt ="撤销" onClick ="format('undo','')" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/wlink.gif" alt ="插入链接" onClick ="format('CreateLink','');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/hr.gif" alt ="插入水平线" onClick ="format('InsertHorizontalRule','');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" />
< img class ="ico" src ="edithtml_include/images/img.gif" alt ="插入图片" onClick ="insert('img');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/flash.gif" alt ="插入动画" onClick ="insert('flash');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < img class ="ico" src ="edithtml_include/images/wmv.gif" alt ="插入节目" onClick ="insert('avi');" onMouseOut ="this.className = 'ico';" onMouseOver ="this.className = 'ico_m';" /> < br > < select id ="FontName" class ="TBGen" onChange ="format('fontname',this[this.selectedIndex].value);this.selectedIndex=0" > < option selected > 字体 </ option > < option value ="宋体" > 宋体 </ option > < option value ="黑体" > 黑体 </ option > < option value ="楷体_GB2312" > 楷体 </ option > < option value ="仿宋_GB2312" > 仿宋 </ option > < option value ="隶书" > 隶书 </ option > < option value ="幼圆" > 幼圆 </ option > < option value ="Arial" > Arial </ option > < option value ="Arial Black" > Arial Black </ option > < option value ="Arial Narrow" > Arial Narrow </ option > < option value ="Brush Script    MT" > Brush Script MT </ option > < option value ="Century Gothic" > Century Gothic </ option > < option value ="Comic Sans MS" > Comic Sans MS </ option > < option value ="Courier" > Courier </ option > < option value ="Courier New" > Courier New </ option > < option value ="MS Sans Serif" > MS Sans Serif </ option > < option value ="Script" > Script </ option > < option value ="System" > System </ option > < option value ="Times New Roman" > Times New Roman </ option > < option value ="Verdana" > Verdana </ option > < option value ="Wide    Latin" > Wide Latin </ option > < option value ="Wingdings" > Wingdings </ option > </ select > < select id ="FontSize" class ="TBGen" onChange ="format('fontsize',this[this.selectedIndex].value);this.selectedIndex=0" > < option selected > 字号 </ option > < option value ="7" > 一号 </ option > < option value ="6" > 二号 </ option > < option value ="5" > 三号 </ option > < option value ="4" > 四号 </ option > < option value ="3" > 五号 </ option > < option value ="2" > 六号 </ option > < option value ="1" > 七号 </ option > </ select > </ div >

编码转换文件 edithtml.asp

< %
function CovHtml(content)
ON ERROR RESUME NEXT CovHtml = content
if not isnull (content) then CovHtml = replace (CovHtml, " & " , " &amp; " )
CovHtml
= replace (CovHtml, " < " , " &lt; " )
CovHtml
= replace (CovHtml, " > " , " &gt; " )
CovHtml
= replace (CovHtml, chr ( 34 ), " &quot; " )
CovHtml
= replace (CovHtml, chr ( 39 ), " &#39; " )
end if if Err.Number <> 0 then CovHtml = " CovHtml转换中出错请联系管理员<br> " Err.Clear
end if end function % >

js文件 edit.js

// JavaScript Document var bodyTag = " <head><style type="text/css">body {font-size:    9pt}</style><meta http-equiv=Content-Type content="text/html; charset=gb2312"></head><BODY bgcolor="#FFFFFF" MONOSPACE> " function document.onreadystatechange() ... {
  HtmlEdit.document.open()
  HtmlEdit.document.write(bodyTag);
  HtmlEdit.document.close()
  HtmlEdit.document.designMode
="On"}
function format(what,value) ... {
if(what!="")...{
if(value!="")...{
        HtmlEdit.document.execCommand(what,
"",value);
    }
else...{
        HtmlEdit.document.execCommand(what);
    }
}
HtmlEdit.focus();
}
function insert(what) ... {
if(what=="img")...{
vararr=showModalDialog("edithtml_include/images/image.htm","","dialogWidth:430px;dialogHeight:230px;status:0");
if(arr!=null)...{
        content
=HtmlEdit.document.body.innerHTML;        
        content
=content+arr;
        HtmlEdit.document.body.innerHTML
=content;
    }
}
elseif(what=="flash")...{
vararr=showModalDialog("edithtml_include/images/flash.htm","","dialogWidth:430px;dialogHeight:200px;status:0");
if(arr!=null)...{
        content
=HtmlEdit.document.body.innerHTML;        
        content
=content+arr;
        HtmlEdit.document.body.innerHTML
=content;
    }
}
elseif(what=="avi")...{
vararr=showModalDialog("edithtml_include/images/video.htm","","dialogWidth:430px;dialogHeight:200px;status:0");
if(arr!=null)...{
        content
=HtmlEdit.document.body.innerHTML;        
        content
=content+arr;
        HtmlEdit.document.body.innerHTML
=content;
    }
}
elseif(what=="color")...{
vararr=showModalDialog("edithtml_include/images/select.htm","","dialogWidth:18.5em; dialogHeight:17.5em; status:0");
if(arr!=null) format('forecolor', arr);
}
HtmlEdit.focus();
}
function CheckForm() ... {
content
=HtmlEdit.document.body.innerHTML; 
document.form_edit.remark.value
=content;
}
function loadForm() ... {
  HtmlEdit.document.body.innerHTML
=document.form_edit.remark.value;
}
setTimeout( ' loadForm(); ' , 1000 );

包含upfile文件夹来负责上传文件功能

upfile/upfile.html

< style type ="text/css" > ... <!--
body
{...}{    background-color:#D4D0C8;    margin:0px;    font-size:12px;}-->
</ style >< form action ="upfilewrite.asp" method ="post" enctype ="multipart/form-data" style ="margin:0px;" > 选择本地文件: < input type ="file" name ="FileName" >< input type ="submit" name ="Submit" value ="上传" onclick ="javascript:showzt.style.display='';" > </ form > < div id ="showzt" style ="color:#ff0000;display:none;text-algin:center;" > 正在上传,请耐心等待...... </ div >

upfile/upfilewrite.asp

< % Server.ScriptTimeout = 9999999 % > < style type = " text/css " > < ! -- body {
    background
- color: #D4D0C8;
    margin:0px;
    font
- size:12px;
}
--> </ style > < ! -- #include file = " upload.inc " --> <
    err.Clear
    nPath
= server.MapPath( " /edithtml_include/upfile/up_file/ " )
set upl = new upload_5xsoft
set file = upl.file( " FileName " )
If file.fileSize > 0 then Randomize                 cfileName = file.fileName
if instr ( UCase (cfileName), " .ASP " ) > 0 Or instr ( UCase (cfileName), " .EXE " ) > 0 then                 % > < script language = ' javascript'> alert( ' 文件类型不合法!请重新选择文件'); this.location.href = ' upfile.html'; </ script > < %
                response.end
end if                 upfilename = split (file.fileName, " . " )
                namekzm
= upfilename( ubound (upfilename))
                filename
= " edit_ " & replace ( replace ( replace ( now (), " - " , "" ), " : " , "" ), " " , "" ) & " . " & namekzm
                file.saveAs npath
& " " & filename
End If If err.Number = 0 Then         % > < script language = ' javascript'> var filename = " <%=filename%> "         var webpath = document.location.href;
// http: // lvlingwy.u - vv.com / work / syradioword / edithtml_include / upfile / upfilewrite.asp
        var getpath
= webpath.substr( 0 ,webpath.indexOf( ' upfile/')+7) var newfilepath = getpath + " up_file/ " + filename ;
        parent.imgurl.value
= newfilepath;
        parent.showupfileinput();
        this.location.href
= ' upfile.html'; </ script > < % Else % > < script language = ' javascript'> alert( ' 文件上传失败,请重新上传'); this.location.href = ' upfile.html'; </ script > < % End If % >

无组件上传 upload.inc

< SCRIPT RUNAT = SERVER LANGUAGE = VBSCRIPT > dim upfile_5xSoft_Stream

Class upload_5xSoft
  
dim Form,File,Version
  
Private Sub Class_Initialize 
dim iStart,iFileNameStart,iFileNameEnd,iEnd,vbEnter,iFormStart,iFormEnd,theFile
dim strDiv,mFormName,mFormValue,mFileName,mFileSize,mFilePath,iDivLen,mStr
Version
= " 化境编程界HTTP上传程序 Version 1.0 " if Request.TotalBytes < 1 then Exit Sub set Form = CreateObject ( " Scripting.Dictionary " )
set File = CreateObject ( " Scripting.Dictionary " )
set upfile_5xSoft_Stream = CreateObject ( " Adodb.Stream " )
upfile_5xSoft_Stream.mode
= 3 upfile_5xSoft_Stream.type = 1 upfile_5xSoft_Stream.open
upfile_5xSoft_Stream.write Request.BinaryRead(Request.TotalBytes)

vbEnter
= Chr ( 13 ) & Chr ( 10 )
iDivLen
= inString( 1 ,vbEnter) + 1 strDiv = subString( 1 ,iDivLen)
iFormStart
= iDivLen
iFormEnd
= inString(iformStart,strDiv) - 1 while iFormStart < iFormEnd
  iStart
= inString(iFormStart, " name="" " )
  iEnd
= inString(iStart + 6 , " "" " )
  mFormName
= subString(iStart + 6 ,iEnd - iStart - 6 )
  iFileNameStart
= inString(iEnd + 1 , " filename="" " )
if iFileNameStart > 0 and iFileNameStart < iFormEnd then    iFileNameEnd = inString(iFileNameStart + 10 , " "" " )
   mFileName
= subString(iFileNameStart + 10 ,iFileNameEnd - iFileNameStart - 10 )
   iStart
= inString(iFileNameEnd + 1 ,vbEnter & vbEnter)
   iEnd
= inString(iStart + 4 ,vbEnter & strDiv)
if iEnd > iStart then     mFileSize = iEnd - iStart - 4 else     mFileSize = 0 end if set theFile = new FileInfo
   theFile.FileName
= getFileName(mFileName)
   theFile.FilePath
= getFilePath(mFileName)
   theFile.FileSize
= mFileSize
   theFile.FileStart
= iStart + 4    theFile.FormName = FormName
   file.add mFormName,theFile
else    iStart = inString(iEnd + 1 ,vbEnter & vbEnter)
   iEnd
= inString(iStart + 4 ,vbEnter & strDiv)

if iEnd > iStart then     mFormValue = subString(iStart + 4 ,iEnd - iStart - 4 )
else     mFormValue = "" end if    form.Add mFormName,mFormValue
end if
  iFormStart
= iformEnd + iDivLen
  iFormEnd
= inString(iformStart,strDiv) - 1 wend End Sub
Private Function subString(theStart,theLen)
dim i,c,stemp
 upfile_5xSoft_Stream.Position
= theStart - 1  stemp = "" for i = 1 to theLen
if upfile_5xSoft_Stream.EOS then Exit for    c = ascB(upfile_5xSoft_Stream.Read( 1 ))
If c > 127 Then if upfile_5xSoft_Stream.EOS then Exit for     stemp = stemp & Chr (AscW(ChrB(AscB(upfile_5xSoft_Stream.Read( 1 ))) & ChrB(c)))
    i
= i + 1 else     stemp = stemp & Chr (c)
End If Next  subString = stemp
End function
Private Function inString(theStart,varStr)
dim i,j,bt,theLen,str
 InString
= 0  Str = toByte(varStr)
 theLen
= LenB(Str)
for i = theStart to upfile_5xSoft_Stream.Size - theLen
if i > upfile_5xSoft_Stream.size then exit Function    upfile_5xSoft_Stream.Position = i - 1 if AscB(upfile_5xSoft_Stream.Read( 1 )) = AscB(midB(Str, 1 )) then     InString = i
for j = 2 to theLen
if upfile_5xSoft_Stream.EOS then         inString = 0 Exit for end if if AscB(upfile_5xSoft_Stream.Read( 1 )) <> AscB(MidB(Str,j, 1 )) then         InString = 0 Exit For end if next if InString <> 0 then Exit Function end if next End Function
Private Sub Class_Terminate  
  form.RemoveAll
  file.RemoveAll
set form = nothing set file = nothing   upfile_5xSoft_Stream.close
set upfile_5xSoft_Stream = nothing End Sub    
 
Private function GetFilePath(FullPath)
If FullPath <> "" Then    GetFilePath = left (FullPath, InStrRev (FullPath, " " ))
Else    GetFilePath = "" End If End function  
Private function GetFileName(FullPath)
If FullPath <> "" Then    GetFileName = mid (FullPath, InStrRev (FullPath, " " ) + 1 )
Else    GetFileName = "" End If End function
Private function toByte(Str)
dim i,iCode,c,iLow,iHigh
   toByte
= "" For i = 1 To Len (Str)
   c
= mid (Str,i, 1 )
   iCode
= Asc (c)
If iCode < 0 Then iCode = iCode + 65535 If iCode > 255 Then      iLow = Left ( Hex ( Asc (c)), 2 )
     iHigh
= Right ( Hex ( Asc (c)), 2 )
     toByte
= toByte & chrB( " &H " & iLow) & chrB( " &H " & iHigh)
Else      toByte = toByte & chrB(AscB(c))
End If Next End function End Class


Class FileInfo
dim FormName,FileName,FilePath,FileSize,FileStart
Private Sub Class_Initialize 
    FileName
= ""     FilePath = ""     FileSize = 0     FileStart = 0     FormName = "" End Sub   
Public function SaveAs(FullPath)
dim dr,ErrorChar,i
    SaveAs
= 1 if trim (fullpath) = "" or FileSize = 0 or FileStart = 0 or FileName = "" then exit function if FileStart = 0 or right (fullpath, 1 ) = " / " then exit function set dr = CreateObject ( " Adodb.Stream " )
    dr.Mode
= 3     dr.Type = 1     dr.Open
    upfile_5xSoft_Stream.position
= FileStart - 1     upfile_5xSoft_Stream.copyto dr,FileSize
    dr.SaveToFile FullPath,
2     dr.Close
set dr = nothing     SaveAs = 0 end function End Class
</ SCRIPT >

存放上传文件的 upfile/up_file文件夹

图片文件夹images,其中有html的处理页面

images/image.htm

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < HTML >< HEAD >< TITLE > 插入图片URL </ TITLE > < META content ="text/html; charset=gb2312" http-equiv =Content-Type > < STYLE type =text/css > ... TD{...}{FONT-SIZE:9pt
}
BODY{...}{FONT-SIZE:9pt
}
INPUT{...}{FONT-SIZE:9pt
}
SELECT{...}{FONT-SIZE:9pt
}

</ STYLE > < script language ="JavaScript" > ... functioncheckchange()
...{
if(chkSize.checked==true)...{
    width.disabled
=false;
    height.disabled
=false;
    }
else...{    
   width.disabled
=true;
   height.disabled
=true;
   }
}

functionimage()...{
varimghtml="";
varstrurl=imgurl.value;
if(strurl==""||strurl=="http://")return;
strtype
=strurl.substring(strurl.length-3,strurl.length);
strtype
=strtype.toLowerCase();
if(strtype=="jpg"||strtype=="gif")...{
  imghtml
=imghtml+"<img src='"+imgurl.value+"' align='"+aligntype.value+"'";
if(alttext.value!="") imghtml=imghtml+"alt='"+alttext.value+"'";
if(border.value!="") imghtml=imghtml+"border='"+border.value+"'";
if(chkSize.checked==true)...{
if(width.value!="") imghtml=imghtml+"width='"+width.value+"'";
if(height.value!="") imghtml=imghtml+"height='"+height.value+"'";
    }
  imghtml=imghtml+">";
  window.returnValue
=imghtml;
  }
window.close();
}

functionshowupfileinput()...{
if(showupfile.style.display=='none')...{showupfile.style.display=''}else...{showupfile.style.display='none'}}

</ script >
< META content ="MSHTML 5.00.2920.0" name =GENERATOR ></ HEAD > < BODY bgColor =menu > < br > < table width ="400" border ="0" align ="center" > < tr > < td width ="76" height ="30" align ="right" > 图片URL: </ td > < td height ="30" colspan ="2" >< input name ="imgurl" type ="text" id ="imgurl" value ="http://" size ="40" > < span style ="cursor:hand;color:#ff0000;" onClick ="showupfileinput();" > 上传文件 </ span ></ td > </ tr > < tr > < td height ="30" colspan ="3" align ="center" id ="showupfile" style ="display:none;" >< iframe border ="0" frameborder ="0" framespacing ="0" height ="40" marginheight ="0" marginwidth ="0" name ="upfilei" noresize scrolling ="no" src ="../upfile/upfile.html" width ="98%" align ="center" vspale ="0" ></ iframe ></ td > </ tr >
< tr > < td height ="30" align ="right" > 替换文字: </ td > < td width ="131" height ="30" >< input name ="alttext" type ="text" id ="alttext" size ="18" ></ td > < td width ="179" height ="30" > 对齐方式: 
< select name ="aligntype" id ="select" > < option value ="" > 默认 </ option > < option value ="left" > 左对齐 </ option > < option value ="right" > 右对齐 </ option > < option value ="top" > 顶边对齐 </ option > < option value ="texttop" > 文字上方 </ option > < option value ="middle" > 相对垂直居中 </ option > < option value ="absmiddle" > 绝对垂直居中 </ option > < option value ="baseline" > 基线 </ option > < option value ="bottom" > 相对底边对齐 </ option > < option value ="absbottom" selected > 绝对底边对齐 </ option > < option value ="center" > 居中 </ option > </ select ></ td > </ tr > < tr > < td height ="30" align ="right" > 图片大小: </ td > < td height ="30" >< input name ="chkSize" type ="checkbox" id ="chkSize" value ="checkbox" onChange ="checkchange();" >       指定大小 </ td > < td height ="30" > 边框粗细: 
< input name ="border" type ="text" id ="border" value ="0" size ="5" >       像素 </ td > </ tr > < tr > < td height ="30" align ="right" > &nbsp; </ td > < td height ="30" > 宽: 
< input name ="width" type ="text" id ="width" size ="5" disabled >       像素 </ td > < td > 高: 
< input name ="height" type ="text" id ="height" size ="5" disabled >       像素 </ td > </ tr > < tr align ="center" > < td height ="5" colspan ="3" >< hr ></ td > </ tr > < tr align ="right" > < td height ="30" colspan ="3" >< input name ="cmdOK" type ="button" id ="cmdOK" value =" 确定 " onClick ="image();" > &nbsp; < input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" > &nbsp;&nbsp;&nbsp;&nbsp; </ td > </ tr > </ table > </ BODY ></ HTML >

flash.htm

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < HTML >< HEAD >< TITLE > 插入flashURL </ TITLE > < META content ="text/html; charset=gb2312" http-equiv =Content-Type > < STYLE type =text/css > ... TD{...}{FONT-SIZE:9pt
}
BODY{...}{FONT-SIZE:9pt
}
INPUT{...}{FONT-SIZE:9pt
}
SELECT{...}{FONT-SIZE:9pt
}

</ STYLE > < script language ="JavaScript" > ... functioncheckchange()...{
if(chkSize.checked==true)...{
    width.disabled
=false;
    height.disabled
=false;
}
else...{    
   width.disabled
=true;
   height.disabled
=true;
   }
}

functionimage()...{
varimghtml="";
varstrurl=imgurl.value;
if(strurl==""||strurl=="http://")return;
strtype
=strurl.substring(strurl.length-3,strurl.length);
strtype
=strtype.toLowerCase();
varwidth=320;
varheight=240;
if(strtype=="swf")...{
if(chkSize.checked==true)...{
if(window.width.value!=""&&window.width.value<480) width=window.width.value;
if(window.height.value!="") height=window.height.value;
    }
  imghtml=imghtml+"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+width+"' height='"+height+"'><param name='allowScriptAccess' value='sameDomain'><param name='movie' value='"+strurl+"'><param name='quality' value='high'><param name='bgcolor' value='#F0F0F0'><param name='menu' value='false'><param name=wmode value='opaque'><embed src='"+strurl+"' wmode='opaque' menu='false' bgcolor='#F0F0F0' quality='high'  width='"+width+"' height='"+height+"' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
  window.returnValue
=imghtml;
  }
window.close();
}
</ script >
< META content ="MSHTML 5.00.2920.0" name =GENERATOR ></ HEAD > < BODY bgColor =menu > < br > < table width ="400" border ="0" align ="center" > < tr > < td width ="76" height ="30" align ="right" > FLASHURL: </ td > < td height ="30" colspan ="2" >< input name ="imgurl" type ="text" id ="imgurl" value ="http://" size ="48" ></ td > </ tr > < tr > < td height ="30" align ="right" > FLASH大小: </ td > < td width ="131" height ="30" >< input name ="chkSize" type ="checkbox" id ="chkSize" value ="checkbox" onChange ="checkchange();" >       指定大小 </ td > < td width ="179" height ="30" > &nbsp; </ td > </ tr > < tr > < td height ="30" align ="right" > &nbsp; </ td > < td height ="30" > 宽: 
< input name ="width" type ="text" id ="width" size ="5" disabled >       像素 </ td > < td > 高: 
< input name ="height" type ="text" id ="height" size ="5" disabled >       像素 </ td > </ tr > < tr align ="center" > < td height ="5" colspan ="3" >< hr ></ td > </ tr > < tr align ="right" > < td height ="30" colspan ="3" >< input name ="cmdOK" type ="button" id ="cmdOK" value =" 确定 " onClick ="image();" > &nbsp; < input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" > &nbsp;&nbsp;&nbsp;&nbsp; </ td > </ tr > </ table > </ BODY ></ HTML >

select.htm

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < HTML >< HEAD >< TITLE > 颜色 </ TITLE > < META content ="text/html; charset=gb2312" http-equiv =Content-Type > < STYLE type =text/css > ... TD{...}{FONT-SIZE:10.8pt
}
BODY{...}{FONT-SIZE:10.8pt
}
BUTTON{...}{WIDTH:5em
}
</ STYLE >
< SCRIPT language =JavaScript > ... varSelRGB='';
varDrRGB='';
varSelGRAY='120';

varhexch=newArray('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');

functionToHex(n)
...{varh, l;

n
=Math.round(n);
l
=n%16;
h
=Math.floor((n/16))%16;
return(hexch[h]+hexch[l]);
}

functionDoColor(c, l)
...{varr, g, b;

r
='0x'+c.substring(1,3);
g
='0x'+c.substring(3,5);
b
='0x'+c.substring(5,7);

if(l>120)
...{
l
=l-120;

r
=(r*(120-l)+255*l)/120;
g
=(g*(120-l)+255*l)/120;
b
=(b*(120-l)+255*l)/120;
}
else...{
r
=(r*l)/120;
g
=(g*l)/120;
b
=(b*l)/120;
}

return'#'+ToHex(r)+ToHex(g)+ToHex(b);
}

functionEndColor()
...{vari;

if(DrRGB!=SelRGB)
...{
DrRGB
=SelRGB;
for(i=0; i<=30; i++)
GrayTable.rows(i).bgColor
=DoColor(SelRGB,240-i*8);
}

SelColor.value
=DoColor(RGB.innerText, GRAY.innerText);
ShowColor.bgColor
=SelColor.value;
}
</ SCRIPT >
< SCRIPT event =onclick for =ColorTable language =JavaScript > ... SelRGB=event.srcElement.bgColor;
EndColor();
</ SCRIPT >
< SCRIPT event =onmouseover for =ColorTable language =JavaScript > ... RGB.innerText=event.srcElement.bgColor;
EndColor();
</ SCRIPT >
< SCRIPT event =onmouseout for =ColorTable language =JavaScript > ... RGB.innerText=SelRGB;
EndColor();
</ SCRIPT >
< SCRIPT event =onclick for =GrayTable language =JavaScript > ... SelGRAY=event.srcElement.title;
EndColor();
</ SCRIPT >
< SCRIPT event =onmouseover for =GrayTable language =JavaScript > ... GRAY.innerText=event.srcElement.title;
EndColor();
</ SCRIPT >
< SCRIPT event =onmouseout for =GrayTable language =JavaScript > ... GRAY.innerText=SelGRAY;
EndColor();
</ SCRIPT >
< SCRIPT event =onclick for =Ok language =JavaScript > ... window.returnValue=SelColor.value;
window.close();
</ SCRIPT >
< META content ="MSHTML 5.00.2920.0" name =GENERATOR ></ HEAD > < BODY bgColor =menu > < DIV align =center > < CENTER > < TABLE border =0 cellPadding =0 cellSpacing =10 > < TBODY > < TR > < TD > < TABLE border =0 cellPadding =0 cellSpacing =0 id =ColorTable
style ="CURSOR: hand" > < SCRIPT language =JavaScript > ... functionwc(r, g, b, n)
...{
r
=((r*16+r)*3*(15-n)+0x80*n)/15;
g
=((g*16+g)*3*(15-n)+0x80*n)/15;
b
=((b*16+b)*3*(15-n)+0x80*n)/15;

document.write(
'<TD BGCOLOR=#'+ToHex(r)+ToHex(g)+ToHex(b)+'height=8 width=8></TD>');
}

varcnum=newArray(1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0);

for(i=0; i<16; i++)
...{
document.write(
'<TR>');
for(j=0; j<30; j++)
...{
n1
=j%5;
n2
=Math.floor(j/5)*3;
n3
=n2+3;

wc((cnum[n3]
*n1+cnum[n2]*(5-n1)),
(cnum[n3
+1]*n1+cnum[n2+1]*(5-n1)),
(cnum[n3
+2]*n1+cnum[n2+2]*(5-n1)), i);
}

document.writeln(
'</TR>');
}
</ SCRIPT >
< TBODY ></ TBODY ></ TABLE ></ TD > < TD > < TABLE border =0 cellPadding =0 cellSpacing =0 id =GrayTable
style ="CURSOR: hand" > < SCRIPT language =JavaScript > ... for(i=255; i>=0; i-=8.5)
document.write(
'<TR BGCOLOR=#'+ToHex(i)+ToHex(i)+ToHex(i)+'><TD TITLE='+Math.floor(i*16/17)+'height=4 width=20></TD></TR>');
</ SCRIPT >
< TBODY ></ TBODY ></ TABLE ></ TD ></ TR ></ TBODY ></ TABLE ></ CENTER ></ DIV > < DIV align =center > < CENTER > < TABLE border =0 cellPadding =0 cellSpacing =10 > < TBODY > < TR > < TD align =middle rowSpan =2 > 选中色彩
< TABLE border =1 cellPadding =0 cellSpacing =0 height =30 id =ShowColor
width =40 > < TBODY > < TR > < TD ></ TD ></ TR ></ TBODY ></ TABLE ></ TD > < TD rowSpan =2 > 基色: < SPAN id =RGB ></ SPAN >< BR > 亮度: < SPAN
id =GRAY > 120 </ SPAN >< BR > 代码: < INPUT id =SelColor size =7 ></ TD > < TD >< BUTTON id =Ok type =submit > 确定 </ BUTTON ></ TD ></ TR > < TR > < TD >< BUTTON
onclick =window.close(); > 取消 </ BUTTON ></ TD ></ TR ></ TBODY ></ TABLE ></ CENTER ></ DIV ></ BODY ></ HTML >

video.htm

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < HTML >< HEAD >< TITLE > 插入节目URL </ TITLE > < META content ="text/html; charset=gb2312" http-equiv =Content-Type > < STYLE type =text/css > ... TD{...}{FONT-SIZE:9pt
}
BODY{...}{FONT-SIZE:9pt
}
INPUT{...}{FONT-SIZE:9pt
}
SELECT{...}{FONT-SIZE:9pt
}

</ STYLE > < script language ="JavaScript" > ... functioncheckchange()...{
if(chkSize.checked==true)...{
    width.disabled
=false;
    height.disabled
=false;
}
else...{
   width.disabled
=true;
   height.disabled
=true;
   }
}

functionimage()...{
varimghtml="";
varstrurl=imgurl.value;
if(strurl==""||strurl=="http://")return;
strtype
=strurl.substring(strurl.length-3,strurl.length);
strtype
=strtype.toLowerCase();
varwidth=320;
varheight=240;
if(strtype=="wmv"||strtype=="wma"||strtype=="wav"||strtype=="mp3"||strtype=="avi")...{
if(chkSize.checked==true)...{
if(window.width.value!=""&&window.width.value<480) width=window.width.value;
if(window.height.value!="") height=window.height.value;
    }
  imghtml=imghtml+"<embed src='"+strurl+"' type=video/x-ms-asf-plugin autostart='true' loop='true' width='"+width+"' height='"+height+"'>";
  window.returnValue
=imghtml;
  }
window.close();
}

functionshowupfileinput()...{
if(showupfile.style.display=='none')...{showupfile.style.display=''}else...{showupfile.style.display='none'}}
</ script >
< META content ="MSHTML 5.00.2920.0" name =GENERATOR ></ HEAD > < BODY bgColor =menu > < br > < table width ="400" border ="0" align ="center" > < tr > < td width ="76" height ="30" align ="right" > 节目URL: </ td > < td height ="30" colspan ="2" >< input name ="imgurl" type ="text" id ="imgurl" value ="http://" size ="40" ></ td > </ td > </ tr > < tr > < td height ="30" align ="right" > 节目大小: </ td > < td width ="131" height ="30" >< input name ="chkSize" type ="checkbox" id ="chkSize" value ="checkbox" onChange ="checkchange();" >       指定大小 </ td > < td width ="179" height ="30" > &nbsp; </ td > </ tr > < tr > < td height ="30" align ="right" > &nbsp; </ td > < td height ="30" > 宽:
< input name ="width" type ="text" id ="width" size ="5" disabled >       像素 </ td > < td > 高:
< input name ="height" type ="text" id ="height" size ="5" disabled >       像素 </ td > </ tr > < tr align ="center" > < td height ="5" colspan ="3" >< hr ></ td > </ tr > < tr align ="right" > < td height ="30" colspan ="3" >< input name ="cmdOK" type ="button" id ="cmdOK" value =" 确定 " onClick ="image();" > &nbsp; < input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" > &nbsp;&nbsp;&nbsp;&nbsp; </ td > </ tr > </ table > </ BODY ></ HTML >

image: http://download1.csdn.net/down3/20070608/08141657200.rar

调用方式

<form method="post" action="write.asp" name="form_edit" id="form_edit" onSubmit="return CheckForm();">

<!--#include file="edithtml_include/edithtml.asp"-->
    <p><textarea name="remark" style="display:none;"><%=CovHtml(content)%></textarea>
     <!--#include file="edithtml_include/inputtool.html"-->
     <iframe class="HtmlEdit" ID="HtmlEdit" marginheight="1" marginwidth="1" width="680" height="300"></iframe>
    </p>

</form>

自己写的html编辑器相关推荐

  1. java实现迷你计算机,用JAVA写一个迷你编辑器.doc

    用JAVA写一个迷你编辑器 用JAVA编写一个迷你编辑器 WINDOWS的记事本程序是非常方便的一个文字处理工具,用它来编辑纯文本文件快捷而灵巧.我用JAVA写了一个编辑器程序,模仿"记事本 ...

  2. hecto - 手把手教你写个 文本编辑器

    https://www.philippflenker.com/hecto/ 的阅读笔记. 我是学完[[Rust权威指南]] 之后才看的这个. 手把手教你写个 文本编辑器(1300+行代码). 作者是真 ...

  3. 用pygame写像素游戏地图编辑器

    用pygame写像素游戏地图编辑器 像素游戏的地图 我使用一个矩阵来存储地图,像下面这样: [[1,0,0],[0,1,0],[1,2,0]] 不同的数字代表不同的物体,比如1代表一个房子,0代表路面 ...

  4. 自己写富文本编辑器jss_JSS选择器和语法规则

    自己写富文本编辑器jss JSS is a JavaScript library that allows you to create objects that follow a CSS-like sy ...

  5. python用哪个软件好-写 Python 哪个编辑器 / IDE 最好用?

    首先,如果你说你要使用python自带的IDE,我毫不夸张的说,你怕是dsb(大帅逼),你确定你能不输错变量名.不输错语法和关键字?python自带的ide更适合你用来测试一个写好的脚本,或者对代码进 ...

  6. 原生手写富文本编辑器组件

    H5富文本编辑器原理解析: 核心属性: 1.contentEditable="true"; //属性规定是否可编辑元素的内容 2.window.document.designMod ...

  7. 如何写一个代码编辑器

    演示什么是代码编辑器 演示 当我们看到这个编辑器的时候,你有没有好奇这是这么做出来的?如果是让你来做,你会怎么做? 闲扯 学无止境,我们现在的技术都是基于前一代人之上做出来的,要想成为一个高级/资深的 ...

  8. linux中vi写java,Linux编辑器vi使用方法详细介绍

    摘要:vi编辑器是全部Unix及Linux系统下标准的编辑器,它的强大不逊色于任何最新的文本编辑器,这里只是简单地介绍一下它的用法和一小部分指令.因为对Unix及Linux系统的任何版本,vi编辑器是 ...

  9. python代码编辑器排行榜-写 Python 哪个编辑器 / IDE 最好用?

    不请自来嘻嘻,简单介绍一下几款好用的编写器,希望对你有帮助- 1.IDLE IDLE是开发 python 程序的基本IDE(集成开发环境),具备基本的IDE的功能,是非商业Python开发的不错的选择 ...

  10. java-编写简单的编辑器

    本文编写的编辑器模仿的是windows底下的记事本功能,并增加了高亮和自动保存的功能. 该编辑器功能如下: 复制粘贴 查找替换 自动保存 代码高亮 这次只搭建简单的框架,搭建出基本样子 2016/03 ...

最新文章

  1. [软件工程]技术规格说明书
  2. labview简易计算机实验报告,labview实验报告..doc
  3. mybatisplus 结果_Java之MyBatis Plus介绍
  4. 常用 Git 命令清单(转)
  5. FreeRTOS 事件标志组 ——提高篇
  6. centos下搭建Jenkins持续集成环境(安装jenkins)
  7. idea多级目录不展开的问题
  8. pythonclass的使用详情_python 类class基础简明笔记
  9. JavaSE复习_8 泛型程序设计
  10. 大一计算机基础ppt练习题,计算机基础知识PPT练习题及答案DOC
  11. 单反相机的一般入门设置建议
  12. Mac如何拷贝文件到移动硬盘
  13. pytorch训练过程中内存一直慢慢增长直到爆
  14. html基础教学ppt,HTML5基础培训ppt课件
  15. 数字化时代:电梯广告的喜与忧
  16. ueditor编辑器上传文件超时报错
  17. 算法:挑选出100瓶药水中有且仅有1瓶毒药水所需的最少老鼠数量?
  18. 讲解 Spatial Pyramid Pooling
  19. [ZT]JavaScript+div实现模态对话框[修正版]
  20. *一篇看了心有所感且文风特别好的文章**

热门文章

  1. row_number 语法
  2. “卷积神经网络目标检测:原理、分析与应用场景一览“
  3. Windows 10英文系统解决中文乱码问题
  4. Android安卓如何创建使用英文专用layout界面和values资源?
  5. 炼数成金dataguru邀请码C451
  6. 打造“拉动式”企业培训管理方案,释放人才潜能
  7. 百度AI交流来西安了!
  8. C. Adding Powers
  9. 【AnyQ】遇到的问题整理(一)
  10. C++写个三维模型展UV