日期:2008-09-13  浏览次数:21121 次

test.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<HTML XMLns:v="urn:schemas-microsoft-com:vml">
<head>
    <title>公文留痕</title>
</head>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<link rel="stylesheet" href=../../"pub_Document.CSS">
<script language="JScript">
var nowID=0;
var popID=0;
var padHeight=0;
function init()
{
newID=parseInt(document.all("n").value);
}
function createDelLine(num)
{
var newMark=document.createElement("<div id='mark"+num+"'></div>");
memo.insertBefore(newMark);
var oRcts = oTempRange.getClientRects();
for(var i=0;i<oRcts.length;i++)
{
  var t=oRcts[i].top;
  var l=oRcts[i].left;
  var r=oRcts[i].right;
  var b=oRcts[i].bottom;
  var newRect=document.createElement("<v:roundRect oncontextmenu='popID="+num+";popUp();' id='Rect"+num+"no"+i+"' style='position:absolute;visibility:hidden' filled=t fillcolor=red strokeColor=red strokeWeight=1pt></v:roundRect>");
  newMark.insertBefore(newRect);
  newRect.style.posTop=t+document.body.scrollTop-2+(b-t)/2;
  newRect.style.posLeft=l-2;
  newRect.style.width=r-l;
  newRect.style.height=2;
  newRect.style.visibility="";
}
}
function createRect(num)
{
var newMark=document.createElement("<div id='mark"+num+"'></div>");
edit.insertBefore(newMark);
var oRcts = oTempRange.getClientRects();
for(var i=0;i<oRcts.length;i++)
{
  var t=oRcts[i].top;
  var l=oRcts[i].left;
  var r=oRcts[i].right;
  var b=oRcts[i].bottom;
  var newRect=document.createElement("<v:roundRect oncontextmenu='popID="+num+";popUp();' id='Rect"+num+"no"+i+"' style='position:absolute;visibility:hidden' filled=f strokeColor=red strokeWeight=1.5pt></v:roundRect>");
  newMark.insertBefore(newRect);
  newRect.style.posTop=t+document.body.scrollTop-3;
  newRect.style.posLeft=l-2;
  newRect.style.width=r-l;
  newRect.style.height=b-t;
  newRect.style.visibility="";
}
}
var PopSrcElement=null;
var SelectOk=false;
var oTempRange=null;
function createTempRange()
{
hideMenu();
doc_click();
if(document.selection.type=="Text")
  {
   oTempRange=document.selection.createRange();  //把选择的文本创建成 TextRange 对象
   if(oTempRange.HTMLText!=""){                    //检查选择的是否为空字符
       RangePosLeft=oTempRange.boundingLeft;
       RangePosTop =oTempRange.offsetTop+document.body.scrollTop+oTempRange.boundingHeight;
       oTempRange.execCommand("BackColor",true,"#99ccff");;
       oTempRange.execCommand("UnSelect");
       SelectOk