Add trigger message on cowebsite alt

This commit is contained in:
Alexis Faizeau 2022-02-01 18:42:07 +01:00
parent 7e966a7381
commit 33e1a369de
3 changed files with 10 additions and 3 deletions

View File

@ -20,7 +20,7 @@
onMount(() => {
icon.src = `${ICON_URL}/icon?url=${urlObject.hostname}&size=64..96..256&fallback_icon_color=14304c`;
icon.alt = urlObject.hostname;
icon.alt = coWebsite.altMessage ?? urlObject.hostname;
icon.onload = () => {
iconLoaded = true;
};
@ -205,7 +205,7 @@
}
&:not(.vertical) {
animation: bounce 0.35s ease 4 alternate;
animation: bounce 0.35s ease 6 alternate;
}
&.vertical {

View File

@ -66,6 +66,7 @@ export class GameMapPropertiesListener {
let websitePolicyProperty: string | undefined;
let websitePositionProperty: number | undefined;
let websiteTriggerProperty: string | undefined;
let websiteTriggerMessageProperty: string | undefined;
layer.properties.forEach((property) => {
switch (property.name) {
@ -84,6 +85,9 @@ export class GameMapPropertiesListener {
case GameMapProperties.OPEN_WEBSITE_TRIGGER:
websiteTriggerProperty = property.value as string | undefined;
break;
case GameMapProperties.OPEN_WEBSITE_TRIGGER_MESSAGE:
websiteTriggerMessageProperty = property.value as string | undefined;
break;
}
});

View File

@ -44,6 +44,7 @@ export type CoWebsite = {
allowPolicy: string | undefined;
allowApi: boolean | undefined;
jitsi?: boolean;
altMessage?: string;
};
class CoWebsiteManager {
@ -533,7 +534,8 @@ class CoWebsiteManager {
allowApi?: boolean,
allowPolicy?: string,
position?: number,
closable?: boolean
closable?: boolean,
altMessage?: string
): CoWebsite {
const iframe = document.createElement("iframe");
const fullUrl = new URL(url, base);
@ -547,6 +549,7 @@ class CoWebsiteManager {
closable: closable ?? false,
allowPolicy,
allowApi,
altMessage,
};
this.initialiseCowebsite(newCoWebsite, position);