Merge branch 'develop' of github.com:thecodingmachine/workadventure into iframeMenuScript

This commit is contained in:
GRL 2021-08-27 10:44:32 +02:00
commit 833c15b2d5
9 changed files with 29 additions and 19 deletions

View file

@ -8,9 +8,9 @@
let expandedMapCopyright = false;
let expandedTilesetCopyright = false;
let mapName: string = 'The map has not a name.';
let mapDescription: string = "The creator of the map didn't use the property to describe the map.";
let mapCopyright: string = "There is not copyright and this map.";
let mapName: string = "";
let mapDescription: string = "";
let mapCopyright: string = "The map creator did not declare a copyright for the map.";
let tilesetCopyright: string[] = [];
onMount(() => {
@ -76,7 +76,7 @@
{#each tilesetCopyright as copyright}
<p class="string-HTML">{copyright}</p>
{:else}
<p>None of the tilesets of this map have a property copyright. This doesn't mean that those tilesets have no license.</p>
<p>The map creator did not declare a copyright for the tilesets. Warning, This doesn't mean that those tilesets have no license.</p>
{/each}
</section>
</section>

View file

@ -8,11 +8,9 @@
import ContactSubMenu from "./ContactSubMenu.svelte";
import CustomSubMenu from "./CustomSubMenu.svelte"
import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore";
import {userIsAdminStore} from "../../Stores/GameStore";
import {onDestroy, onMount} from "svelte";
import {get, Unsubscriber} from "svelte/store";
import {sendMenuClickedEvent} from "../../Api/iframe/Ui/MenuItem";
import {CONTACT_URL} from "../../Enum/EnvironmentVariable";
let activeSubMenu: string = SubMenusInterface.settings;
let activeComponent: typeof SettingsSubMenu | typeof CustomSubMenu = SettingsSubMenu;
@ -20,14 +18,6 @@
let unsubscriberSubMenuStore: Unsubscriber;
onMount(() => {
if(!get(userIsAdminStore)) {
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
}
if(CONTACT_URL === undefined) {
subMenusStore.removeMenu(SubMenusInterface.contact);
}
unsubscriberSubMenuStore = subMenusStore.subscribe(() => {
if(!get(subMenusStore).includes(activeSubMenu)) {
switchMenu(SubMenusInterface.settings);

View file

@ -1,4 +1,5 @@
<script lang="typescript">
import logoWA from "../images/logo-WA-min.png"
import {menuVisiblilityStore} from "../../Stores/MenuStore";
import {get} from "svelte/store";
@ -16,7 +17,7 @@
<svelte:window on:keydown={onKeyDown}/>
<main class="menuIcon">
<img src="/static/images/logo-WA-min.png" alt="open menu" class="nes-pointer" on:click|preventDefault={showMenu}>
<img src={logoWA} alt="open menu" class="nes-pointer" on:click|preventDefault={showMenu}>
</main>
<style lang="scss">

View file

@ -4,6 +4,7 @@
import {onMount} from "svelte";
export let userUUID: string | undefined;
export let userName: string;
let userIsBlocked = false;
onMount(() => {
@ -29,7 +30,7 @@
<div class="block-container">
<h3>Block</h3>
<p>Block any communication from and to this user. This can be reverted.</p>
<p>Block any communication from and to {userName}. This can be reverted.</p>
<button type="button" class="nes-btn is-error" on:click|preventDefault={blockUser}>
{userIsBlocked ? 'Unblock this user' : 'Block this user'}
</button>

View file

@ -75,7 +75,7 @@
</section>
<section class="report-menu-content">
{#if blockActive}
<BlockSubMenu userUUID="{userUUID}"/>
<BlockSubMenu userUUID="{userUUID}" userName="{userName}"/>
{:else if reportActive}
<ReportSubMenu userUUID="{userUUID}"/>
{:else }

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,5 +1,7 @@
import { get, writable } from "svelte/store";
import Timeout = NodeJS.Timeout;
import { userIsAdminStore } from "./GameStore";
import { CONTACT_URL } from "../Enum/EnvironmentVariable";
export const menuIconVisiblilityStore = writable(false);
export const menuVisiblilityStore = writable(false);
@ -67,6 +69,18 @@ function createSubMenusStore() {
export const subMenusStore = createSubMenusStore();
function checkSubMenuToShow() {
if (!get(userIsAdminStore)) {
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
}
if (CONTACT_URL === undefined) {
subMenusStore.removeMenu(SubMenusInterface.contact);
}
}
checkSubMenuToShow();
export const customMenuIframe = new Map<string, { url: string; allowApi: boolean }>();
export function handleMenuRegistrationEvent(

View file

@ -25,7 +25,7 @@ export class HtmlUtils {
}
public static escapeHtml(html: string): string {
const text = document.createTextNode(html.replace(/(\r\n|\r|\n)/g, "<br/>"));
const text = document.createTextNode(html);
const p = document.createElement("p");
p.appendChild(text);
return p.innerHTML;

View file

@ -1084,10 +1084,14 @@ div.action.danger p.action-body{
text-align: left;
color: white;
}
.popUpElement div {
.popUpElement div{
font-family: 'Press Start 2P';
font-size: 10px;
background-color: #727678;
white-space: pre-line;
}
.popUpElement .nes-container{
padding: 1rem 1rem;
}
.popUpElement button {