working v2
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
Vue: 'readonly',
|
Vue: 'readonly',
|
||||||
LZString: 'readonly',
|
Papa: 'readonly',
|
||||||
},
|
},
|
||||||
extends: [ 'eslint:recommended' ],
|
extends: [ 'eslint:recommended' ],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Memory Helper v2
|
||||||
|
|
||||||
|
# Samples:
|
||||||
|
|
||||||
|
* [French Departments](https://klemek.github.io/memory-helper-v2/?url=https%3A%2F%2Fklemek.github.io%2Fmemory-helper-v2%2Fsamples%2Ffrench_departments.csv&title=Départements+Français)
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
[ ] readme
|
||||||
|
[ ] handle images
|
||||||
|
[ ] save modes
|
||||||
|
[ ] remove empty values from available data
|
||||||
+34
-33
@@ -2,16 +2,16 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Memory Helper</title>
|
<title>Memory Helper v2</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<script type="text/javascript" src="libs/vue.global.js"></script>
|
<script type="text/javascript" src="libs/vue.global.js"></script>
|
||||||
<script type="text/javascript" src="libs/lz-string.min.js"></script>
|
<script type="text/javascript" src="libs/papaparse.min.js"></script>
|
||||||
<script type="text/javascript" src="main.js"></script>
|
<script type="text/javascript" src="main.js"></script>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main id="app" style="display:none">
|
<main id="app" style="display:none">
|
||||||
<h1>Memory Helper</h1>
|
<h1>Memory Helper v2<small v-if="title"><br> {{ title }}</small></h1>
|
||||||
<div v-if="available.length > 0">
|
<div v-if="available.length > 0">
|
||||||
<div id='status'>Status : {{ doneDisplay }}/{{ availableDisplay }}</div>
|
<div id='status'>Status : {{ doneDisplay }}/{{ availableDisplay }}</div>
|
||||||
<div v-if="allDone">
|
<div v-if="allDone">
|
||||||
@@ -20,46 +20,47 @@
|
|||||||
<div type="button" class="button long" v-on:click="reset">Reset</div>
|
<div type="button" class="button long" v-on:click="reset">Reset</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else-if="currentItem">
|
||||||
<div class="main"><span id="question">{{question}}</span></div>
|
<div class="main"><span id="question">{{ columns[mode] }} : {{ currentItem[mode] }}</span></div>
|
||||||
<div class="main"><span id="answer">{{showAnswer ? answer : '???'}}</span></div>
|
<template v-if="showAnswer" v-for="(column, i) in columns">
|
||||||
|
<div v-if="i !== mode" class="main"><span id="answer">{{ column }} : {{ currentItem[i] }}</span></div>
|
||||||
|
</template>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<div type="button" class="button long" v-if="!showAnswer" v-on:click="show">Show</div>
|
<div type="button" class="button long" v-if="!showAnswer" v-on:click="show">Show</div>
|
||||||
<div type="button" class="button right" v-if="showAnswer" v-on:click="right">✔</div>
|
<div type="button" class="button right" v-if="showAnswer" v-on:click="right">✔</div>
|
||||||
<div type="button" class="button wrong" v-if="showAnswer" v-on:click="wrong">✘</div>
|
<div type="button" class="button wrong" v-if="showAnswer" v-on:click="wrong">✘</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<h3 v-if="error">{{ error }}</h3>
|
||||||
|
<h3 v-else>(Please provide data below)</h3>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h2 v-on:click="showConfig = !showConfig" class="expand">{{showConfig ? '▾' : '▸'}} List ({{ available.length }})</h2>
|
<h2 v-on:click="showConfig = !showConfig" class="expand">{{showConfig ? '▾' : '▸'}} Config</h2>
|
||||||
<table class="config" v-if="showConfig">
|
<div v-if="showConfig">
|
||||||
<tr>
|
<table class="config">
|
||||||
<td><input type="checkbox" v-model="q2a"/> Q → A</td>
|
<tr>
|
||||||
<td><input type="checkbox" v-model="a2q"/> A → Q</td>
|
<td><label for="title">Title:</label></td>
|
||||||
<td></td>
|
<td><input id="title" v-model.lazy="title" placeholder="change title"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="(row, i) in available">
|
<tr>
|
||||||
<td><input placeholder="question" v-bind:value="row[0]" v-on:change="row[0] = $event.target.value"></td>
|
<td><label for="url">URL (CSV data):</label></td>
|
||||||
<td><input placeholder="answer" v-bind:value="row[1]" v-on:change="row[1] = $event.target.value"></td>
|
<td><input id="url" v-model.lazy="url"></td>
|
||||||
<td><button v-on:click="deleteRow(i)">Delete</button></td>
|
</tr>
|
||||||
</tr>
|
</table>
|
||||||
<tr v-if="size < 2048">
|
<hr>
|
||||||
<td><input placeholder="question" v-bind:value="newRow[0]" v-on:change="newRow[0] = $event.target.value"></td>
|
<table class="config">
|
||||||
<td><input placeholder="answer" v-bind:value="newRow[1]" v-on:change="newRow[1] = $event.target.value"></td>
|
<tr v-for="(column, i) in columns">
|
||||||
<td><button v-on:click="addRow">Add</button></td>
|
<td colspan="2">
|
||||||
</tr>
|
<input type="checkbox" v-bind:checked="modes.indexOf(i) >= 0" v-on:click="(event) => change(i, event.target.checked)"/>
|
||||||
<tr>
|
<label>{{ column }}</label>
|
||||||
<td colspan="2">
|
</td>
|
||||||
<progress max="2048" v-bind:value="size"></progress>
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
<td>
|
</div>
|
||||||
{{ size }} / 2048
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<hr>
|
<hr>
|
||||||
<small><a href="https://twitter.com/_klemek" target="_blank">@Klemek</a> - <a href="https://github.com/Klemek/memory-helper" target="_blank">Github Repository</a> - {{currentYear}}</small>
|
<small><a href="https://twitter.com/_klemek" target="_blank">@Klemek</a> - <a href="https://github.com/Klemek/memory-helper" target="_blank">Github Repository</a> - {{currentYear}}</small>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else{if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);
|
|
||||||
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -4,25 +4,6 @@ const utils = {
|
|||||||
cloneObject: function (obj) {
|
cloneObject: function (obj) {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
},
|
},
|
||||||
serialize: function (list) {
|
|
||||||
return LZString.compressToEncodedURIComponent(list.map(v => v.join('|')).join('|'));
|
|
||||||
},
|
|
||||||
deserialize: function (rawData) {
|
|
||||||
const data = LZString.decompressFromBase64(rawData) ?? LZString.decompressFromEncodedURIComponent(rawData);
|
|
||||||
try {
|
|
||||||
return JSON.parse(data);
|
|
||||||
} catch {
|
|
||||||
let output = [];
|
|
||||||
data.split('|').forEach((v, i) => {
|
|
||||||
if (i % 2 === 0) {
|
|
||||||
output.push([ v, '' ]);
|
|
||||||
} else {
|
|
||||||
output[output.length - 1][1] = v;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
randint: function (min, max) {
|
randint: function (min, max) {
|
||||||
return Math.floor(Math.random() * (max - min)) + min;
|
return Math.floor(Math.random() * (max - min)) + min;
|
||||||
},
|
},
|
||||||
@@ -63,18 +44,19 @@ const utils = {
|
|||||||
let app = {
|
let app = {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
question: '',
|
|
||||||
answer: '',
|
|
||||||
showAnswer: false,
|
showAnswer: false,
|
||||||
available: [],
|
available: [],
|
||||||
current: {},
|
current: {},
|
||||||
failed: {},
|
failed: {},
|
||||||
done: {},
|
done: {},
|
||||||
newRow: [ '', '' ],
|
|
||||||
showConfig: true,
|
showConfig: true,
|
||||||
modes: [ 0 ],
|
modes: [ ],
|
||||||
size: 0,
|
size: 0,
|
||||||
mode: 0,
|
mode: 0,
|
||||||
|
title: '',
|
||||||
|
url: '',
|
||||||
|
error: '',
|
||||||
|
columns: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -83,40 +65,21 @@ let app = {
|
|||||||
},
|
},
|
||||||
doneDisplay() {
|
doneDisplay() {
|
||||||
return this.modes
|
return this.modes
|
||||||
.map(m => this.done[m].length)
|
.map(m => this.done[m]?.length ?? 0)
|
||||||
.reduce((a, b) => a + b, 0);
|
.reduce((a, b) => a + b, 0);
|
||||||
},
|
},
|
||||||
availableDisplay() {
|
availableDisplay() {
|
||||||
return this.modes.length * this.available.length;
|
return this.modes.length * this.available.length;
|
||||||
},
|
},
|
||||||
allDone() {
|
allDone() {
|
||||||
return this.modes.filter(m => this.current[m].length > 0).length === 0;
|
return this.modes.filter(m => (this.current[m]?.length ?? 0) > 0).length === 0;
|
||||||
},
|
},
|
||||||
q2a: {
|
currentItem() {
|
||||||
get() {
|
if (! this.current[this.mode]?.length) {
|
||||||
return this.modes.indexOf(0) >= 0;
|
return null;
|
||||||
},
|
}
|
||||||
set(newValue) {
|
|
||||||
if (!newValue && this.modes.length > 1) {
|
return this.current[this.mode][0];
|
||||||
this.modes.splice(this.modes.indexOf(0), 1);
|
|
||||||
} else if (!this.q2a) {
|
|
||||||
this.modes.push(0);
|
|
||||||
}
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
a2q: {
|
|
||||||
get() {
|
|
||||||
return this.modes.indexOf(1) >= 0;
|
|
||||||
},
|
|
||||||
set(newValue) {
|
|
||||||
if (!newValue && this.modes.length > 1) {
|
|
||||||
this.modes.splice(this.modes.indexOf(1), 1);
|
|
||||||
} else if (!this.a2q) {
|
|
||||||
this.modes.push(1);
|
|
||||||
}
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -134,22 +97,13 @@ let app = {
|
|||||||
this.failed[this.mode].push(this.current[this.mode].shift());
|
this.failed[this.mode].push(this.current[this.mode].shift());
|
||||||
this.nextQuestion();
|
this.nextQuestion();
|
||||||
},
|
},
|
||||||
deleteRow(i) {
|
|
||||||
this.available.splice(i, 1);
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
addRow() {
|
|
||||||
if (this.newRow[0] && this.newRow[1]) {
|
|
||||||
this.available.push(utils.cloneObject(this.newRow));
|
|
||||||
this.newRow = [ '', '' ];
|
|
||||||
}
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
reset() {
|
reset() {
|
||||||
this.current = Object.fromEntries(this.modes.map(m => [ m, utils.shuffle(utils.cloneObject(this.available)) ]));
|
this.current = Object.fromEntries(this.modes.map(m => [ m, utils.shuffle(utils.cloneObject(this.available)) ]));
|
||||||
this.done = Object.fromEntries(this.modes.map(m => [ m, [] ]));
|
this.done = Object.fromEntries(this.modes.map(m => [ m, [] ]));
|
||||||
this.failed = Object.fromEntries(this.modes.map(m => [ m, [] ]));
|
this.failed = Object.fromEntries(this.modes.map(m => [ m, [] ]));
|
||||||
this.nextQuestion();
|
if (this.modes.length) {
|
||||||
|
this.nextQuestion();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
nextQuestion() {
|
nextQuestion() {
|
||||||
this.showAnswer = false;
|
this.showAnswer = false;
|
||||||
@@ -169,49 +123,55 @@ let app = {
|
|||||||
} while (this.current[newMode].length === 0 && tries < 100);
|
} while (this.current[newMode].length === 0 && tries < 100);
|
||||||
|
|
||||||
this.mode = newMode;
|
this.mode = newMode;
|
||||||
|
},
|
||||||
if (this.current[this.mode].length > 0) {
|
change(n, value) {
|
||||||
this.question = this.current[this.mode][0][this.mode];
|
if (!value && this.modes.length > 1) {
|
||||||
this.answer = this.current[this.mode][0][1 - this.mode];
|
this.modes.splice(this.modes.indexOf(n), 1);
|
||||||
|
} else if (value && !utils.contains(this.modes, n)) {
|
||||||
|
this.modes.push(n);
|
||||||
|
}
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
dataComplete(results) {
|
||||||
|
if (results.errors.length) {
|
||||||
|
this.error = 'CSV file contains errors';
|
||||||
|
} else {
|
||||||
|
this.columns = results.data.shift();
|
||||||
|
this.modes = this.columns.map((_, i) => i);
|
||||||
|
this.available = results.data;
|
||||||
|
this.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getLetter() {
|
dataError() {
|
||||||
if (this.modes.length === 1 && this.modes[0] === 0) {
|
this.error = 'Could not read file';
|
||||||
return 'd';
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
async url(newValue) {
|
||||||
|
this.available = [];
|
||||||
|
this.error = '';
|
||||||
|
if (newValue) {
|
||||||
|
Papa.parse(newValue, {
|
||||||
|
download: true,
|
||||||
|
complete: this.dataComplete,
|
||||||
|
error: this.dataError,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (this.modes.length === 1 && this.modes[0] === 1) {
|
|
||||||
return 'e';
|
|
||||||
}
|
|
||||||
return 'f';
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
const url = new URL(window.location);
|
const url = new URL(window.location);
|
||||||
if (url.searchParams.get('d') || url.searchParams.get('e') || url.searchParams.get('f')) {
|
this.url = url.searchParams.get('url') ?? '';
|
||||||
if (url.searchParams.get('d')) {
|
this.title = url.searchParams.get('title') ?? '';
|
||||||
this.modes = [ 0 ];
|
this.showConfig = !this.url;
|
||||||
} else if (url.searchParams.get('e')) {
|
|
||||||
this.modes = [ 1 ];
|
|
||||||
} else {
|
|
||||||
this.modes = [ 0, 1 ];
|
|
||||||
}
|
|
||||||
this.available = utils.deserialize(url.searchParams.get(this.getLetter()));
|
|
||||||
this.showConfig = false;
|
|
||||||
this.reset();
|
|
||||||
}
|
|
||||||
this.size = url.href.length;
|
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
const data = utils.serialize(this.available);
|
|
||||||
const url = new URL(window.location);
|
const url = new URL(window.location);
|
||||||
if (url.searchParams.get(this.getLetter()) !== data) {
|
if (url.searchParams.get('url') !== this.url || url.searchParams.get('title') !== this.title) {
|
||||||
url.searchParams.delete('d');
|
url.searchParams.set('url', this.url);
|
||||||
url.searchParams.delete('e');
|
url.searchParams.set('title', this.title);
|
||||||
url.searchParams.delete('f');
|
|
||||||
url.searchParams.set(this.getLetter(), data);
|
|
||||||
window.history.pushState({}, '', url);
|
window.history.pushState({}, '', url);
|
||||||
}
|
}
|
||||||
this.size = url.href.length;
|
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
setTimeout(this.showApp);
|
setTimeout(this.showApp);
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
N°,Nom,Chef lieu
|
||||||
|
01,Ain,Bourg-en-Bresse
|
||||||
|
02,Aisne,Laon
|
||||||
|
03,Allier,Moulins
|
||||||
|
04,Alpes-de-Haute-Provence,Digne-les-Bains
|
||||||
|
05,Hautes-Alpes,Gap
|
||||||
|
06,Alpes-Maritimes,Nice
|
||||||
|
07,Ardèche,Privas
|
||||||
|
08,Ardennes,Charleville-Mézières
|
||||||
|
09,Ariège,Foix
|
||||||
|
10,Aube,Troyes
|
||||||
|
11,Aude,Carcassonne
|
||||||
|
12,Aveyron,Rodez
|
||||||
|
13,Bouches-du-Rhône,Marseille
|
||||||
|
14,Calvados,Caen
|
||||||
|
15,Cantal,Aurillac
|
||||||
|
16,Charente,Angoulême
|
||||||
|
17,Charente-Maritime,La Rochelle
|
||||||
|
18,Cher,Bourges
|
||||||
|
19,Corrèze,Tulle
|
||||||
|
2A,Corse-du-Sud,Ajaccio
|
||||||
|
2B,Haute-Corse,Bastia
|
||||||
|
21,Côte-d'Or,Dijon
|
||||||
|
22,Côtes-d'Armor,Saint-Brieuc
|
||||||
|
23,Creuse,Guéret
|
||||||
|
24,Dordogne,Périgueux
|
||||||
|
25,Doubs,Besançon
|
||||||
|
26,Drôme,Valence
|
||||||
|
27,Eure,Évreux
|
||||||
|
28,Eure-et-Loir,Chartres
|
||||||
|
29,Finistère,Quimper
|
||||||
|
30,Gard,Nîmes
|
||||||
|
31,Haute-Garonne,Toulouse
|
||||||
|
32,Gers,Auch
|
||||||
|
33,Gironde,Bordeaux
|
||||||
|
34,Hérault,Montpellier
|
||||||
|
35,Ille-et-Vilaine,Rennes
|
||||||
|
36,Indre,Châteauroux
|
||||||
|
37,Indre-et-Loire,Tours
|
||||||
|
38,Isère,Grenoble
|
||||||
|
39,Jura,Lons-le-Saunier
|
||||||
|
40,Landes,Mont-de-Marsan
|
||||||
|
41,Loir-et-Cher,Blois
|
||||||
|
42,Loire,Saint-Étienne
|
||||||
|
43,Haute-Loire,Le Puy-en-Velay
|
||||||
|
44,Loire-Atlantique,Nantes
|
||||||
|
45,Loiret,Orléans
|
||||||
|
46,Lot,Cahors
|
||||||
|
47,Lot-et-Garonne,Agen
|
||||||
|
48,Lozère,Mende
|
||||||
|
49,Maine-et-Loire,Angers
|
||||||
|
50,Manche,Saint-Lô
|
||||||
|
51,Marne,Châlons-en-Champagne
|
||||||
|
52,Haute-Marne,Chaumont
|
||||||
|
53,Mayenne,Laval
|
||||||
|
54,Meurthe-et-Moselle,Nancy
|
||||||
|
55,Meuse,Bar-le-Duc
|
||||||
|
56,Morbihan,Vannes
|
||||||
|
57,Moselle,Metz
|
||||||
|
58,Nièvre,Nevers
|
||||||
|
59,Nord,Lille
|
||||||
|
60,Oise,Beauvais
|
||||||
|
61,Orne,Alençon
|
||||||
|
62,Pas-de-Calais,Arras
|
||||||
|
63,Puy-de-Dôme,Clermont-Ferrand
|
||||||
|
64,Pyrénées-Atlantiques,Pau
|
||||||
|
65,Hautes-Pyrénées,Tarbes
|
||||||
|
66,Pyrénées-Orientales,Perpignan
|
||||||
|
67,Bas-Rhin,Strasbourg
|
||||||
|
68,Haut-Rhin,Colmar
|
||||||
|
69,Rhône,Lyon
|
||||||
|
70,Haute-Saône,Vesoul
|
||||||
|
71,Saône-et-Loire,Mâcon
|
||||||
|
72,Sarthe,Le Mans
|
||||||
|
73,Savoie,Chambéry
|
||||||
|
74,Haute-Savoie,Annecy
|
||||||
|
75,Paris,Paris
|
||||||
|
76,Seine-Maritime,Rouen
|
||||||
|
77,Seine-et-Marne,Melun
|
||||||
|
78,Yvelines,Versailles
|
||||||
|
79,Deux-Sèvres,Niort
|
||||||
|
80,Somme,Amiens
|
||||||
|
81,Tarn,Albi
|
||||||
|
82,Tarn-et-Garonne,Montauban
|
||||||
|
83,Var,Toulon
|
||||||
|
84,Vaucluse,Avignon
|
||||||
|
85,Vendée,La Roche-sur-Yon
|
||||||
|
86,Vienne,Poitiers
|
||||||
|
87,Haute-Vienne,Limoges
|
||||||
|
88,Vosges,Épinal
|
||||||
|
89,Yonne,Auxerre
|
||||||
|
90,Territoire de Belfort,Belfort
|
||||||
|
91,Essonne,Évry-Courcouronnes
|
||||||
|
92,Hauts-de-Seine,Nanterre
|
||||||
|
93,Seine-Saint-Denis,Bobigny
|
||||||
|
94,Val-de-Marne,Créteil
|
||||||
|
95,Val-d'Oise,Pontoise
|
||||||
|
971,Guadeloupe,Basse-Terre
|
||||||
|
972,Martinique,Fort-de-France
|
||||||
|
973,Guyane,Cayenne
|
||||||
|
974,La Réunion,Saint-Denis
|
||||||
|
976,Mayotte,Dzaoudzi
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user