Lib. js_javascript Skills Used in the filemanage Function

Source: Internet
Author: User
Lib. js used in the filemanage function? 1.1.23 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 createp = document. createElement ("p ");
Createp. setAttribute ("id", "myfile _" + sId );
Createp. style. height = "17px ";
Createp. className = "file_p ";

StrHtml ="

"StrHtml + =" "StrHtml + ="
"+ SFileName +"
"

Createp. innerHTML = strHtml;
Document. getElementById ("myfilesarea"). appendChild (createp );
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 = "Step 1: update files and folders"
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 = "Step 1: update files and folders"
Document. getElementById ("step02"). innerHTML = "Step 2: delete invalid Files"
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 = "Step 2: delete invalid Files"
Document. getElementById ("step03"). innerHTML = "Step 3: Set FTP space synchronization"
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 = "Step 3: Set FTP space synchronization"
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 +"
"+" File directory: "+ B +"
"+" File size: "+ c +"
"+" Upload time: "+ d +"
"+" File Introduction: "+ e +"
"+" File downloads: "+ count +"
"
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 ";
}

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.