Rename salesbook
This commit is contained in:
1
salesbook.Shared/wwwroot/js/alphaScroll.js
Normal file
1
salesbook.Shared/wwwroot/js/alphaScroll.js
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
2
salesbook.Shared/wwwroot/js/bootstrap/Sortable.min.js
vendored
Normal file
2
salesbook.Shared/wwwroot/js/bootstrap/Sortable.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
salesbook.Shared/wwwroot/js/bootstrap/bootstrap.bundle.min.js
vendored
Normal file
7
salesbook.Shared/wwwroot/js/bootstrap/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
salesbook.Shared/wwwroot/js/bootstrap/chart.umd.js
Normal file
14
salesbook.Shared/wwwroot/js/bootstrap/chart.umd.js
Normal file
File diff suppressed because one or more lines are too long
7
salesbook.Shared/wwwroot/js/bootstrap/chartjs-plugin-datalabels.min.js
vendored
Normal file
7
salesbook.Shared/wwwroot/js/bootstrap/chartjs-plugin-datalabels.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
56
salesbook.Shared/wwwroot/js/calendar.js
Normal file
56
salesbook.Shared/wwwroot/js/calendar.js
Normal 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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
59
salesbook.Shared/wwwroot/js/main.js
Normal file
59
salesbook.Shared/wwwroot/js/main.js
Normal 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']
|
||||
});
|
||||
Reference in New Issue
Block a user