Fixing unused functions and params

This commit is contained in:
caribaud 2023-06-04 21:37:56 +02:00
parent ca0f9f4e59
commit f87f6c75f5
2 changed files with 9 additions and 32 deletions

View File

@ -29,6 +29,8 @@
"brace-style": ["warn", "allman", {"allowSingleLine": true}],
"function-call-argument-newline" : ["warn", "consistent"],
"function-paren-newline": ["warn", "consistent"],
"no-magic-numbers": ["error", {"ignore": [0,1,2,100]}]
"no-magic-numbers": ["error", {"ignore": [0,1,2,100]}],
"quote-props": ["warn", "as-needed"],
"no-unused-vars": ["error", {"argsIgnorePattern": "^_"}]
}
}

View File

@ -135,26 +135,6 @@ function getFirstZoomOfPage(pageNumber)
}
}
function getLastZoomOfPage(pageNumber)
{
let res = null;
for (let zoomIdx = 0; zoomIdx < PAGES_ZOOMS.length; zoomIdx += 1)
{
if (PAGES_ZOOMS[zoomIdx][0] === pageNumber)
{
res = zoomIdx;
}
if (res !== null && PAGES_ZOOMS[zoomIdx][0] !== pageNumber)
{
break;
}
}
return res;
}
function getZoomCountForPage(pageNumber)
{
return PAGES_ZOOMS.filter(zoom => zoom[0] === pageNumber).length;
@ -210,11 +190,6 @@ function readerFrameRatio()
return READER_CONTENT_FRAME.clientWidth / READER_CONTENT_FRAME.clientHeight;
}
function pageRatio(pageNumber)
{
return READER_PAGES.children[pageNumber - 1].naturalWidth / READER_PAGES.children[pageNumber - 1].naturalHeight;
}
function pageMaxHeight()
{
let maxHeight = 0;
@ -262,7 +237,7 @@ function initReader()
// Smoothly show pictures when they intersect with the viewport
const visibilityObserver = new IntersectionObserver(
(entries, observer) =>
(entries, _observer) =>
{
entries.forEach((entry) =>
{
@ -593,24 +568,24 @@ function handleMouseWhell(event)
window.addEventListener(
"load",
(event) => { initReader() }
(_event) => { initReader(); }
);
addEventListener(
"resize",
(event) => { refreshReaderDisplay() }
(_event) => { refreshReaderDisplay(); }
);
addEventListener(
"keydown",
(event) =>
{
handleKeyPress(event.key, event.shiftKey)
handleKeyPress(event.key, event.shiftKey);
}
);
addEventListener(
"wheel",
(event) => { handleMouseWhell(event) },
{ passive:false }
(event) => { handleMouseWhell(event); },
{ passive: false }
);