Add option for set default archival method

This commit is contained in:
Radhi Fadlillah 2019-06-11 13:24:12 +07:00
parent 7bdebf3108
commit fde91e5edd
6 changed files with 20 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -107,12 +107,14 @@
var opts = JSON.parse(localStorage.getItem("shiori-setting")) || {},
showId = (typeof opts.showId === "boolean") ? opts.showId : false,
listMode = (typeof opts.listMode === "boolean") ? opts.listMode : false,
nightMode = (typeof opts.nightMode === "boolean") ? opts.nightMode : false;
nightMode = (typeof opts.nightMode === "boolean") ? opts.nightMode : false,
useArchive = (typeof opts.useArchive === "boolean") ? opts.useArchive : false;
this.displayOptions = {
showId: showId,
listMode: listMode,
nightMode: nightMode,
useArchive: useArchive,
};
}
},

View file

@ -7,6 +7,7 @@ export default {
showId: false,
listMode: false,
nightMode: false,
useArchive: false,
};
}
}

View file

@ -266,7 +266,8 @@ export default {
}, {
name: "createArchive",
label: "Create archive",
type: "check"
type: "check",
value: this.displayOptions.useArchive,
}],
mainText: "OK",
secondText: "Cancel",
@ -499,7 +500,8 @@ export default {
fields: [{
name: "createArchive",
label: "Update archive as well",
type: "check"
type: "check",
value: this.displayOptions.useArchive,
}],
mainText: "Yes",
secondText: "No",

View file

@ -16,6 +16,10 @@ var template = `
<input type="checkbox" v-model="displayOptions.nightMode" @change="saveSetting">
Use dark theme
</label>
<label>
<input type="checkbox" v-model="displayOptions.useArchive" @change="saveSetting">
Create archive by default
</label>
</details>
<details open class="setting-group" id="setting-accounts">
<summary>Accounts</summary>
@ -62,6 +66,7 @@ export default {
showId: this.displayOptions.showId,
listMode: this.displayOptions.listMode,
nightMode: this.displayOptions.nightMode,
useArchive: this.displayOptions.useArchive,
});
},
loadAccounts() {

View file

@ -584,10 +584,13 @@ body {
#setting-display {
display: flex;
flex-flow: column nowrap;
padding-bottom: 8px;
summary {
margin-bottom: 8px;
&[open] {
padding-bottom: 8px;
summary {
margin-bottom: 8px;
}
}
label {