| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  | import {TagDependantUIElement, TagDependantUIElementConstructor} from "../../Customizations/UIElementConstructor"; | 
					
						
							|  |  |  | import {ImageCarousel} from "./ImageCarousel"; | 
					
						
							|  |  |  | import {OsmImageUploadHandler} from "../../Logic/OsmImageUploadHandler"; | 
					
						
							|  |  |  | import {UIEventSource} from "../UIEventSource"; | 
					
						
							|  |  |  | import {Changes} from "../../Logic/Changes"; | 
					
						
							|  |  |  | import {UserDetails} from "../../Logic/OsmConnection"; | 
					
						
							|  |  |  | import {ImageUploadFlow} from "../ImageUploadFlow"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export class ImageCarouselWithUploadConstructor implements TagDependantUIElementConstructor{ | 
					
						
							|  |  |  |     IsKnown(properties: any): boolean { | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     IsQuestioning(properties: any): boolean { | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Priority(): number { | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-17 17:21:07 +02:00
										 |  |  |     construct(dependencies): TagDependantUIElement { | 
					
						
							|  |  |  |         return new ImageCarouselWithUpload(dependencies); | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ImageCarouselWithUpload extends TagDependantUIElement { | 
					
						
							|  |  |  |     private _imageElement: ImageCarousel; | 
					
						
							|  |  |  |     private _pictureUploader: ImageUploadFlow; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-17 14:24:31 +02:00
										 |  |  |     constructor(dependencies: {tags: UIEventSource<any>, changes: Changes}) { | 
					
						
							|  |  |  |         super(dependencies.tags); | 
					
						
							|  |  |  |         const tags = dependencies.tags; | 
					
						
							|  |  |  |         const changes = dependencies.changes; | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  |         this._imageElement = new ImageCarousel(tags, changes); | 
					
						
							|  |  |  |         const userDetails = changes.login.userDetails; | 
					
						
							| 
									
										
										
										
											2020-07-21 00:07:04 +02:00
										 |  |  |         const license = changes.login.GetPreference( "pictures-license"); | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  |         this._pictureUploader = new OsmImageUploadHandler(tags, | 
					
						
							|  |  |  |             userDetails, license, | 
					
						
							|  |  |  |             changes, this._imageElement.slideshow).getUI(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-21 00:07:04 +02:00
										 |  |  |     InnerRender(): string { | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  |         return this._imageElement.Render() + | 
					
						
							|  |  |  |             this._pictureUploader.Render(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Activate() { | 
					
						
							|  |  |  |         super.Activate(); | 
					
						
							|  |  |  |         this._imageElement.Activate(); | 
					
						
							|  |  |  |         this._pictureUploader.Activate(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Update() { | 
					
						
							|  |  |  |         super.Update(); | 
					
						
							|  |  |  |         this._imageElement.Update(); | 
					
						
							|  |  |  |         this._pictureUploader.Update(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     IsKnown(): boolean { | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     IsQuestioning(): boolean { | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-07-25 01:07:02 +02:00
										 |  |  |      | 
					
						
							|  |  |  |     IsSkipped(): boolean { | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Priority(): number { | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |