src/js/serializers/ldt_annotate.js
branchnew-model
changeset 915 ba7aab923d08
parent 910 b9f1bd52df9a
child 916 ec6849bbbdcc
equal deleted inserted replaced
914:3238d1625df9 915:ba7aab923d08
    11             serializer : function(_data, _source) {
    11             serializer : function(_data, _source) {
    12                 return {
    12                 return {
    13                     begin: _data.begin.milliseconds,
    13                     begin: _data.begin.milliseconds,
    14                     end: _data.end.milliseconds,
    14                     end: _data.end.milliseconds,
    15                     content: {
    15                     content: {
    16                         data: _data.description
    16                         data: _data.description,
       
    17                         audio: _data.audio
    17                     },
    18                     },
    18                     tags: _data.getTagTexts(),
    19                     tags: _data.getTagTexts(),
    19                     media: _source.unNamespace(_data.getMedia().id),
    20                     media: _source.unNamespace(_data.getMedia().id),
    20                     title: _data.title,
    21                     title: _data.title,
    21                     type_title: _data.getAnnotationType().title,
    22                     type_title: _data.getAnnotationType().title,
    22                     type: _source.unNamespace(_data.getAnnotationType().id)
    23                     type: ( typeof _data.getAnnotationType().dont_send_id !== "undefined" && _data.getAnnotationType().dont_send_id ? "" : _source.unNamespace(_data.getAnnotationType().id) )
    23                 }
    24                 }
    24             }
    25             }
    25         }
    26         }
    26     },
    27     },
    27     serialize : function(_source) {
    28     serialize : function(_source) {
    77             });
    78             });
    78             _ann.setTags(_tagIds);
    79             _ann.setTags(_tagIds);
    79             _ann.setBegin(_anndata.begin);
    80             _ann.setBegin(_anndata.begin);
    80             _ann.setEnd(_anndata.end);
    81             _ann.setEnd(_anndata.end);
    81             _ann.creator = _data.meta.creator;
    82             _ann.creator = _data.meta.creator;
       
    83             if (typeof _anndata.content.audio !== "undefined" && _anndata.content.audio.href) {
       
    84                 _ann.audio = _anndata.content.audio;
       
    85             }
    82             _source.getAnnotations().push(_ann);
    86             _source.getAnnotations().push(_ann);
    83         }
    87         }
    84     }
    88     }
    85 }
    89 }