Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c103f75
Change default skin to "2020"
terrill Nov 11, 2022
f576704
Remove data-skin="2020" attribs from all demos
terrill Nov 11, 2022
9dc0013
[CLEANUP] TABs & colors
xerc Nov 20, 2022
5e1adce
[REMOVE] IE rules
xerc Nov 20, 2022
02c8428
[CLS] 9dc0013
xerc Nov 20, 2022
ff01b78
[CLEANUP] indentation @ `vimeo.js`
xerc Nov 20, 2022
a9af6f6
[CLEANUP] scripts/
xerc Nov 20, 2022
ac5f507
[FIX] VIMEO usage
xerc Nov 26, 2022
ad9f60a
[ADD] noreferrer @ credits-links
xerc Nov 26, 2022
53c91b7
[CLEANUP] more indentation
xerc Nov 26, 2022
d442e83
[CLEANUP] even more ident/tabs
xerc Nov 26, 2022
4346cf5
Added https: to dependencies
candideu Dec 7, 2022
fab3bd5
Too -> to
candideu Dec 7, 2022
7e9cad3
Merge pull request #1 from candideu/main
candideu Dec 7, 2022
4e3ab2e
Merge pull request #561 from candideu/develop
terrill Dec 8, 2022
45c8815
Merge branch 'patch-1' of https://github.com/xerc/ableplayer into xer…
terrill Dec 8, 2022
1df2a2f
Merge branch 'xerc-patch-1' into develop
terrill Dec 8, 2022
d657a71
Merge pull request #557 from xerc/patch-2
terrill Dec 8, 2022
28a99d7
Merge pull request #558 from xerc/patch-3
terrill Dec 8, 2022
c6b95db
Increment version
terrill Dec 8, 2022
abb33b7
Handle failure of Safari on Mac OS to getVoices for speechSynthesis
terrill Dec 11, 2022
f3f095e
Added a screenshot of the player
candideu Mar 24, 2023
60b0c0a
Improve speech initialization for Linux browsers
jbylsma Apr 11, 2023
10385d3
Merge branch 'jbylsma-improve-speech-support' into develop
terrill May 24, 2023
c11e0d8
Merge pull request #573 from candideu/patch-1
terrill May 24, 2023
480456f
Add YouTube (no captions) demo
terrill Jun 13, 2023
85c1fc4
Merge branch 'develop' of github.com:ableplayer/ableplayer into develop
terrill Jun 13, 2023
d7286b1
revert typo from early 2021
conorom Jul 24, 2023
6c41745
Add polish translation
zwiastunsw Mar 14, 2024
43fbd77
resolve problems
zwiastunsw Mar 16, 2024
2c9a4f3
fix typo
zwiastunsw Mar 26, 2024
e129d08
merge main into develop with 4.5.1 patch
jeanem Mar 7, 2025
e551e94
updating current develop version
jeanem Mar 7, 2025
f4a4430
Merge branch 'main' into develop
jeanem Mar 14, 2025
28f7d59
update to develop version
jeanem Mar 21, 2025
3c860a0
Merge pull request #595 from lepszyweb/polish-translation
joedolson May 4, 2025
2cb3f6a
Merge pull request #583 from conorom/571/geteferences_typo
joedolson May 4, 2025
f3662ab
Change 'lead developer' to 'original lead developer'.
joedolson May 6, 2025
4f15b20
Change copyright to Able Player Contributors
joedolson May 6, 2025
6b008e6
The translations object has these camel-cased with 'screen' as a sepa…
joedolson May 24, 2025
ec804b0
Replace deprecated `.click()` with `.trigger( 'click' );`
joedolson May 24, 2025
cbc6d33
Replace deprecated .focus() in demos
joedolson May 24, 2025
7316ecf
Replace jquery `.focus()` with `.trigger( 'focus' )`
joedolson May 24, 2025
af166de
Replace .click() in demos.
joedolson May 25, 2025
e55c22c
Replace .click() with .on( 'click'
joedolson May 25, 2025
63e1a82
Replace instances of $.trim() with .trim()
joedolson May 25, 2025
b1d05bb
Replace .change() with .on( 'change'
joedolson May 25, 2025
e7fa7d3
Replace .keydown with .on( 'keydown'
joedolson May 25, 2025
69caf80
Use 'inert' to change interactivity state of non-modal content.
joedolson May 25, 2025
6f682d0
Replace jQuery isNumeric with vanilla JS numeric check.
joedolson May 25, 2025
913eb71
typeof needs to compare to a string, not a var.
joedolson May 25, 2025
a82fa2a
Firefox no longer requires the orient attribute or the slider-vertica…
joedolson May 25, 2025
3c3bf47
Switch to lr to keep previous appearance.
joedolson May 25, 2025
e2bd655
Remove the `role` and `aria-label` on transcript containers if they a…
joedolson May 25, 2025
6521b22
When fullscreen on narrow screens, using vw caption units is too small.
joedolson May 25, 2025
7b6a59e
Remove console.log
joedolson May 25, 2025
176fdb8
Update PR 575
joedolson May 25, 2025
dac86c7
Merge branch 'main' into fix-unbind-click-event
joedolson Jun 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace jquery .focus() with .trigger( 'focus' )
See #612
  • Loading branch information
joedolson committed May 24, 2025
commit 7316ecffa822f6f5f3ee01112e336e0211dd96ee
20 changes: 10 additions & 10 deletions scripts/buildplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,20 +588,20 @@
if (e.which === 9) { // Tab
if (e.shiftKey) {
$thisItem.removeClass('able-focus');
$prevItem.focus().addClass('able-focus');
$prevItem.trigger('focus').addClass('able-focus');
}
else {
$thisItem.removeClass('able-focus');
$nextItem.focus().addClass('able-focus');
$nextItem.trigger('focus').addClass('able-focus');
}
}
else if (e.which === 40 || e.which === 39) { // down or right arrow
$thisItem.removeClass('able-focus');
$nextItem.focus().addClass('able-focus');
$nextItem.trigger('focus').addClass('able-focus');
}
else if (e.which == 38 || e.which === 37) { // up or left arrow
$thisItem.removeClass('able-focus');
$prevItem.focus().addClass('able-focus');
$prevItem.trigger('focus').addClass('able-focus');
}
else if (e.which === 32 || e.which === 13) { // space or enter
$thisItem.trigger( 'click' );
Expand All @@ -623,7 +623,7 @@

if (this.chaptersPopup && this.chaptersPopup.is(':visible')) {
this.chaptersPopup.hide();
this.$chaptersButton.attr('aria-expanded','false').focus();
this.$chaptersButton.attr('aria-expanded','false').trigger('focus');
}
if (this.captionsPopup && this.captionsPopup.is(':visible')) {
this.captionsPopup.hide();
Expand All @@ -646,14 +646,14 @@
}
if (this.$volumeSlider && this.$volumeSlider.is(':visible')) {
this.$volumeSlider.hide().attr('aria-hidden','true');
this.$volumeButton.attr('aria-expanded', 'false').focus();
this.$volumeButton.attr('aria-expanded', 'false').trigger('focus');
}
if (this.$transcriptPopup && this.$transcriptPopup.is(':visible')) {
this.hidingPopup = true;
this.$transcriptPopup.hide();
// restore menu items to their original state
this.$transcriptPopup.find('li').removeClass('able-focus').attr('tabindex','-1');
this.$transcriptPopupButton.attr('aria-expanded','false').focus();
this.$transcriptPopupButton.attr('aria-expanded','false').trigger('focus');
// wait briefly, then reset hidingPopup
setTimeout(function() {
thisObj.hidingPopup = false;
Expand All @@ -663,7 +663,7 @@
this.$signPopup.hide();
// restore menu items to their original state
this.$signPopup.find('li').removeClass('able-focus').attr('tabindex','-1');
this.$signPopupButton.attr('aria-expanded','false').focus();
this.$signPopupButton.attr('aria-expanded','false').trigger('focus');
}
};

Expand Down Expand Up @@ -1400,7 +1400,7 @@
// if player is being rebuilt because user clicked the Prev button
// return focus to that (newly built) button
if (this.buttonWithFocus == 'previous') {
this.$prevButton.focus();
this.$prevButton.trigger('focus');
this.buttonWithFocus = null;
}
}
Expand All @@ -1409,7 +1409,7 @@
// if player is being rebuilt because user clicked the Next button
// return focus to that (newly built) button
if (this.buttonWithFocus == 'next') {
this.$nextButton.focus();
this.$nextButton.trigger('focus');
this.buttonWithFocus = null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
setTimeout(function() {
thisObj.hidingPopup = false;
}, 100);
thisObj.$chaptersButton.focus();
thisObj.$chaptersButton.trigger('focus');
}
};

Expand Down
24 changes: 12 additions & 12 deletions scripts/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@
thisObj.captionsPopup.css('left', thisObj.$ccButton.position().left)
// Place focus on the first button (even if another button is checked)
thisObj.captionsPopup.find('li').removeClass('able-focus');
thisObj.captionsPopup.find('li').first().focus().addClass('able-focus');
thisObj.captionsPopup.find('li').first().trigger('focus').addClass('able-focus');
}, 50);
}
}
Expand All @@ -1279,7 +1279,7 @@
var _timeout = (timeout === undefined || timeout === null) ? 50 : timeout;

