Skip to content

Commit 384d3ba

Browse files
committed
Update build files to 4.6.0.
1 parent afb1714 commit 384d3ba

File tree

8 files changed

+121
-135
lines changed

8 files changed

+121
-135
lines changed

src/build/ableplayer.dist.js

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,22 +5081,21 @@ var AblePlayerInstances = [];
50815081
};
50825082

50835083
AblePlayer.prototype.getDefaultWidth = function(which) {
5084-
5084+
let viewportMaxwidth = window.innerWidth;
50855085
// return default width of resizable elements
50865086
// these values are somewhat arbitrary, but seem to result in good usability
50875087
// if users disagree, they can resize (and resposition) them
50885088
if (which === 'transcript') {
5089-
return 450;
5089+
return ( viewportMaxwidth <= 450 ) ? viewportMaxwidth : 450;
50905090
}
50915091
else if (which === 'sign') {
5092-
return 400;
5092+
return ( viewportMaxwidth <= 400 ) ? viewportMaxwidth : 400;
50935093
}
50945094
};
50955095

50965096
AblePlayer.prototype.positionDraggableWindow = function (which, width) {
50975097

50985098
// which is either 'transcript' or 'sign'
5099-
51005099
var cookie, cookiePos, $window, windowPos;
51015100

51025101
cookie = this.getCookie();
@@ -12926,10 +12925,14 @@ if (typeof module !== "undefined" && module.exports) {
1292612925
$autoScrollLabel = $("<label>", {
1292712926
for: "autoscroll-transcript-checkbox-" + this.mediaId,
1292812927
}).text(this.tt.autoScroll);
12929-
this.$transcriptToolbar.append(
12930-
$autoScrollLabel,
12931-
this.$autoScrollTranscriptCheckbox
12932-
);
12928+
$autoScrollContainer = $( '<div>', {
12929+
'class': 'autoscroll-transcript'
12930+
});
12931+
$autoScrollContainer.append(
12932+
$autoScrollLabel,
12933+
this.$autoScrollTranscriptCheckbox
12934+
);
12935+
this.$transcriptToolbar.append( $autoScrollContainer );
1293312936

1293412937
// Add field for selecting a transcript language
1293512938
// Only necessary if there is more than one language
@@ -14913,7 +14916,7 @@ if (typeof module !== "undefined" && module.exports) {
1491314916

1491414917
AblePlayer.prototype.addWindowMenu = function(which, $window, windowName) {
1491514918

14916-
var thisObj, $windowAlert, menuId, $newButton, $buttonIcon, buttonImgSrc, $buttonImg,
14919+
var thisObj, $windowAlert, menuId, $newButton, $buttonIcon, buttonImgSrc,
1491714920
$buttonLabel, tooltipId, $tooltip, $popup, menuId;
1491814921

1491914922
thisObj = this;
@@ -14955,15 +14958,16 @@ if (typeof module !== "undefined" && module.exports) {
1495514958
});
1495614959
$newButton.append($buttonIcon);
1495714960
}
14961+
// Inexplicably, SVG images aren't working in the dragdrop UI.
1495814962
else {
1495914963
// use image
1496014964
buttonImgSrc = this.rootPath + 'button-icons/' + this.toolbarIconColor + '/preferences.png';
14961-
$buttonImg = $('<img>',{
14965+
$buttonIcon = $('<img>',{
1496214966
'src': buttonImgSrc,
1496314967
'alt': '',
1496414968
'role': 'presentation'
1496514969
});
14966-
$newButton.append($buttonImg);
14970+
$newButton.append($buttonIcon);
1496714971
}
1496814972

1496914973
// add the visibly-hidden label for screen readers that don't support aria-label on the button
@@ -14980,18 +14984,17 @@ if (typeof module !== "undefined" && module.exports) {
1498014984
}).hide();
1498114985
$newButton.on('mouseenter focus',function(e) {
1498214986
var label = $(this).attr('aria-label');
14983-
// get position of this button
14984-
var position = $(this).position();
14985-
var buttonHeight = $(this).height();
14986-
var buttonWidth = $(this).width();
14987-
var tooltipY = position.top - buttonHeight - 5;
14987+
var tooltip = AblePlayer.localGetElementById($newButton[0], tooltipId).text(label);
14988+
// get height of the tooltip
14989+
var tooltipHeight = tooltip.height();
14990+
var tooltipY = ( tooltipHeight + 2 ) * -1;
1498814991
var tooltipX = 0;
1498914992
var tooltipStyle = {
14990-
left: '',
14991-
right: tooltipX + 'px',
14993+
right: '',
14994+
left: tooltipX + 'px',
1499214995
top: tooltipY + 'px'
1499314996
};
14994-
var tooltip = AblePlayer.localGetElementById($newButton[0], tooltipId).text(label).css(tooltipStyle);
14997+
tooltip.css(tooltipStyle);
1499514998
thisObj.showTooltip(tooltip);
1499614999
$(this).on('mouseleave blur',function() {
1499715000
AblePlayer.localGetElementById($newButton[0], tooltipId).text('').hide();
@@ -15211,7 +15214,7 @@ if (typeof module !== "undefined" && module.exports) {
1521115214
else {
1521215215
// first, be sure window is on top
1521315216
this.updateZIndex(which);
15214-
popupTop = $windowButton.position().top + $windowButton.outerHeight();
15217+
popupTop = $toolbar.outerHeight() - 1;
1521515218
$windowPopup.css('top', popupTop);
1521615219
$windowPopup.show(200,'',function() {
1521715220
$windowButton.attr('aria-expanded','true');
@@ -15296,7 +15299,7 @@ if (typeof module !== "undefined" && module.exports) {
1529615299
this.dragDevice = 'mouse';
1529715300
}
1529815301
this.startDrag(which, $window);
15299-
$windowPopup.hide().parent().trigger('focus');
15302+
$windowPopup.hide().parent().attr( 'tabindex', '-1' ).trigger('focus');
1530015303
}
1530115304
else if (choice == 'resize') {
1530215305
// resize through the menu uses a form, not drag
@@ -15339,16 +15342,6 @@ if (typeof module !== "undefined" && module.exports) {
1533915342
$windowPopup = this.$signPopup;
1534015343
}
1534115344

15342-
if (!this.showedAlert(which)) {
15343-
this.showAlert(this.tt.windowMoveAlert,which);
15344-
if (which === 'transcript') {
15345-
this.showedTranscriptAlert = true;
15346-
}
15347-
else if (which === 'sign') {
15348-
this.showedSignAlert = true;
15349-
}
15350-
}
15351-
1535215345
// if window's popup menu is open, close it
1535315346
if ($windowPopup.is(':visible')) {
1535415347
$windowPopup.hide();

src/build/ableplayer.js

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,22 +5081,21 @@ var AblePlayerInstances = [];
50815081
};
50825082

50835083
AblePlayer.prototype.getDefaultWidth = function(which) {
5084-
5084+
let viewportMaxwidth = window.innerWidth;
50855085
// return default width of resizable elements
50865086
// these values are somewhat arbitrary, but seem to result in good usability
50875087
// if users disagree, they can resize (and resposition) them
50885088
if (which === 'transcript') {
5089-
return 450;
5089+
return ( viewportMaxwidth <= 450 ) ? viewportMaxwidth : 450;
50905090
}
50915091
else if (which === 'sign') {
5092-
return 400;
5092+
return ( viewportMaxwidth <= 400 ) ? viewportMaxwidth : 400;
50935093
}
50945094
};
50955095

50965096
AblePlayer.prototype.positionDraggableWindow = function (which, width) {
50975097

50985098
// which is either 'transcript' or 'sign'
5099-
51005099
var cookie, cookiePos, $window, windowPos;
51015100

51025101
cookie = this.getCookie();
@@ -12940,10 +12939,14 @@ if (typeof module !== "undefined" && module.exports) {
1294012939
$autoScrollLabel = $("<label>", {
1294112940
for: "autoscroll-transcript-checkbox-" + this.mediaId,
1294212941
}).text(this.tt.autoScroll);
12943-
this.$transcriptToolbar.append(
12944-
$autoScrollLabel,
12945-
this.$autoScrollTranscriptCheckbox
12946-
);
12942+
$autoScrollContainer = $( '<div>', {
12943+
'class': 'autoscroll-transcript'
12944+
});
12945+
$autoScrollContainer.append(
12946+
$autoScrollLabel,
12947+
this.$autoScrollTranscriptCheckbox
12948+
);
12949+
this.$transcriptToolbar.append( $autoScrollContainer );
1294712950

1294812951
// Add field for selecting a transcript language
1294912952
// Only necessary if there is more than one language
@@ -14927,7 +14930,7 @@ if (typeof module !== "undefined" && module.exports) {
1492714930

1492814931
AblePlayer.prototype.addWindowMenu = function(which, $window, windowName) {
1492914932

14930-
var thisObj, $windowAlert, menuId, $newButton, $buttonIcon, buttonImgSrc, $buttonImg,
14933+
var thisObj, $windowAlert, menuId, $newButton, $buttonIcon, buttonImgSrc,
1493114934
$buttonLabel, tooltipId, $tooltip, $popup, menuId;
1493214935

1493314936
thisObj = this;
@@ -14969,15 +14972,16 @@ if (typeof module !== "undefined" && module.exports) {
1496914972
});
1497014973
$newButton.append($buttonIcon);
1497114974
}
14975+
// Inexplicably, SVG images aren't working in the dragdrop UI.
1497214976
else {
1497314977
// use image
1497414978
buttonImgSrc = this.rootPath + 'button-icons/' + this.toolbarIconColor + '/preferences.png';
14975-
$buttonImg = $('<img>',{
14979+
$buttonIcon = $('<img>',{
1497614980
'src': buttonImgSrc,
1497714981
'alt': '',
1497814982
'role': 'presentation'
1497914983
});
14980-
$newButton.append($buttonImg);
14984+
$newButton.append($buttonIcon);
1498114985
}
1498214986

1498314987
// add the visibly-hidden label for screen readers that don't support aria-label on the button
@@ -14994,18 +14998,17 @@ if (typeof module !== "undefined" && module.exports) {
1499414998
}).hide();
1499514999
$newButton.on('mouseenter focus',function(e) {
1499615000
var label = $(this).attr('aria-label');
14997-
// get position of this button
14998-
var position = $(this).position();
14999-
var buttonHeight = $(this).height();
15000-
var buttonWidth = $(this).width();
15001-
var tooltipY = position.top - buttonHeight - 5;
15001+
var tooltip = AblePlayer.localGetElementById($newButton[0], tooltipId).text(label);
15002+
// get height of the tooltip
15003+
var tooltipHeight = tooltip.height();
15004+
var tooltipY = ( tooltipHeight + 2 ) * -1;
1500215005
var tooltipX = 0;
1500315006
var tooltipStyle = {
15004-
left: '',
15005-
right: tooltipX + 'px',
15007+
right: '',
15008+
left: tooltipX + 'px',
1500615009
top: tooltipY + 'px'
1500715010
};
15008-
var tooltip = AblePlayer.localGetElementById($newButton[0], tooltipId).text(label).css(tooltipStyle);
15011+
tooltip.css(tooltipStyle);
1500915012
thisObj.showTooltip(tooltip);
1501015013
$(this).on('mouseleave blur',function() {
1501115014
AblePlayer.localGetElementById($newButton[0], tooltipId).text('').hide();
@@ -15225,7 +15228,7 @@ if (typeof module !== "undefined" && module.exports) {
1522515228
else {
1522615229
// first, be sure window is on top
1522715230
this.updateZIndex(which);
15228-
popupTop = $windowButton.position().top + $windowButton.outerHeight();
15231+
popupTop = $toolbar.outerHeight() - 1;
1522915232
$windowPopup.css('top', popupTop);
1523015233
$windowPopup.show(200,'',function() {
1523115234
$windowButton.attr('aria-expanded','true');
@@ -15310,7 +15313,7 @@ if (typeof module !== "undefined" && module.exports) {
1531015313
this.dragDevice = 'mouse';
1531115314
}
1531215315
this.startDrag(which, $window);
15313-
$windowPopup.hide().parent().trigger('focus');
15316+
$windowPopup.hide().parent().attr( 'tabindex', '-1' ).trigger('focus');
1531415317
}
1531515318
else if (choice == 'resize') {
1531615319
// resize through the menu uses a form, not drag
@@ -15353,16 +15356,6 @@ if (typeof module !== "undefined" && module.exports) {
1535315356
$windowPopup = this.$signPopup;
1535415357
}
1535515358

15356-
if (!this.showedAlert(which)) {
15357-
this.showAlert(this.tt.windowMoveAlert,which);
15358-
if (which === 'transcript') {
15359-
this.showedTranscriptAlert = true;
15360-
}
15361-
else if (which === 'sign') {
15362-
this.showedSignAlert = true;
15363-
}
15364-
}
15365-
1536615359
// if window's popup menu is open, close it
1536715360
if ($windowPopup.is(':visible')) {
1536815361
$windowPopup.hide();

src/build/ableplayer.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build/ableplayer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)