src/js/serializers/ldt_annotate.js
branchplatform-restapi
changeset 975 35aadec4131b
parent 974 560afb14296d
child 979 ff62016e051d
equal deleted inserted replaced
974:560afb14296d 975:35aadec4131b
     9         var _annType = _data.getAnnotationType();
     9         var _annType = _data.getAnnotationType();
    10         return {
    10         return {
    11             begin: _data.begin.milliseconds,
    11             begin: _data.begin.milliseconds,
    12             end: _data.end.milliseconds,
    12             end: _data.end.milliseconds,
    13             content: {
    13             content: {
    14                 data: _data.description,
    14                 description: _data.description,
       
    15                 title: _data.title,
    15                 audio: _data.audio
    16                 audio: _data.audio
    16             },
    17             },
    17             tags: _data.getTagTexts(),
    18             tags: _data.getTagTexts(),
    18             media: _data.getMedia().id,
    19             media: _data.getMedia().id,
    19             type_title: _annType.title,
    20             type_title: _annType.title,
    41         _source.addList('tag', new IriSP.Model.List(_source.directory));
    42         _source.addList('tag', new IriSP.Model.List(_source.directory));
    42         _source.addList('annotationType', new IriSP.Model.List(_source.directory));
    43         _source.addList('annotationType', new IriSP.Model.List(_source.directory));
    43         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    44         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    44         IriSP._(_data.objects).each(function(_anndata) {
    45         IriSP._(_data.objects).each(function(_anndata) {
    45             var _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    46             var _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    46             _ann.description = _anndata.content.data || "";
    47             _ann.description = _anndata.content.description || "";
    47             _ann.title = "";
    48             _ann.title = _anndata.content.title || "";
    48             _ann.creator = _anndata.meta.creator || "";
    49             _ann.creator = _anndata.meta.creator || "";
    49             _ann.created = new Date(_anndata.meta.created);
    50             _ann.created = new Date(_anndata.meta.created);
    50             _ann.setMedia(_anndata.media, _source);
    51             _ann.setMedia(_anndata.media, _source);
    51             var _anntype = _source.getElement(_anndata.type);
    52             var _anntype = _source.getElement(_anndata.type);
    52             if (!_anntype) {
    53             if (!_anntype) {