setTimeout(function() {
$el.focus();
$el.trigger('focus');
}, _timeout);
}

Expand All @@ -1293,7 +1293,7 @@
if (this.chaptersPopup.is(':visible')) {
this.chaptersPopup.hide();
this.hidingPopup = false;
this.$chaptersButton.attr('aria-expanded','false').focus();
this.$chaptersButton.attr('aria-expanded','false').trigger('focus');
}
else {
this.closePopups();
Expand All @@ -1306,10 +1306,10 @@
// Otherwise, place focus on the first chapter
this.chaptersPopup.find('li').removeClass('able-focus');
if (this.chaptersPopup.find('li[aria-checked="true"]').length) {
this.chaptersPopup.find('li[aria-checked="true"]').focus().addClass('able-focus');
this.chaptersPopup.find('li[aria-checked="true"]').trigger('focus').addClass('able-focus');
}
else {
this.chaptersPopup.find('li').first().addClass('able-focus').attr('aria-checked','true').focus();
this.chaptersPopup.find('li').first().addClass('able-focus').attr('aria-checked','true').trigger('focus');
}
}
};
Expand Down Expand Up @@ -1360,7 +1360,7 @@
// restore each menu item to original hidden state
this.prefsPopup.find('li').removeClass('able-focus').attr('tabindex','-1');
if (!this.showingPrefsDialog) {
this.$prefsButton.focus();
this.$prefsButton.trigger('focus');
}
// wait briefly, then reset hidingPopup
setTimeout(function() {
Expand All @@ -1371,7 +1371,7 @@
this.closePopups();
this.prefsPopup.show();
this.$prefsButton.attr('aria-expanded','true');
this.$prefsButton.focus(); // focus first on prefs button to announce expanded state
this.$prefsButton.trigger('focus'); // focus first on prefs button to announce expanded state
// give time for focus on button then adjust popup settings and focus
setTimeout(function() {
prefsButtonPosition = thisObj.$prefsButton.position();
Expand All @@ -1381,7 +1381,7 @@
thisObj.prefsPopup.css('left', prefsMenuLeft);
// remove prior focus and set focus on first item; also change tabindex from -1 to 0
thisObj.prefsPopup.find('li').removeClass('able-focus').attr('tabindex','0');
thisObj.prefsPopup.find('li').first().focus().addClass('able-focus');
thisObj.prefsPopup.find('li').first().trigger('focus').addClass('able-focus');
}, 50);
}
};
Expand All @@ -1400,7 +1400,7 @@
this.$transcriptButton.addClass('buttonOff').attr('aria-label',this.tt.showTranscript);
this.$transcriptButton.find('span.able-clipped').text(this.tt.showTranscript);
this.prefTranscript = 0;
this.$transcriptButton.focus().addClass('able-focus');
this.$transcriptButton.trigger('focus').addClass('able-focus');
// wait briefly before resetting stopgap var
// otherwise the keypress used to select 'Close' will trigger the transcript button
// Benchmark tests: If this is gonna happen, it typically happens in around 3ms; max 12ms
Expand All @@ -1420,7 +1420,7 @@
this.prefTranscript = 1;
// move focus to first focusable element (window options button)
this.focusNotClick = true;
this.$transcriptArea.find('button').first().focus();
this.$transcriptArea.find('button').first().trigger('focus');
// wait briefly before resetting stopgap var
setTimeout(function() {
thisObj.focusNotClick = false;
Expand All @@ -1438,7 +1438,7 @@
this.$signButton.addClass('buttonOff').attr('aria-label',this.tt.showSign);
this.$signButton.find('span.able-clipped').text(this.tt.showSign);
this.prefSign = 0;
this.$signButton.focus().addClass('able-focus');
this.$signButton.trigger('focus').addClass('able-focus');
// wait briefly before resetting stopgap var
// otherwise the keypress used to select 'Close' will trigger the transcript button
setTimeout(function() {
Expand All @@ -1455,7 +1455,7 @@
this.$signButton.find('span.able-clipped').text(this.tt.hideSign);
this.prefSign = 1;
this.focusNotClick = true;
this.$signWindow.find('button').first().focus();
this.$signWindow.find('button').first().trigger('focus');
// wait briefly before resetting stopgap var
// otherwise the keypress used to select 'Close' will trigger the transcript button
setTimeout(function() {
Expand Down
8 changes: 4 additions & 4 deletions scripts/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
if (e.shiftKey) {
// If backwards from first element, go to last.
if (currentIndex === 0) {
focusable.get(focusable.length - 1).focus();
focusable.get(focusable.length - 1).trigger('focus');
e.preventDefault();
}
}
else {
if (currentIndex === focusable.length - 1) {
focusable.get(0).focus();
focusable.get(0).trigger('focus');
e.preventDefault();
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@
var thisObj = this;
setTimeout(function () {
// set focus on the first focusable element
thisObj.modal.find('button.modalCloseButton').first().focus();
thisObj.modal.find('button.modalCloseButton').first().trigger('focus');
}, 300);
};

Expand All @@ -140,7 +140,7 @@
this.modal.attr('aria-hidden', 'true');
$('body > *').not('.able-modal-overlay').not('.able-modal-dialog').removeAttr('aria-hidden');

this.focusedElementBeforeModal.focus();
this.focusedElementBeforeModal.trigger('focus');
};

AccessibleDialog.prototype.getInputs = function () {
Expand Down
24 changes: 12 additions & 12 deletions scripts/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,12 @@
}
resizeDialog.hide();
$windowPopup.hide();
$windowButton.focus();
$windowButton.trigger('focus');
});
$cancelButton.on('click',function () {
resizeDialog.hide();
$windowPopup.hide();
$windowButton.focus();
$windowButton.trigger('focus');
});

// Now assemble all the parts
Expand Down Expand Up @@ -406,7 +406,7 @@
// also restore menu items to their original state
$windowPopup.find('li').removeClass('able-focus').attr('tabindex','-1');
// also return focus to window options button
$windowButton.focus();
$windowButton.trigger('focus');
});
}
else {
Expand All @@ -433,7 +433,7 @@
thisObj.windowMenuClickRegistered = false; // reset
});
$windowPopup.find('li').removeClass('able-focus');
$windowButton.attr('aria-expanded','false').focus();
$windowButton.attr('aria-expanded','false').trigger('focus');
}
else {
// first, be sure window is on top
Expand All @@ -442,7 +442,7 @@
$windowPopup.css('top', popupTop);
$windowPopup.show(200,'',function() {
$windowButton.attr('aria-expanded','true');
$(this).find('li').first().focus().addClass('able-focus');
$(this).find('li').first().trigger('focus').addClass('able-focus');
thisObj.windowMenuClickRegistered = false; // reset
});
}
Expand Down Expand Up @@ -477,7 +477,7 @@
$windowPopup.find('li').removeClass('able-focus').attr('tabindex','-1');
$windowButton.attr('aria-expanded','false');
// also return focus to window options button
$windowButton.focus();
$windowButton.trigger('focus');
});
return false;
}
Expand All @@ -499,7 +499,7 @@
$windowButton.attr('aria-expanded','false');
});
if (choice !== 'close') {
$windowButton.focus();
$windowButton.trigger('focus');
}
if (choice === 'move') {

Expand All @@ -523,7 +523,7 @@
this.dragDevice = 'mouse';
}
this.startDrag(which, $window);
$windowPopup.hide().parent().focus();
$windowPopup.hide().parent().trigger('focus');
}
else if (choice == 'resize') {
// resize through the menu uses a form, not drag
Expand Down Expand Up @@ -608,7 +608,7 @@
'position': 'absolute',
'top': this.dragStartY + 'px',
'left': this.dragStartX + 'px'
}).focus();
}).trigger('focus');

