Class files:
$ = function (id) {
return (id);
}
//Text to JSON string
= function () {
if (this == ) {
return null;
}
else {
try {
return eval(( + (/rn/g, rn) + ));
}
catch (err) {
}
}
};
// Character formatting method
= function () {
var newStr = this;
var reg = null;
for (var i = 0; i < ; i++) {
reg = RegExp('{' + (i) + '}', 'gm');
newStr = (reg, arguments[i]);
}
return newStr;
};
//Progress bar class
function Progress(objId) {
//Object
= null;
//Progress bar object ID
= objId;
//The current progress starts with 0
= 0;
//The progress bar shows the DIV ID of the progress
= inner + ;
//Progress bar border ID
= frame + ;
//Progress bar parameter configuration
= {
//width
width: 150,
//high
height: 20,
//Left margin
left: 0,
//Top margin
top: 0,
//Progress color
progressColor: red,
//Border color
borderColor: #ccc,
//Border width
borderHeight: 2,
//Hide the progress bar after N seconds after the progress is completed. 0 is hidden immediately.
hiddenSplit:2000
};
}
//Progress bar class initialization method
= function () {
// Create a new progress bar border DIV
var progressdiv = (div);
//Border DIV style
var progressdiv_css_text = position:absolute;width:{0}px;height:{1}px;left:{2}px;top:{3}px;border:{4} {5}px solid;.format
(
,
,
,
,
,
);
//Reset the progress to 0
= 0;
//Set border ID
= ;
//Set border style
= progressdiv_css_text;
//Set the progress bar HTML
= '
'.format(, , );
//Add to body
(progressdiv);
};
//Progress bar hidden function
= function () {
(());
();
}
//Function triggered at the end of the progress
= function () {
();
= (+.hiddenProgress();,);
if () {
();
}
}
//The callback function after each run of progress
= function () {
var progressDiv = ();
var progressFrameDiv = ();
= (*100)+ %;
= Upload progress: + (*100) + %;
= (*100) + %;
if ( >= 1) {
();
= File upload successfully!;
}
}
//The progress bar runs the function. Need to implement it by yourself
= function () {
alert (Please implement the + + .run method to implement asynchronous progress requests, please call back the + + .callback method to send back.);
();
}
//Start progress
= function () {
();
= ( + .run(), 1000);
}