Skip to content

Commit

Permalink
New: Reload button in file list
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm committed Aug 23, 2023
1 parent 265dd4b commit 31675a5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.0-beta.1](https://github.com/ollm/OpenComic/releases/tag/v1.0.0-beta.1) (dd-mm-yyyy)
## v1.0.0-beta.2 (dd-mm-yyyy)

### 🚀 New Features

- Reload button in file list

### 🐛 Bug Fixes


## [v1.0.0-beta.1](https://github.com/ollm/OpenComic/releases/tag/v1.0.0-beta.1) (22-08-2023)

### 🚀 New Features

Expand Down
1 change: 1 addition & 0 deletions languages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"add": "Afegir",
"addToLibrary": "Afegir a la biblioteca",
"unsupportedFile": "L'arxiu no és compatible",
"reload": "Recarregar",
"language": "Idioma",
"settings": "Configuració",
"theme": "Tema",
Expand Down
1 change: 1 addition & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"add": "Add",
"addToLibrary": "Add to library",
"unsupportedFile": "The file is not supported",
"reload": "Reload",
"language": "Language",
"settings": "Settings",
"theme": "Theme",
Expand Down
1 change: 1 addition & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"add": "Añadir",
"addToLibrary": "Añadir a la biblioteca",
"unsupportedFile": "El archivo no es compatible",
"reload": "Recargar",
"language": "Idioma",
"settings": "Ajustes",
"theme": "Tema",
Expand Down
14 changes: 10 additions & 4 deletions scripts/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,11 @@ async function loadFilesIndexPage(file, animation, path, keepScroll, mainPath)

}

async function reloadIndex()
{
loadIndexPage(true, indexPathA, true, true, indexMainPathA);
}

var currentPath = false, currentPathScrollTop = [];

async function loadIndexPage(animation = true, path = false, content = false, keepScroll = false, mainPath = false, fromGoBack = false)
Expand Down Expand Up @@ -979,7 +984,7 @@ function indexPathControlGoBack()
if(goBack.isComic)
openComic(true, goBack.path, goBack.mainPath, false, true);
else
loadIndexPage(true, goBack.path, false, false, goBack.mainPath, true);
loadIndexPage(true, goBack.path, false, false, goBack.mainPath, true);


indexPathControlA.pop();
Expand All @@ -1003,15 +1008,15 @@ var barBackStatus = false;
// This needs to be improved more, if is from fromNextAndPrev, consider changing the previous route/path
function indexPathControl(path = false, mainPath = false, isComic = false, fromNextAndPrev = false)
{
indexPathA = path;
indexMainPathA = mainPath;

if(path === false || mainPath === false)
{
indexPathControlA = [];
}
else
{
indexPathA = path;
indexMainPathA = mainPath;

mainPathR = addSepToEnd(p.dirname(mainPath));

let files = path.replace(new RegExp('^\s*'+pregQuote(mainPathR)), '').split(p.sep);
Expand Down Expand Up @@ -1577,6 +1582,7 @@ gamepad.setButtonEvent('reading', 1, function(key, button) {

module.exports = {
loadIndexPage: loadIndexPage,
reloadIndex: reloadIndex,
loadLanguagesPage: loadLanguagesPage,
loadSettingsPage: loadSettingsPage,
loadThemePage: loadThemePage,
Expand Down
2 changes: 2 additions & 0 deletions templates/index.header.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
{{/if}}
</div>
<div class="bar-buttons-separator"></div>
<div class="material-icon button button2 hover-text" hover-text="{{language.global.reload}}" onclick="dom.reloadIndex();">refresh</div>
<div class="bar-buttons-separator"></div>
<div class="material-icon button button2 button-night-mode hover-text" hover-text="{{language.global.nightMode}}" onclick="dom.nightMode();">{{#if config.nightMode}}dark_mode{{else}}light_mode{{/if}}</div>
</div>
</div>

0 comments on commit 31675a5

Please sign in to comment.