Skip to content

Commit 2a3796e

Browse files
committed
New: Show in first/last page buttons if has next/prev comic and go to next/prev comics scrolling
1 parent 30df2fc commit 2a3796e

File tree

12 files changed

+306
-143
lines changed

12 files changed

+306
-143
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1010

1111
- Open file location in context menu [`339bcc0`](https://github.com/ollm/OpenComic/commit/339bcc0b21eab52228b7762c92c993d06489aa48)
1212
- Option in the context menu to add and remove posters using local artwork assets [`e8a1745`](https://github.com/ollm/OpenComic/commit/e8a1745904cd563336e1e27c02841a33e9cdc536)
13-
- Show image in its original size
13+
- Show image in its original size [`30df2fc`](https://github.com/ollm/OpenComic/commit/30df2fc70dbaefecfe1942bc8032686e083e7d53)
14+
- Show in first/last page buttons if has next/prev comic and go to next/prev comics scrolling
1415

1516
##### 🐛 Bug Fixes
1617

languages/ca.json

+2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@
4949
"emptyFolder": "No hi ha cap arxiu compatible en aquesta carpeta."
5050
},
5151
"reading": {
52+
"prevChapter": "Capítol anterior",
5253
"firstPage": "Primera pàgina",
5354
"previous": "Anterior",
5455
"next": "Següent",
5556
"lastPage": "Última pàgina",
57+
"nextChapter": "Següent capítol",
5658
"pages": {
5759
"main": "Pàgines",
5860
"pageLayout": "Maquetació de les pàgines",

languages/en.json

+2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@
4949
"emptyFolder": "There is no compatible file in this folder."
5050
},
5151
"reading": {
52+
"prevChapter": "Previous chapter",
5253
"firstPage": "First page",
5354
"previous": "Previous",
5455
"next": "Next",
5556
"lastPage": "Last page",
57+
"nextChapter": "Next chapter",
5658
"pages": {
5759
"main": "Pages",
5860
"pageLayout": "Page layout",

languages/es.json

+2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@
4949
"emptyFolder": "No hay ningún archivo compatible en esta carpeta."
5050
},
5151
"reading": {
52+
"prevChapter": "Capítulo anterior",
5253
"firstPage": "Primera página",
5354
"previous": "Anterior",
5455
"next": "Siguiente",
5556
"lastPage": "Última página",
57+
"nextChapter": "Siguiente capítulo",
5658
"pages": {
5759
"main": "Páginas",
5860
"pageLayout": "Maquetación de las páginas",

package-lock.json

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opencomic",
33
"productName": "OpenComic",
4-
"version": "1.0.0-beta.2",
4+
"version": "1.0.0-beta.3",
55
"main": "scripts/main.js",
66
"type": "commonjs",
77
"keywords": [
@@ -59,7 +59,6 @@
5959
"dependencies": {
6060
"@electron/remote": "^2.0.11",
6161
"7zip-bin": "^5.2.0",
62-
"animejs": "^3.2.1",
6362
"electron-json-storage": "^4.6.0",
6463
"electron-window-state": "^5.0.3",
6564
"fs": "0.0.1-security",
@@ -69,6 +68,7 @@
6968
"jimp": "^0.22.10",
7069
"jquery": "^3.7.0",
7170
"jquery-bez": "^1.0.11",
71+
"lodash.isequal": "^4.5.0",
7272
"mime": "^3.0.0",
7373
"mv": "^2.1.1",
7474
"node-7z": "^3.0.0",
@@ -82,7 +82,7 @@
8282
},
8383
"devDependencies": {
8484
"@electron/rebuild": "^3.2.13",
85-
"electron": "^27.0.0-alpha.5",
85+
"electron": "^27.0.0-alpha.6",
8686
"electron-builder": "^24.6.3",
8787
"node-abi": "^3.46.0",
8888
"nodemon": "^3.0.1"

scripts/dom.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,8 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
11851185
template.loadHeader('reading.header.html', true);
11861186
headerPath(path, mainPath);
11871187

1188+
let now = Date.now();
1189+
11881190
let startImage = false;
11891191
let imagePath = path;
11901192
let indexStart = 1;
@@ -1300,9 +1302,19 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
13001302
headerPath(path, mainPath);
13011303
reading.setCurrentComics(comics);
13021304

1303-
template.loadContentLeft('reading.content.left.html', true);
1304-
template.loadContentRight('reading.content.right.html', true);
1305-
template.loadHeader('reading.header.html', true);
1305+
if(Date.now() - now < 300)
1306+
{
1307+
template._contentLeft().firstElementChild.innerHTML = template.load('reading.content.left.html');
1308+
template._contentRight().firstElementChild.innerHTML = template.load('reading.content.right.html');
1309+
template._barHeader().firstElementChild.innerHTML = template.load('reading.header.html');
1310+
}
1311+
else
1312+
{
1313+
template.loadContentLeft('reading.content.left.html', true);
1314+
template.loadContentRight('reading.content.right.html', true);
1315+
template.loadHeader('reading.header.html', true);
1316+
}
1317+
13061318
if(template.globalElement('.reading-elements-menus').length == 0) template.loadGlobalElement('reading.elements.menus.html', 'menus');
13071319

13081320
floatingActionButton(false);

scripts/opencomic.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const electron = require('electron'),
6868
mime = require('mime'),
6969
sha1 = require('sha1'),
7070
p = require('path'),
71-
anime = require('animejs'),
71+
isEqual = require('lodash.isequal'),
7272
$ = require('jquery');
7373

7474
require('jquery-bez');
@@ -556,11 +556,11 @@ function generateAppMenu(force = false)
556556
{
557557
label: language.menu.goto.main,
558558
submenu: [
559-
{label: language.reading.firstPage, enabled: onReading, click: function(){reading.goStart();}, accelerator: 'Home'},
560-
{label: language.reading.previous, enabled: onReading, click: function(){reading.goPrevious();}, accelerator: 'Backspace'},
561-
{label: language.reading.next, enabled: onReading, click: function(){reading.goNext();}, accelerator: 'Space'},
562-
{label: language.reading.lastPage, enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'End'},
563-
{label: 'Next chapter', enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'Ctrl+End'},
559+
{label: language.reading.firstPage, enabled: onReading, click: function(){reading.goStart();}},
560+
{label: language.reading.previous, enabled: onReading, click: function(){reading.goPrevious();}},
561+
{label: language.reading.next, enabled: onReading, click: function(){reading.goNext();}},
562+
{label: language.reading.lastPage, enabled: onReading, click: function(){reading.goEnd();}},
563+
// {label: 'Next chapter', enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'Ctrl+End'},
564564
]
565565
},
566566
{

0 commit comments

Comments
 (0)