4
Copyright DHTMLX LTD. http://www.dhtmlx.com
5
You allowed to use this component or parts of it under GPL terms
6
To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
8
var _all_used_trees=new Array();
9
dhtmlXTreeObject.prototype._createSelfA2=dhtmlXTreeObject.prototype._createSelf;
10
dhtmlXTreeObject.prototype._createSelf=function(){
11
_all_used_trees[_all_used_trees.length]=this;
12
return this._createSelfA2();
15
window.onerror=function (a,b,c,d){
16
var d=document.createElement("DIV");
17
d.style.cssText="position:absolute; background-color:white; top:10px; left:10px; z-index:20; width:500px; border: 2px silver outset;";
18
var dh="<div style='width:100%; color:red; font-size:8pt; font-family:Arial; font-weight:bold; '>Javascript Error</div>";
19
dh+="<div style='width:100%; font-size:8pt; font-family:Arial; '>The next error ocured :<br/> <strong>"+a+"</strong> in <strong>"+b+"</strong> at line <strong>"+c+"</strong></div>";
20
dh+="<div style='width:100%; font-size:8pt; font-family:Arial; '>If you think that error can be caused by dhtmlxtree press the 'Generate report' button and send generated report to <a href='email:support@dhtmlx.com'>support@dhtmlx.com</a> </div>";
21
dh+="<input style='font-size:8pt; font-family:Arial; ' onclick='dhtmlxtreeReport(this)' type='button' value='Generate report'/><input style='font-size:8pt; font-family:Arial; ' type='button' value='Close' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>";
24
document.body.appendChild(d);
28
function dhtmlxtreeErrorReport(a,b,c){
32
str+="<br/>"+c[0].responseText+"</br>"+c[0].status;
35
window.onerror(str, "none", "none");
38
function dhtmlxtreeReport(node){
39
var that=node.parentNode;
40
that.lastChild.innerHTML="<textarea style='width:100%; height:300px;'></textarea>";
41
var rep=that.childNodes[1].innerHTML;
42
for (var a=0; a<_all_used_trees.length; a++){
43
var atree=_all_used_trees[a];
44
rep+="\n\n Tree "+a+"\n";
46
if (typeof(atree[b])=="function") continue;
47
rep+=b+"="+atree[b]+"\n";
49
rep+="---------------------\n";
52
var z=atree.XMLLoader.getXMLTopNode("tree")
56
var xmlSerializer = new XMLSerializer();
57
rep+=xmlSerializer.serializeToString(z)+"\n";
61
rep+="XML not recognised\n";
65
rep+="---------------------\n";
66
for (var i in atree._idpull){
67
var n=atree._idpull[i];
68
if (typeof(n)!='object') continue;
70
rep+=" Childs: "+n.childsCount;
71
for (var j=0; j<n.childsCount; j++)
72
rep+=" ch"+j+":"+n.childNodes[j].id;
76
that.lastChild.childNodes[0].value=rep;
79
dhtmlxError.catchError("ALL",dhtmlxtreeErrorReport);
80
//(c)dhtmlx ltd. www.dhtmlx.com