Fix all 7 ESLint errors on develop · ableplayer/ableplayer@4881464 · GitHub
Skip to content

Commit 4881464

Browse files
blogcastAIclaude
andcommitted
Fix all 7 ESLint errors on develop
- ableplayer-base.js: the descriptionsAudible else-if duplicated the first condition (no-dupe-else-if), so the documented singular spelling data-description-audible was never honored. Read the singular attribute (options.descriptionAudible ?? data.descriptionAudible) in the second branch, matching the existing comment's intent. - dialog.js: import AblePlayer for the AblePlayer.getActiveDOMElement() call (no-undef). - dragdrop.js: remove unused thisObj locals in handleWindowButtonClick and handleMenuChoice (no-unused-vars); document the intentionally-empty Space/Enter branch (no-empty). - preference.js: remove the write-only $thisLabel variable and a dead $thisField assignment (no-unused-vars, no-useless-assignment). npm run lint: 0 problems. jsdom test suites: 55/55 pass. Build artifacts intentionally omitted per contributing.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent c0a05c9 commit 4881464

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

‎scripts/ableplayer-base.js‎

Lines changed: 2 additions & 1 deletion

‎scripts/dialog.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import $ from 'jquery';
2+
import AblePlayer from './ableplayer-base';
23

34
var focusableElementsSelector = "a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";
45

‎scripts/dragdrop.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,8 @@ function addDragdropFunctions(AblePlayer) {
287287

288288
AblePlayer.prototype.handleWindowButtonClick = function (which, e) {
289289

290-
var thisObj, $windowPopup, $windowButton, $toolbar, popupTop;
290+
var $windowPopup, $windowButton, $toolbar, popupTop;
291291

292-
thisObj = this;
293292
if (this.focusNotClick) {
294293
// transcript or sign window has just opened,
295294
// and focus moved to the window button
@@ -309,6 +308,7 @@ function addDragdropFunctions(AblePlayer) {
309308
if (e.type === 'keydown') {
310309
// user pressed a key
311310
if (e.key === ' ' || e.key === 'Enter') {
311+
// Space or Enter: fall through to the toggle logic below
312312
} else if (e.key === 'Escape') {
313313
if ($windowPopup.is(':visible')) {
314314
// close the popup menu
@@ -349,10 +349,9 @@ function addDragdropFunctions(AblePlayer) {
349349

350350
AblePlayer.prototype.handleMenuChoice = function (which, choice, e) {
351351

352-
var thisObj, $window, $windowPopup, $windowButton, resizeDialog, startingWidth, startingHeight,
352+
var $window, $windowPopup, $windowButton, resizeDialog, startingWidth, startingHeight,
353353
aspectRatio, tempWidth, tempHeight;
354354

355-
thisObj = this;
356355
if (which === 'transcript') {
357356
$window = this.$transcriptArea;
358357
$windowPopup = this.$transcriptPopup;

‎scripts/preference.js‎

Lines changed: 1 addition & 6 deletions

0 commit comments

Comments
 (0)