/adei/trunk

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

« back to all changes in this revision

Viewing changes to js/config.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-12-10 08:34:14 UTC
  • Revision ID: csa@dside.dyndns.org-20081210083414-gvpv398ctdgmfn48
Alarms support in all browsers

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
            }
261
261
        }
262
262
        
 
263
        if (self.cfg.module) adei.OpenModule(self.cfg.module);
263
264
 
264
265
        if (self.updater) self.updater.Update();
265
266
        if (save_on_apply) self.Save();
297
298
 
298
299
 
299
300
CONFIG.prototype.SetupModule = function(m) {
300
 
    this.cfg.module = m;
 
301
    if (m != this.cfg.module) {
 
302
        if (this.cfg.module) {
 
303
            this.cfg.module = m;
 
304
            this.Save();
 
305
        } else {
 
306
            this.cfg.module = m;
 
307
        }
 
308
    }
301
309
}
302
310
 
303
311
CONFIG.prototype.GetModule = function() {
331
339
            }
332
340
        }
333
341
        
 
342
        res = "";
 
343
        if (this.cfg.module) {
 
344
            res += "module=" + this.cfg.module + "&";
 
345
        }
 
346
        
334
347
        if (db_server) {
335
 
            res = "db_server=" + db_server + "&db_name=" + db_name + "&db_group=" + db_group + "&db_mask=" + db_mask + "&experiment=" + experiment + "&window=" + win;
 
348
            res += "db_server=" + db_server + "&db_name=" + db_name + "&db_group=" + db_group + "&db_mask=" + db_mask + "&experiment=" + experiment + "&window=" + win;
336
349
            if (this.cfg.aggregation) res += "&aggregation=" + this.cfg.aggregation;
337
350
            if (this.cfg.interpolate) res += "&interpolate=" + this.cfg.interpolate;
338
351
            if (this.cfg.show_marks) res += "&show_gaps=" + this.cfg.show_marks;
343
356
                eval("res += \"&\" + this.cfg.virtual + \"=\" + this.cfg." + this.cfg.virtual);
344
357
            }
345
358
        } else {
346
 
            res = "no_source";
 
359
            res += "no_source";
347
360
        }
348
361
    }
349
362
 
435
448
    if (props) {
436
449
        var cfg = this.ParseProps(props);
437
450
        if (cfg) {
438
 
            this.cfg = cfg.cfg;
439
 
            this.cfg_extra = cfg.extra;
 
451
//          alert(props + " - " + cfg.cfg.db_server);
 
452
            if (cfg.cfg.db_server) {
 
453
                this.cfg = cfg.cfg;
 
454
                this.cfg_extra = cfg.extra;
440
455
 
441
 
            adei.SetStatus(translate("Loading..."), 0);
442
 
            this.ApplyConfig(true);
 
456
                adei.SetStatus(translate("Loading..."), 0);
 
457
                this.ApplyConfig(true);
 
458
            }
443
459
            
444
460
            if (this.cfg.module) {
445
461
                adei.module.Open(this.cfg.module);