src/widgets/CreateAnnotation.js
changeset 1047 c3bf174e0ef8
parent 1038 e78b889a75e1
child 1050 0b287ecbc2cb
equal deleted inserted replaced
1046:eb77616c245f 1047:c3bf174e0ef8
    49     api_endpoint_template: "",
    49     api_endpoint_template: "",
    50     api_method: "POST",
    50     api_method: "POST",
    51     project_id: "",
    51     project_id: "",
    52     after_send_timeout: 0,
    52     after_send_timeout: 0,
    53     close_after_send: false,
    53     close_after_send: false,
    54     tag_prefix: "#"
    54     tag_prefix: "#",
       
    55     pause_when_displaying: false,
    55 };
    56 };
    56 
    57 
    57 IriSP.Widgets.CreateAnnotation.prototype.messages = {
    58 IriSP.Widgets.CreateAnnotation.prototype.messages = {
    58     en: {
    59     en: {
    59         from_time: "from",
    60         from_time: "from",
    60         to_time: "to",
    61         to_time: "to",
    61         at_time: "at",
    62         at_time: "at",
    62         submit: "Submit",
    63         submit: "Submit",
       
    64         cancel: "Cancel",
    63         add_keywords_: "Add keywords:",
    65         add_keywords_: "Add keywords:",
    64         add_polemic_keywords_: "Add polemic attributes :",
    66         add_polemic_keywords_: "Add polemic attributes :",
    65         your_name_: "Your name:",
    67         your_name_: "Your name:",
    66         annotate_video: "Annotate this video",
    68         annotate_video: "Annotate this video",
    67         type_title: "Annotation title",
    69         type_title: "Annotation title",
    79     fr: {
    81     fr: {
    80         from_time: "de",
    82         from_time: "de",
    81         to_time: "à",
    83         to_time: "à",
    82         at_time: "à",
    84         at_time: "à",
    83         submit: "Envoyer",
    85         submit: "Envoyer",
       
    86         cancel: "Annuler",
    84         add_keywords_: "Ajouter des mots-clés\u00a0:",
    87         add_keywords_: "Ajouter des mots-clés\u00a0:",
    85         add_polemic_keywords_: "Ajouter des attributs polémiques\u00a0:",
    88         add_polemic_keywords_: "Ajouter des attributs polémiques\u00a0:",
    86         your_name_: "Votre nom\u00a0:",
    89         your_name_: "Votre nom\u00a0:",
    87         annotate_video: "Annoter cette vidéo",
    90         annotate_video: "Annoter cette vidéo",
    88         type_title: "Titre de l'annotation",
    91         type_title: "Titre de l'annotation",
   110     + '{{#show_slice}} {{l10n.to_time}} <span class="Ldt-CreateAnnotation-End">{{end}}</span>{{/show_slice}}</span></span>'
   113     + '{{#show_slice}} {{l10n.to_time}} <span class="Ldt-CreateAnnotation-End">{{end}}</span>{{/show_slice}}</span></span>'
   111     + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator empty" value="{{creator_name}}" {{#creator_field_readonly}}readonly{{/creator_field_readonly}}/>{{/show_creator_field}}</h3>'
   114     + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator empty" value="{{creator_name}}" {{#creator_field_readonly}}readonly{{/creator_field_readonly}}/>{{/show_creator_field}}</h3>'
   112     + '<textarea class="Ldt-CreateAnnotation-Description empty" placeholder="{{l10n.type_description}}"></textarea>'
   115     + '<textarea class="Ldt-CreateAnnotation-Description empty" placeholder="{{l10n.type_description}}"></textarea>'
   113     + '<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>'
   116     + '<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>'
   114     + '<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{l10n.submit}}" />'
   117     + '<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{l10n.submit}}" />'
       
   118     + '<input type="button" class="Ldt-CreateAnnotation-Cancel" value="{{l10n.cancel}}" />'
   115     + '{{#show_mic_record}}<div class="Ldt-CreateAnnotation-RecBlock"><div class="Ldt-CreateAnnotation-RecLabel">Add voice annotation</div>'
   119     + '{{#show_mic_record}}<div class="Ldt-CreateAnnotation-RecBlock"><div class="Ldt-CreateAnnotation-RecLabel">Add voice annotation</div>'
   116     + '    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="220" height="160">'
   120     + '    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="220" height="160">'
   117     + '        <param name="movie" value="{{record_swf}}" />'
   121     + '        <param name="movie" value="{{record_swf}}" />'
   118     + '        <param name="quality" value="high" />'
   122     + '        <param name="quality" value="high" />'
   119     + '        <param name="bgcolor" value="#ffffff" />'
   123     + '        <param name="bgcolor" value="#ffffff" />'
   221             if (_this.arrow) {
   225             if (_this.arrow) {
   222                 _this.arrow.moveToTime(_time);
   226                 _this.arrow.moveToTime(_time);
   223             }
   227             }
   224         });
   228         });
   225     }
   229     }
       
   230     this.$.find(".Ldt-CreateAnnotation-Cancel").click(function() {
       
   231         _this.player.trigger("CreateAnnotation.hide");
       
   232     });
   226     this.$.find(".Ldt-CreateAnnotation-Close").click(function() {
   233     this.$.find(".Ldt-CreateAnnotation-Close").click(function() {
   227         _this.close_after_send
   234         _this.close_after_send
   228         ? _this.hide()
   235         ? _this.hide()
   229         : _this.showScreen("Main");
   236         : _this.showScreen("Main");
   230         return false;
   237         return false;
   268 }
   275 }
   269 
   276 
   270 IriSP.Widgets.CreateAnnotation.prototype.show = function() {
   277 IriSP.Widgets.CreateAnnotation.prototype.show = function() {
   271     if (!this.visible){
   278     if (!this.visible){
   272         this.visible = true;
   279         this.visible = true;
       
   280         if (this.pause_when_displaying){
       
   281             this.media.pause();
       
   282         }
   273         this.showScreen('Main');
   283         this.showScreen('Main');
   274         this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color", "#666666").addClass("empty");
   284         this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color", "#666666").addClass("empty");
   275         if (this.show_title_field) {
   285         if (this.show_title_field) {
   276             this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color", "#666666").addClass("empty");
   286             this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color", "#666666").addClass("empty");
   277         }
   287         }