wai-website-theme 1.3.1 → 1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/different.html +2 -1
  3. data/_includes/external.html +2 -1
  4. data/_includes/header.html +2 -1
  5. data/_includes/menuitem.html +6 -2
  6. data/_includes/peoplelist.html +21 -0
  7. data/_includes/prevnext-navigation.html +56 -0
  8. data/_includes/{prevnext.html → prevnext-order.html} +9 -0
  9. data/_includes/translation-note-msg.html +5 -3
  10. data/_includes/video-player.html +2 -2
  11. data/_layouts/default.html +8 -1
  12. data/_layouts/news.html +7 -1
  13. data/_layouts/policy.html +7 -1
  14. data/_layouts/sidenav.html +8 -1
  15. data/_layouts/sidenavsidebar.html +8 -1
  16. data/assets/ableplayer/Gruntfile.js +2 -1
  17. data/assets/ableplayer/README.md +158 -85
  18. data/assets/ableplayer/build/ableplayer.dist.js +15445 -13823
  19. data/assets/ableplayer/build/ableplayer.js +15445 -13823
  20. data/assets/ableplayer/build/ableplayer.min.css +1 -2
  21. data/assets/ableplayer/build/ableplayer.min.js +3 -10
  22. data/assets/ableplayer/package-lock.json +944 -346
  23. data/assets/ableplayer/package.json +8 -8
  24. data/assets/ableplayer/scripts/ableplayer-base.js +515 -524
  25. data/assets/ableplayer/scripts/browser.js +158 -158
  26. data/assets/ableplayer/scripts/buildplayer.js +1750 -1682
  27. data/assets/ableplayer/scripts/caption.js +424 -401
  28. data/assets/ableplayer/scripts/chapters.js +259 -259
  29. data/assets/ableplayer/scripts/control.js +1831 -1594
  30. data/assets/ableplayer/scripts/description.js +333 -256
  31. data/assets/ableplayer/scripts/dialog.js +145 -145
  32. data/assets/ableplayer/scripts/dragdrop.js +746 -749
  33. data/assets/ableplayer/scripts/event.js +875 -696
  34. data/assets/ableplayer/scripts/initialize.js +819 -912
  35. data/assets/ableplayer/scripts/langs.js +979 -743
  36. data/assets/ableplayer/scripts/metadata.js +124 -124
  37. data/assets/ableplayer/scripts/misc.js +170 -137
  38. data/assets/ableplayer/scripts/preference.js +904 -904
  39. data/assets/ableplayer/scripts/search.js +172 -172
  40. data/assets/ableplayer/scripts/sign.js +82 -78
  41. data/assets/ableplayer/scripts/slider.js +449 -448
  42. data/assets/ableplayer/scripts/track.js +409 -309
  43. data/assets/ableplayer/scripts/transcript.js +684 -595
  44. data/assets/ableplayer/scripts/translation.js +63 -67
  45. data/assets/ableplayer/scripts/ttml2webvtt.js +85 -85
  46. data/assets/ableplayer/scripts/vimeo.js +448 -0
  47. data/assets/ableplayer/scripts/volume.js +395 -380
  48. data/assets/ableplayer/scripts/vts.js +1077 -1077
  49. data/assets/ableplayer/scripts/webvtt.js +766 -763
  50. data/assets/ableplayer/scripts/youtube.js +695 -478
  51. data/assets/ableplayer/styles/ableplayer.css +54 -46
  52. data/assets/ableplayer/translations/nl.js +54 -54
  53. data/assets/ableplayer/translations/pt-br.js +311 -0
  54. data/assets/ableplayer/translations/tr.js +311 -0
  55. data/assets/ableplayer/translations/zh-tw.js +1 -1
  56. data/assets/css/style.css +1 -1
  57. data/assets/css/style.css.map +1 -1
  58. data/assets/images/icons.svg +5 -5
  59. data/assets/scripts/main.js +7 -0
  60. data/assets/search/tipuesearch.js +3 -3
  61. metadata +8 -3
