Merge branch 'develop' of github.com:thecodingmachine/workadventure into iframeMenuScript
This commit is contained in:
commit
833c15b2d5
9 changed files with 29 additions and 19 deletions
|
@ -8,9 +8,9 @@
|
||||||
let expandedMapCopyright = false;
|
let expandedMapCopyright = false;
|
||||||
let expandedTilesetCopyright = false;
|
let expandedTilesetCopyright = false;
|
||||||
|
|
||||||
let mapName: string = 'The map has not a name.';
|
let mapName: string = "";
|
||||||
let mapDescription: string = "The creator of the map didn't use the property to describe the map.";
|
let mapDescription: string = "";
|
||||||
let mapCopyright: string = "There is not copyright and this map.";
|
let mapCopyright: string = "The map creator did not declare a copyright for the map.";
|
||||||
let tilesetCopyright: string[] = [];
|
let tilesetCopyright: string[] = [];
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
{#each tilesetCopyright as copyright}
|
{#each tilesetCopyright as copyright}
|
||||||
<p class="string-HTML">{copyright}</p>
|
<p class="string-HTML">{copyright}</p>
|
||||||
{:else}
|
{: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}
|
{/each}
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -8,11 +8,9 @@
|
||||||
import ContactSubMenu from "./ContactSubMenu.svelte";
|
import ContactSubMenu from "./ContactSubMenu.svelte";
|
||||||
import CustomSubMenu from "./CustomSubMenu.svelte"
|
import CustomSubMenu from "./CustomSubMenu.svelte"
|
||||||
import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore";
|
import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore";
|
||||||
import {userIsAdminStore} from "../../Stores/GameStore";
|
|
||||||
import {onDestroy, onMount} from "svelte";
|
import {onDestroy, onMount} from "svelte";
|
||||||
import {get, Unsubscriber} from "svelte/store";
|
import {get, Unsubscriber} from "svelte/store";
|
||||||
import {sendMenuClickedEvent} from "../../Api/iframe/Ui/MenuItem";
|
import {sendMenuClickedEvent} from "../../Api/iframe/Ui/MenuItem";
|
||||||
import {CONTACT_URL} from "../../Enum/EnvironmentVariable";
|
|
||||||
|
|
||||||
let activeSubMenu: string = SubMenusInterface.settings;
|
let activeSubMenu: string = SubMenusInterface.settings;
|
||||||
let activeComponent: typeof SettingsSubMenu | typeof CustomSubMenu = SettingsSubMenu;
|
let activeComponent: typeof SettingsSubMenu | typeof CustomSubMenu = SettingsSubMenu;
|
||||||
|
@ -20,14 +18,6 @@
|
||||||
let unsubscriberSubMenuStore: Unsubscriber;
|
let unsubscriberSubMenuStore: Unsubscriber;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if(!get(userIsAdminStore)) {
|
|
||||||
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(CONTACT_URL === undefined) {
|
|
||||||
subMenusStore.removeMenu(SubMenusInterface.contact);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsubscriberSubMenuStore = subMenusStore.subscribe(() => {
|
unsubscriberSubMenuStore = subMenusStore.subscribe(() => {
|
||||||
if(!get(subMenusStore).includes(activeSubMenu)) {
|
if(!get(subMenusStore).includes(activeSubMenu)) {
|
||||||
switchMenu(SubMenusInterface.settings);
|
switchMenu(SubMenusInterface.settings);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
|
import logoWA from "../images/logo-WA-min.png"
|
||||||
import {menuVisiblilityStore} from "../../Stores/MenuStore";
|
import {menuVisiblilityStore} from "../../Stores/MenuStore";
|
||||||
import {get} from "svelte/store";
|
import {get} from "svelte/store";
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
<svelte:window on:keydown={onKeyDown}/>
|
<svelte:window on:keydown={onKeyDown}/>
|
||||||
|
|
||||||
<main class="menuIcon">
|
<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>
|
</main>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import {onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
|
|
||||||
export let userUUID: string | undefined;
|
export let userUUID: string | undefined;
|
||||||
|
export let userName: string;
|
||||||
let userIsBlocked = false;
|
let userIsBlocked = false;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
|
|
||||||
<div class="block-container">
|
<div class="block-container">
|
||||||
<h3>Block</h3>
|
<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}>
|
<button type="button" class="nes-btn is-error" on:click|preventDefault={blockUser}>
|
||||||
{userIsBlocked ? 'Unblock this user' : 'Block this user'}
|
{userIsBlocked ? 'Unblock this user' : 'Block this user'}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
</section>
|
</section>
|
||||||
<section class="report-menu-content">
|
<section class="report-menu-content">
|
||||||
{#if blockActive}
|
{#if blockActive}
|
||||||
<BlockSubMenu userUUID="{userUUID}"/>
|
<BlockSubMenu userUUID="{userUUID}" userName="{userName}"/>
|
||||||
{:else if reportActive}
|
{:else if reportActive}
|
||||||
<ReportSubMenu userUUID="{userUUID}"/>
|
<ReportSubMenu userUUID="{userUUID}"/>
|
||||||
{:else }
|
{:else }
|
||||||
|
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -1,5 +1,7 @@
|
||||||
import { get, writable } from "svelte/store";
|
import { get, writable } from "svelte/store";
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
import { userIsAdminStore } from "./GameStore";
|
||||||
|
import { CONTACT_URL } from "../Enum/EnvironmentVariable";
|
||||||
|
|
||||||
export const menuIconVisiblilityStore = writable(false);
|
export const menuIconVisiblilityStore = writable(false);
|
||||||
export const menuVisiblilityStore = writable(false);
|
export const menuVisiblilityStore = writable(false);
|
||||||
|
@ -67,6 +69,18 @@ function createSubMenusStore() {
|
||||||
|
|
||||||
export const subMenusStore = 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 const customMenuIframe = new Map<string, { url: string; allowApi: boolean }>();
|
||||||
|
|
||||||
export function handleMenuRegistrationEvent(
|
export function handleMenuRegistrationEvent(
|
||||||
|
|
|
@ -25,7 +25,7 @@ export class HtmlUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static escapeHtml(html: string): string {
|
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");
|
const p = document.createElement("p");
|
||||||
p.appendChild(text);
|
p.appendChild(text);
|
||||||
return p.innerHTML;
|
return p.innerHTML;
|
||||||
|
|
|
@ -1088,6 +1088,10 @@ div.action.danger p.action-body{
|
||||||
font-family: 'Press Start 2P';
|
font-family: 'Press Start 2P';
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
background-color: #727678;
|
background-color: #727678;
|
||||||
|
white-space: pre-line;
|
||||||
|
}
|
||||||
|
.popUpElement .nes-container{
|
||||||
|
padding: 1rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popUpElement button {
|
.popUpElement button {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue