src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 838 03b03865eb9b
parent 837 353a78021ebc
child 840 ac66e2240e1e
equal deleted inserted replaced
837:353a78021ebc 838:03b03865eb9b
       
     1 /* Internationalization for this widget */
       
     2 
       
     3 IriSP.i18n.addMessages(
       
     4     {
       
     5         "en": {
       
     6             "submit": "Submit",
       
     7             "add_keywords": "Add keywords",
       
     8             "add_polemic_keywords": "Add polemic keywords",
       
     9             "your_name": "Your name",
       
    10             "type_here": "Type your annotation here.",
       
    11             "wait_while_processed": "Please wait while your request is being processed...",
       
    12             "error_while_contacting": "An error happened while contacting the server. Your annotation has not been saved.",
       
    13             "empty_annotation": "Your annotation is empty. Please write something before submitting.",
       
    14             "annotation_saved": "Thank you, your annotation has been saved.",
       
    15             "share_annotation": "Would you like to share it on social networks ?",
       
    16             "share_on": "Share on"
       
    17         },
       
    18         "fr": {
       
    19             "submit": "Envoyer",
       
    20             "add_keywords": "Ajouter des mots-clés",
       
    21             "add_polemic_keywords": "Ajouter des mots-clés polémiques",
       
    22             "your_name": "Votre nom",
       
    23             "type_here": "Rédigez votre annotation ici.",
       
    24             "wait_while_processed": "Veuillez patienter pendant le traitement de votre requête...",
       
    25             "error_while_contacting": "Une erreur s'est produite en contactant le serveur. Votre annotation n'a pas été enregistrée",
       
    26             "empty_annotation": "Votre annotation est vide. Merci de rédiger un texte avant de l'envoyer.",
       
    27             "annotation_saved": "Merci, votre annotation a été enregistrée.",
       
    28             "share_annotation": "Souhaitez-vous la partager sur les réseaux sociaux ?",
       
    29             "share_on": "Partager sur"
       
    30         }
       
    31     }
       
    32 );
       
    33 
     1 IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) {
    34 IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) {
     2   IriSP.Widget.call(this, Popcorn, config, Serializer);
    35   IriSP.Widget.call(this, Popcorn, config, Serializer);
     3   this._hidden = true;
    36   this._hidden = true;
     4   
    37   
     5   this.checkOption("keywords");
    38   this.checkOption("keywords");
   336     annotation.type = "";
   369     annotation.type = "";
   337   
   370   
   338   annotation.type_title = "Contributions";
   371   annotation.type_title = "Contributions";
   339   annotation.content = {};
   372   annotation.content = {};
   340   annotation.content.data = contents;
   373   annotation.content.data = contents;
       
   374   if (this.cinecast_version) {
       
   375       var _extract = IriSP.underscore(this._serializer._data.annotations)
       
   376           .filter(function(_a) {
       
   377               return (_a.begin <= annotation.begin && _a.end >= annotation.begin && _a.type == "cinecast:MovieExtract");
       
   378           })
       
   379       if (_extract.length) {
       
   380           annotation.extract = _extract[0].id;
       
   381       }
       
   382   }
   341   
   383   
   342   var meta = apiJson.meta;
   384   var meta = apiJson.meta;
   343   
   385   
   344   
   386   
   345   var _username = this.selector.find(".Ldt-createAnnotation-userName").val();
   387   var _username = this.selector.find(".Ldt-createAnnotation-userName").val();