Lib.js_javascript techniques used in filemanage functions

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= ' style= ' table-layout:fixed '" > "
strHTML + = "<tr><td width= ' 174 ' style= ' word-break:break-all ' ></> <font size=2> "+sfilename +" </font> </td> "
strHTML + = "<td width= ' ></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> First step: 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> First step: Update files and folders </font> "
document.getElementById ("Step02"). Innerhtml= "<font size=2> Second step: Delete invalid file </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 two: Delete invalid file </font> "
document.getElementById ("step03"). Innerhtml= "<font size=2> Third step: Set FTP space sync </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> Third step: Set up 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 (a) {
document.getElementById ("Layer_tips"). Innerhtml=a
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= "FileName: +a+" <br> "+" file directory: "+b+" <br> "+" File Size: "+c+" <br> "+" Upload time: "+d+" <br> "+" File Introduction: "+e+" <br> "+" File download times: "+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";
}

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.