eslinted
This commit is contained in:
@@ -6,6 +6,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
Vue: 'readonly',
|
Vue: 'readonly',
|
||||||
|
LZString: 'readonly',
|
||||||
},
|
},
|
||||||
extends: [ 'eslint:recommended' ],
|
extends: [ 'eslint:recommended' ],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ const utils = {
|
|||||||
return output;
|
return output;
|
||||||
},
|
},
|
||||||
shuffle: function (array) {
|
shuffle: function (array) {
|
||||||
const output = [...array];
|
const output = [ ...array ];
|
||||||
if (output.length < 2) {
|
if (output.length < 2) {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < array.length; i++) {
|
for (let i = 0; i < array.length; i++) {
|
||||||
const i1 = this.randindex(array);
|
const i1 = this.randindex(array);
|
||||||
const i2 = this.randindex(array, i1);
|
const i2 = this.randindex(array, i1);
|
||||||
[output[i1], output[i2]] = [output[i2], output[i1]];
|
[ output[i1], output[i2] ] = [ output[i2], output[i1] ];
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
},
|
},
|
||||||
@@ -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');
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user