@@ -1,263 +1,263 @@
1
1
  (function ($) {
2
2
 
3
- AblePlayer.prototype.populateChaptersDiv = function() {
4
-
5
- var headingLevel, headingType, headingId, $chaptersHeading,
6
- $chaptersList;
7
-
8
- if ($('#' + this.chaptersDivLocation)) {
9
- this.$chaptersDiv = $('#' + this.chaptersDivLocation);
10
- this.$chaptersDiv.addClass('able-chapters-div');
11
-
12
- // add optional header
13
- if (this.chaptersTitle) {
14
- headingLevel = this.getNextHeadingLevel(this.$chaptersDiv);
15
- headingType = 'h' + headingLevel.toString();
16
- headingId = this.mediaId + '-chapters-heading';
17
- $chaptersHeading = $('<' + headingType + '>', {
18
- 'class': 'able-chapters-heading',
19
- 'id': headingId
20
- }).text(this.chaptersTitle);
21
- this.$chaptersDiv.append($chaptersHeading);
22
- }
23
-
24
- this.$chaptersNav = $('<nav>');
25
- if (this.chaptersTitle) {
26
- this.$chaptersNav.attr('aria-labelledby',headingId);
27
- }
28
- else {
29
- this.$chaptersNav.attr('aria-label',this.tt.chapters);
30
- }
31
- this.$chaptersDiv.append(this.$chaptersNav);
32
-
33
- // populate this.$chaptersNav with a list of chapters
34
- this.updateChaptersList();
35
- }
36
- };
37
-
38
- AblePlayer.prototype.updateChaptersList = function() {
39
-
40
- var thisObj, cues, $chaptersList, c, thisChapter,
41
- $chapterItem, $chapterButton, buttonId, hasDefault,
42
- getClickFunction, $clickedItem, $chaptersList, thisChapterIndex;
43
-
44
- thisObj = this;
45
-
46
- if (!this.$chaptersNav) {
47
- return false;
48
- }
49
-
50
- if (typeof this.useChapterTimes === 'undefined') {
51
- if (this.seekbarScope === 'chapter' && this.selectedChapters.cues.length) {
52
- this.useChapterTimes = true;
53
- }
54
- else {
55
- this.useChapterTimes = false;
56
- }
57
- }
58
-
59
- if (this.useChapterTimes) {
60
- cues = this.selectedChapters.cues;
61
- }
62
- else if (this.chapters.length >= 1) {
63
- cues = this.chapters[0].cues;
64
- }
65
- else {
66
- cues = [];
67
- }
68
- if (cues.length > 0) {
69
- $chaptersList = $('<ul>');
70
- for (c = 0; c < cues.length; c++) {
71
- thisChapter = c;
72
- $chapterItem = $('<li></li>');
73
- $chapterButton = $('<button>',{
74
- 'type': 'button',
75
- 'val': thisChapter
76
- }).text(this.flattenCueForCaption(cues[thisChapter]));
77
-
78
- // add event listeners
79
- getClickFunction = function (time) {
80
- return function () {
81
- thisObj.seekTrigger = 'chapter';
82
- $clickedItem = $(this).closest('li');
83
- $chaptersList = $(this).closest('ul').find('li');
84
- thisChapterIndex = $chaptersList.index($clickedItem);
85
- $chaptersList.removeClass('able-current-chapter').attr('aria-selected','');
86
- $clickedItem.addClass('able-current-chapter').attr('aria-selected','true');
87
- // Need to updateChapter before seeking to it
88
- // Otherwise seekBar is redrawn with wrong chapterDuration and/or chapterTime
89
- thisObj.updateChapter(time);
90
- thisObj.seekTo(time);
91
- }
92
- };
93
- $chapterButton.on('click',getClickFunction(cues[thisChapter].start)); // works with Enter too
94
- $chapterButton.on('focus',function() {
95
- $(this).closest('ul').find('li').removeClass('able-focus');
96
- $(this).closest('li').addClass('able-focus');
97
- });
98
- $chapterItem.on('hover',function() {
99
- $(this).closest('ul').find('li').removeClass('able-focus');
100
- $(this).addClass('able-focus');
101
- });
102
- $chapterItem.on('mouseleave',function() {
103
- $(this).removeClass('able-focus');
104
- });
105
- $chapterButton.on('blur',function() {
106
- $(this).closest('li').removeClass('able-focus');
107
- });
108
-
109
- // put it all together
110
- $chapterItem.append($chapterButton);
111
- $chaptersList.append($chapterItem);
112
- if (this.defaultChapter === cues[thisChapter].id) {
113
- $chapterButton.attr('aria-selected','true').parent('li').addClass('able-current-chapter');
114
- this.currentChapter = cues[thisChapter];
115
- hasDefault = true;
116
- }
117
- }
118
- if (!hasDefault) {
119
- // select the first chapter
120
- this.currentChapter = cues[0];
121
- $chaptersList.find('button').first().attr('aria-selected','true')
122
- .parent('li').addClass('able-current-chapter');
123
- }
124
- this.$chaptersNav.html($chaptersList);
125
- }
126
- return false;
127
- };
128
-
129
- AblePlayer.prototype.seekToChapter = function(chapterId) {
130
-
131
- // step through chapters looking for matching ID
132
- var i=0;
133
- while (i < this.selectedChapters.cues.length) {
134
- if (this.selectedChapters.cues[i].id == chapterId) {
135
- // found the target chapter! Seek to it
136
- this.seekTo(this.selectedChapters.cues[i].start);
137
- this.updateChapter(this.selectedChapters.cues[i].start);
138
- break;
139
- }
140
- i++;
141
- }
142
- };
143
-
144
- AblePlayer.prototype.updateChapter = function (now) {
145
-
146
- // as time-synced chapters change during playback, track changes in current chapter
147
- if (typeof this.selectedChapters === 'undefined') {
148
- return;
149
- }
150
-
151
- var chapters, i, thisChapterIndex, chapterLabel;
152
-
153
- chapters = this.selectedChapters.cues;
154
- for (i = 0; i < chapters.length; i++) {
155
- if ((chapters[i].start <= now) && (chapters[i].end > now)) {
156
- thisChapterIndex = i;
157
- break;
158
- }
159
- }
160
- if (typeof thisChapterIndex !== 'undefined') {
161
- if (this.currentChapter !== chapters[thisChapterIndex]) {
162
- // this is a new chapter
163
- this.currentChapter = chapters[thisChapterIndex];
164
- if (this.useChapterTimes) {
165
- this.chapterDuration = this.getChapterDuration();
166
- this.seekIntervalCalculated = false; // will be recalculated in setSeekInterval()
167
- }
168
- if (typeof this.$chaptersDiv !== 'undefined') {
169
- // chapters are listed in an external container
170
- this.$chaptersDiv.find('ul').find('li').removeClass('able-current-chapter').attr('aria-selected','');
171
- this.$chaptersDiv.find('ul').find('li').eq(thisChapterIndex)
172
- .addClass('able-current-chapter').attr('aria-selected','true');
173
- }
174
- }
175
- }
176
- };
177
-
178
- AblePlayer.prototype.getChapterDuration = function () {
179
-
180
- // called if this.seekbarScope === 'chapter'
181
- // get duration of the current chapter
182
-
183
- var videoDuration, lastChapterIndex, chapterEnd;
184
-
185
- if (typeof this.currentChapter === 'undefined') {
186
- return 0;
187
- }
188
- videoDuration = this.getDuration();
189
- lastChapterIndex = this.selectedChapters.cues.length-1;
190
-
191
- if (this.selectedChapters.cues[lastChapterIndex] == this.currentChapter) {
192
- // this is the last chapter
193
- if (this.currentChapter.end !== videoDuration) {
194
- // chapter ends before or after video ends, adjust chapter end to match video end
195
- chapterEnd = videoDuration;
196
- this.currentChapter.end = videoDuration;
197
- }
198
- else {
199
- chapterEnd = this.currentChapter.end;
200
- }
201
- }
202
- else { // this is not the last chapter
203
- chapterEnd = this.currentChapter.end;
204
- }
205
- return chapterEnd - this.currentChapter.start;
206
- };
207
-
208
- AblePlayer.prototype.getChapterElapsed = function () {
209
-
210
- // called if this.seekbarScope === 'chapter'
211
- // get current elapsed time, relative to the current chapter duration
212
- if (typeof this.currentChapter === 'undefined') {
213
- return 0;
214
- }
215
- var videoDuration = this.getDuration();
216
- var videoElapsed = this.getElapsed();
217
- if (videoElapsed > this.currentChapter.start) {
218
- return videoElapsed - this.currentChapter.start;
219
- }
220
- else {
221
- return 0;
222
- }
223
- };
224
-
225
- AblePlayer.prototype.convertChapterTimeToVideoTime = function (chapterTime) {
226
-
227
- // chapterTime is the time within the current chapter
228
- // return the same time, relative to the entire video
229
- if (typeof this.currentChapter !== 'undefined') {
230
- var newTime = this.currentChapter.start + chapterTime;
231
- if (newTime > this.currentChapter.end) {
232
- return this.currentChapter.end;
233
- }
234
- else {
235
- return newTime;
236
- }
237
- }
238
- else {
239
- return chapterTime;
240
- }
241
- };
242
-
243
- AblePlayer.prototype.getChapterClickFunction = function (time) {
244
-
245
- // Returns the function used when a chapter is clicked in the chapters menu.
246
- var thisObj = this;
247
- return function () {
248
- thisObj.seekTrigger = 'chapter';
249
- thisObj.seekTo(time);
250
- // stopgap to prevent spacebar in Firefox from reopening popup
251
- // immediately after closing it (used in handleChapters())
252
- thisObj.hidingPopup = true;
253
- thisObj.chaptersPopup.hide();
254
- // Ensure stopgap gets cancelled if handleChapters() isn't called
255
- // e.g., if user triggered button with Enter or mouse click, not spacebar
256
- setTimeout(function() {
257
- thisObj.hidingPopup = false;
258
- }, 100);
259
- thisObj.$chaptersButton.focus();
260
- }
261
- };
3
+ AblePlayer.prototype.populateChaptersDiv = function() {
4
+
5
+ var headingLevel, headingType, headingId, $chaptersHeading,
6
+ $chaptersList;
7
+
8
+ if ($('#' + this.chaptersDivLocation)) {
9
+ this.$chaptersDiv = $('#' + this.chaptersDivLocation);
10
+ this.$chaptersDiv.addClass('able-chapters-div');
11
+
12
+ // add optional header
13
+ if (this.chaptersTitle) {
14
+ headingLevel = this.getNextHeadingLevel(this.$chaptersDiv);
15
+ headingType = 'h' + headingLevel.toString();
16
+ headingId = this.mediaId + '-chapters-heading';
17
+ $chaptersHeading = $('<' + headingType + '>', {
18
+ 'class': 'able-chapters-heading',
19
+ 'id': headingId
20
+ }).text(this.chaptersTitle);
21
+ this.$chaptersDiv.append($chaptersHeading);
22
+ }
23
+
24
+ this.$chaptersNav = $('<nav>');
25
+ if (this.chaptersTitle) {
26
+ this.$chaptersNav.attr('aria-labelledby',headingId);
27
+ }
28
+ else {
29
+ this.$chaptersNav.attr('aria-label',this.tt.chapters);
30
+ }
31
+ this.$chaptersDiv.append(this.$chaptersNav);
32
+
33
+ // populate this.$chaptersNav with a list of chapters
34
+ this.updateChaptersList();
35
+ }
36
+ };
37
+
38
+ AblePlayer.prototype.updateChaptersList = function() {
39
+
40
+ var thisObj, cues, $chaptersList, c, thisChapter,
41
+ $chapterItem, $chapterButton, buttonId, hasDefault,
42
+ getClickFunction, $clickedItem, $chaptersList, thisChapterIndex;
43
+
44
+ thisObj = this;
45
+
46
+ if (!this.$chaptersNav) {
47
+ return false;
48
+ }
49
+
50
+ if (typeof this.useChapterTimes === 'undefined') {
51
+ if (this.seekbarScope === 'chapter' && this.selectedChapters.cues.length) {
52
+ this.useChapterTimes = true;
53
+ }
54
+ else {
55
+ this.useChapterTimes = false;
56
+ }
57
+ }
58
+
59
+ if (this.useChapterTimes) {
60
+ cues = this.selectedChapters.cues;
61
+ }
62
+ else if (this.chapters.length >= 1) {
63
+ cues = this.chapters[0].cues;
64
+ }
65
+ else {
66
+ cues = [];
67
+ }
68
+ if (cues.length > 0) {
69
+ $chaptersList = $('<ul>');
70
+ for (c = 0; c < cues.length; c++) {
71
+ thisChapter = c;
72
+ $chapterItem = $('<li></li>');
73
+ $chapterButton = $('<button>',{
74
+ 'type': 'button',
75
+ 'val': thisChapter
76
+ }).text(this.flattenCueForCaption(cues[thisChapter]));
77
+
78
+ // add event listeners
79
+ getClickFunction = function (time) {
80
+ return function () {
81
+ thisObj.seekTrigger = 'chapter';
82
+ $clickedItem = $(this).closest('li');
83
+ $chaptersList = $(this).closest('ul').find('li');
84
+ thisChapterIndex = $chaptersList.index($clickedItem);
85
+ $chaptersList.removeClass('able-current-chapter').attr('aria-selected','');
86
+ $clickedItem.addClass('able-current-chapter').attr('aria-selected','true');
87
+ // Need to updateChapter before seeking to it
88
+ // Otherwise seekBar is redrawn with wrong chapterDuration and/or chapterTime
89
+ thisObj.updateChapter(time);
90
+ thisObj.seekTo(time);
91
+ }
92
+ };
93
+ $chapterButton.on('click',getClickFunction(cues[thisChapter].start)); // works with Enter too
94
+ $chapterButton.on('focus',function() {
95
+ $(this).closest('ul').find('li').removeClass('able-focus');
96
+ $(this).closest('li').addClass('able-focus');
97
+ });
98
+ $chapterItem.on('hover',function() {
99
+ $(this).closest('ul').find('li').removeClass('able-focus');
100
+ $(this).addClass('able-focus');
101
+ });
102
+ $chapterItem.on('mouseleave',function() {
103
+ $(this).removeClass('able-focus');
104
+ });
105
+ $chapterButton.on('blur',function() {
106
+ $(this).closest('li').removeClass('able-focus');
107
+ });
108
+
109
+ // put it all together
110
+ $chapterItem.append($chapterButton);
111
+ $chaptersList.append($chapterItem);
112
+ if (this.defaultChapter === cues[thisChapter].id) {
113
+ $chapterButton.attr('aria-selected','true').parent('li').addClass('able-current-chapter');
114
+ this.currentChapter = cues[thisChapter];
115
+ hasDefault = true;
116
+ }
117
+ }
118
+ if (!hasDefault) {
119
+ // select the first chapter
120
+ this.currentChapter = cues[0];
121
+ $chaptersList.find('button').first().attr('aria-selected','true')
122
+ .parent('li').addClass('able-current-chapter');
123
+ }
124
+ this.$chaptersNav.html($chaptersList);
125
+ }
126
+ return false;
127
+ };
128
+
129
+ AblePlayer.prototype.seekToChapter = function(chapterId) {
130
+
131
+ // step through chapters looking for matching ID
132
+ var i=0;
133
+ while (i < this.selectedChapters.cues.length) {
134
+ if (this.selectedChapters.cues[i].id == chapterId) {
135
+ // found the target chapter! Seek to it
136
+ this.seekTo(this.selectedChapters.cues[i].start);
137
+ this.updateChapter(this.selectedChapters.cues[i].start);
138
+ break;
139
+ }
140
+ i++;
141
+ }
142
+ };
143
+
144
+ AblePlayer.prototype.updateChapter = function (now) {
145
+
146
+ // as time-synced chapters change during playback, track changes in current chapter
147
+ if (typeof this.selectedChapters === 'undefined') {
148
+ return;
149
+ }
150
+
151
+ var chapters, i, thisChapterIndex, chapterLabel;
152
+
153
+ chapters = this.selectedChapters.cues;
154
+ for (i = 0; i < chapters.length; i++) {
155
+ if ((chapters[i].start <= now) && (chapters[i].end > now)) {
156
+ thisChapterIndex = i;
157
+ break;
158
+ }
159
+ }
160
+ if (typeof thisChapterIndex !== 'undefined') {
161
+ if (this.currentChapter !== chapters[thisChapterIndex]) {
162
+ // this is a new chapter
163
+ this.currentChapter = chapters[thisChapterIndex];
164
+ if (this.useChapterTimes) {
165
+ this.chapterDuration = this.getChapterDuration();
166
+ this.seekIntervalCalculated = false; // will be recalculated in setSeekInterval()
167
+ }
168
+ if (typeof this.$chaptersDiv !== 'undefined') {
169
+ // chapters are listed in an external container
170
+ this.$chaptersDiv.find('ul').find('li').removeClass('able-current-chapter').attr('aria-selected','');
171
+ this.$chaptersDiv.find('ul').find('li').eq(thisChapterIndex)
172
+ .addClass('able-current-chapter').attr('aria-selected','true');
173
+ }
174
+ }
175
+ }
176
+ };
177
+
178
+ AblePlayer.prototype.getChapterDuration = function () {
179
+
180
+ // called if this.seekbarScope === 'chapter'
181
+ // get duration of the current chapter
182
+
183
+ var lastChapterIndex, chapterEnd;
184
+
185
+ if (typeof this.currentChapter === 'undefined') {
186
+ return 0;
187
+ }
188
+ if (typeof this.duration === 'undefined') {
189
+ return 0;
190
+ }
191
+ lastChapterIndex = this.selectedChapters.cues.length-1;
192
+ if (this.selectedChapters.cues[lastChapterIndex] == this.currentChapter) {
193
+ // this is the last chapter
194
+ if (this.currentChapter.end !== this.duration) {
195
+ // chapter ends before or after video ends, adjust chapter end to match video end
196
+ chapterEnd = this.duration;
197
+ this.currentChapter.end = this.duration;
198
+ }
199
+ else {
200
+ chapterEnd = this.currentChapter.end;
201
+ }
202
+ }
203
+ else { // this is not the last chapter
204
+ chapterEnd = this.currentChapter.end;
205
+ }
206
+ return chapterEnd - this.currentChapter.start;
207
+ };
208
+
209
+ AblePlayer.prototype.getChapterElapsed = function () {
210
+ // called if this.seekbarScope === 'chapter'
211
+ // get current elapsed time, relative to the current chapter duration
212
+
213
+ if (typeof this.currentChapter === 'undefined') {
214
+ return 0;
215
+ }
216
+
217
+ if (this.elapsed > this.currentChapter.start) {
218
+ return this.elapsed - this.currentChapter.start;
219
+ }
220
+ else {
221
+ return 0;
222
+ }
223
+ };
224
+
225
+ AblePlayer.prototype.convertChapterTimeToVideoTime = function (chapterTime) {
226
+
227
+ // chapterTime is the time within the current chapter
228
+ // return the same time, relative to the entire video
229
+ if (typeof this.currentChapter !== 'undefined') {
230
+ var newTime = this.currentChapter.start + chapterTime;
231
+ if (newTime > this.currentChapter.end) {
232
+ return this.currentChapter.end;
233
+ }
234
+ else {
235
+ return newTime;
236
+ }
237
+ }
238
+ else {
239
+ return chapterTime;
240
+ }
241
+ };
242
+
243
+ AblePlayer.prototype.getChapterClickFunction = function (time) {
244
+
245
+ // Returns the function used when a chapter is clicked in the chapters menu.
246
+ var thisObj = this;
247
+ return function () {
248
+ thisObj.seekTrigger = 'chapter';
249
+ thisObj.seekTo(time);
250
+ // stopgap to prevent spacebar in Firefox from reopening popup
251
+ // immediately after closing it (used in handleChapters())
252
+ thisObj.hidingPopup = true;
253
+ thisObj.chaptersPopup.hide();
254
+ // Ensure stopgap gets cancelled if handleChapters() isn't called
255
+ // e.g., if user triggered button with Enter or mouse click, not spacebar
256
+ setTimeout(function() {
257
+ thisObj.hidingPopup = false;
258
+ }, 100);
259
+ thisObj.$chaptersButton.focus();
260
+ }
261
+ };
262
262
 
263
263
  })(jQuery);