Remove fat
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import 'maplibre-gl/dist/maplibre-gl.css';
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
||||||
import { Map, NavigationControl, Marker, LngLatBounds, LngLat, Popup } from 'maplibre-gl';
|
import { Map, Marker, LngLatBounds, LngLat, Popup } from 'maplibre-gl';
|
||||||
import { createApp, ref, provide, inject } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import Simplebar from 'simplebar-vue';
|
import Simplebar from 'simplebar-vue';
|
||||||
|
|
||||||
import Lightbox from '@scripts/lightbox';
|
import Lightbox from '@scripts/lightbox';
|
||||||
@@ -22,7 +22,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
server: this.consts.server,
|
|
||||||
feed: {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true},
|
feed: {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true},
|
||||||
refreshRate: 60,
|
refreshRate: 60,
|
||||||
lastUpdate: { unix_time: 0, relative_time: '', formatted_time: ''},
|
lastUpdate: { unix_time: 0, relative_time: '', formatted_time: ''},
|
||||||
@@ -89,23 +88,12 @@ export default {
|
|||||||
if(this.hash.items.length == 0) this.hash.items[0] = this.projects.getDefaultCodeName();
|
if(this.hash.items.length == 0) this.hash.items[0] = this.projects.getDefaultCodeName();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('resize', this.handleResize);
|
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
window.removeEventListener('resize', this.handleResize);
|
|
||||||
this.quit();
|
this.quit();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleResize() {
|
|
||||||
//this.spot.tmp('map_offset', -1 * (this.feedPanelOpen?getOuterWidth(this.$refs.feed):0) / getOuterWidth(window));
|
|
||||||
|
|
||||||
/* TODO
|
|
||||||
if(typeof this.spot.tmp('elev') != 'undefined' && this.spot.tmp('elev')._showState) {
|
|
||||||
this.spot.tmp('elev').resize({width:this.getElevWidth()});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
|
||||||
async init() {
|
async init() {
|
||||||
this.initProject();
|
this.initProject();
|
||||||
this.initLightbox();
|
this.initLightbox();
|
||||||
@@ -335,7 +323,6 @@ export default {
|
|||||||
project: this.currProject
|
project: this.currProject
|
||||||
});
|
});
|
||||||
this.popup.content
|
this.popup.content
|
||||||
.provide('spot', this.spot)
|
|
||||||
.provide('lang', this.lang)
|
.provide('lang', this.lang)
|
||||||
.provide('consts', this.consts)
|
.provide('consts', this.consts)
|
||||||
.mount($Popup);
|
.mount($Popup);
|
||||||
@@ -501,8 +488,6 @@ export default {
|
|||||||
this.feedPanelOpen = (typeof bShow === 'object' || typeof bShow === 'undefined')?(!this.feedPanelOpen):bShow;
|
this.feedPanelOpen = (typeof bShow === 'object' || typeof bShow === 'undefined')?(!this.feedPanelOpen):bShow;
|
||||||
|
|
||||||
if(bOldValue != this.feedPanelOpen && !this.isMobile()) {
|
if(bOldValue != this.feedPanelOpen && !this.isMobile()) {
|
||||||
this.handleResize();
|
|
||||||
|
|
||||||
sMapAction = sMapAction || 'panTo';
|
sMapAction = sMapAction || 'panTo';
|
||||||
switch(sMapAction) {
|
switch(sMapAction) {
|
||||||
case 'none':
|
case 'none':
|
||||||
@@ -516,17 +501,6 @@ export default {
|
|||||||
case 'panToInstant':
|
case 'panToInstant':
|
||||||
this.map.panBy([(this.feedPanelOpen?1:-1) * getOuterWidth(this.$refs.feed) / 2, 0]);
|
this.map.panBy([(this.feedPanelOpen?1:-1) * getOuterWidth(this.$refs.feed) / 2, 0]);
|
||||||
break;
|
break;
|
||||||
case 'fitBounds':
|
|
||||||
/*
|
|
||||||
this.map.fitBounds(
|
|
||||||
this.spot.tmp('track').getBounds(),
|
|
||||||
{
|
|
||||||
paddingTopLeft: L.point(5, this.spot.tmp('marker_size').height + 5),
|
|
||||||
paddingBottomRight: L.point(this.spot.tmp('$Feed').outerWidth(true) + 5, 5)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -535,8 +509,6 @@ export default {
|
|||||||
this.settingsPanelOpen = (typeof bShow === 'object' || typeof bShow === 'undefined')?(!this.settingsPanelOpen):bShow;
|
this.settingsPanelOpen = (typeof bShow === 'object' || typeof bShow === 'undefined')?(!this.settingsPanelOpen):bShow;
|
||||||
|
|
||||||
if(bOldValue != this.settingsPanelOpen && !this.isMobile()) {
|
if(bOldValue != this.settingsPanelOpen && !this.isMobile()) {
|
||||||
this.handleResize();
|
|
||||||
|
|
||||||
sMapAction = sMapAction || 'panTo';
|
sMapAction = sMapAction || 'panTo';
|
||||||
switch(sMapAction) {
|
switch(sMapAction) {
|
||||||
case 'none':
|
case 'none':
|
||||||
@@ -599,7 +571,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-section">
|
<div class="settings-section newsletter">
|
||||||
<ProjectNewsletter />
|
<ProjectNewsletter />
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-section admin" v-if="user.hasClearance(consts.clearances.admin)">
|
<div class="settings-section admin" v-if="user.hasClearance(consts.clearances.admin)">
|
||||||
|
|||||||
@@ -53,17 +53,15 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="newsletter">
|
<h1><SpotIcon :icon="'newsletter'" width="fixed" :text="lang.get('newsletter.title')" /></h1>
|
||||||
<h1><SpotIcon :icon="'newsletter'" width="fixed" :text="lang.get('newsletter.title')" /></h1>
|
<div class="newsletter-form">
|
||||||
<div class="newsletter-form">
|
<input type="email" name="email" id="email" :placeholder="lang.get('newsletter.email_placeholder')" v-model="user.email" :disabled="loading || subscribed" />
|
||||||
<input type="email" name="email" id="email" :placeholder="lang.get('newsletter.email_placeholder')" v-model="user.email" :disabled="loading || subscribed" />
|
<SpotButton :classes="buttonClasses" :title="lang.get('newsletter.'+action)" :icon="action" @click="manage" />
|
||||||
<SpotButton :classes="buttonClasses" :title="lang.get('newsletter.'+action)" :icon="action" @click="manage" />
|
|
||||||
</div>
|
|
||||||
<div id="settings-feedback" class="feedback">
|
|
||||||
<p v-for="feedback in feedbacks" :key="feedback.type + '-' + feedback.msg" :class="feedback.type">
|
|
||||||
<SpotIcon :icon="feedback.type" :text="feedback.msg" />
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{{ lang.get('newsletter.'+(subscribed?'subscribed':'unsubscribed')+'_desc') }}
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="feedback">
|
||||||
|
<p v-for="feedback in feedbacks" :key="feedback.type + '-' + feedback.msg" :class="feedback.type">
|
||||||
|
<SpotIcon :icon="feedback.type" :text="feedback.msg" />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{ lang.get('newsletter.'+(subscribed?'subscribed':'unsubscribed')+'_desc') }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import projectMapLink from '@components/projectMapLink';
|
|||||||
import spotIcon from '@components/spotIcon';
|
import spotIcon from '@components/spotIcon';
|
||||||
import projectRelTime from '@components/projectRelTime';
|
import projectRelTime from '@components/projectRelTime';
|
||||||
import projectMediaLink from '@components/projectMediaLink';
|
import projectMediaLink from '@components/projectMediaLink';
|
||||||
import { options } from '@scripts/lightbox';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,40 +1,5 @@
|
|||||||
/* Common Functions */
|
/* Common Functions */
|
||||||
|
|
||||||
export function copyArray(asArray)
|
|
||||||
{
|
|
||||||
return asArray.slice(0); //trick to copy array
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getElem(aoAnchor, asPath)
|
|
||||||
{
|
|
||||||
return (typeof asPath == 'object' && asPath.length > 1)?getElem(aoAnchor[asPath.shift()], asPath):aoAnchor[(typeof asPath == 'object')?asPath.shift():asPath];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setElem(aoAnchor, asPath, oValue)
|
|
||||||
{
|
|
||||||
var asTypes = {boolean:false, string:'', integer:0, int:0, array:[], object:{}};
|
|
||||||
if(typeof asPath == 'object' && asPath.length > 1)
|
|
||||||
{
|
|
||||||
var nextlevel = asPath.shift();
|
|
||||||
if(!(nextlevel in aoAnchor)) aoAnchor[nextlevel] = {}; //Creating a new level
|
|
||||||
if(typeof aoAnchor[nextlevel] !== 'object') debug('Error - setElem() : Already existing path at level "'+nextlevel+'". Cancelling setElem() action');
|
|
||||||
return setElem(aoAnchor[nextlevel], asPath, oValue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var sKey = (typeof asPath == 'object')?asPath.shift():asPath;
|
|
||||||
return aoAnchor[sKey] = (!(sKey in aoAnchor) && (oValue in asTypes))?asTypes[oValue]:oValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getDragPosition(oEvent) {
|
|
||||||
let bMouse = oEvent.type.includes('mouse');
|
|
||||||
return {
|
|
||||||
x: bMouse?oEvent.pageX:oEvent.touches[0].clientX,
|
|
||||||
y: bMouse?oEvent.pageY:oEvent.touches[0].clientY
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function copyTextToClipboard(text) {
|
export function copyTextToClipboard(text) {
|
||||||
if(!navigator.clipboard) {
|
if(!navigator.clipboard) {
|
||||||
var textArea = document.createElement('textarea');
|
var textArea = document.createElement('textarea');
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
import { getDragPosition } from '@scripts/common';
|
|
||||||
|
|
||||||
$.prototype.defaultVal = function(sDefaultValue)
|
|
||||||
{
|
|
||||||
$(this)
|
|
||||||
.data('default_value', sDefaultValue)
|
|
||||||
.val(sDefaultValue)
|
|
||||||
.addClass('defaultText')
|
|
||||||
.focus(function()
|
|
||||||
{
|
|
||||||
var $This = $(this);
|
|
||||||
if($This.val() == $This.data('default_value')) $This.val('').removeClass('defaultText');
|
|
||||||
})
|
|
||||||
.blur(function()
|
|
||||||
{
|
|
||||||
var $This = $(this);
|
|
||||||
if($This.val() == '') $This.val($This.data('default_value')).addClass('defaultText');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.prototype.checkForm = function(sSelector)
|
|
||||||
{
|
|
||||||
sSelector = sSelector || 'input[type="text"], textarea';
|
|
||||||
var $This = $(this);
|
|
||||||
var bOk = true;
|
|
||||||
$This.find(sSelector).each(function()
|
|
||||||
{
|
|
||||||
$This = $(this);
|
|
||||||
bOk = bOk && $This.val()!='' && $This.val()!=$This.data('default_value');
|
|
||||||
});
|
|
||||||
return bOk;
|
|
||||||
};
|
|
||||||
|
|
||||||
$.prototype.onSwipe = function(fOnStart, fOnMove, fOnEnd){
|
|
||||||
return $(this)
|
|
||||||
.on('dragstart', (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
})
|
|
||||||
.on('mousedown touchstart', (e) => {
|
|
||||||
var $This = $(this);
|
|
||||||
var oPos = getDragPosition(e);
|
|
||||||
$This.data('x-start', oPos.x);
|
|
||||||
$This.data('y-start', oPos.y);
|
|
||||||
$This.data('x-move', oPos.x);
|
|
||||||
$This.data('y-move', oPos.y);
|
|
||||||
$This.data('moving', true).addClass('moving');
|
|
||||||
fOnStart({
|
|
||||||
xStart: $This.data('x-start'),
|
|
||||||
yStart: $This.data('y-start')
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.on('touchmove mousemove', (e) => {
|
|
||||||
var $This = $(this);
|
|
||||||
if($This.data('moving')) {
|
|
||||||
var oPos = getDragPosition(e);
|
|
||||||
$This.data('x-move', oPos.x);
|
|
||||||
$This.data('y-move', oPos.y);
|
|
||||||
fOnMove({
|
|
||||||
xStart: $This.data('x-start'),
|
|
||||||
yStart: $This.data('y-start'),
|
|
||||||
xMove: $This.data('x-move'),
|
|
||||||
yMove: $This.data('y-move')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.on('mouseup mouseleave touchend', (e) => {
|
|
||||||
var $This = $(this);
|
|
||||||
if($This.data('moving')) {
|
|
||||||
$This.data('moving', false).removeClass('moving');
|
|
||||||
fOnEnd({
|
|
||||||
xStart: $This.data('x-start'),
|
|
||||||
yStart: $This.data('y-start'),
|
|
||||||
xEnd: $This.data('x-move'),
|
|
||||||
yEnd: $This.data('y-move')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsletter {
|
&.newsletter {
|
||||||
.newsletter-form {
|
.newsletter-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
|||||||
Reference in New Issue
Block a user