文件夹 edithtml (包含6个文件)
inputtool.html
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, " & " , " & " )
CovHtml = replace (CovHtml, " < " , " < " )
CovHtml = replace (CovHtml, " > " , " > " )
CovHtml = replace (CovHtml, chr ( 34 ), " " " )
CovHtml = replace (CovHtml, chr ( 39 ), " ' " )
end if
if Err.Number <> 0 then
CovHtml = " CovHtml转换中出错请联系管理员<br> "
Err.Clear
end if
end function
% >
js文件 edit.js
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")...{
var arr = 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;
}
}else if(what == "flash")...{
var arr = 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;
}
}else if(what == "avi")...{
var arr = 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;
}
}else if(what == "color")...{
var arr = 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
<!--
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
< 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
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
< 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" > ...
function checkchange()
...{
if (chkSize.checked==true)...{
width.disabled=false;
height.disabled=false;
}
else...{
width.disabled=true;
height.disabled=true;
}
}
function image()...{
var imghtml="";
var strurl=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();
}
function showupfileinput()...{
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" > </ 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();" >
< input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" >
</ td >
</ tr >
</ table >
</ BODY ></ HTML >
< 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" > ...
function checkchange()...{
if (chkSize.checked==true)...{
width.disabled=false;
height.disabled=false;
}else...{
width.disabled=true;
height.disabled=true;
}
}
function image()...{
var imghtml="";
var strurl=imgurl.value;
if (strurl==""||strurl=="http://") return;
strtype=strurl.substring(strurl.length-3,strurl.length);
strtype=strtype.toLowerCase();
var width = 320;
var height = 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" > </ td >
</ tr >
< tr >
< td height ="30" align ="right" > </ 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();" >
< input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" >
</ td >
</ tr >
</ table >
</ BODY ></ HTML >
< 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 > ...
var SelRGB = '';
var DrRGB = '';
var SelGRAY = '120';
var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
function ToHex(n)
...{ var h, l;
n = Math.round(n);
l = n % 16;
h = Math.floor((n / 16)) % 16;
return (hexch[h] + hexch[l]);
}
function DoColor(c, l)
...{ var r, 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);
}
function EndColor()
...{ var i;
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 > ...
function wc(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>');
}
var cnum = new Array(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
< 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" > ...
function checkchange()...{
if (chkSize.checked==true)...{
width.disabled=false;
height.disabled=false;
}else...{
width.disabled=true;
height.disabled=true;
}
}
function image()...{
var imghtml="";
var strurl=imgurl.value;
if (strurl==""||strurl=="http://") return;
strtype=strurl.substring(strurl.length-3,strurl.length);
strtype=strtype.toLowerCase();
var width = 320;
var height = 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();
}
function showupfileinput()...{
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" > </ td >
</ tr >
< tr >
< td height ="30" align ="right" > </ 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();" >
< input name ="cmdCancel" type ="submit" id ="cmdCancel" value =" 取消 " onClick ="window.close();" >
</ 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>