feat(geoloc): Anfangsort hinzugefügt

This commit is contained in:
Developer 02 2024-10-22 23:26:07 +02:00
parent 1af07f0df8
commit 46f1633f79
3 changed files with 23 additions and 9 deletions

View File

@ -54,12 +54,12 @@
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script> <script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="~/lib/sweetalert2/sweetalert2.min.js"></script> <script src="~/lib/sweetalert2/sweetalert2.min.js"></script>
<script src="~/lib/alertifyjs/alertify.min.js"></script> <script src="~/lib/alertifyjs/alertify.min.js"></script>
<script src="~/js/util.min.js" asp-append-version="true"></script>
<script src="~/js/ui.min.js" asp-append-version="true"></script> <script src="~/js/ui.min.js" asp-append-version="true"></script>
<script src="~/js/annotation.js" asp-append-version="true"></script> <script src="~/js/annotation.js" asp-append-version="true"></script>
<script src="~/js/network.min.js" asp-append-version="true"></script> <script src="~/js/network.min.js" asp-append-version="true"></script>
<script src="~/js/app.min.js" asp-append-version="true"></script> <script src="~/js/app.min.js" asp-append-version="true"></script>
<script src="~/lib/pspdfkit/dist-2024.3.2/pspdfkit.js"></script> <script src="~/lib/pspdfkit/dist-2024.3.2/pspdfkit.js"></script>
<script src="~/js/util.min.js" asp-append-version="true"></script>
<script src="~/js/api-service.min.js" asp-append-version="true"></script> <script src="~/js/api-service.min.js" asp-append-version="true"></script>
<script src="~/lib/leaflet/dist/leaflet.js"></script> <script src="~/lib/leaflet/dist/leaflet.js"></script>
<script src="~/lib/leaflet-locationpicker/dist/leaflet-locationpicker.min.js"></script> <script src="~/lib/leaflet-locationpicker/dist/leaflet-locationpicker.min.js"></script>

View File

