| author | ymh <ymh.work@gmail.com> |
| Mon, 28 Dec 2015 15:50:04 +0100 | |
| changeset 1069 | 2409cb4cebaf |
| parent 1056 | 3d19cbe56fcb |
| child 1072 | ac1eacb3aa33 |
| permissions | -rw-r--r-- |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
1 |
/* Widget that displays the last annotation that was posted, optionally for current segment, optionally for a given username */ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
2 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
3 |
IriSP.Widgets.LatestAnnotation = function(player, config){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
4 |
IriSP.Widgets.Widget.call(this, player, config); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
5 |
}; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
6 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
7 |
IriSP.Widgets.LatestAnnotation.prototype = new IriSP.Widgets.Widget(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
8 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
9 |
IriSP.Widgets.LatestAnnotation.prototype.defaults = { |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
10 |
pre_draw_callback: function(){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
11 |
return this.importUsers(); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
12 |
}, |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
13 |
from_user: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
14 |
filter_by_segment: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
15 |
segments_annotation_type: "chap", |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
16 |
hide_without_segment: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
17 |
annotation_type: "contribution", |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
18 |
/* |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
19 |
* Set to a username if you only want to display annotations from a given user |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
20 |
*/ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
21 |
show_only_annotation_from_user: false, |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
22 |
/* |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
23 |
* Displays a button that copy currently displayed annotation into CreateAnnotation input field |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
24 |
*/ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
25 |
copy_and_edit_button: false, |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1056
diff
changeset
|
26 |
hide_annotations_list: false, |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
27 |
/* |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
28 |
* Allows clicks on an annotation from Annotations to display the annotation content into this widget |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
29 |
*/ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
30 |
selectable_annotations: false, |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
31 |
empty_message: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
32 |
starts_hidden: false, |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
33 |
show_header: false, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
34 |
custom_header: false, |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
35 |
make_name_string_function: function(params){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
36 |
return params.username ? params.username : "Anonymous"; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
37 |
}, |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
38 |
}; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
39 |
|
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
40 |
IriSP.Widgets.LatestAnnotation.prototype.messages = { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
41 |
fr : { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
42 |
copy_and_edit: "Copier et Editer", |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
43 |
empty : "Aucune annotation à afficher", |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
44 |
header: "Dernière annotation" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
45 |
}, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
46 |
en: { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
47 |
copy_and_edit: "Copy and Edit", |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
48 |
empty: "No annotation to display", |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
49 |
header: "Last annotation" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
50 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
51 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
52 |
|
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
53 |
IriSP.Widgets.LatestAnnotation.prototype.template = |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
54 |
"{{#show_header}}" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
55 |
+ "<p class='Ldt-LatestAnnotation-header'>" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
56 |
+ "{{#custom_header}}{{custom_header}}{{/custom_header}}" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
57 |
+ "{{^custom_header}}{{l10n.header}}{{/custom_header}}" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
58 |
+ "</p>" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
59 |
+ "{{/show_header}}" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
60 |
+ "<div class='Ldt-LatestAnnotation'>" |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
61 |
+ "</div>"; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
62 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
63 |
IriSP.Widgets.LatestAnnotation.prototype.annotationTemplate = |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
64 |
"<div class='Ldt-LatestAnnotation-Box'>" |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1056
diff
changeset
|
65 |
+ "{{#copy_and_edit_button}}<div class='Ldt-LatestAnnotation-CopyEditButton'>{{button_text}}</div>{{/copy_and_edit_button}}" |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
66 |
+ "<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-CreationDate'>{{{annotation_created}}}</div>" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
67 |
+ "<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Title'>{{{annotation_creator}}}{{#annotation_title}}: {{{annotation_title}}}{{/annotation_title}}</div>" |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
68 |
+ "<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Content'>" |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
69 |
+ "{{{annotation_content}}}" |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
70 |
+ "</div>" |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
71 |
+ "</div>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
72 |
|
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
73 |
|
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
74 |
IriSP.Widgets.LatestAnnotation.prototype.importUsers = function(){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
75 |
if (!this.source.users_data){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
76 |
this.usernames = Array(); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
77 |
var _this = this, |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
78 |
_list = this.getWidgetAnnotations(), |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
79 |
usernames_list_string = ""; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
80 |
|
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
81 |
_list.forEach(function(_annotation){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
82 |
if(_this.usernames.indexOf(_annotation.creator) == -1){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
83 |
_this.usernames.push(_annotation.creator); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
84 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
85 |
}); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
86 |
this.usernames.forEach(function(_username){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
87 |
usernames_list_string+=_username+"," |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
88 |
}) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
89 |
usernames_list_string = usernames_list_string.substring(0, usernames_list_string.length - 1); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
90 |
_url = Mustache.to_html(this.api_users_endpoint, {usernames_list_string: encodeURIComponent(usernames_list_string), usernames_list_length: this.usernames.length}); |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
91 |
return IriSP.jQuery.ajax({ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
92 |
async: false, |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
93 |
url: _url, |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
94 |
type: "GET", |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
95 |
success: function(_data) { |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
96 |
_this.source.users_data = _data.objects |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
97 |
}, |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
98 |
error: function(_xhr, _error, _thrown) { |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
99 |
console.log(_xhr) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
100 |
console.log(_error) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
101 |
console.log(_thrown) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
102 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
103 |
}) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
104 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
105 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
106 |
|
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
107 |
IriSP.Widgets.LatestAnnotation.prototype.draw = function(){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
108 |
var _this = this; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
109 |
this.renderTemplate(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
110 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
111 |
this.annotationContainer_$ = this.$.find('.Ldt-LatestAnnotation'); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
112 |
|
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
113 |
if (this.selectable_annotations){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
114 |
this.onMdpEvent("AnnotationsList.refresh", function(){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
115 |
_this.getWidgetAnnotations().forEach(function(_annotation){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
116 |
_annotation.off("click"); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
117 |
_annotation.on("click", function(){ |
|
1056
3d19cbe56fcb
fixed error when clicking annotation from an user that isn't in the api
durandn
parents:
1055
diff
changeset
|
118 |
var _user = {}, |
|
3d19cbe56fcb
fixed error when clicking annotation from an user that isn't in the api
durandn
parents:
1055
diff
changeset
|
119 |
_user_display_string = "", |
|
3d19cbe56fcb
fixed error when clicking annotation from an user that isn't in the api
durandn
parents:
1055
diff
changeset
|
120 |
_users = this.source.users_data.filter(function(_user_data){ |
|
3d19cbe56fcb
fixed error when clicking annotation from an user that isn't in the api
durandn
parents:
1055
diff
changeset
|
121 |
return _user_data.username == _annotation.creator |
|
3d19cbe56fcb
fixed error when clicking annotation from an user that isn't in the api
durandn
parents:
1055
diff
changeset
|
122 |
}); |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
123 |
if (_users.length == 0){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
124 |
_user.username = _annotation.creator; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
125 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
126 |
else { |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
127 |
_user = _users[0]; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
128 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
129 |
_user_display_string = _this.make_name_string_function(_user) |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
130 |
_html = Mustache.to_html(_this.annotationTemplate, { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
131 |
annotation_created: _annotation.created.toLocaleDateString()+", "+_annotation.created.toLocaleTimeString(), |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
132 |
annotation_creator: _user_display_string, |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
133 |
annotation_title: _annotation.title, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
134 |
annotation_content: _annotation.description, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
135 |
copy_and_edit_button: _this.copy_and_edit_button, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
136 |
button_text: _this.l10n.copy_and_edit, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
137 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
138 |
_this.annotationContainer_$.html(_html); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
139 |
_this.selectedAnnotation = true; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
140 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
141 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
142 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
143 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
144 |
this.segments = _this.source.getAnnotationsByTypeTitle(this.segments_annotation_type) |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
145 |
this.segments.forEach(function(_segment){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
146 |
_segment.on("click", function(){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
147 |
_this.selectedAnnotation = false; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
148 |
}) |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
149 |
}) |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
150 |
this.currentSegment = false; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
151 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
152 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
153 |
this.onMediaEvent("timeupdate", function(){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
154 |
_this.refresh(); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
155 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
156 |
this.onMediaEvent("settimerange", function(_timeRange){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
157 |
_this.refresh(_timeRange); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
158 |
}) |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
159 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
160 |
if (this.starts_hidden){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
161 |
this.visible = true; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
162 |
this.hide(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
163 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
164 |
else{ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
165 |
this.visible = false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
166 |
this.show(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
167 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
168 |
|
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
169 |
this.selectedAnnotation = false; // This flag tells the widget if it must display last annotation (false) or clicked annotation (true) |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
170 |
this.player.trigger("AnnotationsList.refresh"); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
171 |
this.refresh(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
172 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
173 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
174 |
|
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
175 |
IriSP.Widgets.LatestAnnotation.prototype.refresh = function(_timeRange){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
176 |
_timeRange = typeof _timeRange !== 'undefined' ? _timeRange : false ; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
177 |
var _this = this; |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
178 |
if (this.hide_without_segment){ |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
179 |
if (!_timeRange && !this.media.getTimeRange()){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
180 |
var _currentTime = this.media.getCurrentTime(); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
181 |
var _currentSegments = this.segments.filter(function(_segment){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
182 |
return (_currentTime >= _segment.begin && _currentTime <= _segment.end) |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
183 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
184 |
if (_currentSegments.length == 0){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
185 |
this.currentSegment = false; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
186 |
this.selectedAnnotation = false; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
187 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
188 |
else { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
189 |
this.currentSegment = _currentSegments[0] |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
190 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
191 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
192 |
else { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
193 |
var _segmentBegin = _timeRange? _timeRange[0] : this.media.getTimeRange()[0], |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
194 |
_segmentEnd = _timeRange? _timeRange[1] : this.media.getTimeRange()[1]; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
195 |
if ((!this.currentSegment)||(this.currentSegment.begin != _segmentBegin || this.currentSegment.end != _segmentEnd)) { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
196 |
var _currentSegments = this.segments.filter(function(_segment){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
197 |
return _segment.begin == _segmentBegin && _segment.end == _segmentEnd |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
198 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
199 |
if (_currentSegments.length > 0){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
200 |
this.selectedAnnotation = false; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
201 |
this.currentSegment = _currentSegments[0]; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
202 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
203 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
204 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
205 |
if (!this.currentSegment){ |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
206 |
if (this.visible){ |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
207 |
this.hide(); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
208 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
209 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
210 |
else { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
211 |
if (!this.visible){ |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
212 |
this.show(); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
213 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
214 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
215 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
216 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
217 |
if (this.visible && !this.selectedAnnotation){ |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
218 |
var _list = this.getWidgetAnnotations(); |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
219 |
|
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
220 |
if(this.filter_by_segment){ |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
221 |
if (!this.currentSegment) { |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
222 |
_list = _list.filter(function(_annotation){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
223 |
return false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
224 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
225 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
226 |
else { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
227 |
_list = _list.filter(function(_annotation){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
228 |
_annotationTime = (_annotation.begin+_annotation.end)/2; |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
229 |
return (_this.currentSegment.begin <= _annotationTime && _this.currentSegment.end >= _annotationTime); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
230 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
231 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
232 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
233 |
_list = _list.sortBy(function(_annotation){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
234 |
return _annotation.created; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
235 |
}); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
236 |
|
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
237 |
var _latestAnnotation = false, |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
238 |
_html="", |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
239 |
_user_display_string = "", |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
240 |
_user = {}; |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
241 |
if (_list.length != 0){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
242 |
_latestAnnotation = _list.pop(); |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
243 |
_users = this.source.users_data.filter(function(_user_data){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
244 |
return _user_data.username == _latestAnnotation.creator |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
245 |
}) |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
246 |
if (_users.length == 0){ |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
247 |
_user.username = _latestAnnotation.creator; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
248 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
249 |
else { |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
250 |
_user = _users[0]; |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
251 |
} |
|
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
252 |
_user_display_string = this.make_name_string_function(_user) |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
253 |
_html = Mustache.to_html(this.annotationTemplate, { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
254 |
annotation_created: _latestAnnotation.created.toLocaleDateString()+", "+_latestAnnotation.created.toLocaleTimeString(), |
|
1054
cfea8c04c8c7
Added support for displaying user name using additional user informations
durandn
parents:
1046
diff
changeset
|
255 |
annotation_creator: _user_display_string, |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
256 |
annotation_title: _latestAnnotation.title, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
257 |
annotation_content: _latestAnnotation.description, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
258 |
copy_and_edit_button: this.copy_and_edit_button, |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
259 |
button_text: this.l10n.copy_and_edit, |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
260 |
}); |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
261 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
262 |
else { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
263 |
var _empty_message = this.l10n.empty |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
264 |
if (this.empty_message) { |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
265 |
_empty_message = this.empty_message |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
266 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
267 |
_html = "<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-NoAnnotation'>"+_empty_message+"</div>"; |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
268 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
269 |
this.annotationContainer_$.html(_html); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
270 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
271 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
272 |
if(this.copy_and_edit_button){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
273 |
this.copyAndEditButton_$ = this.$.find('.Ldt-LatestAnnotation-CopyEditButton'); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
274 |
this.copyAndEditButton_$.click(this.functionWrapper("copy_and_edit")); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
275 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
276 |
} |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
277 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
278 |
IriSP.Widgets.LatestAnnotation.prototype.copy_and_edit = function(){ |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
279 |
this.player.trigger("CreateAnnotation.show"); |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1056
diff
changeset
|
280 |
if (this.hide_annotations_list){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1056
diff
changeset
|
281 |
this.player.trigger("AnnotationsList.hide"); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1056
diff
changeset
|
282 |
} |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
283 |
annotationText = $('.Ldt-LatestAnnotation-Content').get(0).innerHTML; |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
284 |
|
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
285 |
$('.Ldt-CreateAnnotation-Description').removeClass('empty'); |
|
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
286 |
$('.Ldt-CreateAnnotation-Description').val(annotationText); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
287 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
288 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
289 |
IriSP.Widgets.LatestAnnotation.prototype.hide = function() { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
290 |
if (this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
291 |
this.visible = false; |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
292 |
this.$.find('.Ldt-LatestAnnotation-header').hide(); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
293 |
this.annotationContainer_$.hide() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
294 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
295 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
296 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
297 |
IriSP.Widgets.LatestAnnotation.prototype.show = function() { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
298 |
if(!this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
299 |
this.visible = true; |
|
1046
eb77616c245f
Updated LatestAnnotation, CurrentSegmentInfobox, AnnotationController and AnnotationList widgets to use timerange to find the current segment when the corresponding option is used + CurrentSegmentInfobox now has an option for editing the current segment + LatestAnnotation now has a "Copy and edit" button that allows to use the text from the currently displayed annotation into the CreateAnnotation widget textarea
durandn
parents:
1041
diff
changeset
|
300 |
this.$.find('.Ldt-LatestAnnotation-header').show(); |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
301 |
this.annotationContainer_$.show() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
302 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
303 |
} |