Last change
on this file since 159 was
159,
checked in by mmichalski, 10 years ago
|
Solve poblem for older Chrome
|
File size:
999 bytes
|
Rev | Line | |
---|
[143] | 1 | function NeuroClass() { |
---|
| 2 | this.class = {};//obiekt z cechami klasy |
---|
| 3 | this._properties = {};//obiekt z propertisami |
---|
| 4 | } |
---|
| 5 | |
---|
| 6 | //pobranie danych o klasie |
---|
| 7 | //pobranie danych o propertisach |
---|
| 8 | |
---|
| 9 | NeuroClass.prototype.setModel = function(data) |
---|
| 10 | { |
---|
| 11 | var self = this; |
---|
| 12 | $(data).each(function () { |
---|
| 13 | $.each(this.attributes, function () { |
---|
| 14 | self.class[this.name] = this.value; |
---|
| 15 | }); |
---|
| 16 | }); |
---|
| 17 | |
---|
[159] | 18 | var nodes = data[0].childNodes; |
---|
[143] | 19 | |
---|
| 20 | for (var i = 0; i < nodes.length; i++) { |
---|
[159] | 21 | if(nodes[i].nodeType == 3) |
---|
| 22 | continue; |
---|
[143] | 23 | var node = $(nodes[i]); |
---|
| 24 | this.addProperties(node); |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | NeuroClass.prototype.addProperties = function (data) { |
---|
| 29 | var properties = {}; |
---|
| 30 | |
---|
| 31 | $(data).each(function () { |
---|
| 32 | $.each(this.attributes, function () { |
---|
| 33 | properties[this.name] = this.value; |
---|
| 34 | }); |
---|
| 35 | |
---|
| 36 | }); |
---|
| 37 | |
---|
[159] | 38 | this._properties[properties["ID"]] = properties; |
---|
| 39 | } |
---|
[143] | 40 | |
---|
[159] | 41 | NeuroClass.prototype.getScheme = function(){ |
---|
| 42 | return this.class["SYMBOL"].split(',').map(Number); |
---|
[143] | 43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.