代码如下:
<Public: компонент>
<Public: methodname = "init" InternalName = "fncreateprogressbar"/>
<Public: methodname = "showprogress" intornlaname = "showprogress"/>
<Public: propertyname = "intainer"/>
<Public: PropertyName = "speed"/>
<Scriptlanguage = javascript>
varstarttime = null;
functionfncreateprogressbar () {
Теперь = newdate ();
startTime = now.getTime ();
Теперь = null
ocontainer = element.container
ocontainer.innerhtml = "";
ODIV = window.document.createElement ("div")
Odiv.classname = "Прогресс"
ocontainer.appendchild (ODIV)
Odiv.Style.display = "";
element.bar = Odiv;
}
functionpause (numbermillis) {
vardialogscript =
'window.setTimeout ('+
'function () {window.close ();},'+numbermillis+');';
varresult =
window.showmodaldialog (
'javascript: document.writeln ('+
'' <cript> '+dialogscript+' <'+'/script> ") ');
}
functionShowProgress (StatesDesc) {
Теперь = newdate ();
curtrime = now.gettime ();
Теперь = null
if (statesdesc! = null) window.status = stastsDesc+"当前耗时:"+(curtrime-starttime)+"毫秒!";
element.bar.style.width = (curtrime-starttime)/lelement.speed;