# HG changeset patch # User durandn # Date 1435935430 -7200 # Node ID 5c0416e8bba175964fc62fe56125d4b910530108 # Parent 3b88465041d69633eb988578c8c856e71465645f AnnotationsList widget new features: show creation date for annotations, hide/show feature on signal trigger, filter by username diff -r 3b88465041d6 -r 5c0416e8bba1 src/widgets/AnnotationsList.css --- a/src/widgets/AnnotationsList.css Fri Jul 03 16:54:26 2015 +0200 +++ b/src/widgets/AnnotationsList.css Fri Jul 03 16:57:10 2015 +0200 @@ -13,6 +13,33 @@ width: 1px; height: 1px; } +.Ldt-AnnotationsList-Filters { + display: table-cell; + width: 100%; + height: 30px; + vertical-align: middle; + text-align: center; + +} + +.Ldt-AnnotationsList-filter-text { + text-align: left; + display: inline; + margin: 4px 2px; +} + +.Ldt-AnnotationsList-filter-dropdown { + text-align: center; + display: inline; + margin: 4px 2px; +} + +.Ldt-AnnotationsList-filter-checkbox { + text-align: center; + display: inline; + margin: 4px 2px; +} + ul.Ldt-AnnotationsList-ul { list-style: none; padding: 2px; @@ -48,6 +75,12 @@ font-size: 12px; margin: 2px; } +.Ldt-AnnotationsList-CreationDate { + color: #f7268e; + text-align: left; + font-size: 12px; + margin: 2px 2px 0 82px; +} h3.Ldt-AnnotationsList-Title { color: #0068c4; font-size: 13px; @@ -106,12 +139,4 @@ .Ldt-AnnotationsList-Play:hover { background-position: 0 bottom; -} - -.Ldt-AnnotationsList-Control-Prev { - cursor: url(img/hand_left.png), pointer; -} - -.Ldt-AnnotationsList-Control-Next { - cursor: url(img/hand_right.png), pointer; -} +} \ No newline at end of file diff -r 3b88465041d6 -r 5c0416e8bba1 src/widgets/AnnotationsList.js --- a/src/widgets/AnnotationsList.js Fri Jul 03 16:54:26 2015 +0200 +++ b/src/widgets/AnnotationsList.js Fri Jul 03 16:57:10 2015 +0200 @@ -12,25 +12,47 @@ IriSP.Widgets.AnnotationsList.prototype = new IriSP.Widgets.Widget(); IriSP.Widgets.AnnotationsList.prototype.defaults = { - /* URL when the annotations are to be reloaded from an LDT-like segment API - * e.g. http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=? + /* + * URL when the annotations are to be reloaded from an LDT-like segment API + * e.g. + * http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=? */ ajax_url : false, - /* number of milliseconds before/after the current timecode when calling the segment API + /* + * number of milliseconds before/after the current timecode when calling the + * segment API */ ajax_granularity : 600000, default_thumbnail : "", - /* URL when the annotation is not in the current project, - * e.g. http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}} + /* + * URL when the annotation is not in the current project, e.g. + * http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}} */ foreign_url : "", annotation_type : false, refresh_interval : 0, limit_count : 20, newest_first : false, - show_audio: true, - show_creator: false, - show_controls: false, + always_visible : false, + start_visible: true, + show_audio : true, + show_filters : false, + show_creation_date : false, + show_timecode : true, + /* + * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget. + */ + filter_by_segments: false, + segments_annotation_type: "chap", + /* + * Set to a username if you only want to display annotations from a given user + */ + show_only_annotation_from_user: false, + /* + * Show a text field that filter annotations by username + */ + filter_by_user: false, + tags : true, polemics : [{ keyword: "++", background_color: "#c9ecc6" @@ -59,24 +81,33 @@ IriSP.Widgets.AnnotationsList.prototype.template = '
' + + '{{#show_filters}}' + + '
' + + '' + + '' + + '' + + '
' + + '{{/show_filters}}' + '{{#show_audio}}
{{/show_audio}}' - + '{{#show_controls}}
Previous | Next
{{/show_controls}}' + '' + '
'; IriSP.Widgets.AnnotationsList.prototype.annotationTemplate = - '
  • ' + '
  • ' + '
    ' + '' - + '' + + '' + '' + '
    ' - + '
    {{begin}} - {{end}}
    ' + + '{{#show_timecode}}
    {{begin}} - {{end}}
    {{/show_timecode}}' + '

    ' + '{{{htitle}}}' + '

    ' + '

    {{{hdescription}}}

    ' + + '{{#created}}' + + '
    {{{created}}}
    ' + + '{{/created}}' + '{{#tags.length}}' + '