wai-website-theme 1.3.1 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/different.html +2 -1
- data/_includes/external.html +2 -1
- data/_includes/header.html +2 -1
- data/_includes/menuitem.html +6 -2
- data/_includes/peoplelist.html +21 -0
- data/_includes/prevnext-navigation.html +56 -0
- data/_includes/{prevnext.html → prevnext-order.html} +9 -0
- data/_includes/translation-note-msg.html +5 -3
- data/_includes/video-player.html +2 -2
- data/_layouts/default.html +8 -1
- data/_layouts/news.html +7 -1
- data/_layouts/policy.html +7 -1
- data/_layouts/sidenav.html +8 -1
- data/_layouts/sidenavsidebar.html +8 -1
- data/assets/ableplayer/Gruntfile.js +2 -1
- data/assets/ableplayer/README.md +158 -85
- data/assets/ableplayer/build/ableplayer.dist.js +15445 -13823
- data/assets/ableplayer/build/ableplayer.js +15445 -13823
- data/assets/ableplayer/build/ableplayer.min.css +1 -2
- data/assets/ableplayer/build/ableplayer.min.js +3 -10
- data/assets/ableplayer/package-lock.json +944 -346
- data/assets/ableplayer/package.json +8 -8
- data/assets/ableplayer/scripts/ableplayer-base.js +515 -524
- data/assets/ableplayer/scripts/browser.js +158 -158
- data/assets/ableplayer/scripts/buildplayer.js +1750 -1682
- data/assets/ableplayer/scripts/caption.js +424 -401
- data/assets/ableplayer/scripts/chapters.js +259 -259
- data/assets/ableplayer/scripts/control.js +1831 -1594
- data/assets/ableplayer/scripts/description.js +333 -256
- data/assets/ableplayer/scripts/dialog.js +145 -145
- data/assets/ableplayer/scripts/dragdrop.js +746 -749
- data/assets/ableplayer/scripts/event.js +875 -696
- data/assets/ableplayer/scripts/initialize.js +819 -912
- data/assets/ableplayer/scripts/langs.js +979 -743
- data/assets/ableplayer/scripts/metadata.js +124 -124
- data/assets/ableplayer/scripts/misc.js +170 -137
- data/assets/ableplayer/scripts/preference.js +904 -904
- data/assets/ableplayer/scripts/search.js +172 -172
- data/assets/ableplayer/scripts/sign.js +82 -78
- data/assets/ableplayer/scripts/slider.js +449 -448
- data/assets/ableplayer/scripts/track.js +409 -309
- data/assets/ableplayer/scripts/transcript.js +684 -595
- data/assets/ableplayer/scripts/translation.js +63 -67
- data/assets/ableplayer/scripts/ttml2webvtt.js +85 -85
- data/assets/ableplayer/scripts/vimeo.js +448 -0
- data/assets/ableplayer/scripts/volume.js +395 -380
- data/assets/ableplayer/scripts/vts.js +1077 -1077
- data/assets/ableplayer/scripts/webvtt.js +766 -763
- data/assets/ableplayer/scripts/youtube.js +695 -478
- data/assets/ableplayer/styles/ableplayer.css +54 -46
- data/assets/ableplayer/translations/nl.js +54 -54
- data/assets/ableplayer/translations/pt-br.js +311 -0
- data/assets/ableplayer/translations/tr.js +311 -0
- data/assets/ableplayer/translations/zh-tw.js +1 -1
- data/assets/css/style.css +1 -1
- data/assets/css/style.css.map +1 -1
- data/assets/images/icons.svg +5 -5
- data/assets/scripts/main.js +7 -0
- data/assets/search/tipuesearch.js +3 -3
- metadata +8 -3
@@ -1,174 +1,174 @@
|
|
1
1
|
(function ($) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
41
|
+
var thisObj, signVideoId, signVideoWidth, i, signSrc, srcType, $signSource;
|
40
42
|
|
41
|
-
|
43
|
+
thisObj = this;
|
42
44
|
|
43
|
-
|
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
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
-
|
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
|
-
|
80
|
+
this.$signWindow.append(this.$signToolbar, this.$signVideo);
|
79
81
|
|
80
|
-
|
81
|
-
this.initDragDrop('sign');
|
82
|
+
this.$ableWrapper.append(this.$signWindow);
|
82
83
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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);
|