style(reader): apply code formatting to existing format files
Run code formatting (prettier/eslint) on existing reader format files that were not migrated to the new structure. This ensures consistent code style across the codebase. ## Changes ### Formatting Applied - Added newlines at end of files - Fixed line length and indentation - Updated import statements for consistency - Applied code style rules uniformly ### Files Affected - **Comic**: background-color, chapter-markers, page-order, panel-gap - **Ebook**: font-loader, search, view-modes - **Manga**: vertical-scroll-mode - **PDF**: annotation-layer, pdf-navigation, pdf-text-selection ## Purpose These files will be removed in subsequent commits as they are replaced by the new modular structure. The formatting ensures consistency during the transition period and maintains code quality standards. Note: These are non-functional formatting changes only. No logic or behavior was modified in this commit.
This commit is contained in:
@@ -2,14 +2,17 @@
|
||||
// Auto-detect Japanese vs Western reading order
|
||||
// Feature Registration Pattern implementation
|
||||
|
||||
import type { ReaderContext } from "../core/reader-context";
|
||||
import { ReaderContext } from "../core/reader-context";
|
||||
|
||||
export function init(context: ReaderContext): void {
|
||||
let state: PageOrderState | null = null;
|
||||
|
||||
context.events.on("reader:loaded", (detail: { totalPages: number; pageNames: string[] }) => {
|
||||
state = createPageOrderState(detail.totalPages, detail.pageNames);
|
||||
});
|
||||
context.events.on(
|
||||
"reader:loaded",
|
||||
(detail: { totalPages: number; pageNames: string[] }) => {
|
||||
state = createPageOrderState(detail.totalPages, detail.pageNames);
|
||||
},
|
||||
);
|
||||
|
||||
context.events.on("page-order:set", (detail: { mode: PageOrderMode }) => {
|
||||
if (state) {
|
||||
@@ -24,19 +27,25 @@ export function init(context: ReaderContext): void {
|
||||
}
|
||||
});
|
||||
|
||||
context.events.on("page-order:reorder", (detail: { pageNumbers: number[] }) => {
|
||||
if (state) {
|
||||
const reordered = reorderPages(state, detail.pageNumbers);
|
||||
context.events.emit("page-order:reordered", { pages: reordered });
|
||||
}
|
||||
});
|
||||
context.events.on(
|
||||
"page-order:reorder",
|
||||
(detail: { pageNumbers: number[] }) => {
|
||||
if (state) {
|
||||
const reordered = reorderPages(state, detail.pageNumbers);
|
||||
context.events.emit("page-order:reordered", { pages: reordered });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
context.events.on("page-order:display-number", (detail: { actualPage: number }) => {
|
||||
if (state) {
|
||||
const displayPage = getDisplayPageNumber(state, detail.actualPage);
|
||||
context.events.emit("page-order:display-page", { displayPage });
|
||||
}
|
||||
});
|
||||
context.events.on(
|
||||
"page-order:display-number",
|
||||
(detail: { actualPage: number }) => {
|
||||
if (state) {
|
||||
const displayPage = getDisplayPageNumber(state, detail.actualPage);
|
||||
context.events.emit("page-order:display-page", { displayPage });
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
type PageOrderMode = "auto" | "japanese" | "western";
|
||||
@@ -139,4 +148,5 @@ function getDisplayPageNumber(
|
||||
}
|
||||
|
||||
return actualPage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user