Skip to content

Commit 679b4d6

Browse files
committed
Standardize on "e" for "event"
1 parent 4e1ba92 commit 679b4d6

15 files changed

Lines changed: 299 additions & 291 deletions

build/ableplayer.dist.js

Lines changed: 100 additions & 96 deletions
Large diffs are not rendered by default.

build/ableplayer.js

Lines changed: 100 additions & 96 deletions
Large diffs are not rendered by default.

build/ableplayer.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ableplayer",
3-
"version": "3.1.18",
3+
"version": "3.1.19",
44
"description": "fully accessible HTML5 media player",
55
"homepage": "http://ableplayer.github.io/ableplayer",
66
"bugs": "https://github.com/ableplayer/ableplayer/issues",

scripts/buildplayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@
11501150
}).text(buttonTitle);
11511151
$newButton.append(buttonLabel);
11521152
// add an event listener that displays a tooltip on mouseenter or focus
1153-
$newButton.on('mouseenter focus',function(event) {
1153+
$newButton.on('mouseenter focus',function(e) {
11541154
var label = $(this).attr('aria-label');
11551155
// get position of this button
11561156
var position = $(this).position();

scripts/dialog.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
'title': thisObj.closeButtonLabel,
2525
'aria-label': thisObj.closeButtonLabel
2626
}).text('X');
27-
closeButton.keydown(function (event) {
27+
closeButton.keydown(function (e) {
2828
// Space key down
29-
if (event.which === 32) {
29+
if (e.which === 32) {
3030
thisObj.hide();
3131
}
3232
}).click(function () {
@@ -53,19 +53,19 @@
5353
'role': dialogRole
5454
});
5555

56-
modal.keydown(function (event) {
56+
modal.keydown(function (e) {
5757
// Escape
58-
if (event.which === 27) {
58+
if (e.which === 27) {
5959
if (thisObj.escapeHook) {
60-
thisObj.escapeHook(event, this);
60+
thisObj.escapeHook(e, this);
6161
}
6262
else {
6363
thisObj.hide();
64-
event.preventDefault();
64+
e.preventDefault();
6565
}
6666
}
6767
// Tab
68-
else if (event.which === 9) {
68+
else if (e.which === 9) {
6969
// Manually loop tab navigation inside the modal.
7070
var parts = modal.find('*');
7171
var focusable = parts.filter(focusableElementsSelector).filter(':visible');
@@ -76,21 +76,21 @@
7676

7777
var focused = $(':focus');
7878
var currentIndex = focusable.index(focused);
79-
if (event.shiftKey) {
79+
if (e.shiftKey) {
8080
// If backwards from first element, go to last.
8181
if (currentIndex === 0) {
8282
focusable.get(focusable.length - 1).focus();
83-
event.preventDefault();
83+
e.preventDefault();
8484
}
8585
}
8686
else {
8787
if (currentIndex === focusable.length - 1) {
8888
focusable.get(0).focus();
89-
event.preventDefault();
89+
e.preventDefault();
9090
}
9191
}
9292
}
93-
event.stopPropagation();
93+
e.stopPropagation();
9494
});
9595

9696
$('body > *').not('.able-modal-overlay').not('.able-modal-dialog').attr('aria-hidden', 'false');
@@ -107,8 +107,8 @@
107107
$('body').append(overlay);
108108

109109
// Keep from moving focus out of dialog when clicking outside of it.
110-
overlay.on('mousedown.accessibleModal', function (event) {
111-
event.preventDefault();
110+
overlay.on('mousedown.accessibleModal', function (e) {
111+
e.preventDefault();
112112
});
113113
}
114114

scripts/dragdrop.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,40 @@
4242

4343
// add event listener to toolbar to start and end drag
4444
// other event listeners will be added when drag starts
45-
$toolbar.on('mousedown', function(event) {
46-
event.stopPropagation();
45+
$toolbar.on('mousedown', function(e) {
46+
e.stopPropagation();
4747
if (!thisObj.windowMenuClickRegistered) {
4848
thisObj.windowMenuClickRegistered = true;
49-
thisObj.startMouseX = event.pageX;
50-
thisObj.startMouseY = event.pageY;
49+
thisObj.startMouseX = e.pageX;
50+
thisObj.startMouseY = e.pageY;
5151
thisObj.dragDevice = 'mouse';
5252
thisObj.startDrag(which, $window);
5353
}
5454
return false;
5555
});
56-
$toolbar.on('mouseup', function(event) {
57-
event.stopPropagation();
56+
$toolbar.on('mouseup', function(e) {
57+
e.stopPropagation();
5858
if (thisObj.dragging && thisObj.dragDevice === 'mouse') {
5959
thisObj.endDrag(which);
6060
}
6161
return false;
6262
});
6363

6464
// add event listeners for resizing
65-
$resizeHandle.on('mousedown', function(event) {
65+
$resizeHandle.on('mousedown', function(e) {
6666

67-
event.stopPropagation();
67+
e.stopPropagation();
6868
if (!thisObj.windowMenuClickRegistered) {
6969
thisObj.windowMenuClickRegistered = true;
70-
thisObj.startMouseX = event.pageX;
71-
thisObj.startMouseY = event.pageY;
70+
thisObj.startMouseX = e.pageX;
71+
thisObj.startMouseY = e.pageY;
7272
thisObj.startResize(which, $window);
7373
return false;
7474
}
7575
});
7676

77-
$resizeHandle.on('mouseup', function(event) {
78-
event.stopPropagation();
77+
$resizeHandle.on('mouseup', function(e) {
78+
e.stopPropagation();
7979
if (thisObj.resizing) {
8080
thisObj.endResize(which);
8181
}
@@ -163,7 +163,7 @@
163163
'class' : 'able-tooltip',
164164
'id' : tooltipId
165165
}).hide();
166-
$newButton.on('mouseenter focus',function(event) {
166+
$newButton.on('mouseenter focus',function(e) {
167167
var label = $(this).attr('aria-label');
168168
// get position of this button
169169
var position = $(this).position();
@@ -385,7 +385,7 @@
385385
}
386386
};
387387

388-
AblePlayer.prototype.handleMenuChoice = function (which, choice, event) {
388+
AblePlayer.prototype.handleMenuChoice = function (which, choice, e) {
389389

390390
var thisObj, $window, $windowPopup, $windowButton, resizeDialog, $thisRadio;
391391

@@ -404,8 +404,8 @@
404404
resizeDialog = this.signResizeDialog;
405405
}
406406

407-
if (event.type === 'keydown') {
408-
if (event.which === 27) { // escape
407+
if (e.type === 'keydown') {
408+
if (e.which === 27) { // escape
409409
// hide the popup menu
410410
$windowPopup.hide('fast', function() {
411411
// also reset the Boolean
@@ -444,7 +444,7 @@
444444
this.showedSignAlert = true;
445445
}
446446
}
447-
if (event.type === 'keydown') {
447+
if (e.type === 'keydown') {
448448
this.dragDevice = 'keyboard';
449449
}
450450
else {

scripts/event.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@
145145
var thisObj = this;
146146

147147
// Handle seek bar events.
148-
this.seekBar.bodyDiv.on('startTracking', function (event) {
148+
this.seekBar.bodyDiv.on('startTracking', function (e) {
149149
thisObj.pausedBeforeTracking = thisObj.isPaused();
150150
thisObj.pauseMedia();
151-
}).on('tracking', function (event, position) {
151+
}).on('tracking', function (e, position) {
152152
// Scrub transcript, captions, and metadata.
153153
thisObj.highlightTranscript(position);
154154
thisObj.updateCaption(position);
155155
thisObj.showDescription(position);
156156
thisObj.updateChapter(thisObj.convertChapterTimeToVideoTime(position));
157157
thisObj.updateMeta(position);
158158
thisObj.refreshControls();
159-
}).on('stopTracking', function (event, position) {
159+
}).on('stopTracking', function (e, position) {
160160
if (thisObj.useChapterTimes) {
161161
thisObj.seekTo(thisObj.convertChapterTimeToVideoTime(position));
162162
}
@@ -515,11 +515,11 @@
515515
}
516516
thisObj.refreshControls();
517517
})
518-
.onSeek(function(event) {
518+
.onSeek(function(e) {
519519
// this is called when user scrubs ahead or back,
520520
// after the target offset is reached
521521
if (thisObj.debug) {
522-
console.log('Seeking to ' + event.position + '; target: ' + event.offset);
522+
console.log('Seeking to ' + e.position + '; target: ' + e.offset);
523523
}
524524

525525
if (thisObj.jwSeekPause) {
@@ -609,8 +609,8 @@
609609

610610
this.addSeekbarListeners();
611611
// handle clicks on player buttons
612-
this.$controllerDiv.find('button').on('click',function(event){
613-
event.stopPropagation();
612+
this.$controllerDiv.find('button').on('click',function(e){
613+
e.stopPropagation();
614614
thisObj.onClickPlayerButton(this);
615615
});
616616

scripts/preference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@
721721
thisObj.resetPrefsForm();
722722
})
723723
// Add handler for escape key
724-
$('div.able-prefs-form').keydown(function(event) {
725-
if (event.which === 27) { // escape
724+
$('div.able-prefs-form').keydown(function(e) {
725+
if (e.which === 27) { // escape
726726
thisObj.resetPrefsForm();
727727
}
728728
});

0 commit comments

Comments
 (0)