" +
-
- this._imageElement.Render() +
- this._pictureUploader.Render() +
-
new VerticalCombine(info, "infobox-information ").Render() +
questionsHtml +
@@ -126,8 +116,6 @@ export class FeatureInfoBox extends UIElement {
Activate() {
super.Activate();
- this._imageElement.Activate();
- this._pictureUploader.Activate();
for (const infobox of this._infoboxes) {
infobox.Activate();
}
@@ -135,8 +123,6 @@ export class FeatureInfoBox extends UIElement {
Update() {
super.Update();
- this._imageElement.Update();
- this._pictureUploader.Update();
this._title.Update();
for (const infobox of this._infoboxes) {
infobox.Update();
diff --git a/UI/Image/ImageCarousel.ts b/UI/Image/ImageCarousel.ts
index f8f69c9d4..9d4e1fd00 100644
--- a/UI/Image/ImageCarousel.ts
+++ b/UI/Image/ImageCarousel.ts
@@ -8,8 +8,29 @@ import {Changes} from "../../Logic/Changes";
import {VariableUiElement} from "../Base/VariableUIElement";
import {ConfirmDialog} from "../ConfirmDialog";
import {UserDetails} from "../../Logic/OsmConnection";
+import {TagDependantUIElement, TagDependantUIElementConstructor} from "../../Customizations/UIElementConstructor";
+
+export class ImageCarouselConstructor implements TagDependantUIElementConstructor{
+ IsKnown(properties: any): boolean {
+ return true;
+ }
+
+ IsQuestioning(properties: any): boolean {
+ return false;
+ }
+
+ Priority(): number {
+ return 0;
+ }
+
+ construct(tags: UIEventSource
, changes: Changes): TagDependantUIElement {
+ return new ImageCarousel(tags, changes);
+ }
+
+}
+
+export class ImageCarousel extends TagDependantUIElement {
-export class ImageCarousel extends UIElement {
private readonly searcher: ImageSearcher;
@@ -98,6 +119,18 @@ export class ImageCarousel extends UIElement {
"";
}
+ IsKnown(): boolean {
+ return true;
+ }
+
+ IsQuestioning(): boolean {
+ return false;
+ }
+
+ Priority(): number {
+ return 0;
+ }
+
InnerUpdate(htmlElement: HTMLElement) {
super.InnerUpdate(htmlElement);
this._deleteButton.Update();
diff --git a/UI/Image/ImageCarouselWithUpload.ts b/UI/Image/ImageCarouselWithUpload.ts
new file mode 100644
index 000000000..231044aae
--- /dev/null
+++ b/UI/Image/ImageCarouselWithUpload.ts
@@ -0,0 +1,71 @@
+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;
+ }
+
+ construct(tags: UIEventSource, changes: Changes): TagDependantUIElement {
+ return new ImageCarouselWithUpload(tags, changes);
+ }
+}
+
+class ImageCarouselWithUpload extends TagDependantUIElement {
+ private _imageElement: ImageCarousel;
+ private _pictureUploader: ImageUploadFlow;
+
+ constructor(tags: UIEventSource, changes: Changes) {
+ super(tags);
+ this._imageElement = new ImageCarousel(tags, changes);
+ const userDetails = changes.login.userDetails;
+ const license = changes.login.GetPreference( "mapcomplete-pictures-license");
+ this._pictureUploader = new OsmImageUploadHandler(tags,
+ userDetails, license,
+ changes, this._imageElement.slideshow).getUI();
+
+ }
+
+ protected InnerRender(): string {
+ 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;
+ }
+
+ Priority(): number {
+ return 0;
+ }
+
+}
\ No newline at end of file
diff --git a/assets/ghost_bike.svg b/assets/ghost_bike.svg
new file mode 100644
index 000000000..1befcb799
--- /dev/null
+++ b/assets/ghost_bike.svg
@@ -0,0 +1,92 @@
+
+
diff --git a/index.ts b/index.ts
index 252cf5c50..73b8cea11 100644
--- a/index.ts
+++ b/index.ts
@@ -102,7 +102,6 @@ const leftMessage = new UIEventSource<() => UIElement>(undefined);
const selectedElement = new UIEventSource(undefined);
-const preferedPictureLicense = new UIEventSource(undefined);
const locationControl = new UIEventSource<{ lat: number, lon: number, zoom: number }>({
zoom: questSetToRender.startzoom,
@@ -137,21 +136,6 @@ const bm = new Basemap("leafletDiv", locationControl, new VariableUiElement(
));
-// ------------- Tie together user settings and UI -----------
-
-
-const picturesPrefName = "mapcomplete-pictures-license";
-preferedPictureLicense.addCallback((license) => {
- osmConnection.SetPreference(picturesPrefName, license);
-});
-
-osmConnection.preferences.addCallback((prefs) => {
- if (prefs[picturesPrefName] !== undefined) {
- preferedPictureLicense.setData(prefs[picturesPrefName]);
- }
-})
-
-
// ------------- Setup the layers -------------------------------
const addButtons: {
@@ -175,8 +159,7 @@ for (const layer of questSetToRender.layers) {
layer.title,
layer.elementsToShow,
changes,
- osmConnection.userDetails,
- preferedPictureLicense
+ osmConnection.userDetails
)
};
@@ -228,8 +211,7 @@ selectedElement.addCallback((data) => {
layer.title,
layer.elementsToShow,
changes,
- osmConnection.userDetails,
- preferedPictureLicense
+ osmConnection.userDetails
));
break;
}