Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
Revert "Change all "click" event to "pointerdown" event (workadventur…
Browse files Browse the repository at this point in the history
…e#3745)"

This reverts commit d00585f.
  • Loading branch information
gparant committed Feb 27, 2024
1 parent abd3672 commit 19d8646
Show file tree
Hide file tree
Showing 65 changed files with 314 additions and 327 deletions.
114 changes: 63 additions & 51 deletions play/src/front/Components/ActionBar/ActionBar.svelte

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions play/src/front/Components/ActionBar/Applicatons.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
on:keydown|preventDefault={noDrag}
on:focus|preventDefault={noDrag}
on:blur|preventDefault={noDrag}
on:pointerdown={() => {
on:click={() => {
toggleAppMenu();
}}
class="bottom-action-button"
Expand All @@ -107,7 +107,7 @@
<div class="tw-transition-all bottom-action-button">
<Tooltip text={$LL.mapEditor.properties.klaxoonProperties.label()} />
<button
on:pointerdown={() => {
on:click={() => {
klaxoonButtonHandler();
appMenuOpened = false;
}}
Expand All @@ -124,7 +124,7 @@
<div class="tw-transition-all bottom-action-button">
<Tooltip text={$LL.mapEditor.properties.googleDocsProperties.label()} />
<button
on:pointerdown={() => {
on:click={() => {
window.open(`https://docs.google.com/document/u/1/`, "_blanck");
appMenuOpened = false;
}}
Expand All @@ -139,7 +139,7 @@
<div class="tw-transition-all bottom-action-button">
<Tooltip text={$LL.mapEditor.properties.googleSheetsProperties.label()} />
<button
on:pointerdown={() => {
on:click={() => {
window.open(`https://docs.google.com/spreadsheets/u/1/`, "_blanck");
appMenuOpened = false;
}}
Expand All @@ -154,7 +154,7 @@
<div class="tw-transition-all bottom-action-button">
<Tooltip text={$LL.mapEditor.properties.googleSlidesProperties.label()} />
<button
on:pointerdown={() => {
on:click={() => {
window.open(`https://docs.google.com/presentation/u/1/`, "_blanck");
appMenuOpened = false;
}}
Expand All @@ -169,7 +169,7 @@
<div class="tw-transition-all bottom-action-button">
<Tooltip text={$LL.mapEditor.properties.eraserProperties.label()} />
<button
on:pointerdown={() => {
on:click={() => {
window.open(`https://app.eraser.io/dashboard/all`, "_blanck");
appMenuOpened = false;
}}
Expand Down
6 changes: 3 additions & 3 deletions play/src/front/Components/ActionsMenu/ActionsMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{#if actionsMenuData}
<div class="tw-flex tw-w-full tw-h-full tw-justify-center tw-items-center">
<div class="actions-menu tw-p-4 is-rounded tw-max-w-xs">
<button type="button" class="close-window" on:pointerdown={closeActionsMenu}>×</button>
<button type="button" class="close-window" on:click={closeActionsMenu}>×</button>
{#if actionsMenuData.menuName}
<h2 class="name tw-mb-2 tw-mx-2 margin-close">{actionsMenuData.menuName}</h2>
{/if}
Expand All @@ -65,8 +65,8 @@
type="button"
class="btn light tw-justify-center tw-font-bold tw-text-xs sm:tw-text-base tw-text-center tw-h-fit tw-m-2 tw-w-full {action.style ??
''}"
on:pointerdown={analyticsClient.clicPropertykMapEditor(action.actionName, action.style)}
on:pointerdown|preventDefault={() => {
on:click={analyticsClient.clicPropertykMapEditor(action.actionName, action.style)}
on:click|preventDefault={() => {
action.callback();
}}
>
Expand Down
4 changes: 2 additions & 2 deletions play/src/front/Components/AudioManager/AudioManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<div class="main-audio-manager">
<div class:hidden={state !== "playing"}>
<div class="audio-manager-player-volume">
<span id="audioplayer_volume_icon_playing" bind:this={audioPlayerVolumeIcon} on:pointerdown={onMute}>
<span id="audioplayer_volume_icon_playing" bind:this={audioPlayerVolumeIcon} on:click={onMute}>
<svg
width="2em"
height="2em"
Expand Down Expand Up @@ -183,7 +183,7 @@
<button
type="button"
class="btn light tw-justify-center tw-font-bold tw-text-xs sm:tw-text-base tw-w-fit"
on:pointerdown={tryPlay}>{$LL.audio.manager.allow()}</button
on:click={tryPlay}>{$LL.audio.manager.allow()}</button
>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion play/src/front/Components/Chat/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<div id="chatWindow" class:show={$chatVisibilityStore}>
<input type="text" bind:this={searchElement} on:keydown={search} style="display: none;" />
{#if $chatVisibilityStore}<div class="hide">
<button class="close-window" on:pointerdown={closeChat}>&#215;</button>
<button class="close-window" on:click={closeChat}>&#215;</button>
</div>{/if}
<iframe
id="chatWorkAdventure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
class:ready={$state === "ready"}
class:displayed={isMain || isHighlight}
class:vertical
on:pointerdown={() => analyticsClient.stackOpenCloseMultiIframe()}
on:pointerdown={onClick}
on:click={() => analyticsClient.stackOpenCloseMultiIframe()}
on:click={onClick}
>
<img
class="cowebsite-icon noselect clickable tw-bg-dark-blue/50 tw-p-0 tw-border-medium-purple tw-border-solid tw-rounded tw-pointer-events-auto hover:tw-border-light-purple hover:tw-bg-dark-blue/75 hover:tw-scale-105 tw-transition-all"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<button
type="button"
class="close-window top-right-btn"
on:pointerdown={closeCoWebsite}
on:click={closeCoWebsite}
>
&times;
</button>
Expand Down
4 changes: 2 additions & 2 deletions play/src/front/Components/EmoteMenu/EmoteMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
unsubscriber();
}
document.body.removeEventListener("pointerdown", checkClickOutSide);
document.body.removeEventListener("click", checkClickOutSide);
picker.destroyPicker();
});
Expand All @@ -88,7 +88,7 @@
function clickOutside(element: unknown) {
console.info("clickOutside event listener attached to element: ", element);
document.body.addEventListener("pointerdown", checkClickOutSide);
document.body.addEventListener("click", checkClickOutSide);
}
</script>

Expand Down
32 changes: 18 additions & 14 deletions play/src/front/Components/Exploration/Explorer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
>
<button
class="add-property-button tooltip tw-p-4 tw-flex tw-justify-center tw-items-center"
on:pointerdown={explorationMode}
on:click={explorationMode}
>
<div class="tw-w-10 tw-h-10 tw-flex tw-flex-wrap tw-items-center tw-justify-center">
<img
Expand All @@ -174,7 +174,7 @@
>
<button
class="add-property-button tooltip tw-p-4 tw-flex tw-justify-center tw-items-center"
on:pointerdown={toggleSearchMode}
on:click={toggleSearchMode}
>
<div class="tw-w-10 tw-h-10 tw-flex tw-flex-wrap tw-items-center tw-justify-center">
<img draggable="false" class="tw-max-w-[75%] tw-max-h-[75%]" src={visioSvg} alt="info icon" />
Expand Down Expand Up @@ -202,64 +202,65 @@
<AddPropertyButtonWrapper
property="jitsiRoomProperty"
isActive={$selectFilters.includes("jitsiRoomProperty")}
on:pointerdown={() => {
on:click={() => {
addFilter("jitsiRoomProperty");
}}
/>
<AddPropertyButtonWrapper
property="playAudio"
isActive={$selectFilters.includes("playAudio")}
on:pointerdown={() => {
on:click={() => {
addFilter("playAudio");
}}
/>
<AddPropertyButtonWrapper
property="openWebsite"
isActive={$selectFilters.includes("openWebsite")}
on:pointerdown={() => {
on:click={() => {
addFilter("openWebsite");
}}
/>
<AddPropertyButtonWrapper
property="speakerMegaphone"
isActive={$selectFilters.includes("speakerMegaphone")}
on:pointerdown={() => {
on:click={() => {
addFilter("speakerMegaphone");
}}
/>
<AddPropertyButtonWrapper
property="listenerMegaphone"
isActive={$selectFilters.includes("listenerMegaphone")}
on:pointerdown={() => {
on:click={() => {
addFilter("listenerMegaphone");
}}
/>
<AddPropertyButtonWrapper
property="exit"
isActive={$selectFilters.includes("exit")}
on:pointerdown={() => {
on:click={() => {
addFilter("exit");
}}
/>
<AddPropertyButtonWrapper
property="start"
isActive={$selectFilters.includes("start")}
on:pointerdown={() => {
on:click={() => {
addFilter("silent");
}}
/>
<AddPropertyButtonWrapper
property="focusable"
isActive={$selectFilters.includes("focusable")}
on:pointerdown={() => {
on:click={() => {
addFilter("focusable");
}}
/>
</div>

<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="entities tw-p-4 tw-rounded-2xl tw-flex tw-flex-row tw-justify-around tw-items-center tw-cursor-pointer"
on:pointerdown={toggleEntityList}
on:click={toggleEntityList}
>
<img class="tw-w-10 tw-h-auto tw-mr-2 tw-pointer-events-none" src={EntityToolImg} alt="link icon" />
{#if $entitessListFiltered.size > 0}
Expand All @@ -280,11 +281,12 @@
{#if entityListActive && $entitessListFiltered.size > 0}
<div class="entity-items tw-p-4 tw-flex tw-flex-col">
{#each [...$entitessListFiltered] as [key, entity] (key)}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
id={entity.entityId}
on:mouseenter={() => highlightEntity(entity)}
on:mouseleave={() => unhighlightEntity(entity)}
on:pointerdown={() => mapExplorationObjectSelectedStore.set(entity)}
on:click={() => mapExplorationObjectSelectedStore.set(entity)}
class="item tw-p-4 tw-rounded-2xl tw-flex tw-flex-row tw-justify-around tw-items-center tw-cursor-pointer"
>
<img
Expand All @@ -300,9 +302,10 @@
</div>
{/if}

<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="areas tw-p-4 tw-rounded-2xl tw-flex tw-flex-row tw-justify-around tw-items-center tw-cursor-pointer"
on:pointerdown={toggleAreaList}
on:click={toggleAreaList}
>
<img class="tw-w-10 tw-h-auto tw-mr-2 tw-pointer-events-none" src={AreaToolImg} alt="link icon" />
{#if $areasListFiltered.size > 0}
Expand All @@ -323,11 +326,12 @@
<div class="area-items tw-p-4 tw-flex tw-flex-col">
{#if $areasListFiltered.size > 0}
{#each [...$areasListFiltered] as [key, area] (key)}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
id={key}
on:mouseenter={() => highlightArea(area)}
on:mouseleave={() => unhighlightArea(area)}
on:pointerdown={() => mapExplorationObjectSelectedStore.set(area)}
on:click={() => mapExplorationObjectSelectedStore.set(area)}
class="item tw-p-4 tw-rounded-2xl tw-flex tw-flex-row tw-justify-around tw-items-center tw-cursor-pointer"
>
<img
Expand Down
5 changes: 3 additions & 2 deletions play/src/front/Components/Exploration/MapList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@
<h3>{$LL.mapEditor.listRoom.noRoomFound()}</h3>
{/if}
{#each Array.from($roomListFiltered) as [roomUrl, roomData] (roomUrl)}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
id={roomUrl}
class:active={currentRoomUrl == roomData.roomUrl}
class="room-card tw-flex tw-flex-col tw-items-center tw-justify-center tw-cursor-pointer tw-rounded-xl tw-m-12 tw-p-12"
on:pointerdown={() => clickRoom(roomData.roomUrl, roomData.name)}
on:click={() => clickRoom(roomData.roomUrl, roomData.name)}
>
<img
class="tw-pointer-events-none tw-rounded-full tw-h-56 tw-w-56 tw-mb-3"
Expand All @@ -129,7 +130,7 @@
<div
class="tw-bg-dark-purple/90 tw-backdrop-blur-sm tw-absolute tw-bottom-0 tw-left-0 tw-h-16 tw-w-screen tw-flex tw-justify-center tw-content-center tw-items-center"
>
<button class="light" on:pointerdown={close}>{$LL.mapEditor.listRoom.close()}</button>
<button class="light" on:click={close}>{$LL.mapEditor.listRoom.close()}</button>
</div>
{/if}
</div>
Expand Down
8 changes: 4 additions & 4 deletions play/src/front/Components/FollowMenu/FollowMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
>
<p class="tw-mt-2">{$LL.follow.interactMenu.title.follow({ leader: name($followUsersStore[0]) })}</p>
<div class="tw-flex tw-flex-row tw-justify-evenly">
<button type="button" class="btn light" on:pointerdown|preventDefault={acceptFollowRequest}
<button type="button" class="btn light" on:click|preventDefault={acceptFollowRequest}
>{$LL.follow.interactMenu.yes()}</button
>
<button type="button" class="btn outline" on:pointerdown|preventDefault={reset}
<button type="button" class="btn outline" on:click|preventDefault={reset}
>{$LL.follow.interactMenu.no()}</button
>
</div>
Expand All @@ -67,10 +67,10 @@
<p class="tw-m-1">{$LL.follow.interactMenu.stop.leader()}</p>
{/if}
<div class="tw-flex tw-flex-row tw-justify-evenly">
<button type="button" class="btn light" on:pointerdown|preventDefault={reset}
<button type="button" class="btn light" on:click|preventDefault={reset}
>{$LL.follow.interactMenu.yes()}</button
>
<button type="button" class="btn outline" on:pointerdown|preventDefault={abortEnding}
<button type="button" class="btn outline" on:click|preventDefault={abortEnding}
>{$LL.follow.interactMenu.no()}</button
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
</p>
</section>
<section class="tw-flex tw-row tw-justify-center">
<button class="light" on:pointerdown|preventDefault={refresh}>{$LL.camera.help.refresh()}</button>
<button type="submit" class="outline" on:pointerdown|preventDefault={close}>{$LL.camera.help.continue()}</button
>
<button class="light" on:click|preventDefault={refresh}>{$LL.camera.help.refresh()}</button>
<button type="submit" class="outline" on:click|preventDefault={close}>{$LL.camera.help.continue()}</button>
</section>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
</section>

<section class="tw-flex tw-row tw-justify-center">
<button class="light" on:pointerdown|preventDefault={close}>{$LL.warning.popupBlocked.done()}</button>
<button class="light" on:click|preventDefault={close}>{$LL.warning.popupBlocked.done()}</button>
</section>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
</ul>
</section>
<section class="tw-flex tw-row tw-justify-center">
<button class="light" on:pointerdown|preventDefault={refresh}>{$LL.camera.webrtc.refresh()}</button>
<button type="submit" class="outline" on:pointerdown|preventDefault={close}
>{$LL.camera.webrtc.continue()}</button
>
<button class="light" on:click|preventDefault={refresh}>{$LL.camera.webrtc.refresh()}</button>
<button type="submit" class="outline" on:click|preventDefault={close}>{$LL.camera.webrtc.continue()}</button>
</section>
</form>
2 changes: 1 addition & 1 deletion play/src/front/Components/Input/ButtonState.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
</script>

<button type="button" class={`light tw-mt-5 ${state} button-state`} on:pointerdown={click} disabled={state !== "ready"}>
<button type="button" class={`light tw-mt-5 ${state} button-state`} on:click={click} disabled={state !== "ready"}>
{#if state === "ready"}
{initialText}
{:else if state === "loading"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
>
{#each $layoutManagerActionStore as action (action.uuid)}
{#if action.type === "warning"}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="blue-dialog-box tw-w-56 tw-min-h-10 tw-border-pop-yellow tw-text-pop-yellow tw-border tw-border-solid tw-pointer-events-auto"
on:pointerdown={() => onClick(action.callback)}
on:click={() => onClick(action.callback)}
>
<p class="tw-text-center tw-m-0 tw-p-2">{action.message}</p>
</div>
{:else}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="blue-dialog-box tw-w-56 tw-min-h-10 tw-border-light-blue tw-text-light-blue tw-border tw-border-solid tw-pointer-events-auto"
on:pointerdown={() => onClick(action.callback)}
on:click={() => onClick(action.callback)}
>
<p class="tw-text-center tw-m-0 tw-p-2">{action.message}</p>
</div>
Expand Down
Loading

0 comments on commit 19d8646

Please sign in to comment.