Compare commits

...

7 Commits
0.6.4 ... 0.6.5

Author SHA1 Message Date
Book Pauk
d69e534f8b Merge branch 'release/0.6.5' 2019-03-25 14:04:43 +07:00
Book Pauk
1de9ddd394 Версия 0.6.5 2019-03-25 14:04:16 +07:00
Book Pauk
77c68d4e11 Небольшие поправки 2019-03-25 14:03:50 +07:00
Book Pauk
2a0d1dcfce Поправка бага 2019-03-25 13:06:48 +07:00
Book Pauk
5a19cca407 Поправка текста 2019-03-25 12:53:50 +07:00
Book Pauk
4e8773ecde Мелкая поправка 2019-03-25 12:51:01 +07:00
Book Pauk
4c7dada809 Merge tag '0.6.4' into develop
0.6.4
2019-03-24 14:33:19 +07:00
5 changed files with 32 additions and 21 deletions

View File

@@ -4,7 +4,8 @@
<ul>
<li>загрузка любой страницы интернета</li>
<li>изменение цвета фона, текста, размер и тип шрифта и прочее</li>
<li>установка и запоминание текущей позиции и настроек в браузере (в будущем планируется сохранение и на сервер)</li>
<li>установка и запоминание текущей позиции и настроек в браузере и на сервере</li>
<li>синхронизация данных (настроек и читаемых книг) между различными устройствами</li>
<li>кэширование файлов книг на клиенте и на сервере</li>
<li>открытие книг с локального диска</li>
<li>плавный скроллинг текста</li>

View File

@@ -37,6 +37,7 @@ export default @Component({
class ServerStorage extends Vue {
created() {
this.inited = false;
this.keyInited = false;
this.commit = this.$store.commit;
this.prevServerStorageKey = null;
this.$root.$on('generateNewServerStorageKey', () => {this.generateNewServerStorageKey()});
@@ -88,6 +89,7 @@ class ServerStorage extends Vue {
if (this.prevServerStorageKey != this.serverStorageKey) {
this.prevServerStorageKey = this.serverStorageKey;
this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey));
this.keyInited = true;
await this.loadProfiles(force);
this.checkCurrentProfile();
@@ -163,7 +165,7 @@ class ServerStorage extends Vue {
}
async loadSettings(force) {
if (!this.serverSyncEnabled || !this.currentProfile)
if (!this.keyInited || !this.serverSyncEnabled || !this.currentProfile)
return;
const setsId = `settings-${this.currentProfile}`;
@@ -206,7 +208,7 @@ class ServerStorage extends Vue {
}
async saveSettings() {
if (!this.serverSyncEnabled || !this.currentProfile || this.savingSettings)
if (!this.keyInited || !this.serverSyncEnabled || !this.currentProfile || this.savingSettings)
return;
const diff = utils.getObjDiff(this.oldSettings, this.settings);
@@ -252,7 +254,7 @@ class ServerStorage extends Vue {
}
async loadProfiles(force) {
if (!this.serverSyncEnabled)
if (!this.keyInited || !this.serverSyncEnabled)
return;
const oldRev = this.profilesRev;
@@ -294,7 +296,7 @@ class ServerStorage extends Vue {
}
async saveProfiles() {
if (!this.serverSyncEnabled || this.savingProfiles)
if (!this.keyInited || !this.serverSyncEnabled || this.savingProfiles)
return;
const diff = utils.getObjDiff(this.oldProfiles, this.profiles);
@@ -346,7 +348,7 @@ class ServerStorage extends Vue {
}
async loadRecent(force) {
if (!this.serverSyncEnabled)
if (!this.keyInited || !this.serverSyncEnabled)
return;
const oldRev = bookManager.recentRev;
@@ -416,7 +418,7 @@ class ServerStorage extends Vue {
}
async saveRecent() {
if (!this.serverSyncEnabled || this.savingRecent)
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
return;
const bm = bookManager;
@@ -462,7 +464,7 @@ class ServerStorage extends Vue {
}
async saveRecentLast(force = false) {
if (!this.serverSyncEnabled || this.savingRecentLast)
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecentLast)
return;
const bm = bookManager;

View File

@@ -452,7 +452,7 @@
</el-tab-pane>
<!-- Сброс ------------------------------------------------------------------------->
<el-tab-pane label="Сброс">
<el-button @click="setDefaults">Установить по-умолчанию</el-button>
<el-button @click="setDefaults">Установить по умолчанию</el-button>
</el-tab-pane>
</el-tabs>

View File

@@ -79,19 +79,22 @@ class BookManager {
}
}
let key = null;
len = await bmRecentStore.length();
for (let i = 0; i < len; i++) {
key = await bmRecentStore.key(i);
if (key) {
let r = await bmRecentStore.getItem(key);
if (_.isObject(r) && r.key) {
this.recent[r.key] = r;
//"ленивая" загрузка
(async() => {
let key = null;
len = await bmRecentStore.length();
for (let i = 0; i < len; i++) {
key = await bmRecentStore.key(i);
if (key) {
let r = await bmRecentStore.getItem(key);
if (_.isObject(r) && r.key) {
this.recent[r.key] = r;
}
} else {
await bmRecentStore.removeItem(key);
}
} else {
await bmRecentStore.removeItem(key);
}
}
})();
//размножение для дебага
/*if (key) {
@@ -410,6 +413,11 @@ class BookManager {
this.recentLast = value;
await bmCacheStore.setItem('recent-last', this.recentLast);
if (value && value.key) {
//гарантия переключения книги
const mostRecent = this.mostRecentBook();
if (mostRecent)
this.recent[mostRecent.key].touchTime = value.touchTime - 1;
this.recent[value.key] = value;
await bmRecentStore.setItem(value.key, value);
await bmCacheStore.setItem('recent', this.recent);

View File

@@ -1,6 +1,6 @@
{
"name": "Liberama",
"version": "0.6.4",
"version": "0.6.5",
"engines": {
"node": ">=10.0.0"
},