// add device-specific event listeners
if (this.dragDevice === 'mouse') { // might also be a touchpad
Expand Down Expand Up @@ -725,7 +725,7 @@
this.$activeWindow = null;

if (this.dragDevice === 'keyboard') {
$windowButton.focus();
$windowButton.trigger('focus');
}
this.dragging = false;

Expand Down Expand Up @@ -786,7 +786,7 @@

// if window's popup menu is open, close it & place focus on button (???)
if ($windowPopup.is(':visible')) {
$windowPopup.hide().parent().focus();
$windowPopup.hide().parent().trigger('focus');
}

// get starting width and height
Expand Down Expand Up @@ -823,7 +823,7 @@

$(document).off('mousemove mouseup touchmove touchup');
this.$activeWindow.off('keydown');
$windowButton.show().focus();
$windowButton.show().trigger('focus');
this.resizing = false;
this.$activeWindow.removeClass('able-resize');

Expand Down
2 changes: 1 addition & 1 deletion scripts/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
classList = this.$focusedElement.attr("class").split(/\s+/);
$.each(classList, function(index, item) {
if (item.substring(0,20) === 'able-button-handler-') {
$('div.able-controller div.' + item).focus();
$('div.able-controller div.' + item).trigger('focus');
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
} else if (line.toLowerCase().substring(0, 6) == "focus:") {
focusTarget = line.substring(6).trim();
if ($(focusTarget).length) {
$(focusTarget).focus();
$(focusTarget).trigger('focus');
}
} else {
if ($(line).length) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/vts.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
this.showVtsAlert('A new row ' + newRowNum + ' has been inserted'); // TODO: Localize this

// Place focus in new select field
$select.focus();
$select.trigger('focus');

};

Expand Down