Lib. js used in the filemanage Function

Source: Internet
Author: User

Var indexnum = 10;
Var count = 0;


Function getmap (sFileName, sId ){

Var Uploadpic = "../filetype/unknown.gif ";
Var sExten = sFileName. substring (sFileName. lastIndexOf (".") + 1, sFileName. length );

Var creatediv = document. createElement ("div ");
Creatediv. setAttribute ("id", "myfile _" + sId );
Creatediv. style. height = "17px ";
Creatediv. className = "file_div ";

StrHtml = "<table border = '0' cellpadding = '0' cellspacing = '0' width = '000000' style = 'table-LAYOUT: fixed'>"
StrHtml + = "<tr> <td width = '000000' style = 'word-break: break-all'> </> <font size = 2> "+ sFileName +" </font> </td>"
StrHtml + = "<td width = '26'> </td> </tr> </table>"

Creatediv. innerHTML = strHtml;
Document. getElementById ("myfilesarea"). appendChild (creatediv );
Document. getElementById (sId). style. display = "none"

Count ++;

Checkexist (sExten, sId );

}

Function checkexist (xExt, xId ){
Var picurl = "../filetype/" + xExt + ". gif ";

Var url = "checkexist. asp? Pic = "+ xExt +" & pid = "+ Math. random ();

XmlHttp. open ("GET", url, false );
XmlHttp. onreadystatechange = function sendinfo (){

If (xmlHttp. readyState = 4 ){
If (xmlHttp. status = 200 ){
Var response = xmlHttp. responseText;
If (response = "yes "){
Document. getElementById ('fileext _ '+ xId). src = picurl;
}
}
}
}

XmlHttp. send (null );


}


Function clearfiles (xId ){
Document. getElementById ("myfile _" + xId). removeNode (true );
Document. getElementById (xId). style. display = "block ";
Count --;
}




Function step1 (){
Document. getElementById ("step01 "). innerHTML = "<font size = 2> Step 1: update files and folders </font>"
Var url = ".../listall. asp? Pid = "+ Math. random ();
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = step1ok;
XmlHttp. send (null );
}

Function step1ok (){
If (xmlHttp. readyState = 4 ){
Document. getElementById ("step01 "). innerHTML = "<font size = 2> Step 1: update files and folders </font> Document. getElementById ("step02 "). innerHTML = "<font size = 2> Step 2: delete invalid files </font>"
SetTimeout ("step2 ()", 1000 );
}
}

Function step2 (){
Var url = "../delall. asp? Pid = "+ Math. random ();
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = step2ok;
XmlHttp. send (null );
}

Function step2ok (){
If (xmlHttp. readyState = 4 ){
Document. getElementById ("step02 "). innerHTML = "<font size = 2> Step 2: delete invalid files </font> Document. getElementById ("step03 "). innerHTML = "<font size = 2> Step 3: Set FTP space synchronization </font>"
SetTimeout ("step3 ()", 1000 );
}
}

Function step3 (){
Var url = "ftpformate. asp? Pid = "+ Math. random ();
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = step3ok;
XmlHttp. send (null );
}

Function step3ok (){
If (xmlHttp. readyState = 4 ){
Document. getElementById ("step03 "). innerHTML = "<font size = 2> Step 3: Configure FTP space synchronization </font> SetTimeout ("step4 ()", 1000 );
}
}

Function step4 (){
Document. getElementById ("filemanage_update"). style. display = "none"
Document. getElementById ("filemanage_all"). style. display = "block ";
Showfiles ();
}


Var tagstate;
Tagstate = "no"

Function showtag (){
If (tagstate = "no "){
Document. getElementById ("arror_01"). src = 'images/arror2.gif'
Document. getElementById ("intro"). style. display = "block ";
Tagstate = "yes ";
} Else {
Document. getElementById ("arror_01"). src = 'images/arror.gif'
Document. getElementById ("intro"). style. display = "none ";
Tagstate = "no ";
}
}

Function showtips (){
Document. getElementById ("layer_tips"). innerHTML =
Document. getElementById ("layer_tips"). style. display = "block ";
Document. getElementById ("layer_tips"). style. pixelTop = window. event. y + 18;
Document. getElementById ("layer_tips"). style. pixelLeft = window. event. x + 12;
}

Function notips (){
Document. getElementById ("layer_tips"). style. display = "none ";
}

Function showfileintro (a, B, c, d, e, f ){
Var count
If (f = ''){
Count = 0
} Else {
Count = f
}
Var htmlstr = "file name:" + a + "<br>" + "Directory:" + B + "<br>" + "file size: "+ c +" <br> "+" Upload time: "+ d +" <br> "+" file introduction: "+ e +" <br> "+" file downloads: "+ count +" <br>"
Document. getElementById ("layer_fileintro"). innerHTML = htmlstr
Document. getElementById ("layer_fileintro"). style. display = "block ";
Document. getElementById ("layer_fileintro"). style. pixelTop = window. event. y + 18;
Document. getElementById ("layer_fileintro"). style. pixelLeft = window. event. x + 12;
}

Function nofileintro (){
Document. getElementById ("layer_fileintro"). style. display = "none ";
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.