Skip to content

Commit 97d8ecd

Browse files
authored
New: Option to disable Align with next horizontal when reading on double page
1 parent be5cd98 commit 97d8ecd

7 files changed

Lines changed: 30 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1414
- Support for `JXL` image format [`bd6fb0a`](https://github.com/ollm/OpenComic/commit/bd6fb0a8c8be3685b48c88fa21bbe2d3c384a491)
1515
- Thumbnail generation speed has been improved [`155f064`](https://github.com/ollm/OpenComic/commit/155f064b4c9716c050a6231e44323169686997ea)
1616
- Support for `HEIC` image format [`4f4b5a1`](https://github.com/ollm/OpenComic/commit/4f4b5a16572ea2bd5aff2e519d473b42d80312fb)
17-
- Option to apply configuration profile based on folder/file label
17+
- Option to apply configuration profile based on folder/file label [`71d9ff5`](https://github.com/ollm/OpenComic/commit/71d9ff5655f934e4d710e1833b081e4fddf8d428)
18+
- Option to disable `Align with next horizontal` when reading on double page
1819

1920

2021
## [v1.4.1](https://github.com/ollm/OpenComic/releases/tag/v1.4.1) (08-02-2025)

languages/ca.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"differentMarginInHorizontals": "Diferent en les horitzontals",
124124
"doublePage": "Doble pàgina",
125125
"doNotApplyToHorizontals": "No aplicar a les horitzontals",
126+
"alignWithNextHorizontal": "Alinear amb la següent horitzontal",
126127
"blankPage": "Pàgina en blanc al principi",
127128
"readingDelaySkip": "Retard en canviar de còmic",
128129
"animationSpeed": "Velocitat de l'animació",

languages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"differentMarginInHorizontals": "Different in horizontals",
124124
"doublePage": "Double page",
125125
"doNotApplyToHorizontals": "Do not apply to horizontals",
126+
"alignWithNextHorizontal": "Align with next horizontal",
126127
"blankPage": "Blank page at the beginning",
127128
"readingDelaySkip": "Delay in changing comics",
128129
"animationSpeed": "Animation speed",

languages/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"differentMarginInHorizontals": "Diferente en las horizontales",
124124
"doublePage": "Doble página",
125125
"doNotApplyToHorizontals": "No aplicar a las horizontales",
126+
"alignWithNextHorizontal": "Alinear con la siguiente horizontal",
126127
"blankPage": "Página en blanco al principio",
127128
"readingDelaySkip": "Retraso al cambiar de cómic",
128129
"animationSpeed": "Velocidad de la animación",

scripts/reading.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ var images = {}, imagesData = {}, imagesDataClip = {}, imagesPath = {}, imagesNu
1010
//Calculates whether to add a blank image (If the reading is in double page and do not apply to the horizontals)
1111
function blankPage(index)
1212
{
13+
if(!_config.readingAlignWithNextHorizontal)
14+
return false;
15+
1316
var key = 0;
1417

1518
if(readingDoublePage() && _config.readingDoNotApplyToHorizontals)
@@ -3116,9 +3119,9 @@ function changePagesView(mode, value, save)
31163119
else if(mode == 6) // Set the reading to double page
31173120
{
31183121
if(value)
3119-
$('.reading-do-not-apply-to-horizontals, .reading-blank-page').removeClass('disable-pointer');
3122+
$('.reading-do-not-apply-to-horizontals, .reading-blank-page, .reading-align-with-next-horizontal').removeClass('disable-pointer');
31203123
else
3121-
$('.reading-do-not-apply-to-horizontals, .reading-blank-page').addClass('disable-pointer');
3124+
$('.reading-do-not-apply-to-horizontals, .reading-blank-page, .reading-align-with-next-horizontal').addClass('disable-pointer');
31223125

31233126
updateReadingPagesConfig('readingDoublePage', value);
31243127

@@ -3153,15 +3156,15 @@ function changePagesView(mode, value, save)
31533156

31543157
if(value)
31553158
{
3156-
template.globalElement('.reading-view, .reading-reading-manga, .reading-double-page, .reading-do-not-apply-to-horizontals, .reading-blank-page, .reading-ajust-to-width, .reading-not-enlarge-more-than-original-size, .reading-margin-vertical, .reading-force-single-page').addClass('disable-pointer');
3159+
template.globalElement('.reading-view, .reading-reading-manga, .reading-double-page, .reading-do-not-apply-to-horizontals, .reading-blank-page, .reading-align-with-next-horizontal, .reading-ajust-to-width, .reading-not-enlarge-more-than-original-size, .reading-margin-vertical, .reading-force-single-page').addClass('disable-pointer');
31573160
}
31583161
else
31593162
{
31603163
if(_config.readingView == 'scroll')
31613164
template.globalElement('.reading-ajust-to-width, .reading-force-single-page').removeClass('disable-pointer');
31623165

31633166
if(_config.readingDoublePage)
3164-
template.globalElement('.reading-do-not-apply-to-horizontals, .reading-blank-page').removeClass('disable-pointer');
3167+
template.globalElement('.reading-do-not-apply-to-horizontals, .reading-blank-page, .reading-align-with-next-horizontal').removeClass('disable-pointer');
31653168

31663169
template.globalElement('.reading-view, .reading-reading-manga, .reading-double-page, .reading-not-enlarge-more-than-original-size, .reading-margin-vertical').removeClass('disable-pointer');
31673170
}
@@ -3292,6 +3295,15 @@ function changePagesView(mode, value, save)
32923295
render.resized(readingDoublePage());
32933296
// updateEbook(true);
32943297
}
3298+
else if(mode == 21) // Align double pages with the next horizontal image
3299+
{
3300+
updateReadingPagesConfig('readingAlignWithNextHorizontal', value);
3301+
3302+
if(readingIsEbook) handlebarsContext.loading = true;
3303+
template.loadContentRight('reading.content.right.html', true);
3304+
3305+
read(readingCurrentPath, imageIndex, false, readingIsCanvas, readingIsEbook);
3306+
}
32953307
}
32963308

32973309
function change(key, value)

scripts/storage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var changes = 97; // Update this if readingPagesConfig is updated
1+
var changes = 98; // Update this if readingPagesConfig is updated
22

33
var readingPagesConfig = {
44
readingConfigName: '',
@@ -40,6 +40,7 @@ var readingPagesConfig = {
4040
readingDelayComicSkip: 1,
4141
readingDoublePage: false,
4242
readingDoNotApplyToHorizontals: true,
43+
readingAlignWithNextHorizontal: true,
4344
readingBlankPage: false,
4445
readingManga: false,
4546
readingWebtoon: false,

templates/reading.elements.menus.pages.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,13 @@
358358
<svg viewBox="0 0 52 32"><path d="M 8,0 C 3.58,0 0,3.58 0,8 0,12.42 3.58,16 8,16 8,16 8,16 8,16 12.42,16 16,12.42 16,8 16,3.58 12.42,0 8,0 8,0 8,0 8,0 Z"></path></svg>
359359
</div>
360360
</div>
361+
<div class="menu-simple-text reading-align-with-next-horizontal gamepad-item{{#unless _config.readingDoublePage}} disable-pointer{{else if _config.readingWebtoon}} disable-pointer{{/unless}}">
362+
{{language.reading.pages.alignWithNextHorizontal}}
363+
<div class="switch{{#if _config.readingAlignWithNextHorizontal}} a{{/if}}" on="reading.changePagesView(21, true, false)" off="reading.changePagesView(21, false, false)">
364+
<div></div>
365+
<svg viewBox="0 0 52 32"><path d="M 8,0 C 3.58,0 0,3.58 0,8 0,12.42 3.58,16 8,16 8,16 8,16 8,16 12.42,16 16,12.42 16,8 16,3.58 12.42,0 8,0 8,0 8,0 8,0 Z"></path></svg>
366+
</div>
367+
</div>
361368
<div class="menu-simple-text reading-blank-page gamepad-item{{#unless _config.readingDoublePage}} disable-pointer{{else if _config.readingWebtoon}} disable-pointer{{/unless}}">
362369
{{language.reading.pages.blankPage}}
363370
<div class="switch{{#if _config.readingBlankPage}} a{{/if}}" on="reading.changePagesView(12, true, false)" off="reading.changePagesView(12, false, false)">

0 commit comments

Comments
 (0)