1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Load resources in WebView and put todos on top

This commit is contained in:
Laurent Cozic
2017-07-26 19:36:16 +01:00
parent 76914d6c28
commit f80263ab71
10 changed files with 156 additions and 43 deletions

View File

@@ -42,20 +42,21 @@ class Setting extends BaseModel {
this.cancelScheduleSave();
this.cache_ = [];
return this.modelSelectAll('SELECT * FROM settings').then((rows) => {
this.cache_ = rows;
this.cache_ = [];
for (let i = 0; i < this.cache_.length; i++) {
let c = this.cache_[i];
// Old keys - can be removed later
const ignore = ['clientId', 'sync.onedrive.auth', 'syncInterval', 'todoOnTop', 'todosOnTop'];
if (c.key == 'clientId') continue; // For older clients
if (c.key == 'sync.onedrive.auth') continue; // For older clients
if (c.key == 'syncInterval') continue; // For older clients
for (let i = 0; i < rows.length; i++) {
let c = rows[i];
if (ignore.indexOf(c.key) >= 0) continue;
// console.info(c.key + ' = ' + c.value);
c.value = this.formatValue(c.key, c.value);
this.cache_[i] = c;
this.cache_.push(c);
}
const keys = this.keys();
@@ -303,6 +304,7 @@ Setting.metadata_ = {
recent: _('Non-completed and recently completed ones'),
nonCompleted: _('Non-completed ones only'),
})},
'uncompletedTodosOnTop': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Show uncompleted todos on top of the lists') },
'trackLocation': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Save location with notes') },
'sync.interval': { value: 300, type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation interval'), options: () => {
return {