209 data: jsonString, |
209 data: jsonString, |
210 // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType |
210 // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType |
211 dataType: 'json', |
211 dataType: 'json', |
212 success: function(json, textStatus, XMLHttpRequest) { |
212 success: function(json, textStatus, XMLHttpRequest) { |
213 /* add the annotation to the annotations and tell the world */ |
213 /* add the annotation to the annotations and tell the world */ |
214 |
|
215 delete annotation.tags; |
214 delete annotation.tags; |
216 annotation.content.description = annotation.content.data; |
215 annotation.content.description = annotation.content.data; |
217 delete annotation.content.data; |
216 delete annotation.content.data; |
218 annotation.id = json.annotations[0].id; |
217 annotation.id = json.annotations[0].id; |
219 annotation.title = _this._currentAnnotation.content.title; |
218 annotation.title = _this._currentAnnotation.content.title; |
|
219 annotation.meta = meta; |
|
220 annotation.meta["id-ref"] = annotation["type"]; |
220 // everything is shared so there's no need to propagate the change |
221 // everything is shared so there's no need to propagate the change |
221 _this._serializer._data.annotations.push(annotation); |
222 _this._serializer._data.annotations.push(annotation); |
222 _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation"); |
223 _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation"); |
223 }, |
224 }, |
224 error: function(jqXHR, textStatus, errorThrown) { |
225 error: function(jqXHR, textStatus, errorThrown) { |