Skip to content

Commit 386a4f5

Browse files
committed
New: Setting to set the number of items in recent
1 parent 1c9cfc4 commit 386a4f5

22 files changed

+58
-22
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2727
- Show library, favorites, labels, etc in header path [`123cd2c`](https://github.com/ollm/OpenComic/commit/123cd2cfc15956a2c8bed4531c6448774a6d3c71)
2828
- Continue reading and Recently added section in library, favorites, labels, etc [`6938f19`](https://github.com/ollm/OpenComic/commit/6938f199fab46aee0fa454effecd3238038daac0)
2929
- Sound effect on page turn [`d9957da`](https://github.com/ollm/OpenComic/commit/d9957da8c3266127802a03812f158f06e831dffd)
30+
- Setting to set the number of items in recent
3031

3132
##### 🐛 Bug Fixes
3233

languages/ca.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Utilitzar la primera imatge com a pòster (Només si no n'hi ha cap actualment)",
256256
"showFullPathLibrary": "Mostrar la ruta completa a l'obrir els còmics de la biblioteca",
257257
"showFullPathOpened": "Mostrar la ruta completa a l'obrir un arxiu o carpeta",
258-
"showLibraryPath": "Mostra la biblioteca, favorits, etiquetes, etc a la ruta de la capçalera"
258+
"showLibraryPath": "Mostra la biblioteca, favorits, etiquetes, etc a la ruta de la capçalera",
259+
"recentlyOpenedItems": "Nombre d'elements a guardar a Obert recentment"
259260
},
260261
"startupBehavior": {
261262
"main": "Comportament d'inici",

languages/cs.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/de.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/empty.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Use the first image as a poster (Only if there is none currently)",
256256
"showFullPathLibrary": "Show full path when opening library comics",
257257
"showFullPathOpened": "Show full path when opening a file or folder",
258-
"showLibraryPath": "Show library, favorites, labels, etc in header path"
258+
"showLibraryPath": "Show library, favorites, labels, etc in header path",
259+
"recentlyOpenedItems": "Number of items to save in Recently opened"
259260
},
260261
"startupBehavior": {
261262
"main": "Startup behavior",

languages/es.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Utilizar la primera imagen como póster (Solo si no hay ninguno actualmente)",
256256
"showFullPathLibrary": "Mostrar la ruta completa al abrir los cómics de la biblioteca",
257257
"showFullPathOpened": "Mostrar la ruta completa al abrir un archivo o carpeta",
258-
"showLibraryPath": "Mostrar la biblioteca, favoritos, etiquetas, etc en la ruta del encabezado"
258+
"showLibraryPath": "Mostrar la biblioteca, favoritos, etiquetas, etc en la ruta del encabezado",
259+
"recentlyOpenedItems": "Número de elementos a guardar en Abierto recientemente"
259260
},
260261
"startupBehavior": {
261262
"main": "Comportamiento de inicio",

languages/fr.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Utiliser la première image comme affiche",
256256
"showFullPathLibrary": "Afficher le chemin complet de la bibliothèque",
257257
"showFullPathOpened": "Afficher le chemin complet ouvert",
258-
"showLibraryPath": "Afficher le chemin de la bibliothèque"
258+
"showLibraryPath": "Afficher le chemin de la bibliothèque",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/hu.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/it.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Usa prima immagine come poster (Solo se non c'è nessuna attualmente)",
256256
"showFullPathLibrary": "Mostra percorso intero quando apri la libreria dei fumetti",
257257
"showFullPathOpened": "Mostra percorso intero quando apri un file o una cartella",
258-
"showLibraryPath": "Mostra percorso libreria nella barra superiore"
258+
"showLibraryPath": "Mostra percorso libreria nella barra superiore",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "Comportamento all'avvio",

languages/ja.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/ko.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/pt-br.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/ru.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

languages/sv.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Använd den första bilden som affisch (endast om det inte redan finns någon)",
256256
"showFullPathLibrary": "Visa fullständig filväg när du öppnar serietidningar i biblioteket",
257257
"showFullPathOpened": "Visa fullständig filväg när en fil eller mapp öppnas",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "Startbeteende",

languages/th.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "ใช้ภาพแรกเป็นภาพปก (กรณีที่ที่อยู่ปัจจุบันไม่ม่)",
256256
"showFullPathLibrary": "แสดงที่ตั้งแบบเต็มเมื่อเปิดห้องสมุดคอมมิกส์",
257257
"showFullPathOpened": "แสดงที่ตั้งแบบเต็มเมื่อเปิดไฟล์หรือโฟลเดอร์",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "การกระทำเมื่อเริ่มต้น",

languages/vi.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "Dùng ảnh đầu tiên làm ảnh bìa (chỉ khi chưa cài đặt ảnh bìa)",
256256
"showFullPathLibrary": "Hiển thị đường dẫn đầy đủ khi mở truyện trong thư viện",
257257
"showFullPathOpened": "Hiển thị đường dẫn đầy đủ khi mở tệp tin hoặc thư mục",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "Tùy chọn khởi động",

languages/zh-hans.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "使用第一张图片作为海报(当前没有海报时)",
256256
"showFullPathLibrary": "打开库时显示漫画完整路径",
257257
"showFullPathOpened": "打开文件或文件夹时显示完整路径",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "启动行为",

languages/zh-hant.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"useTheFirstImageAsPoster": "",
256256
"showFullPathLibrary": "",
257257
"showFullPathOpened": "",
258-
"showLibraryPath": ""
258+
"showLibraryPath": "",
259+
"recentlyOpenedItems": ""
259260
},
260261
"startupBehavior": {
261262
"main": "",

scripts/recently-opened.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async function load(animation = true, content = false)
111111
});
112112
}
113113

114-
handlebarsContext.comics = comics;
114+
handlebarsContext.comics = comics.slice(0, config.recentlyOpenedItems);
115115
handlebarsContext.comicsReadingProgress = false;
116116
dom.setCurrentPageVars('recently-opened');
117117

@@ -155,7 +155,7 @@ function set(mainPath)
155155
recentlyOpenedA.push(recentlyOpened[path]);
156156
}
157157

158-
if(recentlyOpenedA.length > 100)
158+
if(recentlyOpenedA.length > config.recentlyOpenedItems)
159159
{
160160
recentlyOpenedA.sort(function(a, b) {
161161

@@ -166,7 +166,7 @@ function set(mainPath)
166166

167167
});
168168

169-
for(let i = 100, len = recentlyOpenedA.length; i < len; i++)
169+
for(let i = config.recentlyOpenedItems, len = recentlyOpenedA.length; i < len; i++)
170170
{
171171
delete recentlyOpened[recentlyOpenedA[i].path];
172172
}

scripts/storage.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var changes = 88; // Update this if readingPagesConfig is updated
1+
var changes = 89; // Update this if readingPagesConfig is updated
22

33
var readingPagesConfig = {
44
readingConfigName: '',
@@ -122,6 +122,7 @@ var storageDefault = {
122122
recentlyAdded: true,
123123
}
124124
},
125+
recentlyOpenedItems: 100,
125126
showFullPathLibrary: false,
126127
showFullPathOpened: false,
127128
showLibraryPath: true,

templates/settings.content.right.html

+16
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,22 @@ <h2 class="headline-small">{{language.settings.navigation.files}}</h2>
278278
</div>
279279
</div>
280280

281+
<h2 class="headline-small">{{language.global.recents}}</h2>
282+
283+
<div class="simple-slider gamepad-item" data-gamepad-left="events.rangeMoveStep(this, -1)" data-gamepad-right="events.rangeMoveStep(this, 1)" style="margin-top: 10px;">
284+
<div class="simple-slider-text">{{language.settings.navigation.recentlyOpenedItems}}<div><i class="material-icon slider-reset" onclick="events.resetRange(this)" data-default="100">undo</i><span>{{config.recentlyOpenedItems}}</span></div></div>
285+
<div class="range">
286+
<div class="range-position">
287+
<span class="range-line" style="width: 100%"></span>
288+
<span class="range-steps"></span>
289+
<div>
290+
<div class="range-point" position="100" style="left: 100%;"><div class="elevation-1"></div></div>
291+
</div>
292+
</div>
293+
<input type="range" max="200" min="0" step="1" value="{{config.recentlyOpenedItems}}" onrange="settings.set('recentlyOpenedItems', \{{value}})">
294+
</div>
295+
</div>
296+
281297
<h2 class="headline-small">{{language.settings.startupBehavior.main}}</h2>
282298

283299
<div class="menu-simple-text gamepad-item">

0 commit comments

Comments
 (0)