From b764371cce57e4cb9df5943482ab354c8df0a300 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 6 Nov 2020 04:02:53 +0100 Subject: [PATCH] Finish refactoring --- Customizations/JSON/LayerConfig.ts | 4 +- Logic/Leaflet/StrayClickHandler.ts | 4 +- Logic/Osm/OsmConnection.ts | 4 +- Svg.ts | 4 + UI/CustomGenerator/AllLayersPanel.ts | 16 +- UI/CustomGenerator/CustomGeneratorPanel.ts | 9 +- UI/CustomGenerator/GenerateEmpty.ts | 8 +- UI/CustomGenerator/HelpText.ts | 3 +- UI/CustomGenerator/LayerPanel.ts | 9 +- UI/CustomGenerator/SavePanel.ts | 3 +- UI/Image/DeleteImage.ts | 3 +- UI/Image/ImageUploadFlow.ts | 3 +- UI/Image/SlideShow.ts | 12 +- UI/Img.ts | 2 - UI/Input/AndOrTagInput.ts | 9 +- UI/Input/MultiInput.ts | 6 +- UI/MoreScreen.ts | 3 +- UI/ShareScreen.ts | 18 +- UI/SimpleAddUI.ts | 8 +- assets/add.svg | 289 -------- assets/addSmall.svg | 288 -------- assets/ampersand.svg | 53 -- assets/arrow-left-smooth.svg | 76 --- assets/arrow-right-smooth.svg | 76 --- assets/bug.svg | 3 - assets/camera-plus.svg | 79 --- assets/checkmark.svg | 1 - assets/close.svg | 85 --- assets/crosshair-blue-center.svg | 103 --- assets/crosshair-blue.svg | 103 --- assets/crosshair.svg | 103 --- assets/delete.svg | 55 -- assets/down.svg | 58 -- assets/floppy.svg | 35 - assets/gear.svg | 1 - assets/help.svg | 42 -- assets/layers.svg | 66 -- assets/layersAdd.svg | 300 -------- assets/logo.svg | 297 -------- assets/or.svg | 54 -- assets/osm-logo-us.svg | 7 - assets/osm-logo.svg | 758 --------------------- assets/pencil.svg | 3 - assets/pop-out.svg | 7 - assets/questions/questions.json | 2 +- assets/reload.svg | 54 -- assets/search.svg | 6 - assets/share.svg | 100 --- assets/svg/no_checkmark.svg | 2 + assets/up.svg | 10 - assets/wikimedia-commons-white.svg | 22 - assets/wikipedia.svg | 3 - createLayouts.ts | 2 +- css/slideshow.css | 2 + index.html | 4 +- 55 files changed, 76 insertions(+), 3201 deletions(-) delete mode 100644 assets/add.svg delete mode 100644 assets/addSmall.svg delete mode 100644 assets/ampersand.svg delete mode 100644 assets/arrow-left-smooth.svg delete mode 100644 assets/arrow-right-smooth.svg delete mode 100644 assets/bug.svg delete mode 100644 assets/camera-plus.svg delete mode 100644 assets/checkmark.svg delete mode 100644 assets/close.svg delete mode 100644 assets/crosshair-blue-center.svg delete mode 100644 assets/crosshair-blue.svg delete mode 100644 assets/crosshair.svg delete mode 100644 assets/delete.svg delete mode 100644 assets/down.svg delete mode 100644 assets/floppy.svg delete mode 100644 assets/gear.svg delete mode 100644 assets/help.svg delete mode 100644 assets/layers.svg delete mode 100644 assets/layersAdd.svg delete mode 100644 assets/logo.svg delete mode 100644 assets/or.svg delete mode 100644 assets/osm-logo-us.svg delete mode 100644 assets/osm-logo.svg delete mode 100644 assets/pencil.svg delete mode 100644 assets/pop-out.svg delete mode 100644 assets/reload.svg delete mode 100644 assets/search.svg delete mode 100644 assets/share.svg create mode 100644 assets/svg/no_checkmark.svg delete mode 100644 assets/up.svg delete mode 100644 assets/wikimedia-commons-white.svg delete mode 100644 assets/wikipedia.svg diff --git a/Customizations/JSON/LayerConfig.ts b/Customizations/JSON/LayerConfig.ts index 48a19c2..7b610b1 100644 --- a/Customizations/JSON/LayerConfig.ts +++ b/Customizations/JSON/LayerConfig.ts @@ -6,6 +6,8 @@ import {FromJSON} from "./FromJSON"; import SharedTagRenderings from "../SharedTagRenderings"; import {TagRenderingConfigJson} from "./TagRenderingConfigJson"; import {Translation} from "../../UI/i18n/Translation"; +import {Img} from "../../UI/Img"; +import Svg from "../../Svg"; export default class LayerConfig { id: string; @@ -106,7 +108,7 @@ export default class LayerConfig { this.title = tr("title", ""); - this.icon = tr("icon", "./assets/bug.svg"); + this.icon = tr("icon", Img.AsData(Svg.bug)); this.iconSize = tr("iconSize", "40,40,center"); this.color = tr("color", "#0000ff"); this.width = tr("width", "7"); diff --git a/Logic/Leaflet/StrayClickHandler.ts b/Logic/Leaflet/StrayClickHandler.ts index ca7fcdc..b8ab83d 100644 --- a/Logic/Leaflet/StrayClickHandler.ts +++ b/Logic/Leaflet/StrayClickHandler.ts @@ -1,6 +1,8 @@ import * as L from "leaflet"; import {UIElement} from "../../UI/UIElement"; import State from "../../State"; +import {Img} from "../../UI/Img"; +import Svg from "../../Svg"; /** * The stray-click-hanlders adds a marker to the map if no feature was clicked. @@ -33,7 +35,7 @@ export class StrayClickHandler { } self._lastMarker = L.marker([lastClick.lat, lastClick.lon], { icon: L.icon({ - iconUrl: "./assets/add.svg", + iconUrl: Img.AsData(Svg.add), iconSize: [50, 50], iconAnchor: [25, 50], popupAnchor: [0, -45] diff --git a/Logic/Osm/OsmConnection.ts b/Logic/Osm/OsmConnection.ts index 2def74c..d98bfff 100644 --- a/Logic/Osm/OsmConnection.ts +++ b/Logic/Osm/OsmConnection.ts @@ -5,6 +5,8 @@ import {OsmPreferences} from "./OsmPreferences"; import {ChangesetHandler} from "./ChangesetHandler"; import {Layout} from "../../Customizations/Layout"; import {ElementStorage} from "../ElementStorage"; +import {Img} from "../../UI/Img"; +import Svg from "../../Svg"; export class UserDetails { @@ -157,7 +159,7 @@ export class OsmConnection { if (imgEl !== undefined && imgEl[0] !== undefined) { data.img = imgEl[0].getAttribute("href"); } - data.img = data.img ?? "./assets/osm-logo.svg"; + data.img = data.img ?? Img.AsData(Svg.osm_logo); const homeEl = userInfo.getElementsByTagName("home"); if (homeEl !== undefined && homeEl[0] !== undefined) { diff --git a/Svg.ts b/Svg.ts index 2d941d5..7a11237 100644 --- a/Svg.ts +++ b/Svg.ts @@ -104,6 +104,10 @@ export default class Svg { public static mapillary_img = Img.AsImageElement(Svg.mapillary) public static mapillary_ui() { return new FixedUiElement(Svg.mapillary_img);} + public static no_checkmark = " " + public static no_checkmark_img = Img.AsImageElement(Svg.no_checkmark) + public static no_checkmark_ui() { return new FixedUiElement(Svg.no_checkmark_img);} + public static or = " image/svg+xml " public static or_img = Img.AsImageElement(Svg.or) public static or_ui() { return new FixedUiElement(Svg.or_img);} diff --git a/UI/CustomGenerator/AllLayersPanel.ts b/UI/CustomGenerator/AllLayersPanel.ts index 3fe9b20..34b00ea 100644 --- a/UI/CustomGenerator/AllLayersPanel.ts +++ b/UI/CustomGenerator/AllLayersPanel.ts @@ -11,9 +11,10 @@ import {MultiInput} from "../Input/MultiInput"; import TagRenderingPanel from "./TagRenderingPanel"; import SingleSetting from "./SingleSetting"; import {VariableUiElement} from "../Base/VariableUIElement"; -import {FromJSON} from "../../Customizations/JSON/FromJSON"; import AvailableBaseLayers from "../../Logic/AvailableBaseLayers"; import {DropDown} from "../Input/DropDown"; +import TagRenderingConfig from "../../Customizations/JSON/TagRenderingConfig"; +import Svg from "../../Svg"; export default class AllLayersPanel extends UIElement { @@ -67,27 +68,26 @@ export default class AllLayersPanel extends UIElement { const layer = config.layers[i]; if (typeof layer !== "string") { try { - const iconTagRendering = FromJSON.TagRendering(layer.icon, "icon"); - const icon = iconTagRendering.GetContent({"id": "node/-1"}).txt; + const iconTagRendering = new TagRenderingConfig(layer.icon, "icon") + const icon = iconTagRendering.GetRenderValue({"id": "node/-1"}).txt; return `` } catch (e) { - return "" + return Svg.bug_img // Nothing to do here } } - return "" - + return Svg.help_img; })), content: new LayerPanelWithPreview(this._config, this.languages, i, userDetails) }); } tabs.push({ - header: "", + header: Svg.layersAdd_img, content: new Combine([ "

Layer editor

", "In this tab page, you can add and edit the layers of the theme. Click the layers above or add a new layer to get started.", new SubtleButton( - "./assets/layersAdd.svg", + Svg.layersAdd_ui(), "Add a new layer" ).onClick(() => { self._config.data.layers.push(GenerateEmpty.createEmptyLayer()) diff --git a/UI/CustomGenerator/CustomGeneratorPanel.ts b/UI/CustomGenerator/CustomGeneratorPanel.ts index 5d6e561..d8c1999 100644 --- a/UI/CustomGenerator/CustomGeneratorPanel.ts +++ b/UI/CustomGenerator/CustomGeneratorPanel.ts @@ -16,6 +16,7 @@ import {FixedUiElement} from "../Base/FixedUiElement"; import SavePanel from "./SavePanel"; import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource"; import HelpText from "./HelpText"; +import Svg from "../../Svg"; export default class CustomGeneratorPanel extends UIElement { @@ -66,7 +67,7 @@ export default class CustomGeneratorPanel extends UIElement { ]).SetClass("preview") this.mainPanel = new TabbedComponent([ { - header: "", + header: Svg.gear_img, content: new PageSplit( generalSettings.SetStyle("width: 50vw;"), @@ -77,16 +78,16 @@ export default class CustomGeneratorPanel extends UIElement { ) }, { - header: "", + header: Svg.layers_img, content: new AllLayersPanel(es, languages, userDetails) }, { - header: "", + header: Svg.floppy_img, content: new SavePanel(this.connection, es, chronic) }, { - header: "", + header:Svg.share_img, content: new SharePanel(es, liveUrl, userDetails) } ]) diff --git a/UI/CustomGenerator/GenerateEmpty.ts b/UI/CustomGenerator/GenerateEmpty.ts index ebd2d20..34defb8 100644 --- a/UI/CustomGenerator/GenerateEmpty.ts +++ b/UI/CustomGenerator/GenerateEmpty.ts @@ -14,7 +14,7 @@ export class GenerateEmpty { tagRenderings: [], hideUnderlayingFeaturesMinPercentage: 0, icon: { - render: "./assets/bug.svg" + render: "./assets/svg/bug.svg" }, width: { render: "8" @@ -36,7 +36,7 @@ export class GenerateEmpty { description: {}, language: [], maintainer: "", - icon: "./assets/bug.svg", + icon: "./assets/svg/bug.svg", version: "0", startLat: 0, startLon: 0, @@ -58,7 +58,7 @@ export class GenerateEmpty { description: {"en": "A layout for testing"}, language: ["en"], maintainer: "Pieter Vander Vennet", - icon: "./assets/bug.svg", + icon: "./assets/svg/bug.svg", version: "0", startLat: 0, startLon: 0, @@ -72,7 +72,7 @@ export class GenerateEmpty { overpassTags: {and: ["highway=residential"]}, title: {}, description: {"en": "Some Description"}, - icon: {render: {en: "./assets/pencil.svg"}}, + icon: {render: {en: "./assets/svg/pencil.svg"}}, width: {render: {en: "5"}}, tagRenderings: [{ render: {"en":"Test Rendering"} diff --git a/UI/CustomGenerator/HelpText.ts b/UI/CustomGenerator/HelpText.ts index 2769790..880fe65 100644 --- a/UI/CustomGenerator/HelpText.ts +++ b/UI/CustomGenerator/HelpText.ts @@ -4,6 +4,7 @@ import {VariableUiElement} from "../Base/VariableUIElement"; import {SubtleButton} from "../Base/SubtleButton"; import Combine from "../Base/Combine"; import SingleSetting from "./SingleSetting"; +import Svg from "../../Svg"; export default class HelpText extends UIElement { @@ -12,7 +13,7 @@ export default class HelpText extends UIElement { constructor(currentSetting: UIEventSource>) { super(); - this.returnButton = new SubtleButton("./assets/close.svg", + this.returnButton = new SubtleButton(Svg.close_ui(), new VariableUiElement( currentSetting.map(currentSetting => { if (currentSetting === undefined) { diff --git a/UI/CustomGenerator/LayerPanel.ts b/UI/CustomGenerator/LayerPanel.ts index bbd440c..6b89bca 100644 --- a/UI/CustomGenerator/LayerPanel.ts +++ b/UI/CustomGenerator/LayerPanel.ts @@ -20,8 +20,7 @@ import {UserDetails} from "../../Logic/Osm/OsmConnection"; import State from "../../State"; import {FixedUiElement} from "../Base/FixedUiElement"; import ValidatedTextField from "../Input/ValidatedTextField"; -import {TagRendering} from "../Popup/TagRendering"; -import {Utils} from "../../Utils"; +import Svg from "../../Svg"; /** * Shows the configuration for a single layer @@ -51,7 +50,7 @@ export default class LayerPanel extends UIElement { this.mapRendering = this.setupRenderOptions(config, languages, index, currentlySelected, userDetails); const actualDeleteButton = new SubtleButton( - "./assets/delete.svg", + Svg.delete_icon_ui(), "Yes, delete this layer" ).onClick(() => { config.data.layers.splice(index, 1); @@ -63,7 +62,7 @@ export default class LayerPanel extends UIElement { [ "

Confirm layer deletion

", new SubtleButton( - "./assets/close.svg", + Svg.close_ui(), "No, don't delete" ), "Deleting a layer can not be undone!", @@ -71,7 +70,7 @@ export default class LayerPanel extends UIElement { ] ), new SubtleButton( - "./assets/delete.svg", + Svg.delete_icon_ui(), "Remove this layer" ) ) diff --git a/UI/CustomGenerator/SavePanel.ts b/UI/CustomGenerator/SavePanel.ts index 6279524..333796c 100644 --- a/UI/CustomGenerator/SavePanel.ts +++ b/UI/CustomGenerator/SavePanel.ts @@ -7,6 +7,7 @@ import {OsmConnection} from "../../Logic/Osm/OsmConnection"; import {FixedUiElement} from "../Base/FixedUiElement"; import {TextField} from "../Input/TextField"; import {SubtleButton} from "../Base/SubtleButton"; +import Svg from "../../Svg"; export default class SavePanel extends UIElement { private json: UIElement; @@ -39,7 +40,7 @@ export default class SavePanel extends UIElement { textAreaRows: 20 }); this.json = jsonTextField; - this.loadFromJson = new SubtleButton("./assets/reload.svg", "Load the JSON file below") + this.loadFromJson = new SubtleButton(Svg.reload_ui(), "Load the JSON file below") .onClick(() => { try{ const json = jsonTextField.GetValue().data; diff --git a/UI/Image/DeleteImage.ts b/UI/Image/DeleteImage.ts index 2007b15..b59af06 100644 --- a/UI/Image/DeleteImage.ts +++ b/UI/Image/DeleteImage.ts @@ -5,6 +5,7 @@ import CheckBox from "../Input/CheckBox"; import Combine from "../Base/Combine"; import State from "../../State"; import {Tag} from "../../Logic/Tags"; +import Svg from "../../Svg"; export default class DeleteImage extends UIElement { @@ -35,7 +36,7 @@ export default class DeleteImage extends UIElement { cancelButton ]).SetStyle("display:flex;flex-direction:column;"), - "" + Svg.delete_icon_ui().SetStyle('width:1.5em;display:block;padding-left: calc(50% - 0.75em);') ) } diff --git a/UI/Image/ImageUploadFlow.ts b/UI/Image/ImageUploadFlow.ts index 29d9b66..0e8815a 100644 --- a/UI/Image/ImageUploadFlow.ts +++ b/UI/Image/ImageUploadFlow.ts @@ -8,6 +8,7 @@ import {Imgur} from "../../Logic/Web/Imgur"; import {DropDown} from "../Input/DropDown"; import {Tag} from "../../Logic/Tags"; import Translations from "../i18n/Translations"; +import Svg from "../../Svg"; export class ImageUploadFlow extends UIElement { private readonly _licensePicker: UIElement; @@ -96,7 +97,7 @@ export class ImageUploadFlow extends UIElement { ]); const label = new Combine([ - " ", + Svg.camera_plus_ui().SetStyle("width: 36px;height: 36px;padding: 0.1em;margin-top: 5px;border-radius: 0;float: left;display:block"), Translations.t.image.addPicture .SetStyle("width:max-content;font-size: 28px;" + "font-weight: bold;" + diff --git a/UI/Image/SlideShow.ts b/UI/Image/SlideShow.ts index c629cab..3a36c36 100644 --- a/UI/Image/SlideShow.ts +++ b/UI/Image/SlideShow.ts @@ -27,7 +27,8 @@ export class SlideShow extends UIElement { const self = this; this._prev = new Combine([ "
", - Svg.arrow_left_smooth_img]).SetStyle("prev-button") + Svg.arrow_left_smooth_img]) + .SetClass("prev-button") .onClick(() => { const current = self._currentSlide.data; self.MoveTo(current - 1); @@ -64,11 +65,12 @@ export class SlideShow extends UIElement { } slides += "
" + embeddedElement.Render() + "
\n"; } - return new Combine(["
" - , this._prev + return new Combine([ + this._prev , "
", slides, "
" - , this._next - , "
"]).Render(); + , this._next]) + .SetClass('image-slideshow') + .Render(); } public MoveTo(index: number) { diff --git a/UI/Img.ts b/UI/Img.ts index de735e0..cab2a1f 100644 --- a/UI/Img.ts +++ b/UI/Img.ts @@ -12,7 +12,5 @@ export class Img { static AsImageElement(source: string): string{ return ``; } - static readonly checkmark = ``; - static readonly no_checkmark = ``; } diff --git a/UI/Input/AndOrTagInput.ts b/UI/Input/AndOrTagInput.ts index 74f5e0a..7f41ab1 100644 --- a/UI/Input/AndOrTagInput.ts +++ b/UI/Input/AndOrTagInput.ts @@ -7,7 +7,6 @@ import CheckBox from "./CheckBox"; import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson"; import {MultiTagInput} from "./MultiTagInput"; import Svg from "../../Svg"; -import {Img} from "../Img"; class AndOrConfig implements AndOrTagConfigJson { public and: (string | AndOrTagConfigJson)[] = undefined; @@ -32,13 +31,13 @@ export default class AndOrTagInput extends InputElement { super(); const self = this; this._isAndButton = new CheckBox( - new SubtleButton(Img.AsData(Svg.ampersand), null).SetClass("small-button"), - new SubtleButton(Img.AsData(Svg.or), null).SetClass("small-button"), + new SubtleButton(Svg.ampersand_ui(), null).SetClass("small-button"), + new SubtleButton(Svg.or_ui(), null).SetClass("small-button"), this._isAnd); this._addBlock = - new SubtleButton(Img.AsData(Svg.addSmall), "Add an and/or-expression") + new SubtleButton(Svg.addSmall_ui(), "Add an and/or-expression") .SetClass("small-button") .onClick(() => {self.createNewBlock()}); @@ -65,7 +64,7 @@ export default class AndOrTagInput extends InputElement { private createDeleteButton(elementId: string): UIElement { const self = this; - return new SubtleButton(Img.AsData(Svg.delete_icon), null).SetClass("small-button") + return new SubtleButton(Svg.delete_icon_ui(), null).SetClass("small-button") .onClick(() => { for (let i = 0; i < self._subAndOrs.length; i++) { if (self._subAndOrs[i].id === elementId) { diff --git a/UI/Input/MultiInput.ts b/UI/Input/MultiInput.ts index c95df1a..22f9fdf 100644 --- a/UI/Input/MultiInput.ts +++ b/UI/Input/MultiInput.ts @@ -3,9 +3,7 @@ import {UIEventSource} from "../../Logic/UIEventSource"; import {UIElement} from "../UIElement"; import Combine from "../Base/Combine"; import {SubtleButton} from "../Base/SubtleButton"; -import {FixedUiElement} from "../Base/FixedUiElement"; import Svg from "../../Svg"; -import {Img} from "../Img"; export class MultiInput extends InputElement { @@ -30,7 +28,7 @@ export class MultiInput extends InputElement { this.ListenTo(value.map((latest : T[]) => latest.length)); this._options = options ?? {}; - this.addTag = new SubtleButton(Img.AsData(Svg.addSmall), addAElement) + this.addTag = new SubtleButton(Svg.addSmall_ui(), addAElement) .SetClass("small-button") .onClick(() => { this.IsSelected.setData(true); @@ -72,7 +70,7 @@ export class MultiInput extends InputElement { this.inputELements.push(input); input.IsSelected.addCallback(() => this.UpdateIsSelected()); - const moveUpBtn = new FixedUiElement(Img.AsData(Svg.up)) + const moveUpBtn = Svg.up_ui() .onClick(() => { const v = self._value.data[i]; self._value.data[i] = self._value.data[i - 1]; diff --git a/UI/MoreScreen.ts b/UI/MoreScreen.ts index 7d1f797..fb5dab3 100644 --- a/UI/MoreScreen.ts +++ b/UI/MoreScreen.ts @@ -79,8 +79,7 @@ export class MoreScreen extends UIElement { if (userDetails.csCount < State.userJourney.themeGeneratorReadOnlyUnlock) { return tr.requestATheme.Render(); } - return new SubtleButton( - Img.AsData(Svg.pencil), tr.createYourOwnTheme, { + return new SubtleButton(Svg.pencil_ui(), tr.createYourOwnTheme, { url: "./customGenerator.html", newTab: false }).Render(); diff --git a/UI/ShareScreen.ts b/UI/ShareScreen.ts index a97bb34..b6d00ce 100644 --- a/UI/ShareScreen.ts +++ b/UI/ShareScreen.ts @@ -34,8 +34,8 @@ export class ShareScreen extends UIElement { const optionParts: (UIEventSource)[] = []; const includeLocation = new CheckBox( - new Combine([Img.checkmark, tr.fsIncludeCurrentLocation]), - new Combine([Img.no_checkmark, tr.fsIncludeCurrentLocation]), + new Combine([Svg.checkmark, tr.fsIncludeCurrentLocation]), + new Combine([Svg.no_checkmark, tr.fsIncludeCurrentLocation]), true ) optionCheckboxes.push(includeLocation); @@ -69,8 +69,8 @@ export class ShareScreen extends UIElement { return tr.fsIncludeCurrentBackgroundMap.Subs({name: layer?.name ?? ""}).Render(); })); const includeCurrentBackground = new CheckBox( - new Combine([Img.checkmark, currentBackground]), - new Combine([Img.no_checkmark, currentBackground]), + new Combine([Svg.checkmark, currentBackground]), + new Combine([Svg.no_checkmark, currentBackground]), true ) optionCheckboxes.push(includeCurrentBackground); @@ -84,8 +84,8 @@ export class ShareScreen extends UIElement { const includeLayerChoices = new CheckBox( - new Combine([Img.checkmark, tr.fsIncludeCurrentLayers]), - new Combine([Img.no_checkmark, tr.fsIncludeCurrentLayers]), + new Combine([Svg.checkmark, tr.fsIncludeCurrentLayers]), + new Combine([Svg.no_checkmark, tr.fsIncludeCurrentLayers]), true ) optionCheckboxes.push(includeLayerChoices); @@ -114,8 +114,8 @@ export class ShareScreen extends UIElement { for (const swtch of switches) { const checkbox = new CheckBox( - new Combine([Img.checkmark, Translations.W(swtch.human)]), - new Combine([Img.no_checkmark, Translations.W(swtch.human)]), !swtch.reverse + new Combine([Svg.checkmark, Translations.W(swtch.human)]), + new Combine([Svg.no_checkmark, Translations.W(swtch.human)]), !swtch.reverse ); optionCheckboxes.push(checkbox); optionParts.push(checkbox.isEnabled.map((isEn) => { @@ -187,7 +187,7 @@ export class ShareScreen extends UIElement { return ""; } - return new SubtleButton(Img.AsData(Svg.pencil), + return new SubtleButton(Svg.pencil_ui(), new Combine([tr.editThisTheme.SetClass("bold"), "
", tr.editThemeDescription]), {url: `./customGenerator.html#${State.state.layoutDefinition}`, newTab: true}).Render(); diff --git a/UI/SimpleAddUI.ts b/UI/SimpleAddUI.ts index e02fa36..bed3179 100644 --- a/UI/SimpleAddUI.ts +++ b/UI/SimpleAddUI.ts @@ -30,7 +30,7 @@ export class SimpleAddUI extends UIElement { private confirmButton: UIElement = undefined; private openLayerControl: UIElement; private cancelButton: UIElement; - private goToInboxButton: UIElement = new SubtleButton(Img.AsData(Svg.envelope), + private goToInboxButton: UIElement = new SubtleButton(Svg.envelope_ui(), Translations.t.general.goToInbox, {url:"https://www.openstreetmap.org/messages/inbox", newTab: false}); constructor() { @@ -97,15 +97,13 @@ export class SimpleAddUI extends UIElement { } } - this.cancelButton = new SubtleButton( - Img.AsData(Svg.close), + this.cancelButton = new SubtleButton(Svg.close_ui(), Translations.t.general.cancel ).onClick(() => { self._confirmPreset.setData(undefined); }) - this.openLayerControl = new SubtleButton( - Img.AsData(Svg.layers), + this.openLayerControl = new SubtleButton(Svg.layers_ui(), Translations.t.general.add.openLayerControl ).onClick(() => { State.state.layerControlIsOpened.setData(true); diff --git a/assets/add.svg b/assets/add.svg deleted file mode 100644 index cc4b162..0000000 --- a/assets/add.svg +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/addSmall.svg b/assets/addSmall.svg deleted file mode 100644 index 59051c8..0000000 --- a/assets/addSmall.svg +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/ampersand.svg b/assets/ampersand.svg deleted file mode 100644 index 525a1ef..0000000 --- a/assets/ampersand.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/assets/arrow-left-smooth.svg b/assets/arrow-left-smooth.svg deleted file mode 100644 index 1139447..0000000 --- a/assets/arrow-left-smooth.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/assets/arrow-right-smooth.svg b/assets/arrow-right-smooth.svg deleted file mode 100644 index 7cc17c6..0000000 --- a/assets/arrow-right-smooth.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/assets/bug.svg b/assets/bug.svg deleted file mode 100644 index 5f33a14..0000000 --- a/assets/bug.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/assets/camera-plus.svg b/assets/camera-plus.svg deleted file mode 100644 index 77201f2..0000000 --- a/assets/camera-plus.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/assets/checkmark.svg b/assets/checkmark.svg deleted file mode 100644 index 59d073f..0000000 --- a/assets/checkmark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/close.svg b/assets/close.svg deleted file mode 100644 index 82be2b8..0000000 --- a/assets/close.svg +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/assets/crosshair-blue-center.svg b/assets/crosshair-blue-center.svg deleted file mode 100644 index 55996b6..0000000 --- a/assets/crosshair-blue-center.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/assets/crosshair-blue.svg b/assets/crosshair-blue.svg deleted file mode 100644 index 82ff998..0000000 --- a/assets/crosshair-blue.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/assets/crosshair.svg b/assets/crosshair.svg deleted file mode 100644 index ff7f105..0000000 --- a/assets/crosshair.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/assets/delete.svg b/assets/delete.svg deleted file mode 100644 index 60bf193..0000000 --- a/assets/delete.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/assets/down.svg b/assets/down.svg deleted file mode 100644 index f5b0cc2..0000000 --- a/assets/down.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - diff --git a/assets/floppy.svg b/assets/floppy.svg deleted file mode 100644 index 9eae121..0000000 --- a/assets/floppy.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/assets/gear.svg b/assets/gear.svg deleted file mode 100644 index 302fac4..0000000 --- a/assets/gear.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/help.svg b/assets/help.svg deleted file mode 100644 index 1f6bad7..0000000 --- a/assets/help.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/assets/layers.svg b/assets/layers.svg deleted file mode 100644 index 6eb851c..0000000 --- a/assets/layers.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - diff --git a/assets/layersAdd.svg b/assets/layersAdd.svg deleted file mode 100644 index 927e6c8..0000000 --- a/assets/layersAdd.svg +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/logo.svg b/assets/logo.svg deleted file mode 100644 index bd2eb3c..0000000 --- a/assets/logo.svg +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/or.svg b/assets/or.svg deleted file mode 100644 index 12e9510..0000000 --- a/assets/or.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/assets/osm-logo-us.svg b/assets/osm-logo-us.svg deleted file mode 100644 index 21ada51..0000000 --- a/assets/osm-logo-us.svg +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/assets/osm-logo.svg b/assets/osm-logo.svg deleted file mode 100644 index cc5e0d4..0000000 --- a/assets/osm-logo.svg +++ /dev/null @@ -1,758 +0,0 @@ - - - - OpenStreetMap logo 2011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - OpenStreetMap logo 2011 - - - Ken Vermette - - - - April 2011 - - - OpenStreetMap.org - - - Replacement logo for OpenStreetMap Foundation - - - OSM openstreetmap logo - - - http://wiki.openstreetmap.org/wiki/File:Public-images-osm_logo.svg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 010110010011010110010011 - 010110010011010110010011 - - - \ No newline at end of file diff --git a/assets/pencil.svg b/assets/pencil.svg deleted file mode 100644 index 6f9610f..0000000 --- a/assets/pencil.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/assets/pop-out.svg b/assets/pop-out.svg deleted file mode 100644 index 6a4cad6..0000000 --- a/assets/pop-out.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - \ No newline at end of file diff --git a/assets/questions/questions.json b/assets/questions/questions.json index d84ef8e..678df97 100644 --- a/assets/questions/questions.json +++ b/assets/questions/questions.json @@ -4,7 +4,7 @@ }, "osmlink": { - "render": "OSM", + "render": "", "mappings":[{ "if": "id~=-", "then": "Uploading..." diff --git a/assets/reload.svg b/assets/reload.svg deleted file mode 100644 index bc315bb..0000000 --- a/assets/reload.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/search.svg b/assets/search.svg deleted file mode 100644 index 42c7066..0000000 --- a/assets/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/assets/share.svg b/assets/share.svg deleted file mode 100644 index d70d175..0000000 --- a/assets/share.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/assets/svg/no_checkmark.svg b/assets/svg/no_checkmark.svg new file mode 100644 index 0000000..3199381 --- /dev/null +++ b/assets/svg/no_checkmark.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/up.svg b/assets/up.svg deleted file mode 100644 index bd0fde6..0000000 --- a/assets/up.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/assets/wikimedia-commons-white.svg b/assets/wikimedia-commons-white.svg deleted file mode 100644 index 9fc0c79..0000000 --- a/assets/wikimedia-commons-white.svg +++ /dev/null @@ -1,22 +0,0 @@ - - -Wikimedia Commons Logo - - - - - - - - - - - - - - - - - - - diff --git a/assets/wikipedia.svg b/assets/wikipedia.svg deleted file mode 100644 index 87876d4..0000000 --- a/assets/wikipedia.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -Wikipedia logo version 2 \ No newline at end of file diff --git a/createLayouts.ts b/createLayouts.ts index 4c14ef9..b9f8052 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -222,7 +222,7 @@ function createLandingPage(layout: Layout) { .replace(/.+?<\/title>/, `<title>${ogTitle}`) .replace("Loading MapComplete, hang on...", `Loading MapComplete theme ${ogTitle}...`) .replace("", customCss) - .replace(``, + .replace(``, ``); try { diff --git a/css/slideshow.css b/css/slideshow.css index 8184a8a..ce4074a 100644 --- a/css/slideshow.css +++ b/css/slideshow.css @@ -1,6 +1,7 @@ .image-slideshow { position: relative; + display: block; text-align: center; max-width: 100%; margin-top: 1em; @@ -8,6 +9,7 @@ } .slides { + display: block; overflow: hidden; } diff --git a/index.html b/index.html index aaa8d15..70be6c3 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ - + @@ -34,7 +34,7 @@ id="decoration-desktop"> - +