src/widgets/AnnotationsList.js
changeset 1069 2409cb4cebaf
parent 1068 7623f9af9272
child 1072 ac1eacb3aa33
equal deleted inserted replaced
1068:7623f9af9272 1069:2409cb4cebaf
    26      * number of milliseconds before/after the current timecode when calling the
    26      * number of milliseconds before/after the current timecode when calling the
    27      * segment API
    27      * segment API
    28      */
    28      */
    29     ajax_granularity : 600000,
    29     ajax_granularity : 600000,
    30     default_thumbnail : "",
    30     default_thumbnail : "",
       
    31     custom_external_icon : "",
    31     /*
    32     /*
    32      * URL when the annotation is not in the current project, e.g.
    33      * URL when the annotation is not in the current project, e.g.
    33      * http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}}
    34      * http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}}
    34      */
    35      */
    35     foreign_url : "",
    36     foreign_url : "",
    36     annotation_type : false,
    37     annotation_type : false,
    37     refresh_interval : 0,
    38     refresh_interval : 0,
    38     limit_count : 20,
    39     limit_count : 20,
    39     newest_first : false,
    40     newest_first : false,
    40 
    41     show_title: true,
    41     show_audio: true,
    42     show_audio: true,
    42     show_creator: false,
    43     show_creator: true,
    43     show_controls: false,
    44     show_controls: false,
    44     show_end_time: true,
    45     show_end_time: true,
    45     show_publish: false,
    46     show_publish: false,
    46     show_twitter: false,
    47     show_twitter: false,
    47     twitter_hashtag: '',
    48     twitter_hashtag: '',
    53     api_serializer: "ldt_annotate",
    54     api_serializer: "ldt_annotate",
    54     api_method: "POST",
    55     api_method: "POST",
    55     editable: false,
    56     editable: false,
    56     // Id that will be used as localStorage key
    57     // Id that will be used as localStorage key
    57     editable_storage: "",
    58     editable_storage: "",
    58 
    59     widget_max_height: 680,
    59     always_visible : false,
    60     always_visible : false,
    60     start_visible: true,
    61     start_visible: true,
    61     show_audio : true,
    62     show_audio : true,
    62     show_filters : false,
    63     show_filters : false,
    63     keyword_filter: true,
    64     keyword_filter: true,
    67     latest_contributions_filter: false,
    68     latest_contributions_filter: false,
    68     current_day_filter: true,
    69     current_day_filter: true,
    69     show_header : false,
    70     show_header : false,
    70     custom_header : false,
    71     custom_header : false,
    71     annotations_count_header : true,
    72     annotations_count_header : true,
       
    73     annotations_count_header_string: "annotations",
    72     show_creation_date : false,
    74     show_creation_date : false,
    73     show_timecode : true,
    75     show_timecode : true,
       
    76     show_end_time : true,
    74     project_id: "",
    77     project_id: "",
    75     /*
    78     /*
    76      * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget.
    79      * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget.
    77      */
    80      */
    78     allow_annotations_deletion: false,
    81     allow_annotations_deletion: false,
   158         publish_annotation: "Make note public",
   161         publish_annotation: "Make note public",
   159         import_annotations: "Paste or load notes in this field and press Import.",
   162         import_annotations: "Paste or load notes in this field and press Import.",
   160         confirm_delete_message: "You are about to delete {{ annotation.title }}. Are you sure you want to delete it?",
   163         confirm_delete_message: "You are about to delete {{ annotation.title }}. Are you sure you want to delete it?",
   161         confirm_publish_message: "You are about to publish {{ annotation.title }}. Are you sure you want to make it public?",
   164         confirm_publish_message: "You are about to publish {{ annotation.title }}. Are you sure you want to make it public?",
   162         tweet_annotation: "Tweet annotation",
   165         tweet_annotation: "Tweet annotation",
       
   166         external_annotation: "This annotation was submitted to another project",
   163         everyone: "Everyone",
   167         everyone: "Everyone",
   164         header: "Annotations for this content",
   168         header: "Annotations for this content",
   165         segment_filter: "All cuttings",
   169         segment_filter: "All cuttings",
   166         latest_contributions: "Latest contributions",
   170         latest_contributions: "Latest contributions",
   167         close_widget: "Close",
   171         close_widget: "Close",
   168         confirm: "Confirm",
   172         confirm: "Confirm",
   169         cancel: "Cancel",
   173         cancel: "Cancel",
   170         annotation_deletion_delete: "You will delete this annotation : ",
   174         annotation_deletion_delete: "You will delete this annotation",
   171         annotation_deletion_sending: "Your deletion request is being sent ... ",
   175         annotation_deletion_sending: "Your deletion request is being sent ... ",
   172         annotation_deletion_success: "The annotation has been deleted.",
   176         annotation_deletion_success: "The annotation has been deleted.",
   173         annotation_deletion_error: "There was an error contacting the server. The annotation has not been deleted."
   177         annotation_deletion_error: "There was an error contacting the server. The annotation has not been deleted."
   174     },
   178     },
   175     fr: {
   179     fr: {
   183         publish_annotation: "Rendre la note publique",
   187         publish_annotation: "Rendre la note publique",
   184         import_annotations: "Copiez ou chargez des notes dans ce champ et appuyez sur Import",
   188         import_annotations: "Copiez ou chargez des notes dans ce champ et appuyez sur Import",
   185         confirm_delete_message: "Vous allez supprimer {{ annotation.title }}. Êtes-vous certain(e) ?",
   189         confirm_delete_message: "Vous allez supprimer {{ annotation.title }}. Êtes-vous certain(e) ?",
   186         confirm_publish_message: "Vous allez publier {{ annotation.title }}. Êtes-vous certain(e) ?",
   190         confirm_publish_message: "Vous allez publier {{ annotation.title }}. Êtes-vous certain(e) ?",
   187         tweet_annotation: "Tweeter l'annotation",
   191         tweet_annotation: "Tweeter l'annotation",
       
   192         external_annotation: "Cette annotation a été postée sur un autre projet",
   188         everyone: "Tous",
   193         everyone: "Tous",
   189         header: "Annotations sur ce contenu",
   194         header: "Annotations sur ce contenu",
   190         segment_filter: "Tous les segments",
   195         segment_filter: "Tous les segments",
   191         latest_contributions: "Dernières contributions",
   196         latest_contributions: "Dernières contributions",
   192         close_widget: "Fermer",
   197         close_widget: "Fermer",
   193         confirm: "Confirmer",
   198         confirm: "Confirmer",
   194         cancel: "Annuler",
   199         cancel: "Annuler",
   195         annotation_deletion_delete: "Vous allez supprimer cette annotation: ",
   200         annotation_deletion_delete: "Vous allez supprimer cette annotation",
   196         annotation_deletion_sending: "Votre demande de suppression est en cours d'envoi ... ",
   201         annotation_deletion_sending: "Votre demande de suppression est en cours d'envoi ... ",
   197         annotation_deletion_success: "L'annotation a été supprimée.",
   202         annotation_deletion_success: "L'annotation a été supprimée.",
   198         annotation_deletion_error: "Une erreur s'est produite en contactant le serveur. L'annotation n'a pas été supprimée."
   203         annotation_deletion_error: "Une erreur s'est produite en contactant le serveur. L'annotation n'a pas été supprimée."
   199     }
   204     }
   200 };
   205 };
   221     +         '</ul>'
   226     +         '</ul>'
   222     +     '</div>'    
   227     +     '</div>'    
   223     +     '{{#allow_annotations_deletion}}'
   228     +     '{{#allow_annotations_deletion}}'
   224     +     '<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenDelete">'
   229     +     '<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenDelete">'
   225     +         '<a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>' 
   230     +         '<a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>' 
       
   231     +         '{{l10n.annotation_deletion_delete}}'
   226     +         '<ul class="Ldt-AnnotationsList-ul-ToDelete"></ul>'
   232     +         '<ul class="Ldt-AnnotationsList-ul-ToDelete"></ul>'
   227     +         '{{l10n.annotation_deletion_delete}} <a class="Ldt-AnnotationsList-ConfirmDelete">{{l10n.confirm}}</a> <a class="Ldt-AnnotationsList-CancelDelete">{{l10n.cancel}}</a>'
   233     +         '<a class="Ldt-AnnotationsList-ConfirmDelete">{{l10n.confirm}}</a> <a class="Ldt-AnnotationsList-CancelDelete">{{l10n.cancel}}</a>'
   228     +     '</div>'
   234     +     '</div>'
   229     +     '<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSending">'
   235     +     '<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSending">'
   230     +         '<a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>'  
   236     +         '<a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>'  
   231     +         '{{l10n.annotation_deletion_sending}}'
   237     +         '{{l10n.annotation_deletion_sending}}'
   232     +     '</div>'
   238     +     '</div>'
   242     + '</div>';
   248     + '</div>';
   243 
   249 
   244 IriSP.Widgets.AnnotationsList.prototype.annotationTemplate =
   250 IriSP.Widgets.AnnotationsList.prototype.annotationTemplate =
   245     '<li class="Ldt-AnnotationsList-li Ldt-Highlighter-Annotation Ldt-TraceMe" data-annotation="{{ id }}" data-begin="{{ begin_ms }}" data-end="{{ end_ms }}" trace-info="annotation-id:{{id}}, media-id:{{media_id}}" style="{{specific_style}}">'
   251     '<li class="Ldt-AnnotationsList-li Ldt-Highlighter-Annotation Ldt-TraceMe" data-annotation="{{ id }}" data-begin="{{ begin_ms }}" data-end="{{ end_ms }}" trace-info="annotation-id:{{id}}, media-id:{{media_id}}" style="{{specific_style}}">'
   246     + '<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-ThumbContainer Ldt-AnnotationsList-Annotation-Screen Ldt-AnnotationsList-Annotation-ScreenMain">'
   252     + '<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-ThumbContainer Ldt-AnnotationsList-Annotation-Screen Ldt-AnnotationsList-Annotation-ScreenMain">'
   247     +   '<a href="{{url}}" draggable="true">'
   253     +   '<a {{#url}}href="{{url}}"{{/url}} draggable="true">'
   248     +     '<img title="{{ begin }} - {{ title }}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />'
   254     +     '<img title="{{^external}}{{ begin }} - {{ end }}{{/external}}{{#external}}{{l10n.external_annotation}}{{/external}}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />'
       
   255     +     '{{#external}}<div title="{{l10n.external_annotation}}" class="Ldt-AnnotationsList-External-Icon"></div>{{/external}}'
   249     +   '</a>'
   256     +   '</a>'
   250     + '</div>'
   257     + '</div>'
   251     + '{{#allow_annotations_deletion}}'
   258     + '{{#allow_annotations_deletion}}'
   252     + '<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-DeleteButton">&#10006;</div>'
   259     + '<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-DeleteButton">&#10006;</div>'
   253     + '{{/allow_annotations_deletion}}'
   260     + '{{/allow_annotations_deletion}}'
   254     + '{{#show_timecode}}<div title="{{l10n.set_time}}" class="Ldt-AnnotationsList-Duration"><span class="Ldt-AnnotationsList-Begin Ldt-live-editable Ldt-AnnotationsList-TimeEdit" data-editable_value="{{begin}}" data-editable_id="{{id}}" data-editable_field="begin" data-editable_type="timestamp">{{begin}}</span>{{#show_end_time}} - <span class="Ldt-AnnotationsList-End Ldt-live-editable" data-editable_value="{{end}}" data-editable_id="{{id}}" data-editable_field="end" data-editable_type="timestamp">{{end}}</span>{{/show_end_time}}</div>{{/show_timecode}}'
   261     + '{{#show_timecode}}<div title="{{l10n.set_time}}" class="Ldt-AnnotationsList-Duration"><span class="Ldt-AnnotationsList-Begin Ldt-live-editable Ldt-AnnotationsList-TimeEdit" data-editable_value="{{begin}}" data-editable_id="{{id}}" data-editable_field="begin" data-editable_type="timestamp">{{begin}}</span>{{#show_end_time}} - <span class="Ldt-AnnotationsList-End Ldt-live-editable" data-editable_value="{{end}}" data-editable_id="{{id}}" data-editable_field="end" data-editable_type="timestamp">{{end}}</span>{{/show_end_time}}</div>{{/show_timecode}}'
   255     + '<h3 class="Ldt-AnnotationsList-Title Ldt-Annotation-Timecode" data-timecode="{{ begin_ms }}" draggable="true">'
   262     + '<h3 class="Ldt-AnnotationsList-Title Ldt-Annotation-Timecode" data-timecode="{{ begin_ms }}" draggable="true">'
   256     +   '<span class="Ldt-AnnotationsList-TitleContent Ldt-live-editable" data-editable_value="{{title}}" data-editable_type="multiline" data-editable_id="{{id}}" data-editable_field="title">{{{htitle}}}</span>'
   263     + '{{#show_title}}<span class="Ldt-AnnotationsList-TitleContent Ldt-live-editable" data-editable_value="{{title}}" data-editable_type="multiline" data-editable_id="{{id}}" data-editable_field="title">{{{htitle}}}</span>{{/show_title}}'
   257     + '{{#show_creator}}<span class="Ldt-AnnotationsList-Creator">{{ creator }}</span>{{/show_creator}}'
   264     + '{{#show_creator}}<span class="Ldt-AnnotationsList-Creator">{{ creator }}</span>{{/show_creator}}'
   258     + '</h3>'
   265     + '</h3>'
   259     + '<p class="Ldt-AnnotationsList-Description Ldt-live-editable" data-editable_type="multiline" data-editable_value="{{description}}" data-editable_id="{{id}}" data-editable_field="description">{{{hdescription}}}</p>'
   266     + '<p class="Ldt-AnnotationsList-Description Ldt-live-editable" data-editable_type="multiline" data-editable_value="{{description}}" data-editable_id="{{id}}" data-editable_field="description">{{{hdescription}}}</p>'
   260     + '{{#created}}'
   267     + '{{#created}}'
   261     + '<div class="Ldt-AnnotationsList-CreationDate">{{{created}}}</div>'
   268     + '<div class="Ldt-AnnotationsList-CreationDate">{{{created}}}</div>'
   532                             annotationType : _annotation.annotationType.id
   539                             annotationType : _annotation.annotationType.id
   533                         }
   540                         }
   534                     )
   541                     )
   535                     : document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id + '&t=' + (_annotation.begin / 1000.0)
   542                     : document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id + '&t=' + (_annotation.begin / 1000.0)
   536                     )
   543                     )
   537             );
   544                 ),
   538             var _title = "",
   545                 _external = _annotation.project != _this.source.projectId ? true : false,
       
   546                 _title = "",
   539                 _description = _annotation.description,
   547                 _description = _annotation.description,
   540                 _thumbnail = (typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail);
   548                 _thumbnail = (typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail);
   541             
   549             if (_this.show_creator){
   542             // Update : display creator
   550                 if (_annotation.creator) {
   543             if (_annotation.creator) {
   551                     var _users = [],
   544                 var _users = [],
   552                         _user = {},
   545                     _user = {};
   553                         _creator = "";
   546                 if (_this.source.users_data) {
   554                     if (_this.source.users_data) {
   547                     _users = _this.source.users_data.filter(function(_user_data){
   555                         _users = _this.source.users_data.filter(function(_user_data){
   548                         return _user_data.username == _annotation.creator;
   556                             return _user_data.username == _annotation.creator;
   549                     });
   557                         });
       
   558                     }
       
   559                     if (_users.length == 0){
       
   560                         _user.username = _annotation.creator
       
   561                     }
       
   562                     else{
       
   563                         _user = _users[0]
       
   564                     }
       
   565                     _creator = _this.make_name_string_function(_user);
   550                 }
   566                 }
   551                 if (_users.length == 0){
   567             }
   552                     _user.username = _annotation.creator
   568             if (_this.show_title && _annotation.title){
   553                 }
   569                     var _title = _annotation.title;
   554                 else{
       
   555                     _user = _users[0]
       
   556                 }
       
   557                 _title = _this.make_name_string_function(_user);
       
   558             }
       
   559             if (_annotation.title) {
       
   560                 var tempTitle = _annotation.title;
       
   561                 if( tempTitle.substr(0, _title.length + 1) == (_title + ":") ){
       
   562                     _title = "";
       
   563                 }
       
   564                 _title = _title + ( (_title=="") ? "" : ": ") + _annotation.title;
       
   565             }
   570             }
   566             var _bgcolor;
   571             var _bgcolor;
   567             IriSP._(_this.polemics).each(function(_polemic) {
   572             IriSP._(_this.polemics).each(function(_polemic) {
   568                 var _rgxp = IriSP.Model.regexpFromTextOrArray(_polemic.keyword, true);
   573                 var _rgxp = IriSP.Model.regexpFromTextOrArray(_polemic.keyword, true);
   569                 if (_rgxp.test(_title + " " + _description)) {
   574                 if (_rgxp.test(_title + " " + _description)) {
   570                     _bgcolor = _polemic.background_color;
   575                     _bgcolor = _polemic.background_color;
   571                 }
   576                 }
   572             });
   577             });
   573             var _created = false;
   578             var _created = false;
   574             if (_this.show_creation_date) {
   579             if (_this.show_creation_date) {
   575                 _created = _annotation.created.toLocaleDateString()+", "+_annotation.created.toLocaleTimeString();
   580                 _created = _annotation.created.toLocaleDateString()+", "+_annotation.created.toLocaleTimeString().replace(/\u200E/g, '').replace(/^([^\d]*\d{1,2}:\d{1,2}):\d{1,2}([^\d]*)$/, '$1$2');;
   576             }
   581             }
   577             if(this.tags == true){
   582             if(this.tags == true){
   578                 var _tags = _annotation.getTagTexts();
   583                 var _tags = _annotation.getTagTexts();
   579             }
   584             }
   580             else {
   585             else {
   583             var _data = {
   588             var _data = {
   584                 id : _annotation.id,
   589                 id : _annotation.id,
   585                 media_id : _annotation.getMedia().id,
   590                 media_id : _annotation.getMedia().id,
   586                 htitle : IriSP.textFieldHtml(_title),
   591                 htitle : IriSP.textFieldHtml(_title),
   587                 title: _title,
   592                 title: _title,
   588                 creator: _annotation.creator ? ' (' + _annotation.creator + ')' : "",
   593                 creator: _creator,
   589                 hdescription : IriSP.textFieldHtml(_description),
   594                 hdescription : IriSP.textFieldHtml(_description),
   590                 description: _description,
   595                 description: _description,
   591                 begin : _annotation.begin.toString(),
   596                 begin : _annotation.begin.toString(),
   592                 end : _annotation.end.toString(),
   597                 end : _annotation.end.toString(),
   593                 created : _created,
   598                 created : _created,
   594                 show_timecode : _this.show_timecode,
   599                 show_timecode : _this.show_timecode,
       
   600                 show_end_time : _this.show_end_time,
       
   601                 show_title : _this.show_title && _title,
   595                 thumbnail : _thumbnail,
   602                 thumbnail : _thumbnail,
   596                 url : _url,
   603                 url : _url,
   597                 tags : _tags,
   604                 tags : _tags,
   598                 specific_style : (typeof _bgcolor !== "undefined" ? "background-color: " + _bgcolor : ""),
   605                 specific_style : (typeof _bgcolor !== "undefined" ? "background-color: " + _bgcolor : ""),
   599                 l10n: _this.l10n,
   606                 l10n: _this.l10n,
   600                 editable: _this.editable,
   607                 editable: _this.editable,
       
   608                 external: _external,
   601                 show_publish: _this.show_publish,
   609                 show_publish: _this.show_publish,
   602                 show_creator: _this.show_creator,
   610                 show_creator: _this.show_creator,
   603                 show_twitter: _this.show_twitter,
   611                 show_twitter: _this.show_twitter,
   604                 twitter_param: IriSP.jQuery.param({ url: _url, text: IriSP.textFieldHtml(_title) + (_this.twitter_hashtag ? ' #' + _this.twitter_hashtag : "") }),
   612                 twitter_param: IriSP.jQuery.param({ url: _url, text: IriSP.textFieldHtml(_title) + (_this.twitter_hashtag ? ' #' + _this.twitter_hashtag : "") }),
   605                 allow_annotations_deletion: _this.allow_annotations_deletion
   613                 allow_annotations_deletion: _this.allow_annotations_deletion
   647                 })
   655                 })
   648                 .mouseout(function() {
   656                 .mouseout(function() {
   649                     _annotation.trigger("unselect");
   657                     _annotation.trigger("unselect");
   650                 })
   658                 })
   651                 .click(function() {
   659                 .click(function() {
       
   660                     if (_this.filter_by_segments && _this.media.getTimeRange()){
       
   661                         _ann_time = ( _annotation.begin + _annotation.end ) / 2;
       
   662                         if ((_ann_time <= _this.media.getTimeRange()[0]) || (_ann_time >= _this.media.getTimeRange()[1])){
       
   663                             _this.media.resetTimeRange()
       
   664                         }
       
   665                     }
   652                     _annotation.trigger("click");
   666                     _annotation.trigger("click");
   653                 })
   667                 })
   654                 .appendTo(_this.list_$);
   668                 .appendTo(_this.list_$);
   655             IriSP.attachDndData(_el.find("[draggable]"), {
   669             IriSP.attachDndData(_el.find("[draggable]"), {
   656             	title: _title,
   670             	title: _title,
   901     
   915     
   902     return _list.length;
   916     return _list.length;
   903 };
   917 };
   904 
   918 
   905 IriSP.Widgets.AnnotationsList.prototype.onDeleteClick = function(event){
   919 IriSP.Widgets.AnnotationsList.prototype.onDeleteClick = function(event){
   906     
   920     _list = this.getWidgetAnnotations();
   907     ann_id = event.target.dataset.annotation;
   921     ann_id = event.target.dataset.annotation;
   908     delete_preview_$ = this.$.find(".Ldt-AnnotationsList-ul-ToDelete");
   922     delete_preview_$ = this.$.find(".Ldt-AnnotationsList-ul-ToDelete");
   909     delete_preview_$.html("");
   923     delete_preview_$.html("");
   910     _list = this.getWidgetAnnotations()
       
   911     _list = _list.filter(function(_annotation){
   924     _list = _list.filter(function(_annotation){
   912         return _annotation.id == ann_id
   925         return _annotation.id == ann_id
   913     })
   926     })
   914     var _annotation = _list[0],
   927     var _annotation = _list[0],
   915         _title = "",
   928         _title = "",
       
   929         _creator = "",
   916         _this = this;
   930         _this = this;
   917     if (_annotation.creator) {
   931     if (_annotation.creator) {
   918         var _users = [],
   932         var _users = [],
   919             _user = {};
   933             _user = {};
   920         if (_this.source.users_data) {
   934         if (_this.source.users_data) {
   926             _user.username = _annotation.creator
   940             _user.username = _annotation.creator
   927         }
   941         }
   928         else{
   942         else{
   929             _user = _users[0]
   943             _user = _users[0]
   930         }
   944         }
   931         _title = _this.make_name_string_function(_user);
   945         _creator = _this.make_name_string_function(_user);
   932     }
   946     }
   933     if (_annotation.title) {
   947     if (_annotation.title) {
   934         var tempTitle = _annotation.title;
   948         var tempTitle = _annotation.title;
   935         if( tempTitle.substr(0, _title.length + 1) == (_title + ":") ){
   949         if( tempTitle.substr(0, _title.length + 1) == (_title + ":") ){
   936             _title = "";
   950             _title = "";
   948             hdescription : IriSP.textFieldHtml(_annotation.description),
   962             hdescription : IriSP.textFieldHtml(_annotation.description),
   949             begin : _annotation.begin.toString(),
   963             begin : _annotation.begin.toString(),
   950             end : _annotation.end.toString(),
   964             end : _annotation.end.toString(),
   951             created : _created,
   965             created : _created,
   952             show_timecode : this.show_timecode,
   966             show_timecode : this.show_timecode,
       
   967             show_creator : this.show_creator,
       
   968             creator : _creator,
   953             tags : false,
   969             tags : false,
   954             l10n: this.l10n,
   970             l10n: this.l10n,
   955             allow_annotations_deletion: false
   971             allow_annotations_deletion: false
   956     }
   972     }
   957     _html = Mustache.to_html(this.annotationTemplate, _data)
   973     _html = Mustache.to_html(this.annotationTemplate, _data)
   963     
   979     
   964     this.showScreen("Delete");    
   980     this.showScreen("Delete");    
   965 }
   981 }
   966 
   982 
   967 IriSP.Widgets.AnnotationsList.prototype.refreshHeader = function() {
   983 IriSP.Widgets.AnnotationsList.prototype.refreshHeader = function() {
   968     var annotation_count_string = " (" + this.annotations_count +" annotations)";
   984     var annotation_count_string = " (" + this.annotations_count +" "+this.annotations_count_header_string+")";
   969     this.$.find('.Ldt-AnnotationsList-header').html("");
   985     this.$.find('.Ldt-AnnotationsList-header').html("");
   970     this.$.find('.Ldt-AnnotationsList-header').html(
   986     this.$.find('.Ldt-AnnotationsList-header').html(
   971         this.custom_header && typeof this.custom_header == "string"? this.custom_header + annotation_count_string : this.l10n.header + annotation_count_string
   987         this.custom_header && typeof this.custom_header == "string"? this.custom_header + annotation_count_string : this.l10n.header + annotation_count_string
   972     );
   988     );
   973 }
   989 }
  1040 
  1056 
  1041     var _this = this;
  1057     var _this = this;
  1042     this.list_$ = this.$.find(".Ldt-AnnotationsList-ul");
  1058     this.list_$ = this.$.find(".Ldt-AnnotationsList-ul");
  1043     this.widget_$ = this.$.find(".Ldt-AnnotationsListWidget");
  1059     this.widget_$ = this.$.find(".Ldt-AnnotationsListWidget");
  1044     
  1060     
       
  1061     if (this.widget_max_height){
       
  1062         this.widget_$.css("max-height", this.widget_max_height)
       
  1063     }
       
  1064     
  1045     if (this.show_filters){
  1065     if (this.show_filters){
  1046         if (this.user_filter){
  1066         if (this.user_filter){
  1047             this.userselect_$ = this.$.find("#Ldt-AnnotationsList-userFilter");
  1067             this.userselect_$ = this.$.find("#Ldt-AnnotationsList-userFilter");
  1048             this.userselect_$.change(function(){
  1068             this.userselect_$.change(function(){
  1049                 _this.player.trigger("AnnotationsList.refresh");
  1069                 _this.player.trigger("AnnotationsList.refresh");