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,174 +1,174 @@
1
1
  (function ($) {
2
- AblePlayer.prototype.showSearchResults = function() {
3
-
4
- // search VTT file for all instances of searchTerms
5
- // Currently just supports search terms separated with one or more spaces
6
-
7
- // TODO: Add support for more robust search syntax:
8
- // Search terms wrapped in quotation marks ("") must occur exactly as they appear in the quotes
9
- // Search terms with an attached minus sign (e.g., -term) are to be excluded from results
10
- // Boolean AND/OR operators
11
- // ALSO: Add localization support
12
-
13
- var thisObj = this;
14
-
15
- if (this.searchDiv && this.searchString) {
16
- if ($('#' + this.SearchDiv)) {
17
- var resultsArray = this.searchFor(this.searchString);
18
- if (resultsArray.length > 0) {
19
- var resultsSummary = $('<p>',{
20
- 'class': 'able-search-results-summary'
21
- });
22
- var resultsSummaryText = 'Found <strong>' + resultsArray.length + '</strong> matching items. ';
23
- resultsSummaryText += 'Click the time associated with any item ';
24
- resultsSummaryText += 'to play the video from that point.';
25
- resultsSummary.html(resultsSummaryText);
26
- var resultsList = $('<ul>');
27
- for (var i = 0; i < resultsArray.length; i++) {
28
- var resultsItem = $('<li>',{
29
- });
30
- var itemStartTime = this.secondsToTime(resultsArray[i]['start']);
31
- var itemStartSpan = $('<span>',{
32
- 'class': 'able-search-results-time',
33
- 'data-start': resultsArray[i]['start'],
34
- 'title': itemStartTime['title'],
35
- 'tabindex': '0'
36
- });
37
- itemStartSpan.text(itemStartTime['value']);
38
- // add a listener for clisk on itemStart
39
- itemStartSpan.click(function(e) {
40
- var spanStart = parseFloat($(this).attr('data-start'));
41
- // Add a tiny amount so that we're inside the span.
42
- spanStart += .01;
43
- thisObj.seeking = true;
44
- thisObj.seekTo(spanStart);
45
- });
46
-
47
- var itemText = $('<span>',{
48
- 'class': 'able-search-result-text'
49
- })
50
- itemText.html('...' + resultsArray[i]['caption'] + '...');
51
- resultsItem.append(itemStartSpan, itemText);
52
- resultsList.append(resultsItem);
53
- }
54
- $('#' + this.searchDiv).append(resultsSummary, resultsList);
55
- }
56
- else {
57
- var noResults = $('<p>').text('No results found.');
58
- $('#' + this.searchDiv).append(noResults);
59
- }
60
- }
61
- }
62
- };
63
-
64
- AblePlayer.prototype.searchFor = function(searchString) {
65
-
66
- // return chronological array of caption cues that match searchTerms
67
- var captionLang, captions, results, caption, c, i, j;
68
- results = [];
69
- // split searchTerms into an array
70
- var searchTerms = searchString.split(' ');
71
- if (this.captions.length > 0) {
72
- // Get caption track that matches this.searchLang
73
- for (i=0; i < this.captions.length; i++) {
74
- if (this.captions[i].language === this.searchLang) {
75
- captionLang = this.searchLang;
76
- captions = this.captions[i].cues;
77
- }
78
- }
79
- if (captions.length > 0) {
80
- c = 0;
81
- for (i = 0; i < captions.length; i++) {
82
- if ($.inArray(captions[i].components.children[0]['type'], ['string','i','b','u','v','c']) !== -1) {
83
- caption = this.flattenCueForCaption(captions[i]);
84
- for (j = 0; j < searchTerms.length; j++) {
85
- if (caption.indexOf(searchTerms[j]) !== -1) {
86
- results[c] = [];
87
- results[c]['start'] = captions[i].start;
88
- results[c]['lang'] = captionLang;
89
- results[c]['caption'] = this.highlightSearchTerm(searchTerms,j,caption);
90
- c++;
91
- break;
92
- }
93
- }
94
- }
95
- }
96
- }
97
- }
98
- return results;
99
- };
100
-
101
- AblePlayer.prototype.highlightSearchTerm = function(searchTerms, index, resultString) {
102
-
103
- // highlight ALL found searchTerms in the current resultString
104
- // index is the first index in the searchTerm array where a match has already been found
105
- // Need to step through the remaining terms to see if they're present as well
106
-
107
- var i, searchTerm, termIndex, termLength, str1, str2, str3;
108
-
109
- for (i=index; i<searchTerms.length; i++) {
110
-
111
- searchTerm = searchTerms[i];
112
- termIndex = resultString.indexOf(searchTerm);
113
- if (termIndex !== -1) {
114
- termLength = searchTerm.length;
115
- if (termLength > 0) {
116
- str1 = resultString.substring(0, termIndex);
117
- str2 = '<span class="able-search-term">' + searchTerm + '</span>';
118
- str3 = resultString.substring(termIndex+termLength);
119
- resultString = str1 + str2 + str3;
120
- }
121
- else {
122
- str1 = '<span class="able-search-term">' + searchTerm + '</span>';
123
- str2 = resultString.substring(termIndex+termLength);
124
- resultString = str1 + str2;
125
- }
126
- }
127
- }
128
- return resultString;
129
- };
130
-
131
- AblePlayer.prototype.secondsToTime = function(totalSeconds) {
132
-
133
- // return an array of totalSeconds converted into two formats
134
- // time['value'] = HH:MM:SS with hours dropped if there are none
135
- // time['title'] = a speakable rendering, so speech rec users can easily speak the link
136
-
137
- // first, round down to nearest second
138
- var totalSeconds = Math.floor(totalSeconds);
139
-
140
- var hours = parseInt( totalSeconds / 3600 , 10) % 24;
141
- var minutes = parseInt( totalSeconds / 60 , 10) % 60;
142
- var seconds = totalSeconds % 60;
143
- var value = '';
144
- var title = '';
145
- if (hours > 0) {
146
- value += hours + ':';
147
- title + hours + ' hours ';
148
- }
149
- if (minutes < 10) {
150
- value += '0' + minutes + ':';
151
- if (minutes > 0) {
152
- title += minutes + ' minutes ';
153
- }
154
- }
155
- else {
156
- value += minutes + ':';
157
- title += minutes + ' minutes ';
158
- }
159
- if (seconds < 10) {
160
- value += '0' + seconds;
161
- if (seconds > 0) {
162
- title += seconds + ' seconds ';
163
- }
164
- }
165
- else {
166
- value += seconds;
167
- title += seconds + ' seconds ';
168
- }
169
- var time = [];
170
- time['value'] = value;
171
- time['title'] = title;
172
- return time;
173
- };
2
+ AblePlayer.prototype.showSearchResults = function() {
3
+
4
+ // search VTT file for all instances of searchTerms
5
+ // Currently just supports search terms separated with one or more spaces
6
+
7
+ // TODO: Add support for more robust search syntax:
8
+ // Search terms wrapped in quotation marks ("") must occur exactly as they appear in the quotes
9
+ // Search terms with an attached minus sign (e.g., -term) are to be excluded from results
10
+ // Boolean AND/OR operators
11
+ // ALSO: Add localization support
12
+
13
+ var thisObj = this;
14
+
15
+ if (this.searchDiv && this.searchString) {
16
+ if ($('#' + this.SearchDiv)) {
17
+ var resultsArray = this.searchFor(this.searchString);
18
+ if (resultsArray.length > 0) {
19
+ var resultsSummary = $('<p>',{
20
+ 'class': 'able-search-results-summary'
21
+ });
22
+ var resultsSummaryText = 'Found <strong>' + resultsArray.length + '</strong> matching items. ';
23
+ resultsSummaryText += 'Click the time associated with any item ';
24
+ resultsSummaryText += 'to play the video from that point.';
25
+ resultsSummary.html(resultsSummaryText);
26
+ var resultsList = $('<ul>');
27
+ for (var i = 0; i < resultsArray.length; i++) {
28
+ var resultsItem = $('<li>',{
29
+ });
30
+ var itemStartTime = this.secondsToTime(resultsArray[i]['start']);
31
+ var itemStartSpan = $('<span>',{
32
+ 'class': 'able-search-results-time',
33
+ 'data-start': resultsArray[i]['start'],
34
+ 'title': itemStartTime['title'],
35
+ 'tabindex': '0'
36
+ });
37
+ itemStartSpan.text(itemStartTime['value']);
38
+ // add a listener for clisk on itemStart
39
+ itemStartSpan.click(function(e) {
40
+ var spanStart = parseFloat($(this).attr('data-start'));
41
+ // Add a tiny amount so that we're inside the span.
42
+ spanStart += .01;
43
+ thisObj.seeking = true;
44
+ thisObj.seekTo(spanStart);
45
+ });
46
+
47
+ var itemText = $('<span>',{
48
+ 'class': 'able-search-result-text'
49
+ })
50
+ itemText.html('...' + resultsArray[i]['caption'] + '...');
51
+ resultsItem.append(itemStartSpan, itemText);
52
+ resultsList.append(resultsItem);
53
+ }
54
+ $('#' + this.searchDiv).append(resultsSummary, resultsList);
55
+ }
56
+ else {
57
+ var noResults = $('<p>').text('No results found.');
58
+ $('#' + this.searchDiv).append(noResults);
59
+ }
60
+ }
61
+ }
62
+ };
63
+
64
+ AblePlayer.prototype.searchFor = function(searchString) {
65
+
66
+ // return chronological array of caption cues that match searchTerms
67
+ var captionLang, captions, results, caption, c, i, j;
68
+ results = [];
69
+ // split searchTerms into an array
70
+ var searchTerms = searchString.split(' ');
71
+ if (this.captions.length > 0) {
72
+ // Get caption track that matches this.searchLang
73
+ for (i=0; i < this.captions.length; i++) {
74
+ if (this.captions[i].language === this.searchLang) {
75
+ captionLang = this.searchLang;
76
+ captions = this.captions[i].cues;
77
+ }
78
+ }
79
+ if (captions.length > 0) {
80
+ c = 0;
81
+ for (i = 0; i < captions.length; i++) {
82
+ if ($.inArray(captions[i].components.children[0]['type'], ['string','i','b','u','v','c']) !== -1) {
83
+ caption = this.flattenCueForCaption(captions[i]);
84
+ for (j = 0; j < searchTerms.length; j++) {
85
+ if (caption.indexOf(searchTerms[j]) !== -1) {
86
+ results[c] = [];
87
+ results[c]['start'] = captions[i].start;
88
+ results[c]['lang'] = captionLang;
89
+ results[c]['caption'] = this.highlightSearchTerm(searchTerms,j,caption);
90
+ c++;
91
+ break;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ return results;
99
+ };
100
+
101
+ AblePlayer.prototype.highlightSearchTerm = function(searchTerms, index, resultString) {
102
+
103
+ // highlight ALL found searchTerms in the current resultString
104
+ // index is the first index in the searchTerm array where a match has already been found
105
+ // Need to step through the remaining terms to see if they're present as well
106
+
107
+ var i, searchTerm, termIndex, termLength, str1, str2, str3;
108
+
109
+ for (i=index; i<searchTerms.length; i++) {
110
+
111
+ searchTerm = searchTerms[i];
112
+ termIndex = resultString.indexOf(searchTerm);
113
+ if (termIndex !== -1) {
114
+ termLength = searchTerm.length;
115
+ if (termLength > 0) {
116
+ str1 = resultString.substring(0, termIndex);
117
+ str2 = '<span class="able-search-term">' + searchTerm + '</span>';
118
+ str3 = resultString.substring(termIndex+termLength);
119
+ resultString = str1 + str2 + str3;
120
+ }
121
+ else {
122
+ str1 = '<span class="able-search-term">' + searchTerm + '</span>';
123
+ str2 = resultString.substring(termIndex+termLength);
124
+ resultString = str1 + str2;
125
+ }
126
+ }
127
+ }
128
+ return resultString;
129
+ };
130
+
131
+ AblePlayer.prototype.secondsToTime = function(totalSeconds) {
132
+
133
+ // return an array of totalSeconds converted into two formats
134
+ // time['value'] = HH:MM:SS with hours dropped if there are none
135
+ // time['title'] = a speakable rendering, so speech rec users can easily speak the link
136
+
137
+ // first, round down to nearest second
138
+ var totalSeconds = Math.floor(totalSeconds);
139
+
140
+ var hours = parseInt( totalSeconds / 3600 , 10) % 24;
141
+ var minutes = parseInt( totalSeconds / 60 , 10) % 60;
142
+ var seconds = totalSeconds % 60;
143
+ var value = '';
144
+ var title = '';
145
+ if (hours > 0) {
146
+ value += hours + ':';
147
+ title + hours + ' hours ';
148
+ }
149
+ if (minutes < 10) {
150
+ value += '0' + minutes + ':';
151
+ if (minutes > 0) {
152
+ title += minutes + ' minutes ';
153
+ }
154
+ }
155
+ else {
156
+ value += minutes + ':';
157
+ title += minutes + ' minutes ';
158
+ }
159
+ if (seconds < 10) {
160
+ value += '0' + seconds;
161
+ if (seconds > 0) {
162
+ title += seconds + ' seconds ';
163
+ }
164
+ }
165
+ else {
166
+ value += seconds;
167
+ title += seconds + ' seconds ';
168
+ }
169
+ var time = [];
170
+ time['value'] = value;
171
+ time['title'] = title;
172
+ return time;
173
+ };
174
174
  })(jQuery);
@@ -1,92 +1,96 @@
1
1
  (function ($) {
2
- AblePlayer.prototype.initSignLanguage = function() {
3
- // Sign language is only currently supported in HTML5 player, not fallback or YouTube
4
- if (this.player === 'html5') {
5
- // check to see if there's a sign language video accompanying this video
6
- // check only the first source
7
- // If sign language is provided, it must be provided for all sources
8
- this.signFile = this.$sources.first().attr('data-sign-src');
9
- if (this.signFile) {
10
- if (this.debug) {
11
- console.log('This video has an accompanying sign language video: ' + this.signFile);
12
- }
13
- this.hasSignLanguage = true;
14
- this.injectSignPlayerCode();
15
- }
16
- else {
17
- this.hasSignLanguage = false;
18
- }
19
- }
20
- };
2
+ AblePlayer.prototype.initSignLanguage = function() {
21
3
 
22
- AblePlayer.prototype.injectSignPlayerCode = function() {
4
+ // Sign language is only currently supported in HTML5 player, not YouTube or Vimeo
5
+ if (this.player === 'html5') {
6
+ // check to see if there's a sign language video accompanying this video
7
+ // check only the first source
8
+ // If sign language is provided, it must be provided for all sources
9
+ this.signFile = this.$sources.first().attr('data-sign-src');
10
+ if (this.signFile) {
11
+ if (this.debug) {
12
+ console.log('This video has an accompanying sign language video: ' + this.signFile);
13
+ }
14
+ this.hasSignLanguage = true;
15
+ this.injectSignPlayerCode();
16
+ }
17
+ else {
18
+ this.hasSignLanguage = false;
19
+ }
20
+ }
21
+ else {
22
+ this.hasSignLanguage = false;
23
+ }
24
+ };
23
25
 
24
- // create and inject surrounding HTML structure
25
- // If IOS:
26
- // If video:
27
- // IOS does not support any of the player's functionality
28
- // - everything plays in its own player
29
- // Therefore, AblePlayer is not loaded & all functionality is disabled
30
- // (this all determined. If this is IOS && video, this function is never called)
31
- // If audio:
32
- // HTML cannot be injected as a *parent* of the <audio> element
33
- // It is therefore injected *after* the <audio> element
34
- // This is only a problem in IOS 6 and earlier,
35
- // & is a known bug, fixed in IOS 7
26
+ AblePlayer.prototype.injectSignPlayerCode = function() {
36
27
 
37
- var thisObj, signVideoId, signVideoWidth, i, signSrc, srcType, $signSource;
28
+ // create and inject surrounding HTML structure
29
+ // If IOS:
30
+ // If video:
31
+ // IOS does not support any of the player's functionality
32
+ // - everything plays in its own player
33
+ // Therefore, AblePlayer is not loaded & all functionality is disabled
34
+ // (this all determined. If this is IOS && video, this function is never called)
35
+ // If audio:
36
+ // HTML cannot be injected as a *parent* of the <audio> element
37
+ // It is therefore injected *after* the <audio> element
38
+ // This is only a problem in IOS 6 and earlier,
39
+ // & is a known bug, fixed in IOS 7
38
40
 
39
- thisObj = this;
41
+ var thisObj, signVideoId, signVideoWidth, i, signSrc, srcType, $signSource;
40
42
 
41
- signVideoWidth = this.getDefaultWidth('sign');
43
+ thisObj = this;
42
44
 
43
- signVideoId = this.mediaId + '-sign';
44
- this.$signVideo = $('<video>',{
45
- 'id' : signVideoId,
46
- 'tabindex' : '-1'
47
- });
48
- this.signVideo = this.$signVideo[0];
49
- // for each original <source>, add a <source> to the sign <video>
50
- for (i=0; i < this.$sources.length; i++) {
51
- signSrc = this.$sources[i].getAttribute('data-sign-src');
52
- srcType = this.$sources[i].getAttribute('type');
53
- if (signSrc) {
54
- $signSource = $('<source>',{
55
- 'src' : signSrc,
56
- 'type' : srcType
57
- });
58
- this.$signVideo.append($signSource);
59
- }
60
- else {
61
- // source is missing a sign language version
62
- // can't include sign language
63
- this.hasSignLanguage = false;
64
- break;
65
- }
66
- }
45
+ signVideoWidth = this.getDefaultWidth('sign');
67
46
 
68
- this.$signWindow = $('<div>',{
69
- 'class' : 'able-sign-window',
70
- 'tabindex': '-1'
71
- });
72
- this.$signToolbar = $('<div>',{
73
- 'class': 'able-window-toolbar able-' + this.toolbarIconColor + '-controls'
74
- });
47
+ signVideoId = this.mediaId + '-sign';
48
+ this.$signVideo = $('<video>',{
49
+ 'id' : signVideoId,
50
+ 'tabindex' : '-1'
51
+ });
52
+ this.signVideo = this.$signVideo[0];
53
+ // for each original <source>, add a <source> to the sign <video>
54
+ for (i=0; i < this.$sources.length; i++) {
55
+ signSrc = this.$sources[i].getAttribute('data-sign-src');
56
+ srcType = this.$sources[i].getAttribute('type');
57
+ if (signSrc) {
58
+ $signSource = $('<source>',{
59
+ 'src' : signSrc,
60
+ 'type' : srcType
61
+ });
62
+ this.$signVideo.append($signSource);
63
+ }
64
+ else {
65
+ // source is missing a sign language version
66
+ // can't include sign language
67
+ this.hasSignLanguage = false;
68
+ break;
69
+ }
70
+ }
75
71
 
76
- this.$signWindow.append(this.$signToolbar, this.$signVideo);
72
+ this.$signWindow = $('<div>',{
73
+ 'class' : 'able-sign-window',
74
+ 'tabindex': '-1'
75
+ });
76
+ this.$signToolbar = $('<div>',{
77
+ 'class': 'able-window-toolbar able-' + this.toolbarIconColor + '-controls'
78
+ });
77
79
 
78
- this.$ableWrapper.append(this.$signWindow);
80
+ this.$signWindow.append(this.$signToolbar, this.$signVideo);
79
81
 
80
- // make it draggable
81
- this.initDragDrop('sign');
82
+ this.$ableWrapper.append(this.$signWindow);
82
83
 
83
- if (this.prefSign === 1) {
84
- // sign window is on. Go ahead and position it and show it
85
- this.positionDraggableWindow('sign',this.getDefaultWidth('sign'));
86
- }
87
- else {
88
- this.$signWindow.hide();
89
- }
90
- };
84
+ // make it draggable
85
+ this.initDragDrop('sign');
86
+
87
+ if (this.prefSign === 1) {
88
+ // sign window is on. Go ahead and position it and show it
89
+ this.positionDraggableWindow('sign',this.getDefaultWidth('sign'));
90
+ }
91
+ else {
92
+ this.$signWindow.hide();
93
+ }
94
+ };
91
95
 
92
96
  })(jQuery);