Skip to content

Commit

Permalink
updated package dependencies, fixed linting errors, fix for issue #21
Browse files Browse the repository at this point in the history
…and #23
  • Loading branch information
MisterZurk0n committed Apr 28, 2023
1 parent 2e130c8 commit eb8d95f
Show file tree
Hide file tree
Showing 7 changed files with 11,354 additions and 20,671 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
},
rules: {
'vue/v-on-style': 'off',
Expand Down
31,978 changes: 11,325 additions & 20,653 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
},
"dependencies": {
"@babel/polyfill": "^7.11.5",
"bootstrap": "^5.1.3",
"bootstrap-vue": "^2.21.2",
"bootstrap": "^4.6.1",
"bootstrap-vue": "^2.23.0",
"core-js": "^3.20.2",
"mutationobserver-shim": "^0.3.7",
"ssri": "^8.0.1",
"vue": "^2.6.14"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.15",
"@vue/cli-plugin-eslint": "~4.5.15",
"@vue/cli-service": "^4.5.15",
"@babel/eslint-parser": "^7.21.3",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"@vue/eslint-config-airbnb": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^8.6.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-vue": "^8.2.0",
Expand Down
12 changes: 6 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export default {
// Give Warning instead of CMIF Creator when Internet Explorer is detected
mounted() {
if (
navigator.userAgent.match(new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})'))
navigator.userAgent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/)
|| navigator.userAgent.match(/Trident.*rv\:11\./)
) {
this.isInternetExplorer = true;
Expand All @@ -423,23 +423,23 @@ export default {
let rp = new RegExp();
switch (target) {
case 'url': {
rp = new RegExp(/^http(s)?\:\/\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?/gi);
rp = /^http(s)?\:\/\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?/gi;
return rp.test(string);
}
case 'email': {
rp = new RegExp(/^[a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/);
rp = /^[a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
return rp.test(string);
}
case 'person': {
rp = new RegExp(/^(http(s)?\:\/\/correspSearch\.net\/unknown?)|^(http(s)?\:\/\/d\-nb\.info\/gnd\/?)|^(http(s)?\:\/\/viaf\.org\/viaf\/?)|^(http(s)?\:\/\/catalogue\.bnf\.fr\/?)|^(http(s)?\:\/\/lccn\.loc\.gov\/?)|^(http(s)?\:\/\/correspSearch\.net\/?)/g);
rp = /^(http(s)?\:\/\/correspSearch\.net\/unknown?)|^(http(s)?\:\/\/d\-nb\.info\/gnd\/?)|^(http(s)?\:\/\/viaf\.org\/viaf\/?)|^(http(s)?\:\/\/catalogue\.bnf\.fr\/?)|^(http(s)?\:\/\/lccn\.loc\.gov\/?)|^(http(s)?\:\/\/correspSearch\.net\/?)/g;
return rp.test(string);
}
case 'place': {
rp = new RegExp(/^http\:\/\/www\.geonames\.org\/?/g);
rp = /^http(s)?\:\/\/www\.geonames\.org\/?/g;
return rp.test(string);
}
case 'date': {
rp = new RegExp(/^(([0-2][0-9][0-9][0-9])$)|^(([0-2][0-9][0-9][0-9])\-([0][1-9]|[1][0-2])$)|^(([0-2][0-9][0-9][0-9])\-([0][1-9]|[1][0-2])\-([0-9][1-9]|[1-2][0-9]|[3][0-1])$)/g);
rp = /^(([0-2][0-9][0-9][0-9])$)|^(([0-2][0-9][0-9][0-9])\-([0][1-9]|[1][0-2])$)|^(([0-2][0-9][0-9][0-9])\-([0][1-9]|[1][0-2])\-([0-9][1-9]|[1-2][0-9]|[3][0-1])$)/g;
let result = rp.test(string);
const date = string.split('-');
if (date[1] !== undefined && date[2] !== undefined) {
Expand Down
4 changes: 4 additions & 0 deletions src/components/correspDesc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.
button
v-on:mousedown="select(tpe, item.id, key)"
v-on:mouseenter="s.highlighted = suKey"
v-on:focus="s.highlighted = suKey"
>
{{ suggestion }}
</BListGroupItem>
Expand Down Expand Up @@ -352,6 +353,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.
button
v-on:mousedown="selectGnd(tpe, item.id, key, suggestion)"
v-on:mouseenter="item[tpe].persName[key].gnd.highlighted = kee"
v-on:focus="item[tpe].persName[key].gnd.highlighted = kee"
>
{{ suggestion.label }}
</BListGroupItem>
Expand Down Expand Up @@ -461,6 +463,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.
v-bind:class="{'highlighted': suKey === place.highlighted}"
v-on:mousedown="select(tpe, item.id, key, true)"
v-on:mouseenter="place.highlighted = suKey"
v-on:focus="place.highlighted = suKey"
>
{{ suggestion }}
</BListGroupItem>
Expand Down Expand Up @@ -524,6 +527,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.
v-bind:class="{'highlighted': suKey === place.geo.highlighted}"
v-on:mousedown="selectGeoname(tpe, item.id, key, suggestion)"
v-on:mouseenter="place.geo.highlighted = suKey"
v-on:focus="place.geo.highlighted = suKey"
>
{{ suggestion.name }}, {{ suggestion.adminName1 }} ({{ suggestion.countryCode }})
</BListGroupItem>
Expand Down
3 changes: 2 additions & 1 deletion src/components/save.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.

<script>
export default {
/* eslint-disable-next-line */
name: 'Save',
props: {
labels: {
Expand Down Expand Up @@ -707,7 +708,7 @@ export default {
json = this.clear(json);
if (this.metaFails.length === 0 && this.biblFails.length === 0 && this.correspDescFails.length === 0) {
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://correspSearch.net/api/v1.1/converter/json2xml.xql', true);
xhr.open('POST', 'https://correspsearch.net/api/v1.2/converter/json2xml.xql', true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = () => {
if (xhr.status === 200) {
Expand Down
14 changes: 10 additions & 4 deletions src/components/start.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ along with CMIF Creator. If not, see <http://www.gnu.org/licenses/>.

<script>
export default {
/* eslint-disable-next-line */
name: 'Start',
props: {
labels: {
Expand Down Expand Up @@ -364,7 +365,7 @@ export default {
const fileExtension = this.file.name.split('.').pop();
if (fileExtension === 'xml') {
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://correspSearch.net/api/v1.1/converter/xml2json.xql', true);
xhr.open('POST', 'https://correspsearch.net/api/v1.2/converter/xml2json.xql', true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = () => {
if (xhr.status === 200) {
Expand Down Expand Up @@ -1178,10 +1179,15 @@ export default {
// Get id from uuid
getRealBibId(uuid) {
let result = '';
for (let i = 0; i < this.$parent.biblData.length; i += 1) {
result = (this.$parent.biblData[i].uuid === uuid) ? i : 0;
break;
// for (let i = 0; i < this.$parent.biblData.length; i += 1) {
// result = (this.$parent.biblData[i].uuid === uuid) ? i : 0;
// break;
// }
result = this.$parent.biblData.findIndex((element) => element.uuid === uuid);
if (result === -1) {
result = 0;
}
console.log('result', result);
return result;
},
},
Expand Down

0 comments on commit eb8d95f

Please sign in to comment.