/openshift/adei

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

« back to all changes in this revision

Viewing changes to js/xmlmodule.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:
 
1
function XMLMODULE(div, root_node) {
 
2
    if (typeof div == "object") this.div = div;
 
3
    else {
 
4
        this.div = document.getElementById(div);
 
5
        if (!this.div) adei.ReportError(translate("Element \"%s\" is not present in current document model", div));
 
6
    }
 
7
    
 
8
    if (typeof root_node == "undefined") this.root_node = this.div;
 
9
    else if (typeof root_node == "object") this.root_node = root_node;
 
10
    else this.root_node = document.getElementById(root_node);
 
11
}
 
12
 
 
13
XMLMODULE.prototype.Update = function(json, forced) {
 
14
    if ((json.xml)&&(json.xslt)) {
 
15
        adei.UpdateDIV(this.div, json.xml, json.xslt);
 
16
        adei.SetSuccessStatus(translate("Done"));
 
17
    } else {
 
18
        adei.SetStatus(translate("Update failed: Incomplete response received by Alarms module"));
 
19
    }
 
20
}
 
21
 
 
22
XMLMODULE.prototype.GetNode = function() {
 
23
    return this.root_node;
 
24
}