src/widgets/CreateAnnotation.js
branchplatform-restapi
changeset 974 560afb14296d
parent 970 b1c3bf6eca78
child 975 35aadec4131b
equal deleted inserted replaced
973:638fe8541a2e 974:560afb14296d
   390     }
   390     }
   391     _annotation.created = new Date(); /* Date de création de l'annotation */
   391     _annotation.created = new Date(); /* Date de création de l'annotation */
   392     _annotation.description = this.$.find(".Ldt-CreateAnnotation-Description").val(); /* Champ description */
   392     _annotation.description = this.$.find(".Ldt-CreateAnnotation-Description").val(); /* Champ description */
   393     _annotation.setTags(this.$.find(".Ldt-CreateAnnotation-TagLi.selected")
   393     _annotation.setTags(this.$.find(".Ldt-CreateAnnotation-TagLi.selected")
   394         .map(function() { return IriSP.jQuery(this).attr("tag-id")})); /*Liste des ids de tags */
   394         .map(function() { return IriSP.jQuery(this).attr("tag-id")})); /*Liste des ids de tags */
   395     
       
   396     if (this.audio_url) {
   395     if (this.audio_url) {
   397         _annotation.audio = {
   396         _annotation.audio = {
   398             src: "mic",
   397             src: "mic",
   399             mimetype: "audio/mp3",
   398             mimetype: "audio/mp3",
   400             href: this.audio_url
   399             href: this.audio_url
   401         };
   400         };
   402     }
   401     }
   403     
       
   404     /* Les données créateur/date de création sont envoyées non pas dans l'annotation, mais dans le projet */
       
   405     if (this.show_creator_field) {
   402     if (this.show_creator_field) {
   406         _export.creator = this.$.find(".Ldt-CreateAnnotation-Creator").val();
   403         _annotation.creator = this.$.find(".Ldt-CreateAnnotation-Creator").val();
   407     } else {
   404     } else {
   408         _export.creator = this.creator_name;
   405         _annotation.creator = this.creator_name;
   409     }
   406     }
   410     _export.created = new Date();
       
   411     _exportedAnnotations.push(_annotation); /* Ajout de l'annotation à la liste à exporter */
   407     _exportedAnnotations.push(_annotation); /* Ajout de l'annotation à la liste à exporter */
   412     _export.addList("annotation",_exportedAnnotations); /* Ajout de la liste à exporter à l'objet Source */
   408     _export.addList("annotation",_exportedAnnotations); /* Ajout de la liste à exporter à l'objet Source */
   413     
   409     
   414     var _this = this;
   410     var _this = this;
   415     /* Envoi de l'annotation via AJAX au serveur ! */
   411     /* Envoi de l'annotation via AJAX au serveur ! */