Rename salesbook

This commit is contained in:
2025-06-26 10:08:21 +02:00
parent a34e673cd2
commit 3f2b7a6bb5
164 changed files with 267 additions and 262 deletions

View File

@@ -0,0 +1 @@


File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,56 @@
window.calendarSwipe = {
register: function (element, dotnetHelper) {
let startX = 0, startY = 0;
let endX = 0, endY = 0;
// Touch events
element.addEventListener('touchstart', (e) => {
if (e.touches.length === 1) {
startX = e.touches[0].clientX;
startY = e.touches[0].clientY;
}
});
element.addEventListener('touchend', (e) => {
if (e.changedTouches.length === 1) {
endX = e.changedTouches[0].clientX;
endY = e.changedTouches[0].clientY;
handle();
}
});
// Mouse events
let mouseDown = false;
element.addEventListener('mousedown', (e) => {
if (e.button !== 0) return;
mouseDown = true;
startX = e.clientX;
startY = e.clientY;
});
element.addEventListener('mouseup', (e) => {
if (!mouseDown) return;
mouseDown = false;
endX = e.clientX;
endY = e.clientY;
handle();
});
function handle() {
let diffX = endX - startX;
let diffY = endY - startY;
if (Math.abs(diffX) > Math.abs(diffY)) {
if (Math.abs(diffX) > 40) {
if (diffX < 0) dotnetHelper.invokeMethodAsync('OnSwipeLeft');
else dotnetHelper.invokeMethodAsync('OnSwipeRight');
}
} else {
if (Math.abs(diffY) > 40) {
if (diffY < 0) dotnetHelper.invokeMethodAsync('OnSwipeUp');
else dotnetHelper.invokeMethodAsync('OnSwipeDown');
}
}
}
}
};

View File

@@ -0,0 +1,59 @@
// Funzione goBack
window.goBack = function () {
console.log("goBack");
history.back();
};
// Funzione per aggiungere tabindex ai bottoni
function addTabindexToButtons() {
document.querySelectorAll('button.custom-plus-button').forEach(btn => {
if (!btn.hasAttribute('tabindex')) {
btn.setAttribute('tabindex', '0');
}
});
}
// Funzione per monitorare la classe expanded e aggiungere ah-calendar-m
function monitorExpandedClass(mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
const target = mutation.target;
if (target.classList.contains('week-slider') && target.classList.contains('expanded')) {
const appointments = document.querySelector('.appointments');
if (appointments) {
appointments.classList.add('ah-calendar-m');
console.log('Classe "ah-calendar-m" aggiunta a .appointments');
}
}
// Rimuovi la classe quando expanded viene rimossa
else if (target.classList.contains('week-slider') && !target.classList.contains('expanded')) {
const appointments = document.querySelector('.appointments');
if (appointments) {
appointments.classList.remove('ah-calendar-m');
console.log('Classe "ah-calendar-m" rimossa da .appointments');
}
}
}
});
}
// Esegui la funzione tabindex inizialmente
addTabindexToButtons();
// Observer combinato per entrambe le funzionalità
const observer = new MutationObserver((mutations) => {
// Aggiungi tabindex ai nuovi bottoni
addTabindexToButtons();
// Monitora le classi expanded
monitorExpandedClass(mutations);
});
// Osserva sia i cambiamenti nel DOM che gli attributi
observer.observe(document.body, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['class']
});