/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

Viewing changes to js/adei.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-12-06 01:38:28 UTC
  • Revision ID: csa@dside.dyndns.org-20081206013828-lm3jqpc4fizd6cn7
XML+XSLT modules support, Alarms support in frontend (mozilla only)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    }
9
9
 
10
10
    this.config = new CONFIG;
11
 
    this.module = new MODULE(null, configSetupModule, this.config);
 
11
    this.module = new MODULE(null, this.SetupModule, this);
12
12
    this.popup = new POPUP(Geometry, null);
13
13
    this.search = new SEARCH();
 
14
    this.xslpool = new XSLPOOL(false/*true*/);
14
15
    this.virtual = null;
15
16
    
16
17
    this.status = new STATUS(this.statusbar_node);
20
21
 
21
22
    if (menu_id) this.menu = new MENU(this.config, this.updater, menu_id);
22
23
    else this.menu = null;
 
24
 
 
25
        // Screen geometry, will be updated on load event
 
26
    this.screen_width = false;
 
27
    this.screen_height = false;
23
28
    
24
29
    this.source = null;
25
30
    this.source_interval = null;
87
92
ADEI.prototype.keyHelp = function (key) {
88
93
    var duration = 3;
89
94
 
90
 
    if (this.config.open_module == "graph") {
 
95
    if (this.config.GetModule() == "graph") {
91
96
        switch(key) {
92
97
         case 72:       // h
93
98
            this.key_status_id = this.SetStatus("wheel: Navigate history", duration);
169
174
 
170
175
ADEI.prototype.RegisterVirtualControl = function(id, control) {
171
176
    this.virtual = new VIRTUAL(id, control);
 
177
    this.virtual.AttachConfig(this.config);
172
178
}
173
179
 
174
180
ADEI.prototype.AttachSourceModule = function(source, ivl, wnd) {
217
223
    this.updater.Start(update_rate);
218
224
}
219
225
 
 
226
/* This functions are used by external code to change current module/popup */
220
227
ADEI.prototype.OpenModule = function(mod) {
221
228
    this.module.Open(mod);
222
229
}
225
232
    this.popup.Switch(mod);
226
233
}
227
234
 
 
235
/* This is functions get notification if module/popup are changed */
 
236
ADEI.prototype.SetupModule = function(self, mod) {
 
237
    self.config.SetupModule(mod);
 
238
    self.UpdateModuleGeometry(mod, self.screen_width, self.screen_height);
 
239
 
 
240
    if ((self.config)&&(self.config.ready)) self.updater.Update();
 
241
}
 
242
 
228
243
ADEI.prototype.UpdateModuleGeometry = function(mod, width, height) {
 
244
    if ((!width)||(!height)) return;
 
245
 
 
246
    this.screen_width = width;
 
247
    this.screen_height = height;
 
248
    
229
249
    var m = this.module.GetModule(mod);
230
250
    if (!m) return;
231
251
 
241
261
    var h = this.statusbar_node.offsetTop - mboffset[1]; /* substract something to fix IE6 */
242
262
    var w = width - mboffset[0]; 
243
263
 
244
 
    if (typeof m.AdjustGeometry != "undefined")
 
264
    if (typeof m.AdjustGeometry != "undefined") {
245
265
        m.AdjustGeometry(w, h, width, this.statusbar_node.offsetTop);
 
266
    } else if (typeof m.GetNode() != "undefined") {
 
267
        var node = m.GetNode();
 
268
        
 
269
//      alert(h);
 
270
        if (node.offsetParent) { // on screen
 
271
            var mboffset = domGetNodeOffset(node);
 
272
            var w = (width) - mboffset[0];
 
273
            var h = (this.statusbar_node.offsetTop) - mboffset[1] - 1;
 
274
//          alert(h);
 
275
            domAdjustGeometry(node, w, h, true);
 
276
        }
 
277
    }
246
278
 
247
279
    this.popup.UpdateGlobalGeometry(h, this.statusbar_node.offsetTop);
248
280
}
336
368
ADEI.prototype.OpenControl = function(name) {
337
369
    this.popup.OpenControl(name);
338
370
}
 
371
 
 
372
ADEI.prototype.UpdateDIV = function(div, xmlurl, xslt) {
 
373
    this.xslpool.Load(xslt, xmlurl, false, div);
 
374
}
 
 
b'\\ No newline at end of file'