/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to includes/dhtmlx/ext/dhtmlxtree_er.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-10-29 03:02:24 UTC
  • mto: This revision was merged to the branch mainline in revision 116.
  • Revision ID: csa@dside.dyndns.org-20081029030224-yc3wy2dti4htlfxf
New version of dhtmlxmenu and dhtmlxtree is added

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//v.2.0 build 81009
 
2
 
 
3
/*
 
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
 
7
*/
 
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();
 
13
}
 
14
 
 
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);'/>";
 
22
    dh+="<div/>";
 
23
    d.innerHTML=dh;
 
24
    document.body.appendChild(d);
 
25
    return true;
 
26
};
 
27
 
 
28
function dhtmlxtreeErrorReport(a,b,c){
 
29
    var str=a+" ["+b+"]";
 
30
    if (a=='LoadXML')
 
31
        {
 
32
            str+="<br/>"+c[0].responseText+"</br>"+c[0].status;
 
33
        }
 
34
 
 
35
    window.onerror(str, "none", "none");
 
36
}
 
37
 
 
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";
 
45
            for (b in atree){
 
46
                if (typeof(atree[b])=="function") continue;
 
47
                rep+=b+"="+atree[b]+"\n";
 
48
                }
 
49
            rep+="---------------------\n";
 
50
                if (atree.XMLLoader){
 
51
                    try{
 
52
                    var z=atree.XMLLoader.getXMLTopNode("tree")
 
53
                        if (document.all)
 
54
                           rep+=z.xml+"\n";
 
55
                        else{
 
56
                          var xmlSerializer = new XMLSerializer();
 
57
                          rep+=xmlSerializer.serializeToString(z)+"\n";
 
58
                        }
 
59
                    }
 
60
                    catch(e){
 
61
            rep+="XML not recognised\n";
 
62
                    }
 
63
                }
 
64
 
 
65
            rep+="---------------------\n";
 
66
            for (var i in atree._idpull){
 
67
                var n=atree._idpull[i];
 
68
                if (typeof(n)!='object') continue;
 
69
                rep+="Node: "+n.id;
 
70
                rep+="  Childs: "+n.childsCount;
 
71
                for (var j=0; j<n.childsCount; j++)
 
72
                    rep+="  ch"+j+":"+n.childNodes[j].id;
 
73
                rep+="\n";
 
74
            }
 
75
    }
 
76
    that.lastChild.childNodes[0].value=rep;
 
77
}
 
78
 
 
79
dhtmlxError.catchError("ALL",dhtmlxtreeErrorReport);
 
80
//(c)dhtmlx ltd. www.dhtmlx.com