Updated serializer
authorveltr
Tue, 28 May 2013 16:29:52 +0200
changeset 52 f4c3171cd051
parent 51 c7ece022eca8
child 53 7d20d7fd0f76
Updated serializer
integration/js/ldt-serializer.js
--- a/integration/js/ldt-serializer.js	Tue May 28 16:27:45 2013 +0200
+++ b/integration/js/ldt-serializer.js	Tue May 28 16:29:52 2013 +0200
@@ -131,6 +131,7 @@
                     }
                     _res.color = '#' + _c;
                 }
+                _res.content = _data.content;
                 _res.setMedia(_data.media);
                 _res.setAnnotationType(_data.meta["id-ref"]);
                 _res.setTags(IriSP._(_data.tags).pluck("id-ref"));
@@ -153,14 +154,22 @@
                     id : _data.id,
                     begin : _data.begin.milliseconds,
                     end : _data.end.milliseconds,
-                    content : {
-                        title : _data.title || "",
-                        description : _data.description || "",
-                        audio : _data.audio,
-                        img: {
-                            src: _data.thumbnail
+                    content : IriSP._.defaults(
+                        {},
+                        {
+                            title : _data.title,
+                            description : _data.description,
+                            audio : _data.audio,
+                            img: {
+                                src: _data.thumbnail
+                            }
+                        },
+                        _data.content,
+                        {
+                            title: "",
+                            description: ""
                         }
-                    },
+                    ),
                     color: _color,
                     media : _data.media.id,
                     meta : {
@@ -177,6 +186,7 @@
                        } 
                     })
                 }
+                _res.content.title = _data.title || _res.content.title || "";
                 _dest.annotations.push(_res);
             }
         },