Skip to content

Commit

Permalink
New: Show in first/last page buttons if has next/prev comic and go to…
Browse files Browse the repository at this point in the history
… next/prev comics scrolling
  • Loading branch information
ollm committed Sep 8, 2023
1 parent 30df2fc commit 2a3796e
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 143 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

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

##### 🐛 Bug Fixes

Expand Down
2 changes: 2 additions & 0 deletions languages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
"emptyFolder": "No hi ha cap arxiu compatible en aquesta carpeta."
},
"reading": {
"prevChapter": "Capítol anterior",
"firstPage": "Primera pàgina",
"previous": "Anterior",
"next": "Següent",
"lastPage": "Última pàgina",
"nextChapter": "Següent capítol",
"pages": {
"main": "Pàgines",
"pageLayout": "Maquetació de les pàgines",
Expand Down
2 changes: 2 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
"emptyFolder": "There is no compatible file in this folder."
},
"reading": {
"prevChapter": "Previous chapter",
"firstPage": "First page",
"previous": "Previous",
"next": "Next",
"lastPage": "Last page",
"nextChapter": "Next chapter",
"pages": {
"main": "Pages",
"pageLayout": "Page layout",
Expand Down
2 changes: 2 additions & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
"emptyFolder": "No hay ningún archivo compatible en esta carpeta."
},
"reading": {
"prevChapter": "Capítulo anterior",
"firstPage": "Primera página",
"previous": "Anterior",
"next": "Siguiente",
"lastPage": "Última página",
"nextChapter": "Siguiente capítulo",
"pages": {
"main": "Páginas",
"pageLayout": "Maquetación de las páginas",
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencomic",
"productName": "OpenComic",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"main": "scripts/main.js",
"type": "commonjs",
"keywords": [
Expand Down Expand Up @@ -59,7 +59,6 @@
"dependencies": {
"@electron/remote": "^2.0.11",
"7zip-bin": "^5.2.0",
"animejs": "^3.2.1",
"electron-json-storage": "^4.6.0",
"electron-window-state": "^5.0.3",
"fs": "0.0.1-security",
Expand All @@ -69,6 +68,7 @@
"jimp": "^0.22.10",
"jquery": "^3.7.0",
"jquery-bez": "^1.0.11",
"lodash.isequal": "^4.5.0",
"mime": "^3.0.0",
"mv": "^2.1.1",
"node-7z": "^3.0.0",
Expand All @@ -82,7 +82,7 @@
},
"devDependencies": {
"@electron/rebuild": "^3.2.13",
"electron": "^27.0.0-alpha.5",
"electron": "^27.0.0-alpha.6",
"electron-builder": "^24.6.3",
"node-abi": "^3.46.0",
"nodemon": "^3.0.1"
Expand Down
18 changes: 15 additions & 3 deletions scripts/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
template.loadHeader('reading.header.html', true);
headerPath(path, mainPath);

let now = Date.now();

let startImage = false;
let imagePath = path;
let indexStart = 1;
Expand Down Expand Up @@ -1300,9 +1302,19 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
headerPath(path, mainPath);
reading.setCurrentComics(comics);

template.loadContentLeft('reading.content.left.html', true);
template.loadContentRight('reading.content.right.html', true);
template.loadHeader('reading.header.html', true);
if(Date.now() - now < 300)
{
template._contentLeft().firstElementChild.innerHTML = template.load('reading.content.left.html');
template._contentRight().firstElementChild.innerHTML = template.load('reading.content.right.html');
template._barHeader().firstElementChild.innerHTML = template.load('reading.header.html');
}
else
{
template.loadContentLeft('reading.content.left.html', true);
template.loadContentRight('reading.content.right.html', true);
template.loadHeader('reading.header.html', true);
}

if(template.globalElement('.reading-elements-menus').length == 0) template.loadGlobalElement('reading.elements.menus.html', 'menus');

floatingActionButton(false);
Expand Down
12 changes: 6 additions & 6 deletions scripts/opencomic.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const electron = require('electron'),
mime = require('mime'),
sha1 = require('sha1'),
p = require('path'),
anime = require('animejs'),
isEqual = require('lodash.isequal'),
$ = require('jquery');

require('jquery-bez');
Expand Down Expand Up @@ -556,11 +556,11 @@ function generateAppMenu(force = false)
{
label: language.menu.goto.main,
submenu: [
{label: language.reading.firstPage, enabled: onReading, click: function(){reading.goStart();}, accelerator: 'Home'},
{label: language.reading.previous, enabled: onReading, click: function(){reading.goPrevious();}, accelerator: 'Backspace'},
{label: language.reading.next, enabled: onReading, click: function(){reading.goNext();}, accelerator: 'Space'},
{label: language.reading.lastPage, enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'End'},
{label: 'Next chapter', enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'Ctrl+End'},
{label: language.reading.firstPage, enabled: onReading, click: function(){reading.goStart();}},
{label: language.reading.previous, enabled: onReading, click: function(){reading.goPrevious();}},
{label: language.reading.next, enabled: onReading, click: function(){reading.goNext();}},
{label: language.reading.lastPage, enabled: onReading, click: function(){reading.goEnd();}},
// {label: 'Next chapter', enabled: onReading, click: function(){reading.goEnd();}, accelerator: 'Ctrl+End'},
]
},
{
Expand Down
Loading

0 comments on commit 2a3796e

Please sign in to comment.