JS代码格式化和语法着色V2

2019-06-03 18:16:39王旭

(var i=0;i<glbFuntionNames.length;i+=1){   if(!selJSExport.options[i].selected)
{    for(j=0;j<fcs.length;j++){     if(html2txt(fcs[j]).match
(glbFuntionNames[i].replace(/./g,"."))){      selJSExport.options
[i].selected=true;      needDepthTest=true;      break;&#
13;     }    }   }  }  if
(needDepthTest)execJSExport_Dep(); } function showWait(onstop)
{  glbBusy=true;  document.body.style.cursor="wait";    wit
h(divWaiting.style){   display="block";   left=(document.body.clientWidth-
divWaiting.offsetWidth)/2;   top=(document.body.clientHeight-divWaiting.offsetHeight)/2;  }
 spnProcess.innerHTML="0.00%  ( 0 / 0 )
";  divWaiting.onstop=onstop;  cmdStop.focus();  return(false); }
function hideWait()
{  glbBusy=false;  document.body.style.cursor="";  divWaiting.style.displ
ay="none";  try{clearTimeout(glbTimer);}catch(e){}  try{divWaiting.onstop();}catch(e)
{}  return(false); } function stopExec(){ hideWait(); }
function startRecalcLine()
{  var re="", re2="";  if(glbBusy)
return;  glbBusy=true;    for(var i=0;i<parseInt
(divJSOutput.scrollHeight/14+200);i++){   re+="<p>"+(i+1)
+"</p>";   re2+="<p>&nbsp;</p>";  }
   divJSOutputLineNo.innerHTML=re;  divJSOutputPlus.innerHTML=re2;  
divJSOutputPlus.buttons=new Array();    glbP=0;    showWait
();  recalcLine();  return(false); }
function recalcLine()
{  var objs, j;    objs=document.getElementsByTagName
("div");  for(var i=glbP;i<objs.length&&(i-glbP<30);i++){   if
(objs[i].className=="indent"){    j=parseInt(objs[i].offsetTop/14)-
1;    divJSOutputPlus.childNodes
[j].className="colsp";    divJSOutputPlus.childNodes[j].innerHTML="-