| author | ymh <ymh.work@gmail.com> |
| Sun, 12 Nov 2017 22:07:33 +0100 | |
| changeset 1071 | 02c04d2c8fd8 |
| parent 1069 | 2409cb4cebaf |
| child 1072 | ac1eacb3aa33 |
| permissions | -rw-r--r-- |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
1 |
/* |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
2 |
* Widget that ties AnnotationList and CreateAnnotation together |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
3 |
* using buttons to hide/show AnnotationList and CreateAnnotation widgets. |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
4 |
* |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
5 |
*/ |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
6 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
7 |
IriSP.Widgets.AnnotationsController = function(player, config){ |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
8 |
IriSP.Widgets.Widget.call(this, player, config); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
9 |
}; |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
10 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
11 |
IriSP.Widgets.AnnotationsController.prototype = new IriSP.Widgets.Widget(); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
12 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
13 |
IriSP.Widgets.AnnotationsController.prototype.defaults = { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
14 |
// If true, displaying AnnotationList will hide CreateAnnotation and vice versa. |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
15 |
display_or_write: false, |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
16 |
toggle_widgets: false, |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
17 |
starts_hidden: false, |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
18 |
hide_without_segment: false, |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
19 |
hide_when_writing: true, |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
20 |
starting_widget: false, |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
21 |
always_show_widget: 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:
1039
diff
changeset
|
22 |
segments_annotation_type: "chap", |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
23 |
custom_write_text: false, |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
24 |
custom_display_text: false, |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
25 |
}; |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
26 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
27 |
IriSP.Widgets.AnnotationsController.prototype.template = |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
28 |
"<div class='Ldt-AnnotationsController'>" |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
29 |
+ "<div class='Ldt-AnnotationsController-ButtonsContainer'>" |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
30 |
+ " <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowCreateAnnotationButton'>{{#custom_write_text}}{{/custom_write_text}}{{custom_write_text}}{{^custom_write_text}}{{l10n.write}}{{/custom_write_text}}</div>" |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
31 |
+ " <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowAnnotationsListButton'>{{#custom_display_text}}{{/custom_display_text}}{{custom_display_text}}{{^custom_display_text}}{{l10n.display}}{{/custom_display_text}}</div>" |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
32 |
+ "</div>" |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
33 |
+ "</div>" |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
34 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
35 |
IriSP.Widgets.AnnotationsController.prototype.messages = { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
36 |
en : { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
37 |
write : "Write", |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
38 |
display : "Display", |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
39 |
}, |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
40 |
fr : { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
41 |
write : "Ecrire", |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
42 |
display : "Voir" |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
43 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
44 |
}; |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
45 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
46 |
IriSP.Widgets.AnnotationsController.prototype.draw = function() { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
47 |
this.renderTemplate(); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
48 |
var _this = this; |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
49 |
this.element_$ = this.$.find(".Ldt-AnnotationsController") |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
50 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
51 |
this.displayButton_$ = this.$.find(".Ldt-AnnotationsController-ShowAnnotationsListButton"); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
52 |
this.writeButton_$ = this.$.find(".Ldt-AnnotationsController-ShowCreateAnnotationButton"); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
53 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
54 |
this.writeButton_$.click(function(){ |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
55 |
if (!_this.writeButton_$.hasClass("selected")){ |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
56 |
_this.player.trigger("CreateAnnotation.show") |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
57 |
if (_this.display_or_write){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
58 |
_this.player.trigger("AnnotationsList.hide"); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
59 |
} |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
60 |
} |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
61 |
else { |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
62 |
_this.player.trigger("CreateAnnotation.hide") |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
63 |
if (_this.toggle_widgets){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
64 |
_this.player.trigger("AnnotationsList.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
65 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
66 |
else if (_this.display_or_write){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
67 |
_this.player.trigger("AnnotationsList.hide"); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
68 |
} |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
69 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
70 |
}); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
71 |
this.displayButton_$.click(function(){ |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
72 |
if (!_this.displayButton_$.hasClass("selected")){ |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
73 |
_this.player.trigger("AnnotationsList.show") |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
74 |
if (_this.display_or_write){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
75 |
_this.player.trigger("CreateAnnotation.hide"); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
76 |
} |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
77 |
} |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
78 |
else { |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
79 |
_this.player.trigger("AnnotationsList.hide") |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
80 |
if (_this.toggle_widgets){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
81 |
_this.player.trigger("CreateAnnotation.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
82 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
83 |
else if (_this.display_or_write){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
84 |
_this.player.trigger("CreateAnnotation.hide"); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
85 |
} |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
86 |
} |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
87 |
|
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
88 |
}) |
|
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:
1039
diff
changeset
|
89 |
|
|
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:
1039
diff
changeset
|
90 |
if(this.hide_without_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:
1039
diff
changeset
|
91 |
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:
1039
diff
changeset
|
92 |
_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:
1039
diff
changeset
|
93 |
}) |
|
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:
1039
diff
changeset
|
94 |
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:
1039
diff
changeset
|
95 |
_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:
1039
diff
changeset
|
96 |
}) |
|
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:
1039
diff
changeset
|
97 |
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:
1039
diff
changeset
|
98 |
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:
1039
diff
changeset
|
99 |
} |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
100 |
|
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
101 |
|
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
102 |
this.createAnnotationEnabled = false; |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
103 |
this.onMdpEvent("CreateAnnotation.hide", function(){ |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
104 |
if (_this.hide_when_writing){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
105 |
_this.show() |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
106 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
107 |
_this.createAnnotationEnabled = false; |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
108 |
_this.writeButton_$.toggleClass("selected", false); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
109 |
}) |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
110 |
this.onMdpEvent("CreateAnnotation.show", function(){ |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
111 |
if (_this.hide_when_writing){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
112 |
_this.hide() |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
113 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
114 |
_this.createAnnotationEnabled = true; |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
115 |
_this.writeButton_$.toggleClass("selected", true); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
116 |
}) |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
117 |
this.onMdpEvent("AnnotationsList.hide", function(){ |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
118 |
_this.displayButton_$.toggleClass("selected", false); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
119 |
}) |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
120 |
this.onMdpEvent("AnnotationsList.show", function(){ |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
121 |
_this.displayButton_$.toggleClass("selected", true); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
122 |
}) |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
123 |
|
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
124 |
if (this.starts_hidden) { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
125 |
this.visible = true |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
126 |
this.hide(); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
127 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
128 |
else{ |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
129 |
this.visible = false |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
130 |
this.show(); |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
131 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
132 |
|
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
133 |
if (this.starting_widget && this.visible){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
134 |
if (this.starting_widget == "AnnotationsList"){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
135 |
this.player.trigger("AnnotationsList.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
136 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
137 |
else if (this.starting_widget == "CreateAnnotation"){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
138 |
this.player.trigger("CreateAnnotation.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
139 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
140 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
141 |
|
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
142 |
}; |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
143 |
|
|
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:
1039
diff
changeset
|
144 |
IriSP.Widgets.AnnotationsController.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:
1039
diff
changeset
|
145 |
_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:
1039
diff
changeset
|
146 |
|
|
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:
1039
diff
changeset
|
147 |
if(!_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:
1039
diff
changeset
|
148 |
if (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:
1039
diff
changeset
|
149 |
_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:
1039
diff
changeset
|
150 |
} |
|
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:
1039
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:
1039
diff
changeset
|
152 |
|
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
153 |
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:
1039
diff
changeset
|
154 |
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:
1039
diff
changeset
|
155 |
_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:
1039
diff
changeset
|
156 |
_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:
1039
diff
changeset
|
157 |
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:
1039
diff
changeset
|
158 |
}); |
|
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:
1039
diff
changeset
|
159 |
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:
1039
diff
changeset
|
160 |
currentSegment = 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:
1039
diff
changeset
|
161 |
} |
|
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:
1039
diff
changeset
|
162 |
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:
1039
diff
changeset
|
163 |
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:
1039
diff
changeset
|
164 |
} |
|
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:
1039
diff
changeset
|
165 |
} |
|
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:
1039
diff
changeset
|
166 |
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:
1039
diff
changeset
|
167 |
var _timeRangeBegin = _timeRange[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:
1039
diff
changeset
|
168 |
_timeRangeEnd = _timeRange[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:
1039
diff
changeset
|
169 |
_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:
1039
diff
changeset
|
170 |
return (_timeRangeBegin == _segment.begin && _timeRangeEnd == _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:
1039
diff
changeset
|
171 |
}); |
|
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:
1039
diff
changeset
|
172 |
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:
1039
diff
changeset
|
173 |
currentSegment = 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:
1039
diff
changeset
|
174 |
} |
|
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:
1039
diff
changeset
|
175 |
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:
1039
diff
changeset
|
176 |
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:
1039
diff
changeset
|
177 |
} |
|
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:
1039
diff
changeset
|
178 |
} |
|
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:
1039
diff
changeset
|
179 |
if (!currentSegment && _currentSegments.length == 0){ |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
180 |
if (this.visible || this.hide_when_writing){ |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
181 |
this.writeButton_$.toggleClass("selected", false); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
182 |
this.displayButton_$.toggleClass("selected", 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:
1039
diff
changeset
|
183 |
this.player.trigger("CreateAnnotation.hide"); |
|
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:
1039
diff
changeset
|
184 |
this.player.trigger("AnnotationsList.hide"); |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
185 |
this.hide(); |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
186 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
187 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
188 |
else { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
189 |
if (!this.visible){ |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
190 |
if (!this.createAnnotationEnabled){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
191 |
this.show(); |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
192 |
} |
|
1048
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
193 |
this.writeButton_$.toggleClass("selected", false); |
|
13211bca0256
Updated Annotation controller to assign "selected" class to buttons when they get clicked on, for use in custom css.
durandn
parents:
1046
diff
changeset
|
194 |
this.displayButton_$.toggleClass("selected", false); |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
195 |
if (this.starting_widget == "AnnotationsList"){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
196 |
this.player.trigger("AnnotationsList.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
197 |
} |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
198 |
if (this.starting_widget == "CreateAnnotation"){ |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
199 |
this.player.trigger("CreateAnnotation.show") |
|
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
200 |
} |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
201 |
} |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
202 |
|
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
203 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
204 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
205 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
206 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
207 |
IriSP.Widgets.AnnotationsController.prototype.hide = function() { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
208 |
if (this.visible){ |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
209 |
this.visible = false; |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
210 |
this.element_$.hide(); |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
211 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
212 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
213 |
|
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
214 |
IriSP.Widgets.AnnotationsController.prototype.show = function() { |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
215 |
if(!this.visible){ |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
216 |
this.visible = true; |
|
1069
2409cb4cebaf
getting various changes from github
ymh <ymh.work@gmail.com>
parents:
1048
diff
changeset
|
217 |
this.element_$.show(); |
|
1039
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
218 |
} |
|
4fddc765a716
New widget AnnotationsController that displays buttons to hide/show AnnotationsList and CreateAnnotations
durandn
parents:
diff
changeset
|
219 |
} |