Implement lint
This commit is contained in:
@@ -43,7 +43,7 @@ export default {
|
||||
|
||||
for(const [sType, aoElems] of Object.entries(aoElemTypes)) {
|
||||
this.elems[sType] = {};
|
||||
for(const [iKey, oElem] of Object.entries(aoElems)) {
|
||||
for(const oElem of Object.values(aoElems)) {
|
||||
oElem.type = sType;
|
||||
this.elems[sType][oElem.id] = oElem;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export default {
|
||||
this.api.post('admin_create', {type: sType})
|
||||
.then((aoNewElemTypes) => {
|
||||
for(const [sType, aoNewElems] of Object.entries(aoNewElemTypes)) {
|
||||
for(const [iKey, oNewElem] of Object.entries(aoNewElems)) {
|
||||
for(const oNewElem of Object.values(aoNewElems)) {
|
||||
oNewElem.type = sType;
|
||||
this.elems[sType][oNewElem.id] = oNewElem;
|
||||
this.addFeedback('success', this.l('admin.create_success'), {'create':sType});
|
||||
@@ -114,7 +114,7 @@ export default {
|
||||
.catch((oError) => {this.addFeedback('error', oError.desc_lang_text, {'update':'project'});});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div id="admin">
|
||||
@@ -134,7 +134,7 @@ export default {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="project in elems.project">
|
||||
<tr v-for="project in elems.project" :key="project.id">
|
||||
<td>{{ project.id }}</td>
|
||||
<td><AdminInput :type="'text'" :name="'name'" :elem="project" /></td>
|
||||
<td>{{ project.mode }}</td>
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="feed in elems.feed">
|
||||
<tr v-for="feed in elems.feed" :key="feed.id">
|
||||
<td>{{ feed.id }}</td>
|
||||
<td><AdminInput :type="'text'" :name="'ref_feed_id'" :elem="feed" /></td>
|
||||
<td><AdminInput :type="'number'" :name="'id_spot'" :elem="feed" /></td>
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="spot in elems.spot">
|
||||
<tr v-for="spot in elems.spot" :key="spot.id">
|
||||
<td>{{ spot.id }}</td>
|
||||
<td>{{ spot.ref_spot_id }}</td>
|
||||
<td>{{ spot.name }}</td>
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in elems.user">
|
||||
<tr v-for="user in elems.user" :key="user.id">
|
||||
<td>{{ user.id }}</td>
|
||||
<td class="left">{{ user.name }}</td>
|
||||
<td class="left">{{ user.email }}</td>
|
||||
@@ -228,7 +228,7 @@ export default {
|
||||
<AppButton :classes="'refresh'" :text="l('project.update_messages')" :icon="'refresh'" @click="updateProject" />
|
||||
</div>
|
||||
<div id="feedback" class="feedback">
|
||||
<p v-for="feedback in feedbacks" :class="feedback.type">{{ feedback.msg }}</p>
|
||||
<p v-for="(feedback, index) in feedbacks" :key="index" :class="feedback.type">{{ feedback.msg }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
return this.elem[this.name];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
iconClasses: String,
|
||||
iconSize: String
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<button :class="classes"><AppIcon :icon="icon" :text="text" :classes="iconClasses" :size="iconSize" /></button>
|
||||
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
return this.transform || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
].filter(Boolean).join(' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
positionFromTop: 0,
|
||||
resizeDuration: parseFloat(this.getStyleProperty('--trans-slow')),
|
||||
hasVideo: true,
|
||||
onMediaChange: async (oMedia) => {
|
||||
onMediaChange: async(oMedia) => {
|
||||
this.hash.items = [this.project.codename, 'media', oMedia.id];
|
||||
if(oMedia.set == 'post-medias') {
|
||||
(await this.feed.findPost('media', oMedia.id))?.panMapToMarker();
|
||||
@@ -439,7 +439,7 @@ export default {
|
||||
onMarkerClick(oEvent, oMarker) {
|
||||
oEvent.preventDefault();
|
||||
oEvent.stopPropagation();
|
||||
switch (oMarker.type) {
|
||||
switch(oMarker.type) {
|
||||
case 'project':
|
||||
this.hash.items = [oMarker.codename];
|
||||
break;
|
||||
@@ -448,7 +448,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onMarkerHover(oEvent, oMarker) {
|
||||
switch (oMarker.type) {
|
||||
switch(oMarker.type) {
|
||||
case 'project':
|
||||
if(oEvent.type == 'mouseenter') this.openProjectPopup(oMarker);
|
||||
else this.closePopup();
|
||||
@@ -651,7 +651,7 @@ export default {
|
||||
getStyleProperty(sProperty) {
|
||||
return getComputedStyle(this.$el).getPropertyValue(sProperty).trim();
|
||||
},
|
||||
isMarkerVisible(oLngLat){
|
||||
isMarkerVisible(oLngLat) {
|
||||
return !!this.map && this.map.getBounds().contains(oLngLat);
|
||||
},
|
||||
onPanelToggle(sPanel, bNewValue, iAnimDuration=500) {
|
||||
@@ -674,7 +674,7 @@ export default {
|
||||
this.settings = vPanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
manageLogin() {
|
||||
if(this.loginLoading) return;
|
||||
|
||||
var regexEmail = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
let regexEmail = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
if(!regexEmail.test(this.user.email)) this.feedbacks.push({type:'error', 'msg':this.lang.get('account.invalid_email')});
|
||||
else if(this.settingPassword && this.password !== this.passwordConfirmation) this.feedbacks.push({type:'error', 'msg':this.lang.get('account.password_mismatch')});
|
||||
else {
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -215,7 +215,7 @@ export default {
|
||||
return this.$el.getBoundingClientRect().width;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
<ProjectPost v-else :options="{type: 'poster', relative_time: lang.get('post.new_message')}" />
|
||||
</div>
|
||||
<div v-if="project" v-show="!loadingPost" id="feed-posts">
|
||||
<ProjectPost v-for="post in posts" :options="post" ref="posts" />
|
||||
<ProjectPost v-for="post in posts" :key="post.ref" :options="post" ref="posts" />
|
||||
</div>
|
||||
<div id="feed-footer" v-if="loading">
|
||||
<ProjectPost :options="{type: 'loading', headerless: true}" />
|
||||
|
||||
@@ -4,7 +4,7 @@ export default {
|
||||
options: Object
|
||||
},
|
||||
inject: ['lang']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
title:''
|
||||
}
|
||||
};
|
||||
},
|
||||
inject: ['lang', 'isMobile'],
|
||||
mounted() {
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
this.$refs.link.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
<div v-if="options.medias" class="section medias">
|
||||
<appIcon v-if="options.type=='message'" icon="media" width="fixed" size="lg" :text="lang.get('media.nearby')" />
|
||||
<div class="medias-list">
|
||||
<projectMediaLink v-for="media in options?.medias" :options="media" :type="'marker'" />
|
||||
<projectMediaLink v-for="media in options?.medias" :key="media.id_media" :options="media" :type="'marker'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
case 'media':
|
||||
this.$refs.medialink.openMedia();
|
||||
if(this.relatedMarker) return this.openMarkerPopup();
|
||||
else return Promise.resolve();
|
||||
default:
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -168,7 +169,7 @@
|
||||
//Auto-adjust text area height
|
||||
if(this.options.type == 'poster') autosize(this.$refs.post);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
(bDifferentTimeZone?sTime:null);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
return this.$el.getBoundingClientRect().width;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
</div>
|
||||
<div v-if="project?.id && !isMobile()" id="legend" class="panel-control panel-control-bottom">
|
||||
<div class="panel-control-elem">
|
||||
<div v-for="(color, hikeType) in hikes.colors" class="track">
|
||||
<div v-for="(color, hikeType) in hikes.colors" :key="hikeType" class="track">
|
||||
<span class="line" :style="'background-color:'+color+';'"></span>
|
||||
<span class="desc">{{ lang.get('track.'+hikeType) }}</span>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
else this.addLog('upload.position.unsupported');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div id="upload">
|
||||
|
||||
Reference in New Issue
Block a user