MapComplete/UI/Image/ImageCarouselWithUpload.ts

61 lines
1.5 KiB
TypeScript
Raw Normal View History

2020-10-14 12:15:09 +02:00
import {TagDependantUIElement, TagDependantUIElementConstructor} from "../../Customizations/UIElementConstructor";
import {ImageCarousel} from "./ImageCarousel";
2020-10-14 12:15:09 +02:00
import {ImageUploadFlow} from "./ImageUploadFlow";
import Translation from "../i18n/Translation";
2020-10-14 12:15:09 +02:00
import {UIEventSource} from "../../Logic/UIEventSource";
2020-09-10 19:33:06 +02:00
export default class ImageCarouselWithUploadConstructor implements TagDependantUIElementConstructor{
IsKnown(properties: any): boolean {
return true;
}
IsQuestioning(properties: any): boolean {
return false;
}
construct(dependencies): TagDependantUIElement {
return new ImageCarouselWithUpload(dependencies);
}
GetContent(tags: any): Translation {
2020-10-14 12:15:09 +02:00
return new Translation({"*": "Image carousel with uploader"});
}
}
2020-10-14 12:15:09 +02:00
class OsmImageUploadHandler {
constructor(tags: UIEventSource<any>) {
}
}
class ImageCarouselWithUpload extends TagDependantUIElement {
private _imageElement: ImageCarousel;
private _pictureUploader: ImageUploadFlow;
2020-10-14 12:15:09 +02:00
constructor(tags: UIEventSource<any>) {
super(tags);
this._imageElement = new ImageCarousel(tags);
2020-10-14 12:15:09 +02:00
this._pictureUploader = new OsmImageUploadHandler(tags).getUI();
}
2020-07-21 00:07:04 +02:00
InnerRender(): string {
return this._imageElement.Render() +
this._pictureUploader.Render();
}
IsKnown(): boolean {
return true;
}
IsQuestioning(): boolean {
return false;
}
2020-07-25 01:07:02 +02:00
IsSkipped(): boolean {
return false;
}
}