summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-05-12 12:11:52 +0300
committerAlon Levy <alon@pobox.com>2015-05-12 12:30:04 +0300
commit3ec9cadd4d7245e5b21604c2ed68ddee1124ca0d (patch)
tree8593542dc08d379315ca5afeda5664012f6aeac9 /src
parente4652f764bf284d95a5233f5578fc67d2e17eaa0 (diff)
client/model/diff: add meta to Attr_Diff and Topo_Diff
Diffstat (limited to 'src')
-rw-r--r--src/client/model/diff.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/model/diff.js b/src/client/model/diff.js
index 07982bcb..5d515998 100644
--- a/src/client/model/diff.js
+++ b/src/client/model/diff.js
@@ -6,6 +6,18 @@
define(['consts'],
function(consts) {
+function Meta(obj_spec) {
+ this.sentence = (obj_spec && obj_spec.sentence) || '';
+ this.author = (obj_spec && obj_spec.author) || '';
+ this.ts_created = (obj_spec && obj_spec.ts_created) || undefined;
+}
+
+function new_meta_from_spec(obj_spec) {
+ var ret = new Meta(obj_spec);
+
+ return ret;
+}
+
/**
* A set of diff objects
*/
@@ -36,6 +48,7 @@ function Topo_Diff(obj_spec) {
this.node_set_add = obj_spec.node_set_add;
this.link_set_add = obj_spec.link_set_add;
this._link_set_add__fix_empty_links();
+ this.meta = new_meta_from_spec(obj_spec.meta);
}
@@ -212,6 +225,7 @@ function new_attr_diff() {
var ret = new Attr_Diff();
ret.__type_node = {}; // id-to-obj map
ret.__type_link = {}; // id-to-obj map
+ ret.meta = new_meta_from_spec({});
return ret;
}
@@ -254,6 +268,8 @@ function new_attr_diff_from_spec(attr_diff_spec) {
};
};
+ ret.meta = attr_diff_spec.meta;
+
return ret;
}