This commit is contained in:
_Bastler
2022-01-26 12:44:08 +01:00
parent 31f6847b53
commit e3b58a0d56
23 changed files with 131 additions and 94 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ export type CoWebsite = {
iframe: HTMLIFrameElement;
// icon: HTMLDivElement;
position: number;
state : CoWebsiteState;
state: CoWebsiteState;
};
type CoWebsiteSlot = {
@@ -539,7 +539,7 @@ class CoWebsiteManager {
const coWebsite = {
iframe,
state : CoWebsiteState.OPENED,
state: CoWebsiteState.OPENED,
position: position ?? this.coWebsites.length,
};
+12 -12
View File
@@ -1,4 +1,4 @@
const sanitizeHtml = require('sanitize-html');
const sanitizeHtml = require("sanitize-html");
export class HtmlUtils {
public static getElementByIdOrFail<T extends HTMLElement>(id: string): T {
@@ -33,22 +33,22 @@ export class HtmlUtils {
return p.innerHTML;
}
public static sanitize(html : string | number | boolean | undefined): string {
public static sanitize(html: string | number | boolean | undefined): string {
if (typeof html === "string") {
return sanitizeHtml(html, {
allowedAttributes: {
'span': ['style'],
},
allowedStyles: {
'span': {
'color': [/^#(0x)?[0-9a-f]+$/i, /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/],
'font-size': [/^\d+(?:px|em|%)$/]
}
}
allowedAttributes: {
span: ["style"],
},
allowedStyles: {
span: {
color: [/^#(0x)?[0-9a-f]+$/i, /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/],
"font-size": [/^\d+(?:px|em|%)$/],
},
},
});
}
return "";
}
}
public static urlify(text: string, style: string = ""): string {
const urlRegex = /(https?:\/\/[^\s]+)/g;
+1 -1
View File
@@ -129,7 +129,7 @@ class JitsiFactory {
* Slugifies the room name and prepends the room name with the instance
*/
public getRoomName(roomName: string, instance: string): string {
if (!instance || instance == '') {
if (!instance || instance == "") {
return slugify(roomName);
}
return slugify(instance.replace("/", "-") + "-" + roomName);