/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
$source_title = _("Data Source");

function sourceJS() {
    global $config_options;
    global $SOURCE_KEEP_WINDOW;
    
?>
    function source_moduleSetDisplayInfo(s, module_name) {
	if (module_name == "time") {
	    s.interval.window.module_on_display = true;
	    s.interval.module_on_display = true;
	    s.module_on_display = false;
	} else /* source */ {
	    s.interval.window.module_on_display = false;
	    s.interval.module_on_display = false;
	    s.module_on_display = true;
	}
	s.FixHidden();
    }

    function source_popupSetDisplayInfo(s, status) {
	if (status) {
	    source_moduleSetDisplayInfo(s, source_modules.current_module);
	} else {
	    s.interval.window.module_on_display = false;
	    s.interval.module_on_display = false;
	    s.module_on_display = false;
	}
    }
    
    function source_fixItemSelSize() {
	/* We defined a source_db_item_sel size in procents, to fill completely two table cells.
	However, this causes problems in Gecko while using adaptive SetWidth. The SELECT would
	be extend during first step, but not shrinked back on the second. */
	 
	var itemsel = document.getElementById("source_db_item_sel");
	domSetWidth(itemsel,itemsel.offsetWidth);
    }

    if (!isIE()) {
	    /* This problem only occurs in Gecko 1.8. The fix by iteself causes problems in IE (no
	    idea why). The Opera does not need the fix, but it not harmless as well */
        domShow("popup_source");
	source_fixItemSelSize();
	domHide("popup_source");
    }



    source_modules = new MODULE("source");
    source_modules.RegisterGeometryCallback(popupUpdateGeometryCallback, { 'popup': adei.popup, 'module': "source" });
    source_modules.Open("source");

    adei.popup.RegisterOnCallback("source", moduleUpdateGeometry, source_modules);
    adei.popup.RegisterControlsModule("source", source_modules);
    adei.popup.RegisterControl("source", "source");
    adei.popup.RegisterControl("source", "time");
    

    var source_opts = new Object();
    <?if ($SOURCE_KEEP_WINDOW) {?> source_opts.keep_window = true; <?}?>

    source_window = new WINDOW("source_timewindow_sel", "source_winstart_inp", "source_winend_inp", "source_miny_inp", "source_maxy_inp");
    source_interval = new INTERVAL(source_window, "source_db_experiment_sel", "source_timestart_inp", "source_timeend_inp");
    source = new SOURCE(source_interval, "source_db_server_sel", "source_db_name_sel", "source_db_group_sel", "source_db_mask_sel", "source_db_item_sel", "source_apply_button", source_opts);

    adei.AttachSourceModule(source, source_interval, source_window);

    source.RegisterGeometryCallback(moduleUpdateGeometry, source_modules);
    if (isIE()) {
	adei.popup.RegisterOffCallback("source", source_popupSetDisplayInfo, source);
	adei.popup.RegisterOnCallback("source", source_popupSetDisplayInfo, source);
	source_modules.RegisterCallback(source_moduleSetDisplayInfo, source);
    }
<?
}

function sourcePage() {
    global $ZEUS_TIMINGS;
?>
<table width="100%"><tr>
    <th class="module_source_link_current" id="module_link_source_source"><a href="javascript:source_modules.Open('source')"><?echo _("Source");?></a></th>
    <th class="module_source_link" id="module_link_source_time"><a href="javascript:source_modules.Open('time')"><?echo _("Axis");?></a></th>
</tr><tr><td colspan="2">
<div class="controls">
    <div class="module" id="module_source_source">
	<table class="select_table" width="100%"><tr><?
	    echo "<td>" . _("Server") . "</td><td><select id=\"source_db_server_sel\" onchange='javascript:source.UpdateServer(this.value)'><option>Loading...</option></select></td>";
	?></tr><tr><?
	    echo "<td>" . _("Database") . "</td><td><select id=\"source_db_name_sel\" onchange='javascript:source.UpdateDatabase(this.value)'><option>Loading...</option></select></td>";
	?></tr><tr><?
	    echo "<td>" . _("LogGroup") . "</td><td><select id=\"source_db_group_sel\" onchange='javascript:source.UpdateGroup(this.value)'><option>Loading...</option></select></td>";
	?></tr><tr><?
	    echo "<td>" . _("ItemMask") . "</td><td><select id=\"source_db_mask_sel\" onchange='javascript:source.UpdateMask(this.value)'><option>Loading...</option></select></td>";
	?></tr><tr id="source_db_item_tr"><?
	    echo "<td colspan=\"2\"><select id=\"source_db_item_sel\" onchange='javascript:source.UpdateItem(this.value)'><option>Loading...</option></select></td>";
	?></tr></table>
    </div>
    <div class="module" id="module_source_time" style="display: none;">
	<table class="select_table"><tr><?
	    echo "<td>" . _("Experiment") . "</td><td><select id=\"source_db_experiment_sel\" onchange='javascript:source_interval.UpdateExperiment(this.value)'><option>Loading...</option></select></td>";
	?></tr><tr>
	    <td><div class="hide_experiment_custom"><?echo _("Start");?></div></td>
	    <td id="source_timestart"><div class="hide_experiment_custom">
		<input type="text" id="source_timestart_inp" maxlength="25" onchange="javascript:source_window.UpdateRange()"/>
		<a href="javascript:NewCal('source_timestart_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
		    <img src="images/cal.gif"/>
		</a>
	    </div></td>
	</tr><tr>
	    <td><div class="hide_experiment_custom"><?echo _("End");?></div></td>
	    <td id="source_timeend"><div class="hide_experiment_custom">
		<input type="text" id="source_timeend_inp" maxlength="25" onchange="javascript:source_window.UpdateRange()"/>
		<a href="javascript:NewCal('source_timeend_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
		    <img src="images/cal.gif"/>
		</a>
	    </div></td>
	</tr><tr>
	    <td><?echo _("Window");?></td><td><select id="source_timewindow_sel" onchange='javascript:source_window.UpdateWidth(this.value)'><option>Loading...</option></select></td>
	</tr><tr>
	    <td><div class="hide_window_custom"><?echo _("Start");?></div></td>
	    <td id="source_winstart"><div class="hide_window_custom">
		<input type="text" id="source_winstart_inp" maxlength="31" onchange="javascript:source_window.UpdateRange()"/>
		<a href="javascript:NewCal('source_winstart_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
		    <img src="images/cal.gif"/>
		</a>
	    </div></td>
	</tr><tr>
	    <td><div class="hide_window_custom"><?echo _("End");?></div></td>
	    <td id="source_winend"><div class="hide_window_custom">
		<input type="text" id="source_winend_inp" maxlength="31" onchange="javascript:source_window.UpdateRange()" />
		<a href="javascript:NewCal('source_winend_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window));">
		    <img src="images/cal.gif"/>
		</a>
	    </div></td>
	</tr><tr>
	    <td><div class="hide_window_custom"><?echo _("Y");?> [<a href='javascript:source_window.ResetY()'><?echo _("Reset");?></a>]</div></td>
	    <td id="source_yrange"><div class="hide_window_custom">
		<input type="text" id="source_miny_inp" maxlength="16" onchange="javascript:source_window.UpdateRange()"/>
		-
		<input type="text" id="source_maxy_inp" maxlength="16" onchange="javascript:source_window.UpdateRange()"/>
	    </div></td>
	</tr></table>
    </div>
</div>
</td></tr><tr class="source_apply"><td colspan="2">
    <button id="source_apply_button" type="button" onclick="javascript:source.Apply()"><?echo translate("Apply");?></button>
</td></tr></table>
<?}?>