forked from MapComplete/MapComplete
More refactoring!
This commit is contained in:
parent
b2c234b51d
commit
6ac8ec84e4
22 changed files with 170 additions and 158 deletions
16
UI/Base/Img.ts
Normal file
16
UI/Base/Img.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
export default class Img {
|
||||
|
||||
public static runningFromConsole = false;
|
||||
|
||||
static AsData(source:string){
|
||||
if(this.runningFromConsole){
|
||||
return source;
|
||||
}
|
||||
return `data:image/svg+xml;base64,${(btoa(source))}`;
|
||||
}
|
||||
|
||||
static AsImageElement(source: string): string{
|
||||
return `<img src="${Img.AsData(source)}">`;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue