This commit is contained in:
Klemek
2023-08-29 16:44:25 +02:00
parent 233f4b1c3a
commit 3239a8293c
2 changed files with 130 additions and 129 deletions
+1
View File
@@ -6,6 +6,7 @@ module.exports = {
}, },
globals: { globals: {
Vue: 'readonly', Vue: 'readonly',
LZString: 'readonly',
}, },
extends: [ 'eslint:recommended' ], extends: [ 'eslint:recommended' ],
parserOptions: { parserOptions: {
+11 -11
View File
@@ -50,14 +50,14 @@ const utils = {
let app = { let app = {
data() { data() {
return { return {
question: "", question: '',
answer: "", answer: '',
showAnswer: false, showAnswer: false,
available: [], available: [],
current: [], current: [],
failed: [], failed: [],
done: [], done: [],
newRow: ["", ""], newRow: [ '', '' ],
showConfig: true, showConfig: true,
}; };
}, },
@@ -71,7 +71,7 @@ let app = {
}, },
methods: { methods: {
showApp() { showApp() {
document.getElementById("app").setAttribute("style", ""); document.getElementById('app').setAttribute('style', '');
}, },
show() { show() {
this.showAnswer = true; this.showAnswer = true;
@@ -93,7 +93,7 @@ let app = {
addRow() { addRow() {
if (this.newRow[0] && this.newRow[1]) { if (this.newRow[0] && this.newRow[1]) {
this.available.push(utils.cloneObject(this.newRow)); this.available.push(utils.cloneObject(this.newRow));
this.newRow = ["", ""]; this.newRow = [ '', '' ];
} }
this.reset(); this.reset();
}, },
@@ -119,8 +119,8 @@ let app = {
}, },
beforeMount() { beforeMount() {
const url = new URL(window.location); const url = new URL(window.location);
if (url.searchParams.get("d")) { if (url.searchParams.get('d')) {
this.available = utils.deserialize(url.searchParams.get("d")); this.available = utils.deserialize(url.searchParams.get('d'));
this.showConfig = false; this.showConfig = false;
this.reset(); this.reset();
} }
@@ -128,9 +128,9 @@ let app = {
updated() { updated() {
const data = utils.serialize(this.available); const data = utils.serialize(this.available);
const url = new URL(window.location); const url = new URL(window.location);
if (url.searchParams.get("d") !== data) { if (url.searchParams.get('d') !== data) {
url.searchParams.set("d", data); url.searchParams.set('d', data);
window.history.pushState({}, "", url); window.history.pushState({}, '', url);
} }
}, },
mounted: function () { mounted: function () {
@@ -140,5 +140,5 @@ let app = {
window.onload = () => { window.onload = () => {
app = Vue.createApp(app); app = Vue.createApp(app);
app.mount("#app"); app.mount('#app');
}; };