var CBugReport=Class.create();
CBugReport.prototype={initialize:function(_1){
this._baseUrl=_1;
this._debug=0;
this.id="BUGREPORT_"+((new Date()).getTime().toString(16));
this.snapshot={};
this.formWidth=640;
this.formHeight=550;
this.ticketUrl="http://support.iprogress.com/tools/img_upload/ticketform.php";
this.formUrl="http://support.iprogress.com/index.php";
this.uploadUrl="http://support.iprogress.com/tools/img_upload/upload.php";
this.gotoUrl="http://support.iprogress.com/tools/img_upload/goto.php";
if(this._debug){
this.ticketUrl="http://srvrdtst3:82/tests/bugreport/ticketform.php";
this.formUrl="http://srvrdtst3:82/tests/bugreport/index.cfm";
this.uploadUrl="http://srvrdtst3:82/tests/bugreport/upload.php";
this.gotoUrl="http://srvrdtst3:82/tests/bugreport/goto.php";
}
},newActiveX:function(_2){
if(PGLoader&&PGLoader.object){
return PGLoader.object.getNew(_2);
}
return null;
},captureActiveWindow:function(_3){
var _4=[".bmp",".png"];
var _5=2;
var _6=this.newActiveX("Scripting.FileSystemObject");
if(_6==null){
return;
}
var _7=_6.GetSpecialFolder(_5).path+"\\";
this.snapshot.fileName=this.id+_4[_3];
this.snapshot.localFilePath=_7+this.snapshot.fileName;
var _8=_7+this.id+"0"+_4[_3];
var _9=this.newActiveX("OdSCCtrl.OdSnapshotCtrl.1");
if(_9==null){
return;
}
_9.StartFilePath=_7;
_9.FileType=_3;
_9.StartFileName=this.id;
_9.CaptureWidth=screen.availWidth;
_9.CaptureHeight=screen.availHeight;
_9.AskFileName=false;
_9.NoDigits=0;
_9.LastPicIdx=-1;
_9.Shoot();
_6.MoveFile(_8,this.snapshot.localFilePath);
},getEncodedSnaphot:function(){
var _a=4;
try{
var _b="";
var _c=this.newActiveX("Microsoft.XMLHTTP");
if(_c!=null){
_c.open("GET",this.snapshot.localFilePath,false);
_c.setRequestHeader("Content-Type","text/plain; charset=x-user-defined");
_c.send();
if(_c.readyState==_a){
var _d=this.newActiveX("MSXML2.DOMDocument");
if(_d!=null){
var _e=_d.createElement("node");
_e.dataType="bin.base64";
_e.nodeTypedValue=_c.responseBody;
_b=_e.text;
}
}
}
}
catch(e){
_b="";
}
return _b;
},fillForm:function(_f,_10){
function $get(id){
return _f.getElementById(id);
};
function addLine(lbl,val){
return "<b>"+lbl+": </b>"+val+"<br />";
};
var _14=this.snapshot.fileName;
var _15=this.getEncodedSnaphot();
if(_14&&_15){
$get("upFileName").value=_14;
$get("upFileData").value=_15;
$get("upFileUrl").value=this.uploadUrl;
try{
var _16=this.newActiveX("Scripting.FileSystemObject");
_16.DeleteFile(this.snapshot.localFilePath);
}
catch(e){
}
}
var _17=WApplication.activityTree;
$get("productName").value=_17.root.title;
var _18=WApplication.resume.sessionBookmark;
var cur=_17.currentActivity;
var _1a=cur;
var _1b="";
while(_1a!=null){
_1b=" / "+_1a.title+_1b;
_1a=_1a.parent;
}
var _1c=escape(location.href.replace(/^.+main\.htm/,"/scowrapper/scowrapper.htm")+"&deecran="+_18+"&noseq=1");
var _1d="<a style=\"color:#00f;text-decoration:underline;\" target=\"_blank\" href=\""+this.gotoUrl+"?url="+_1c+"\">open item</a>";
var _1e="";
_1e+="<hr>";
_1e+=addLine("where",_1b);
_1e+=addLine("screen ID",_18);
_1e+=addLine("screen URL",cur.getResource().href);
_1e+=addLine("screen link",_1d);
_1e+=addLine("suspend_data",WApplication.activityTree.serialize(true,""));
_1e+=addLine("launch_data",WApplication.launch_data);
_1e+=addLine("base Url",WApplication.baseUrl);
_1e+=addLine("LMS type",WApplication.lms.type);
_1e+=addLine("user agent",navigator.userAgent);
_1e+=addLine("platform",navigator.platform);
_1e+=addLine("screen size",screen.width+"x"+screen.height);
$get("debugData").value=_1e;
$get("supportUrl").value=this.formUrl;
$get(_10).action=this.ticketUrl;
$get(_10).submit();
},open:function(){
this.captureActiveWindow(1);
popup(this._baseUrl+"bugreport.htm",this.id,this.formWidth,this.formHeight);
}};