@ -11,7 +11,7 @@ document.querySelectorAll('.email-input').forEach(input => {
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var dropdownItems = document.querySelectorAll('.culture-dropdown-item'); var dropdownItems = document.querySelectorAll('.culture-dropdown-item');
dropdownItems.forEach(function (item) { dropdownItems.forEach(function (item) {
item.addEventListener('click', async function(event) { item.addEventListener('click', async function (event) {
event.preventDefault(); event.preventDefault();
var language = this.getAttribute('data-language'); var language = this.getAttribute('data-language');
var flagCode = this.getAttribute('data-flag'); var flagCode = this.getAttribute('data-flag');
@ -29,7 +29,7 @@ document.getElementById('readonly-send').addEventListener('click', async () => {
const dateValid_value = dateValid.value; const dateValid_value = dateValid.value;
//check email //check email
if (!receiverMail_value || receiverMail.classList.contains('is-invalid')) { if (!receiverMail_value || receiverMail.classList.contains('is-invalid')) {
Swal.fire({ Swal.fire({
icon: "error", icon: "error",
title: "Falsche Email", title: "Falsche Email",
@ -73,13 +73,27 @@ document.getElementById('readonly-send').addEventListener('click', async () => {
}); });
}) })
receiverMail.value = ''; receiverMail.value = '';
dateValid.valueAsDate = new Date(new Date().setDate(new Date().getDate() + 8)); dateValid.valueAsDate = new Date(new Date().setDate(new Date().getDate() + 8));
}); });
$('#geoloc').leafletLocationPicker({ document.addEventListener('DOMContentLoaded', async () => {
alwaysOpen: true, var coords;
mapContainer: "#fixedMapCont" try {
coords = await getCoordinates();
}
catch (err) {
coords = {
latitude: 0,
longitude: 0,
};
}
$('#geoloc').leafletLocationPicker({
alwaysOpen: true,
mapContainer: "#fixedMapCont",
location: { latitude: coords.latitude, longitude: coords.longitude }
});
}); });
const bsNotify = (message, options) => alertify.notify( const bsNotify = (message, options) => alertify.notify(

View File

@ -1 +1 @@
document.querySelectorAll(".email-input").forEach(n=>{n.addEventListener("input",function(){/^\S+@\S+\.\S+$/.test(this.value)?this.classList.remove("is-invalid"):this.classList.add("is-invalid")})});document.addEventListener("DOMContentLoaded",function(){var n=document.querySelectorAll(".culture-dropdown-item");n.forEach(function(n){n.addEventListener("click",async function(n){n.preventDefault();var t=this.getAttribute("data-language"),i=this.getAttribute("data-flag");document.getElementById("selectedFlag").className="fi "+i+" me-2";await setLanguage(t)})})});document.getElementById("readonly-send").addEventListener("click",async()=>{const n=document.getElementById("readonly-receiver-mail"),t=document.getElementById("readonly-date-valid"),i=n.value,r=t.value;if(!i||n.classList.contains("is-invalid")){Swal.fire({icon:"error",title:"Falsche Email",text:"Die E-Mail-Adresse ist ungültig. Bitte verwenden Sie das richtige Format, z. B.: user@mail.com."});return}const u=new Date(Date.now()+864e5);if(new Date(r)<u){Swal.fire({icon:"error",title:"Falsches Datum",text:"Die Verteilung der Umschläge sollte mindestens einen Tag dauern."});return}shareEnvelope(i,r).then(n=>{n.ok?Swal.fire({title:"Gesendet",icon:"success"}):Swal.fire({icon:"error",title:`Fehler ${n.status}`,text:"Der Vorgang ist fehlgeschlagen. Bitte wenden Sie sich an das IT-Team."})}).catch(()=>{Swal.fire({icon:"error",title:"Unerwarteter Fehler",text:"Der Vorgang ist fehlgeschlagen. Bitte wenden Sie sich an das IT-Team."})});n.value="";t.valueAsDate=new Date((new Date).setDate((new Date).getDate()+8))});$("#geoloc").leafletLocationPicker({alwaysOpen:!0,mapContainer:"#fixedMapCont"});const bsNotify=(n,t)=>alertify.notify(`<div class="alert ${t.alert_type?"alert-"+t.alert_type:""}" role="alert"><span class="material-symbols-outlined">${t?.icon_name??""}</span><p>${n}</p></div>`,"custom",t?.delay??5);class Comp{static ActPanel=class{static __Root;static get Root(){Comp.ActPanel.__Root??=document.getElementById("flex-action-panel");return Comp.ActPanel.__Root}static get Elements(){return[...Comp.ActPanel.Root.children]}static get IsHided(){return Comp.ActPanel.Root.style.display=="none"}static set Display(n){Comp.ActPanel.Root.style.display=n;Comp.ActPanel.Elements.forEach(t=>t.style.display=n)}static Toggle(){Comp.ActPanel.Display=Comp.ActPanel.IsHided?"":"none"}};static SignatureProgress=class{static __SignatureCount;static get SignatureCount(){this.__SignatureCount=parseInt(document.getElementById("signature-count").innerText);return this.__SignatureCount}static __SignedCountSpan;static get SignedCountSpan(){this.__SignedCountSpan??=document.getElementById("signed-count");return Comp.SignatureProgress.__SignedCountSpan}static __signedCount=0;static get SignedCount(){return this.__signedCount}static set SignedCount(n){this.__signedCount=n;const t=(n/this.SignatureCount)*100;this.SignedCountBar.style.setProperty("--progress-width",t+"%");this.SignedCountSpan.innerText=n.toString()}static __SignedCountBar;static get SignedCountBar(){this.__SignedCountBar??=document.getElementById("signed-count-bar");return this.__SignedCountBar}};static __ShareBackdrop;static get ShareBackdrop(){return Comp.__ShareBackdrop??=new bootstrap.Modal(document.getElementById("shareBackdrop")),this.__ShareBackdrop}static __LocationBackdrop;static get LocationBackdrop(){return Comp.__LocationBackdrop??=new bootstrap.Modal(document.getElementById("locationBackdrop")),this.__LocationBackdrop}} document.querySelectorAll(".email-input").forEach(n=>{n.addEventListener("input",function(){/^\S+@\S+\.\S+$/.test(this.value)?this.classList.remove("is-invalid"):this.classList.add("is-invalid")})});document.addEventListener("DOMContentLoaded",function(){var n=document.querySelectorAll(".culture-dropdown-item");n.forEach(function(n){n.addEventListener("click",async function(n){n.preventDefault();var t=this.getAttribute("data-language"),i=this.getAttribute("data-flag");document.getElementById("selectedFlag").className="fi "+i+" me-2";await setLanguage(t)})})});document.getElementById("readonly-send").addEventListener("click",async()=>{const n=document.getElementById("readonly-receiver-mail"),t=document.getElementById("readonly-date-valid"),i=n.value,r=t.value;if(!i||n.classList.contains("is-invalid")){Swal.fire({icon:"error",title:"Falsche Email",text:"Die E-Mail-Adresse ist ungültig. Bitte verwenden Sie das richtige Format, z. B.: user@mail.com."});return}const u=new Date(Date.now()+864e5);if(new Date(r)<u){Swal.fire({icon:"error",title:"Falsches Datum",text:"Die Verteilung der Umschläge sollte mindestens einen Tag dauern."});return}shareEnvelope(i,r).then(n=>{n.ok?Swal.fire({title:"Gesendet",icon:"success"}):Swal.fire({icon:"error",title:`Fehler ${n.status}`,text:"Der Vorgang ist fehlgeschlagen. Bitte wenden Sie sich an das IT-Team."})}).catch(()=>{Swal.fire({icon:"error",title:"Unerwarteter Fehler",text:"Der Vorgang ist fehlgeschlagen. Bitte wenden Sie sich an das IT-Team."})});n.value="";t.valueAsDate=new Date((new Date).setDate((new Date).getDate()+8))});document.addEventListener("DOMContentLoaded",async()=>{var n;try{n=await getCoordinates()}catch(t){n={latitude:0,longitude:0}}$("#geoloc").leafletLocationPicker({alwaysOpen:!0,mapContainer:"#fixedMapCont",location:{latitude:n.latitude,longitude:n.longitude}})});const bsNotify=(n,t)=>alertify.notify(`<div class="alert ${t.alert_type?"alert-"+t.alert_type:""}" role="alert"><span class="material-symbols-outlined">${t?.icon_name??""}</span><p>${n}</p></div>`,"custom",t?.delay??5);class Comp{static ActPanel=class{static __Root;static get Root(){Comp.ActPanel.__Root??=document.getElementById("flex-action-panel");return Comp.ActPanel.__Root}static get Elements(){return[...Comp.ActPanel.Root.children]}static get IsHided(){return Comp.ActPanel.Root.style.display=="none"}static set Display(n){Comp.ActPanel.Root.style.display=n;Comp.ActPanel.Elements.forEach(t=>t.style.display=n)}static Toggle(){Comp.ActPanel.Display=Comp.ActPanel.IsHided?"":"none"}};static SignatureProgress=class{static __SignatureCount;static get SignatureCount(){this.__SignatureCount=parseInt(document.getElementById("signature-count").innerText);return this.__SignatureCount}static __SignedCountSpan;static get SignedCountSpan(){this.__SignedCountSpan??=document.getElementById("signed-count");return Comp.SignatureProgress.__SignedCountSpan}static __signedCount=0;static get SignedCount(){return this.__signedCount}static set SignedCount(n){this.__signedCount=n;const t=(n/this.SignatureCount)*100;this.SignedCountBar.style.setProperty("--progress-width",t+"%");this.SignedCountSpan.innerText=n.toString()}static __SignedCountBar;static get SignedCountBar(){this.__SignedCountBar??=document.getElementById("signed-count-bar");return this.__SignedCountBar}};static __ShareBackdrop;static get ShareBackdrop(){return Comp.__ShareBackdrop??=new bootstrap.Modal(document.getElementById("shareBackdrop")),this.__ShareBackdrop}static __LocationBackdrop;static get LocationBackdrop(){return Comp.__LocationBackdrop??=new bootstrap.Modal(document.getElementById("locationBackdrop")),this.__LocationBackdrop}}