src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 814 9abad8fe5207
parent 807 9f6c136ddc03
child 817 e9599ee285ab
equal deleted inserted replaced
813:25a241b6688a 814:9abad8fe5207
     5   
     5   
     6   this.polemic_mode = IriSP.widgetsDefaults["createAnnotationWidget"].polemic_mode;
     6   this.polemic_mode = IriSP.widgetsDefaults["createAnnotationWidget"].polemic_mode;
     7   this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics;
     7   this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics;
     8   
     8   
     9   this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version;
     9   this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version;
       
    10   this.api_endpoint_template = IriSP.widgetsDefaults["createAnnotationWidget"].api_endpoint_template;
       
    11   
    10   this.ids = {}; /* a dictionnary linking buttons ids to keywords */
    12   this.ids = {}; /* a dictionnary linking buttons ids to keywords */
    11   
    13   
    12   /* variables to save the current position of the slicer */
    14   /* variables to save the current position of the slicer */
    13   if (this.cinecast_version) {
    15   if (this.cinecast_version) {
    14     this.sliceLeft = 0;
    16     this.sliceLeft = 0;
   408   
   410   
   409   var jsonString = JSON.stringify(apiJson);
   411   var jsonString = JSON.stringify(apiJson);
   410   var project_id = this._serializer._data.meta.id;
   412   var project_id = this._serializer._data.meta.id;
   411   
   413   
   412   //TODO: extract magic url
   414   //TODO: extract magic url
   413   var url = Mustache.to_html("{{platf_url}}/ldtplatform/api/ldt/annotations/{{id}}.json",
   415   var url = Mustache.to_html(this.api_endpoint_template,
   414                               {platf_url: IriSP.platform_url, id: project_id});
   416                               {id: project_id});
   415                           
   417                           
   416   IriSP.jQuery.ajax({
   418   IriSP.jQuery.ajax({
   417       url: url,
   419       url: url,
   418       type: 'PUT',
   420       type: 'PUT',
   419       contentType: 'application/json',
   421       contentType: 'application/json',