src/js/serializers/ldt_annotate.js
branchnew-model
changeset 924 64c2eaafe5e2
parent 923 b3ee7d1b472a
child 974 560afb14296d
equal deleted inserted replaced
923:b3ee7d1b472a 924:64c2eaafe5e2
    50         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    50         _source.addList('annotation', new IriSP.Model.List(_source.directory));
    51         if (typeof _data.annotations == "object" && _data.annotations && _data.annotations.length) {
    51         if (typeof _data.annotations == "object" && _data.annotations && _data.annotations.length) {
    52             var _anndata = _data.annotations[0],
    52             var _anndata = _data.annotations[0],
    53                 _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    53                 _ann = new IriSP.Model.Annotation(_anndata.id, _source);
    54             _ann.description = _anndata.content.data || "";
    54             _ann.description = _anndata.content.data || "";
    55             _ann.title = _data.creator;
    55             _ann.title = _data.creator || "";
    56             _ann.created = new Date(_data.meta.created);
    56             _ann.created = new Date(_data.meta.created);
    57             _ann.setMedia(_anndata.media, _source);
    57             _ann.setMedia(_anndata.media, _source);
    58             var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
    58             var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
    59             if (_anntypes.length) {
    59             if (_anntypes.length) {
    60                 var _anntype = _anntypes[0];
    60                 var _anntype = _anntypes[0];