get the annotation creation api endpoint from the settings instead of
hardcoding it.
--- a/src/js/site.js.templ Fri Feb 17 10:22:39 2012 +0100
+++ b/src/js/site.js.templ Fri Feb 17 10:56:28 2012 +0100
@@ -83,7 +83,12 @@
Ldt-createAnnotation-polemic-equalequal for equalequal, etc.
*/
polemics: {"++" : "positive", "--" : "negative", "==" : "reference", "??" : "question"},
- cinecast_version: true /* put to false to enable the platform version, true for the festival cinecast one. */
+ cinecast_version: true, /* put to false to enable the platform version, true for the festival cinecast one. */
+
+ /* where does the widget PUT the annotations - this is a mustache template. id refers to the id of the media ans is filled
+ by the widget.
+ */
+ api_endpoint_template: platform_url + "/ldtplatform/api/ldt/annotations/{{id}}.json"
},
"SparklineWidget" : {
column_width: 10 // the width of a column in pixels.
--- a/src/js/widgets/createAnnotationWidget.js Fri Feb 17 10:22:39 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Fri Feb 17 10:56:28 2012 +0100
@@ -7,6 +7,8 @@
this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics;
this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version;
+ this.api_endpoint_template = IriSP.widgetsDefaults["createAnnotationWidget"].api_endpoint_template;
+
this.ids = {}; /* a dictionnary linking buttons ids to keywords */
/* variables to save the current position of the slicer */
@@ -410,8 +412,8 @@
var project_id = this._serializer._data.meta.id;
//TODO: extract magic url
- var url = Mustache.to_html("{{platf_url}}/ldtplatform/api/ldt/annotations/{{id}}.json",
- {platf_url: IriSP.platform_url, id: project_id});
+ var url = Mustache.to_html(this.api_endpoint_template,
+ {id: project_id});
IriSP.jQuery.ajax({
url: url,