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> <ul>
<li>загрузка любой страницы интернета</li> <li>загрузка любой страницы интернета</li>
<li>изменение цвета фона, текста, размер и тип шрифта и прочее</li> <li>изменение цвета фона, текста, размер и тип шрифта и прочее</li>
<li>установка и запоминание текущей позиции и настроек в браузере (в будущем планируется сохранение и на сервер)</li> <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 { class ServerStorage extends Vue {
created() { created() {
this.inited = false; this.inited = false;
this.keyInited = false;
this.commit = this.$store.commit; this.commit = this.$store.commit;
this.prevServerStorageKey = null; this.prevServerStorageKey = null;
this.$root.$on('generateNewServerStorageKey', () => {this.generateNewServerStorageKey()}); this.$root.$on('generateNewServerStorageKey', () => {this.generateNewServerStorageKey()});
@@ -88,6 +89,7 @@ class ServerStorage extends Vue {
if (this.prevServerStorageKey != this.serverStorageKey) { if (this.prevServerStorageKey != this.serverStorageKey) {
this.prevServerStorageKey = this.serverStorageKey; this.prevServerStorageKey = this.serverStorageKey;
this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey)); this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey));
this.keyInited = true;
await this.loadProfiles(force); await this.loadProfiles(force);
this.checkCurrentProfile(); this.checkCurrentProfile();
@@ -163,7 +165,7 @@ class ServerStorage extends Vue {
} }
async loadSettings(force) { async loadSettings(force) {
if (!this.serverSyncEnabled || !this.currentProfile) if (!this.keyInited || !this.serverSyncEnabled || !this.currentProfile)
return; return;
const setsId = `settings-${this.currentProfile}`; const setsId = `settings-${this.currentProfile}`;
@@ -206,7 +208,7 @@ class ServerStorage extends Vue {
} }
async saveSettings() { async saveSettings() {
if (!this.serverSyncEnabled || !this.currentProfile || this.savingSettings) if (!this.keyInited || !this.serverSyncEnabled || !this.currentProfile || this.savingSettings)
return; return;
const diff = utils.getObjDiff(this.oldSettings, this.settings); const diff = utils.getObjDiff(this.oldSettings, this.settings);
@@ -252,7 +254,7 @@ class ServerStorage extends Vue {
} }
async loadProfiles(force) { async loadProfiles(force) {
if (!this.serverSyncEnabled) if (!this.keyInited || !this.serverSyncEnabled)
return; return;
const oldRev = this.profilesRev; const oldRev = this.profilesRev;
@@ -294,7 +296,7 @@ class ServerStorage extends Vue {
} }
async saveProfiles() { async saveProfiles() {
if (!this.serverSyncEnabled || this.savingProfiles) if (!this.keyInited || !this.serverSyncEnabled || this.savingProfiles)
return; return;
const diff = utils.getObjDiff(this.oldProfiles, this.profiles); const diff = utils.getObjDiff(this.oldProfiles, this.profiles);
@@ -346,7 +348,7 @@ class ServerStorage extends Vue {
} }
async loadRecent(force) { async loadRecent(force) {
if (!this.serverSyncEnabled) if (!this.keyInited || !this.serverSyncEnabled)
return; return;
const oldRev = bookManager.recentRev; const oldRev = bookManager.recentRev;
@@ -416,7 +418,7 @@ class ServerStorage extends Vue {
} }
async saveRecent() { async saveRecent() {
if (!this.serverSyncEnabled || this.savingRecent) if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
return; return;
const bm = bookManager; const bm = bookManager;
@@ -462,7 +464,7 @@ class ServerStorage extends Vue {
} }
async saveRecentLast(force = false) { async saveRecentLast(force = false) {
if (!this.serverSyncEnabled || this.savingRecentLast) if (!this.keyInited || !this.serverSyncEnabled || this.savingRecentLast)
return; return;
const bm = bookManager; const bm = bookManager;

View File

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

View File

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

View File

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