Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpauk committed Mar 25, 2024
2 parents 1370bae + 6977749 commit cafdb5b
Show file tree
Hide file tree
Showing 10 changed files with 4,831 additions and 4,009 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Options:

// Подключение себя, как клиента, к серверу обновлений
"bucServer": false

// Сcылка для открытия в новом окне брауpера по клику на кнопку "Сетевая библиотека"
// Если не задано, открывается внутренний менеджер библиотек с использванием фрейма
"networkLibraryLink": "http://samlib.ru/"
}
```

Expand Down
2 changes: 1 addition & 1 deletion client/api/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Misc {
async loadConfig() {

const query = {params: [
'name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'bucEnabled', 'branch',
'name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'bucEnabled', 'branch', 'networkLibraryLink',
]};

const config = await wsc.message(await wsc.send(Object.assign({action: 'get-config'}, query)));
Expand Down
6 changes: 6 additions & 0 deletions client/components/Reader/Reader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,11 @@ class Reader {
}
libsToogle() {
if (this.config.networkLibraryLink) {
window.open(this.config.networkLibraryLink, '_blank');
return;
}
this.libsActive = !this.libsActive;
if (this.libsActive) {
this.$refs.libsPage.init();//no await
Expand Down Expand Up @@ -1379,6 +1384,7 @@ class Reader {
found = (found ? _.cloneDeep(found) : found);
if (found) {
//если такой файл уже не загружен (path не совпадают)
if (wasOpened.sameBookKey != found.sameBookKey) {
//спрашиваем, надо ли объединить файлы
const askResult = bookManager.keysEqual(found.path, addedBook.path) ||
Expand Down
49 changes: 37 additions & 12 deletions client/components/Reader/RecentBooksPage/RecentBooksPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

<div
class="del-button self-end row justify-center items-center clickable"
@click="handleDel(item.key)"
@click="handleDel(item)"
>
<q-icon class="la la-times" size="12px" />
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">
Expand All @@ -212,7 +212,7 @@
<div
v-show="showArchive"
class="restore-button self-start row justify-center items-center clickable"
@click="handleRestore(item.key)"
@click="handleRestore(item)"
>
<q-icon class="la la-arrow-left" size="14px" />
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">
Expand Down Expand Up @@ -593,21 +593,46 @@ class RecentBooksPage {
}
}
async handleDel(key) {
if (!this.showArchive) {
await bookManager.delRecentBook({key});
this.$root.notify.info('Перенесено в архив');
async handleDel(item) {
if (item.group) {
const keys = [{key: item.key}];
for (const book of item.group)
keys.push({key: book.key});
if (!this.showArchive) {
await bookManager.delRecentBooks(keys);
this.$root.notify.info(`Группа книг (всего ${keys.length}) перенесена в архив`);
} else {
if (await this.$root.stdDialog.confirm(`Подтвердите удаление группы книг (всего ${keys.length}) из архива:`, ' ')) {
await bookManager.delRecentBooks(keys, 2);
this.$root.notify.info('Группа книг удалена безвозвратно');
}
}
} else {
if (await this.$root.stdDialog.confirm('Подтвердите удаление из архива:', ' ')) {
await bookManager.delRecentBook({key}, 2);
this.$root.notify.info('Удалено безвозвратно');
if (!this.showArchive) {
await bookManager.delRecentBooks([{key: item.key}]);
this.$root.notify.info('Книга перенесена в архив');
} else {
if (await this.$root.stdDialog.confirm('Подтвердите удаление книги из архива:', ' ')) {
await bookManager.delRecentBooks([{key: item.key}], 2);
this.$root.notify.info('Книга удалено безвозвратно');
}
}
}
}
async handleRestore(key) {
await bookManager.restoreRecentBook({key});
this.$root.notify.info('Восстановлено из архива');
async handleRestore(item) {
if (item.group) {
const keys = [{key: item.key}];
for (const book of item.group)
keys.push({key: book.key});
await bookManager.restoreRecentBooks(keys);
this.$root.notify.info(`Группа книг (всего ${keys.length}) восстановлена из архива`);
} else {
await bookManager.restoreRecentBooks([{key: item.key}]);
this.$root.notify.info('Книга восстановлена из архива');
}
}
async loadBook(item, force = false) {
Expand Down
26 changes: 25 additions & 1 deletion client/components/Reader/share/bookManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class BookManager {
async getRecentBook(value) {
return this.recent[value.key];
}

/*
async delRecentBook(value, delFlag = 1) {
const item = this.recent[value.key];
item.deleted = delFlag;
Expand All @@ -479,13 +479,37 @@ class BookManager {
await this.recentSetItem(item);
this.emit('recent-deleted', value.key);
}
*/
async delRecentBooks(values, delFlag = 1) {
for (const value of values) {
const item = this.recent[value.key];
item.deleted = delFlag;

if (this.recentLastKey == value.key) {
await this.recentSetLastKey(null);
}

await this.recentSetItem(item);
}

this.emit('recent-deleted');
}
/*
async restoreRecentBook(value) {
const item = this.recent[value.key];
item.deleted = 0;
await this.recentSetItem(item);
}
*/
async restoreRecentBooks(values) {
for (const value of values) {
const item = this.recent[value.key];
item.deleted = 0;

await this.recentSetItem(item);
}
}

async setCheckBuc(value, checkBuc) {
const item = this.recent[value.key];
Expand Down
14 changes: 14 additions & 0 deletions client/components/Reader/versionHistory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
export const versionHistory = [
{
version: '1.2.0',
releaseDate: '2024-03-25',
showUntil: '2024-03-24',
content:
`
<ul>
<li>в списке загруженных, книга в архив (из архива) переносится теперь со всей группой своих версий</li>
<li>добавлена возможность задавать в конфиге любую ссылку для кнопки "Сетевая библиотека", параматр networkLibraryLink (#47)</li>
</ul>
`
},

{
version: '1.1.3',
releaseDate: '2023-02-06',
Expand Down
Loading

0 comments on commit cafdb5b

Please sign in to comment.