/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
200 by Suren A. Chilingaryan
Initial commit of gestures support for iDevices by Toni Pirhonen, Fix IE support broken by revision r196
1
function VIRTUAL(id, control, geometry_node) {
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
2
    this.node = document.getElementById(id);
3
    this.control = control;
4
200 by Suren A. Chilingaryan
Initial commit of gestures support for iDevices by Toni Pirhonen, Fix IE support broken by revision r196
5
    this.controls_node = geometry_node;
6
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
7
    this.srctree=new dhtmlXTreeObject(id,"100%","100%",0, false);
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
8
    if (adei.cfg.dhtmlx_iconset) {
9
	this.srctree.setImagePath(adei.cfg.dhtmlx_iconset);
10
    }
11
    this.srctree.setXMLAutoLoading(adei.GetServiceURL("srctree")); 
12
    this.srctree.setDataMode("xml");
13
    this.srctree.enableCheckBoxes(1);
14
    this.srctree.enableThreeStateCheckboxes(true);
196 by Suren A. Chilingaryan
Arsen Sogomonyan - Fix horizontal scroll in VirtualTree
15
}
16
17
VIRTUAL.prototype.UpdateTreeGeometry = function() {
200 by Suren A. Chilingaryan
Initial commit of gestures support for iDevices by Toni Pirhonen, Fix IE support broken by revision r196
18
    var s = domGetNodeSize(this.controls_node);
19
    if (s[1] > 0) domSetHeight(this.node, s[1], true, this.controls_node, s[1], true);
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
20
}
21
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
22
VIRTUAL.prototype.AttachConfig = function(config) {
23
    this.config = config;
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
24
    config.Register(this);
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
25
}
26
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
27
VIRTUAL.prototype.Start = function() {
111 by Suren A. Chilingaryan
Source tree opening fix
28
    adei.source.RegisterSelectionCallback(new CALLBACK(adei.virtual, "OnSelect"), /^virtual$/, /^srctree$/);
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
29
    adei.source.RegisterSubmitCallback(new CALLBACK(adei.virtual, "ApplyConfig"), /^virtual$/);
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
30
    this.srctree.loadXML(adei.GetServiceURL("srctree"));
31
}
32
33
VIRTUAL.prototype.OnSelect = function() {
34
    adei.popup.OpenControl(this.control);
35
}
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
36
37
VIRTUAL.prototype.ApplyConfig = function() {
38
    this.config.SetVirtualSettings("srctree", this.srctree.getAllChecked());
39
//    alert();
40
}
41
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
42
VIRTUAL.prototype.OpenItem = function (item, check) {
43
    var parts = item.split("__");
44
    var parent = false;
45
    for (var j = 0; j < parts.length - 1; j++) {
46
        if (j) parent = parent + "__" + parts[j];
47
        else parent = parts[j];
48
    
49
        this.srctree.openItem(parent);
50
	if (typeof check != "undefined") {
51
	    this.srctree.setCheck(parent, check);
52
	}
53
    }
54
}
55
56
VIRTUAL.prototype.SimpleReadConfig = function() {
57
//    alert(this.config.cfg.srctree);
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
58
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
59
    var add = false;
60
    
61
    
62
    var checked = this.srctree.getAllChecked();
63
    if (checked) checked = checked.split(",");
64
    else checked = false;
65
66
    while ((checked)&&(checked.length > 0)) {
67
	for (var i = 0; i < checked.length; i++) {
68
	    this.OpenItem(checked[i], 0);
69
	    this.srctree.setCheck(checked[i], 0);
70
	}
71
72
	var checked = this.srctree.getAllChecked();
73
        if (checked) checked = checked.split(",");
74
	else checked = false;
75
    }
76
    
77
    if (this.config.cfg.srctree) {
78
      var checked = this.config.cfg.srctree.split(",");
79
      for (var i = 0; i < checked.length; i++) {
80
	var item = checked[i];
81
82
        if (add) {
83
	    var start = item.substr(0, add.length);	
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
84
	    if (start != add) {
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
85
		this.OpenItem(add, "unsure");
86
		this.srctree.setCheck(add, 1);
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
87
	    }
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
88
	    add = false;
89
	}
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
90
/*
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
91
	var parts = item.split("__");
92
	
93
	if (parts.length < 4) add = item;
94
	else {
95
	    this.OpenItem(item, "unsure");
96
	    this.srctree.setCheck(item, 1);
97
	}
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
98
*/
99
        add = item;
118 by Suren A. Chilingaryan
Missing javascript stuff from previous commit
100
	
101
      }
102
      if (add) {
103
	this.OpenItem(add, "unsure");
104
	this.srctree.setCheck(add, 1);
105
      }
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
106
    }
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
107
85 by Suren A. Chilingaryan
XML+XSLT modules support, Alarms support in frontend (mozilla only)
108
}
109