/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 js/adei.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-20 05:22:25 UTC
  • Revision ID: csa@dside.dyndns.org-20080420052225-enu1yngq1pny531z
Layout redesign: search tab, controls, menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function ADEI(sidebar_id, menu_id, session_id) {
 
1
function ADEI(maindiv_id, sidebar_id, statusbar_id, menu_id, session_id) {
 
2
    this.maindiv_node = document.getElementById(maindiv_id);
 
3
    this.sidebar_node = document.getElementById(sidebar_id);
 
4
    this.statusbar_node = document.getElementById(statusbar_id);
 
5
    
 
6
    if ((!this.sidebar_node)||(!this.statusbar_node)||(!this.maindiv_node)) {
 
7
        alert("ADEI INTERNAL ERROR: Some of importnant HTML elements are not found");
 
8
    }
 
9
 
2
10
    this.config = new CONFIG;
3
11
    this.module = new MODULE(null, configSetupModule, this.config);
4
12
    this.popup = new POPUP(Geometry, null);
32
40
 
33
41
    this.AddToQuery('adei_session=' + session_id);
34
42
    
35
 
    this.sidebar_node = document.getElementById(sidebar_id);
36
 
    
37
 
    
38
43
        // Tracking key presses and currently pressed key    
39
44
    this.key = false;
40
45
    
84
89
    this.module.Register(mod, mod_class);
85
90
}
86
91
 
 
92
ADEI.prototype.RegisterSuperPopup = function(popup, geometry_node) {
 
93
    if (this.popup) {
 
94
        this.popup.TryFixedSizeMode(this.sidebar_node, popup, geometry_node);
 
95
    }
 
96
}
 
97
 
87
98
ADEI.prototype.AttachSourceModule = function(source, ivl, wnd) {
88
99
    this.source = source;
89
100
    this.source_interval = ivl;
129
140
 
130
141
ADEI.prototype.UpdateModuleGeometry = function(mod, width, height) {
131
142
    var m = this.module.GetModule(mod);
132
 
    if ((m)&&(typeof m.AdjustGeometry != "undefined"))
133
 
        m.AdjustGeometry(width - this.sidebar_node.offsetWidth, height);
 
143
    if (!m) return;
 
144
 
 
145
    var mboffset = domGetNodeOffset(this.maindiv_node);
 
146
/*
 
147
    This was a rougher approach
 
148
    var h1 = height - 
 
149
        document.getElementById("header_div").offsetHeight - 
 
150
        this.statusbar_node.offsetHeight;
 
151
    var w1 = width - this.sidebar_node.offsetWidth;
 
152
*/
 
153
    
 
154
    var h = this.statusbar_node.offsetTop - mboffset[1]; /* substract something to fix IE6 */
 
155
    var w = width - mboffset[0]; 
 
156
 
 
157
    if (typeof m.AdjustGeometry != "undefined")
 
158
        m.AdjustGeometry(w, h, width, this.statusbar_node.offsetTop);
 
159
 
 
160
    this.popup.UpdateGlobalGeometry(h, this.statusbar_node.offsetTop);
134
161
}
135
162
 
136
163
ADEI.prototype.GetURL = function(page, props) {