165 ( typeof _this.source.projectId !== "undefined" && typeof _annotation.project !== "undefined" && _annotation.project && _this.source.projectId !== _annotation.project ) |
165 ( typeof _this.source.projectId !== "undefined" && typeof _annotation.project !== "undefined" && _annotation.project && _this.source.projectId !== _annotation.project ) |
166 ? Mustache.to_html( |
166 ? Mustache.to_html( |
167 _this.foreign_url, |
167 _this.foreign_url, |
168 { |
168 { |
169 project : _annotation.project, |
169 project : _annotation.project, |
170 media : _annotation.media.id.replace(/^.*:/,''), |
170 media : _annotation.media.id, |
171 annotation : _annotation.id, |
171 annotation : _annotation.id, |
172 annotationType : _annotation.annotationType.id.replace(/^.*:/,'') |
172 annotationType : _annotation.annotationType.id |
173 } |
173 } |
174 ) |
174 ) |
175 : '#id=' + _annotation.id |
175 : '#id=' + _annotation.id |
176 ) |
176 ) |
177 ); |
177 ); |
|
178 var _title = _annotation.title.replace(_annotation.description,''), |
|
179 _description = _annotation.description; |
|
180 if (!_annotation.title) { |
|
181 _title = _annotation.creator; |
|
182 } |
|
183 if (!_annotation.description && _annotation.creator) { |
|
184 _description = _annotation.title; |
|
185 _title = _annotation.creator; |
|
186 } |
178 var _res = { |
187 var _res = { |
179 id : _annotation.id, |
188 id : _annotation.id, |
180 title : _annotation.title.replace(_annotation.description,''), |
189 title : _title, |
181 description : _annotation.description, |
190 description : _description, |
182 begin : _annotation.begin.toString(), |
191 begin : _annotation.begin.toString(), |
183 end : _annotation.end.toString(), |
192 end : _annotation.end.toString(), |
184 thumbnail : typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail, |
193 thumbnail : typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail, |
185 url : _url, |
194 url : _url, |
186 tags : _annotation.getTagTexts() |
195 tags : _annotation.getTagTexts() |