src/js/serializers/ldt_annotate.js
branchnew-model
changeset 923 b3ee7d1b472a
parent 916 ec6849bbbdcc
child 924 64c2eaafe5e2
equal deleted inserted replaced
922:096c06aea8b5 923:b3ee7d1b472a
    17                         data: _data.description,
    17                         data: _data.description,
    18                         audio: _data.audio
    18                         audio: _data.audio
    19                     },
    19                     },
    20                     tags: _data.getTagTexts(),
    20                     tags: _data.getTagTexts(),
    21                     media: _data.getMedia().id,
    21                     media: _data.getMedia().id,
    22                     title: _data.title,
       
    23                     type_title: _annType.title,
    22                     type_title: _annType.title,
    24                     type: ( typeof _annType.dont_send_id !== "undefined" && _annType.dont_send_id ? "" : _annType.id )
    23                     type: ( typeof _annType.dont_send_id !== "undefined" && _annType.dont_send_id ? "" : _annType.id )
    25                 }
    24                 }
    26             }
    25             }
    27         }
    26         }
    50         _source.addList('annotationType', new IriSP.Model.List(_source.directory));
    49         _source.addList('annotationType', new IriSP.Model.List(_source.directory));
    51         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    50         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    52         if (typeof _data.annotations == "object" && _data.annotations && _data.annotations.length) {
    51         if (typeof _data.annotations == "object" && _data.annotations && _data.annotations.length) {
    53             var _anndata = _data.annotations[0],
    52             var _anndata = _data.annotations[0],
    54                 _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    53                 _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    55             _ann.title = _anndata.content.title || "";
       
    56             _ann.description = _anndata.content.data || "";
    54             _ann.description = _anndata.content.data || "";
       
    55             _ann.title = _data.creator;
    57             _ann.created = new Date(_data.meta.created);
    56             _ann.created = new Date(_data.meta.created);
    58             _ann.setMedia(_anndata.media, _source);
    57             _ann.setMedia(_anndata.media, _source);
    59             var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
    58             var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
    60             if (_anntypes.length) {
    59             if (_anntypes.length) {
    61                 var _anntype = _anntypes[0];
    60                 var _anntype = _anntypes[0];