Skip to content

Commit

Permalink
version bump on eslint and apply linter on merged Code
Browse files Browse the repository at this point in the history
  • Loading branch information
aferditamuriqi committed Feb 17, 2024
1 parent 4bfbb97 commit fff6f44
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 221 deletions.
358 changes: 179 additions & 179 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"@types/rimraf": "^4.0.5",
"@types/sanitize-html": "^2.9.0",
"@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"ansi-regex": ">=5.0.1",
"babel-eslint": "^10.1.0",
"braces": ">=3.0.2",
Expand Down
12 changes: 6 additions & 6 deletions src/modules/highlight/renderer/iframe/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ export function convertRange(
const startContainerElement = startIsElement
? (range.startContainer as Element)
: range.startContainer.parentNode &&
range.startContainer.parentNode.nodeType === Node.ELEMENT_NODE
? (range.startContainer.parentNode as Element)
: undefined;
range.startContainer.parentNode.nodeType === Node.ELEMENT_NODE
? (range.startContainer.parentNode as Element)
: undefined;
if (!startContainerElement) {
return undefined;
}
Expand All @@ -170,9 +170,9 @@ export function convertRange(
const endContainerElement = endIsElement
? (range.endContainer as Element)
: range.endContainer.parentNode &&
range.endContainer.parentNode.nodeType === Node.ELEMENT_NODE
? (range.endContainer.parentNode as Element)
: undefined;
range.endContainer.parentNode.nodeType === Node.ELEMENT_NODE
? (range.endContainer.parentNode as Element)
: undefined;
if (!endContainerElement) {
return undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/mediaoverlays/MediaOverlayModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,8 @@ export class MediaOverlayModule implements ReaderModule {
isNight || isSepia
? R2_MO_CLASS_ACTIVE
: classActive
? classActive
: R2_MO_CLASS_ACTIVE;
? classActive
: R2_MO_CLASS_ACTIVE;
}

if (this.pid) {
Expand Down
20 changes: 12 additions & 8 deletions src/modules/mediaoverlays/MediaOverlaySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ export class MediaOverlaySettings implements IMediaOverlayUserSettings {
(
this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF) as Incremental
).increment();
this.volume = this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF)
?.value;
this.volume = this.userProperties.getByRef(
MEDIAOVERLAYREFS.VOLUME_REF
)?.value;
let prop = this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF);
if (prop) {
this.storeProperty(prop);
Expand All @@ -442,8 +443,9 @@ export class MediaOverlaySettings implements IMediaOverlayUserSettings {
(
this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF) as Incremental
).increment();
this.rate = this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF)
?.value;
this.rate = this.userProperties.getByRef(
MEDIAOVERLAYREFS.RATE_REF
)?.value;
let prop = this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF);
if (prop) {
this.storeProperty(prop);
Expand All @@ -457,8 +459,9 @@ export class MediaOverlaySettings implements IMediaOverlayUserSettings {
(
this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF) as Incremental
).decrement();
this.volume = this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF)
?.value;
this.volume = this.userProperties.getByRef(
MEDIAOVERLAYREFS.VOLUME_REF
)?.value;
let prop = this.userProperties.getByRef(MEDIAOVERLAYREFS.VOLUME_REF);
if (prop) {
this.storeProperty(prop);
Expand All @@ -468,8 +471,9 @@ export class MediaOverlaySettings implements IMediaOverlayUserSettings {
(
this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF) as Incremental
).decrement();
this.rate = this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF)
?.value;
this.rate = this.userProperties.getByRef(
MEDIAOVERLAYREFS.RATE_REF
)?.value;
let prop = this.userProperties.getByRef(MEDIAOVERLAYREFS.RATE_REF);
if (prop) {
this.storeProperty(prop);
Expand Down
4 changes: 2 additions & 2 deletions src/navigator/PDFNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ export class PDFNavigator extends EventEmitter implements Navigator {
tableOfContents(): any {
return this.publication.tableOfContents;
}
landmarks(): any {};
pageList(): any {};
landmarks(): any {}
pageList(): any {}

//TODO:
currentResource(): any {}
Expand Down
41 changes: 19 additions & 22 deletions src/utils/KeyboardEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { IFrameNavigator } from "../navigator/IFrameNavigator";

export default class KeyboardEventHandler {
navigator: IFrameNavigator;
rtl: boolean; constructor(navigator: IFrameNavigator) {
rtl: boolean;
constructor(navigator: IFrameNavigator) {
this.navigator = navigator;
this.rtl = false;
}
Expand Down Expand Up @@ -72,7 +73,7 @@ rtl: boolean; constructor(navigator: IFrameNavigator) {
private onKeyDown(self: this) {
return (
this.handlers["onKeyDown"] ||
(this.handlers["onKeyDown"] = function(event: KeyboardEvent) {
(this.handlers["onKeyDown"] = function (event: KeyboardEvent) {
// Ignore input elements
const eventTarget = event.target as HTMLElement;
if (/input|select|option|textarea/i.test(eventTarget.tagName)) {
Expand All @@ -91,26 +92,22 @@ rtl: boolean; constructor(navigator: IFrameNavigator) {
const key = event.key;
switch (key) {
case "ArrowRight":
self.rtl
? self.onBackwardSwipe(event)
: self.onForwardSwipe(event);
break;
case "ArrowLeft":
self.rtl
? self.onForwardSwipe(event)
: self.onBackwardSwipe(event);
break;
}
switch (event.code) {
case "Space":
if (event.ctrlKey) {
self.onBackwardSwipe(event);
} else {
self.onForwardSwipe(event);
}
break;
}
})
self.rtl ? self.onBackwardSwipe(event) : self.onForwardSwipe(event);
break;
case "ArrowLeft":
self.rtl ? self.onForwardSwipe(event) : self.onBackwardSwipe(event);
break;
}
switch (event.code) {
case "Space":
if (event.ctrlKey) {
self.onBackwardSwipe(event);
} else {
self.onForwardSwipe(event);
}
break;
}
})
);
}
}

0 comments on commit fff6f44

Please sign in to comment.