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

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

        }
    }
    if(fns.length==0)return;

    divJSExportContent.style.display="block";
    selJSExport.style.display="none";

    divJSExportContent.innerHTML=fcs.join("rn<br>rn");
}

function execJSExport_Dep(){
    var fns=new Array(), fcs=new Array(), str, regFNs=new Array(), needDepthTest;

    for(var i=0; i<selJSExport.options.length; i++){
        if(selJSExport.options[i].selected){
            fns.push(selJSExport.options[i].value);
            try{
                str=selJSExport.options[i].obj.nextSibling.outerHTML;
            }catch(e){}
            fcs.push(str);
        }
    }
    if(fns.length==0)return;

    divJSExportContent.style.display="none";
    selJSExport.style.display="block";

    needDepthTest=false;
    for(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;
                }
            }
        }
    }
    if(needDepthTest)execJSExport_Dep();
}


function showWait(onstop){
    glbBusy=true;
    document.body.style.cursor="wait";

    with(divWaiting.style){
        display="block";