fix bug where touch events prevented focusing inputs, change input type of file transfer reception data
This commit is contained in:
Vendored
+20
-10
@@ -1136,7 +1136,7 @@
|
|||||||
function localeCompare(a, b) {
|
function localeCompare(a, b) {
|
||||||
return a.localeCompare(b);
|
return a.localeCompare(b);
|
||||||
}
|
}
|
||||||
function implementPinchZoom(targetSelector) {
|
function implementPinchZoom(canvas) {
|
||||||
let pinching = false;
|
let pinching = false;
|
||||||
let lastElement = void 0;
|
let lastElement = void 0;
|
||||||
let initialDistance, currentZoom, initialZoom, currentX, currentY, initialX, initialY, initialTouchX, initialTouchY;
|
let initialDistance, currentZoom, initialZoom, currentX, currentY, initialX, initialY, initialTouchX, initialTouchY;
|
||||||
@@ -1154,8 +1154,7 @@
|
|||||||
reset();
|
reset();
|
||||||
const MIN = 0.25;
|
const MIN = 0.25;
|
||||||
const MAX = 5;
|
const MAX = 5;
|
||||||
const element = () => canvas.querySelector(targetSelector);
|
const element = () => canvas.querySelector(".zoom");
|
||||||
const parent = () => element().parentElement;
|
|
||||||
const distance = (e) => Math.hypot(
|
const distance = (e) => Math.hypot(
|
||||||
e.touches[0].pageX - e.touches[1].pageX,
|
e.touches[0].pageX - e.touches[1].pageX,
|
||||||
e.touches[0].pageY - e.touches[1].pageY
|
e.touches[0].pageY - e.touches[1].pageY
|
||||||
@@ -1171,7 +1170,6 @@
|
|||||||
currentY = y;
|
currentY = y;
|
||||||
currentZoom = factor;
|
currentZoom = factor;
|
||||||
}
|
}
|
||||||
const canvas = document.body;
|
|
||||||
canvas.addEventListener("touchstart", (event) => {
|
canvas.addEventListener("touchstart", (event) => {
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
if (lastElement != void 0 && lastElement != element()) reset();
|
if (lastElement != void 0 && lastElement != element()) reset();
|
||||||
@@ -1205,16 +1203,24 @@
|
|||||||
const midY = midpoint(event, "y");
|
const midY = midpoint(event, "y");
|
||||||
const ratio = currentDistance / initialDistance;
|
const ratio = currentDistance / initialDistance;
|
||||||
const difference = currentDistance - initialDistance;
|
const difference = currentDistance - initialDistance;
|
||||||
apply(initialZoom * ratio, [initialX + (midX - difference - initialTouchX) / initialZoom, initialY + (midY - difference - initialTouchY) / initialZoom]);
|
apply(initialZoom * ratio, [
|
||||||
|
initialX + (midX - difference - initialTouchX) / initialZoom,
|
||||||
|
initialY + (midY - difference - initialTouchY) / initialZoom
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
canvas.addEventListener("wheel", (event) => {
|
canvas.addEventListener("wheel", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
apply(currentZoom, [currentX - event.deltaX, currentY - event.deltaY]);
|
apply(currentZoom, [
|
||||||
|
currentX - event.deltaX,
|
||||||
|
currentY - event.deltaY
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
;
|
apply(currentZoom + (event.deltaY < 0 ? 1 : -1) * 0.1, [
|
||||||
apply(currentZoom + (event.deltaY < 0 ? 1 : -1) * 0.1, [initialX, initialY]);
|
initialX,
|
||||||
|
initialY
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
canvas.addEventListener("scroll", (event) => {
|
canvas.addEventListener("scroll", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -1230,7 +1236,7 @@
|
|||||||
this.connectionModel = connectionModel2;
|
this.connectionModel = connectionModel2;
|
||||||
this.chatListModel = chatListModel2;
|
this.chatListModel = chatListModel2;
|
||||||
this.fileTransferModel = fileTransferModel2;
|
this.fileTransferModel = fileTransferModel2;
|
||||||
this.BUILD = "Build 26.08.30.E";
|
this.BUILD = "Build 26.08.30.F2";
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
this.contextStack = /* @__PURE__ */ new Map();
|
this.contextStack = /* @__PURE__ */ new Map();
|
||||||
this.closeContext = (contextId, fromHistoryEvent = false) => {
|
this.closeContext = (contextId, fromHistoryEvent = false) => {
|
||||||
@@ -5493,6 +5499,8 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
const wrapper = /* @__PURE__ */ createElement("div", { class: "content main-content", "children:set": pages });
|
||||||
|
implementPinchZoom(wrapper);
|
||||||
const taskSettingsModal = createProxyState(
|
const taskSettingsModal = createProxyState(
|
||||||
[boardViewModel.selectedTaskViewModel],
|
[boardViewModel.selectedTaskViewModel],
|
||||||
() => {
|
() => {
|
||||||
@@ -5564,7 +5572,7 @@
|
|||||||
"on:click": boardViewModel.createTask
|
"on:click": boardViewModel.createTask
|
||||||
},
|
},
|
||||||
/* @__PURE__ */ createElement("span", { class: "icon" }, "add")
|
/* @__PURE__ */ createElement("span", { class: "icon" }, "add")
|
||||||
))), /* @__PURE__ */ createElement("div", { class: "content main-content", "children:set": pages }), BoardSettingsModal(coreViewModel2, boardViewModel), SearchModal(
|
))), wrapper, BoardSettingsModal(coreViewModel2, boardViewModel), SearchModal(
|
||||||
coreViewModel2,
|
coreViewModel2,
|
||||||
boardViewModel.searchViewModel,
|
boardViewModel.searchViewModel,
|
||||||
coreViewModel2.translations.chatPage.task.filterTasksHeadline,
|
coreViewModel2.translations.chatPage.task.filterTasksHeadline,
|
||||||
@@ -7031,12 +7039,14 @@
|
|||||||
return /* @__PURE__ */ createElement("div", { class: "modal", "toggle:open": isPresented }, /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("main", null, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.dataTransferModal.receiveHeadline), /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.dataEntryInputDescription), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-column gap content-margin-bottom" }, /* @__PURE__ */ createElement("label", { class: "tile" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "forum"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.transferChannelHeadline), /* @__PURE__ */ createElement(
|
return /* @__PURE__ */ createElement("div", { class: "modal", "toggle:open": isPresented }, /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("main", null, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.dataTransferModal.receiveHeadline), /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.dataEntryInputDescription), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-column gap content-margin-bottom" }, /* @__PURE__ */ createElement("label", { class: "tile" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "forum"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.transferChannelHeadline), /* @__PURE__ */ createElement(
|
||||||
"input",
|
"input",
|
||||||
{
|
{
|
||||||
|
type: "number",
|
||||||
"on:enter": fileTransferViewModel2.prepareReceivingData,
|
"on:enter": fileTransferViewModel2.prepareReceivingData,
|
||||||
"bind:value": fileTransferViewModel2.receivingTransferChannel
|
"bind:value": fileTransferViewModel2.receivingTransferChannel
|
||||||
}
|
}
|
||||||
))), /* @__PURE__ */ createElement("label", { class: "tile" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "key"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.transferKeyHeadline), /* @__PURE__ */ createElement(
|
))), /* @__PURE__ */ createElement("label", { class: "tile" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "key"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", { class: "secondary" }, coreViewModel2.translations.dataTransferModal.transferKeyHeadline), /* @__PURE__ */ createElement(
|
||||||
"input",
|
"input",
|
||||||
{
|
{
|
||||||
|
type: "number",
|
||||||
"on:enter": fileTransferViewModel2.prepareReceivingData,
|
"on:enter": fileTransferViewModel2.prepareReceivingData,
|
||||||
"bind:value": fileTransferViewModel2.receivingTransferKey
|
"bind:value": fileTransferViewModel2.receivingTransferKey
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const CACHE_VERSION = "26.08.30.E";
|
const CACHE_VERSION = "3";
|
||||||
|
|
||||||
self.addEventListener("fetch", (event) => {
|
self.addEventListener("fetch", (event) => {
|
||||||
event.respondWith(handleRequest(event));
|
event.respondWith(handleRequest(event));
|
||||||
@@ -22,7 +22,7 @@ async function getFromCache(event) {
|
|||||||
|
|
||||||
async function fetchAndCache(event) {
|
async function fetchAndCache(event) {
|
||||||
const request = event.request;
|
const request = event.request;
|
||||||
const response = await fetch(request);
|
const response = await fetch(request, {cache: "no-cache"});
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
// Only cache successful responses
|
// Only cache successful responses
|
||||||
const cache = await caches.open(CACHE_VERSION);
|
const cache = await caches.open(CACHE_VERSION);
|
||||||
|
|||||||
@@ -279,15 +279,19 @@ export function localeCompare(a: string, b: string): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
export function implementPinchZoom(targetSelector: string) {
|
export function implementPinchZoom(canvas: HTMLElement) {
|
||||||
let pinching = false;
|
let pinching = false;
|
||||||
let lastElement: HTMLElement | undefined = undefined;
|
let lastElement: HTMLElement | undefined = undefined;
|
||||||
|
|
||||||
let initialDistance,
|
let initialDistance: number,
|
||||||
currentZoom, initialZoom,
|
currentZoom: number,
|
||||||
currentX, currentY,
|
initialZoom: number,
|
||||||
initialX, initialY,
|
currentX: number,
|
||||||
initialTouchX, initialTouchY;
|
currentY: number,
|
||||||
|
initialX: number,
|
||||||
|
initialY: number,
|
||||||
|
initialTouchX: number,
|
||||||
|
initialTouchY: number;
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
initialDistance = 0;
|
initialDistance = 0;
|
||||||
@@ -308,8 +312,7 @@ export function implementPinchZoom(targetSelector: string) {
|
|||||||
const MIN = 0.25;
|
const MIN = 0.25;
|
||||||
const MAX = 5;
|
const MAX = 5;
|
||||||
|
|
||||||
const element = (): HTMLElement => canvas.querySelector(targetSelector);
|
const element = (): HTMLElement => canvas.querySelector(".zoom");
|
||||||
const parent = (): HTMLElement => element().parentElement;
|
|
||||||
const distance = (e: TouchEvent) =>
|
const distance = (e: TouchEvent) =>
|
||||||
Math.hypot(
|
Math.hypot(
|
||||||
e.touches[0].pageX - e.touches[1].pageX,
|
e.touches[0].pageX - e.touches[1].pageX,
|
||||||
@@ -331,7 +334,6 @@ export function implementPinchZoom(targetSelector: string) {
|
|||||||
currentZoom = factor;
|
currentZoom = factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
const canvas = document.body;
|
|
||||||
canvas.addEventListener("touchstart", (event: TouchEvent) => {
|
canvas.addEventListener("touchstart", (event: TouchEvent) => {
|
||||||
(document.activeElement as HTMLElement).blur();
|
(document.activeElement as HTMLElement).blur();
|
||||||
|
|
||||||
@@ -357,8 +359,10 @@ export function implementPinchZoom(targetSelector: string) {
|
|||||||
canvas.addEventListener("touchmove", (event: TouchEvent) => {
|
canvas.addEventListener("touchmove", (event: TouchEvent) => {
|
||||||
if (!pinching) {
|
if (!pinching) {
|
||||||
apply(currentZoom, [
|
apply(currentZoom, [
|
||||||
initialX + (((event.touches[0].clientX - initialTouchX)/initialZoom)),
|
initialX +
|
||||||
initialY + ((event.touches[0].clientY - initialTouchY)/initialZoom),
|
(event.touches[0].clientX - initialTouchX) / initialZoom,
|
||||||
|
initialY +
|
||||||
|
(event.touches[0].clientY - initialTouchY) / initialZoom,
|
||||||
]);
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -369,15 +373,24 @@ export function implementPinchZoom(targetSelector: string) {
|
|||||||
const midY = midpoint(event, "y");
|
const midY = midpoint(event, "y");
|
||||||
const ratio = currentDistance / initialDistance;
|
const ratio = currentDistance / initialDistance;
|
||||||
const difference = currentDistance - initialDistance;
|
const difference = currentDistance - initialDistance;
|
||||||
apply(initialZoom * ratio, [initialX + (midX - difference - initialTouchX)/initialZoom, initialY + (midY - difference - initialTouchY)/initialZoom]);
|
apply(initialZoom * ratio, [
|
||||||
|
initialX + (midX - difference - initialTouchX) / initialZoom,
|
||||||
|
initialY + (midY - difference - initialTouchY) / initialZoom,
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
canvas.addEventListener("wheel", (event: WheelEvent) => {
|
canvas.addEventListener("wheel", (event: WheelEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
apply(currentZoom, [currentX - event.deltaX, currentY - event.deltaY]);
|
apply(currentZoom, [
|
||||||
|
currentX - event.deltaX,
|
||||||
|
currentY - event.deltaY,
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
apply(currentZoom + (event.deltaY < 0 ? 1 : -1) * 0.1, [initialX, initialY]);
|
apply(currentZoom + (event.deltaY < 0 ? 1 : -1) * 0.1, [
|
||||||
|
initialX,
|
||||||
|
initialY,
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
canvas.addEventListener("scroll", (event: MouseEvent) => {
|
canvas.addEventListener("scroll", (event: MouseEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ export function BoardPage(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const wrapper = <div class="content main-content" children:set={pages}></div>
|
||||||
|
Utility.implementPinchZoom(wrapper);
|
||||||
|
|
||||||
// task modal
|
// task modal
|
||||||
const taskSettingsModal = React.createProxyState(
|
const taskSettingsModal = React.createProxyState(
|
||||||
[boardViewModel.selectedTaskViewModel],
|
[boardViewModel.selectedTaskViewModel],
|
||||||
@@ -150,7 +153,7 @@ export function BoardPage(
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content main-content" children:set={pages}></div>
|
{wrapper}
|
||||||
|
|
||||||
{BoardSettingsModal(coreViewModel, boardViewModel)}
|
{BoardSettingsModal(coreViewModel, boardViewModel)}
|
||||||
{SearchModal(
|
{SearchModal(
|
||||||
|
|||||||
@@ -476,6 +476,7 @@ function TransferDataInputModal(
|
|||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
|
type="number"
|
||||||
on:enter={
|
on:enter={
|
||||||
fileTransferViewModel.prepareReceivingData
|
fileTransferViewModel.prepareReceivingData
|
||||||
}
|
}
|
||||||
@@ -496,6 +497,7 @@ function TransferDataInputModal(
|
|||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
|
type="number"
|
||||||
on:enter={
|
on:enter={
|
||||||
fileTransferViewModel.prepareReceivingData
|
fileTransferViewModel.prepareReceivingData
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import ConnectionModel from "../../Model/Global/connectionModel";
|
|||||||
import ChatListModel from "../../Model/Chat/chatListModel";
|
import ChatListModel from "../../Model/Chat/chatListModel";
|
||||||
|
|
||||||
export default class CoreViewModel {
|
export default class CoreViewModel {
|
||||||
readonly BUILD = "Build 26.08.30.E";
|
readonly BUILD = "Build 26.08.30.F2";
|
||||||
|
|
||||||
translations: Translations;
|
translations: Translations;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user