|
@@ -22,6 +22,8 @@ Node.prototype = {
|
|
|
|
|
|
isNode: true,
|
|
|
|
|
|
+ hashProperties: undefined,
|
|
|
+
|
|
|
analyze: function ( builder, settings ) {
|
|
|
|
|
|
settings = settings || {};
|
|
@@ -103,10 +105,11 @@ Node.prototype = {
|
|
|
getHash: function() {
|
|
|
|
|
|
var hash = '{';
|
|
|
+ var prop, obj;
|
|
|
|
|
|
- for(var prop in this) {
|
|
|
+ for(prop in this) {
|
|
|
|
|
|
- var obj = this[ prop ];
|
|
|
+ obj = this[ prop ];
|
|
|
|
|
|
if (obj instanceof Node) {
|
|
|
|
|
@@ -116,6 +119,19 @@ Node.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if (this.hashProperties) {
|
|
|
+
|
|
|
+ for(var i = 0; i < this.hashProperties.length; i++) {
|
|
|
+
|
|
|
+ prop = this.hashProperties[ i ];
|
|
|
+ obj = this[ prop ];
|
|
|
+
|
|
|
+ hash += '"' + prop + '":"' + String( obj ) + '",';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
hash += '"id":"' + this.uuid + '"}';
|
|
|
|
|
|
return hash;
|