diff --git a/AllTranslationAssets.ts b/AllTranslationAssets.ts index 6fb8faa..9c42287 100644 --- a/AllTranslationAssets.ts +++ b/AllTranslationAssets.ts @@ -54,7 +54,7 @@ export default class AllTranslationAssets { openLayerControl: new Translation( {"en":"Open the layer control box","ca":"Obrir el control de capes","es":"Abrir el control de capas","nl":"Open de laag-instellingen","fr":"Ouvrir la panneau de contrôle","de":"Das Ebenen-Kontrollkästchen öffnen"} ), layerNotEnabled: new Translation( {"en":"The layer {layer} is not enabled. Enable this layer to add a point","ca":"La capa {layer} no està habilitada. Fes-ho per poder afegir un punt a aquesta capa","es":"La capa {layer} no está habilitada. Hazlo para poder añadir un punto en esta capa","nl":"De laag {layer} is gedeactiveerd. Activeer deze om een punt toe te voegen","fr":"La couche [layer] est désactivée. Activez-la pour ajouter un point.","de":"Die Ebene {layer} ist nicht aktiviert. Aktivieren Sie diese Ebene, um einen Punkt hinzuzufügen"} ), }, - pickLanguage: new Translation( {"en":"Choose a language","ca":"Tria idioma","es":"Escoge idioma","nl":"Kies je taal","fr":"Choisir la langue","gl":"Escoller lingua","de":"Wählen Sie eine Sprache"} ), + pickLanguage: new Translation( {"en":"Choose a language","ca":"Tria idioma","es":"Escoge idioma","nl":"Kies je taal: ","fr":"Choisir la langue","gl":"Escoller lingua","de":"Wählen Sie eine Sprache"} ), about: new Translation( {"en":"Easily edit and add OpenStreetMap for a certain theme","ca":"Edita facilment i afegeix punts a OpenStreetMap d'una temàtica determinada","es":"Edita facilmente y añade puntos en OpenStreetMap de un tema concreto","nl":"Bewerk en voeg data toe aan OpenStreetMap over een specifiek onderwerp op een gemakkelijke manier","fr":"Éditer facilement et ajouter OpenStreetMap pour un certain thème","gl":"Editar doadamente e engadir puntos no OpenStreetMap dun eido en concreto","de":"OpenStreetMap für ein bestimmtes Thema einfach bearbeiten und hinzufügen"} ), nameInlineQuestion: new Translation( {"en":"The name of this {category} is $$$","ca":"{category}: El seu nom és $$$","es":"{category}: Su nombre es $$$","nl":"De naam van dit {category} is $$$","fr":"Le nom de cet/cette {category} est $$$","gl":"{category}: O teu nome é $$$","de":"Der Name dieser {category} ist $$$"} ), noNameCategory: new Translation( {"en":"{category} without a name","ca":"{category} sense nom","es":"{category} sin nombre","nl":"{category} zonder naam","fr":"{category} sans nom","gl":"{category} sen nome","de":"{category} ohne Namen"} ), diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index 8584109..2c163ca 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -276,6 +276,16 @@ export default class MetaTagging { } ); + + private static currentTime = new SimpleMetaTagger( + ["_date:now"], + "Adds the time that the data got loaded - pretty much the time of downloading from overpass. The format is YYYY-MM-DD hh:mm, aka 'sortable' aka ISO-8601-but-not-entirely", + feature => { + const now = new Date(); + // @ts-ignore + feature.properties["_date:now"] = now.toISOString().splice(0,-5).replace("T", " "); + } + ) private static metatags = [ MetaTagging.latlon, @@ -283,7 +293,8 @@ export default class MetaTagging { MetaTagging.country, MetaTagging.isOpen, MetaTagging.carriageWayWidth, - MetaTagging.directionSimplified + MetaTagging.directionSimplified, + MetaTagging.currentTime ]; diff --git a/README.md b/README.md index b3d7a52..65a9a35 100644 --- a/README.md +++ b/README.md @@ -265,3 +265,5 @@ Bench icons from StreetComplete: https://github.com/westnordost/StreetComplete/t Urinal icon: https://thenounproject.com/term/urinal/1307984/ 24/7 icon: https://www.vecteezy.com/vector-art/1394992-24-7-service-and-support-icon-set + +Translation-icon: https://commons.wikimedia.org/wiki/File:OOjs_UI_icon_language-ltr.svg \ No newline at end of file diff --git a/Svg.ts b/Svg.ts index 2505dc8..8207e7e 100644 --- a/Svg.ts +++ b/Svg.ts @@ -299,6 +299,11 @@ export default class Svg { public static statistics_svg() { return new FixedUiElement(Svg.statistics);} public static statistics_ui() { return new FixedUiElement(Svg.statistics_img);} + public static translate = " " + public static translate_img = Img.AsImageElement(Svg.translate) + public static translate_svg() { return new FixedUiElement(Svg.translate);} + public static translate_ui() { return new FixedUiElement(Svg.translate_img);} + public static up = " " public static up_img = Img.AsImageElement(Svg.up) public static up_svg() { return new FixedUiElement(Svg.up);} @@ -319,4 +324,4 @@ export default class Svg { public static wikipedia_svg() { return new FixedUiElement(Svg.wikipedia);} public static wikipedia_ui() { return new FixedUiElement(Svg.wikipedia_img);} -public static All = {"Ornament-Horiz-0.svg": Svg.Ornament_Horiz_0,"Ornament-Horiz-1.svg": Svg.Ornament_Horiz_1,"Ornament-Horiz-2.svg": Svg.Ornament_Horiz_2,"Ornament-Horiz-3.svg": Svg.Ornament_Horiz_3,"Ornament-Horiz-4.svg": Svg.Ornament_Horiz_4,"Ornament-Horiz-5.svg": Svg.Ornament_Horiz_5,"Ornament-Horiz-6.svg": Svg.Ornament_Horiz_6,"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"back.svg": Svg.back,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"circle.svg": Svg.circle,"clock.svg": Svg.clock,"close.svg": Svg.close,"compass.svg": Svg.compass,"cross_bottom_right.svg": Svg.cross_bottom_right,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"phone.svg": Svg.phone,"pin.svg": Svg.pin,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"ring.svg": Svg.ring,"search.svg": Svg.search,"send_email.svg": Svg.send_email,"share.svg": Svg.share,"square.svg": Svg.square,"star.svg": Svg.star,"star_half.svg": Svg.star_half,"star_outline.svg": Svg.star_outline,"star_outline_half.svg": Svg.star_outline_half,"statistics.svg": Svg.statistics,"up.svg": Svg.up,"wikidata.svg": Svg.wikidata,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};} +public static All = {"Ornament-Horiz-0.svg": Svg.Ornament_Horiz_0,"Ornament-Horiz-1.svg": Svg.Ornament_Horiz_1,"Ornament-Horiz-2.svg": Svg.Ornament_Horiz_2,"Ornament-Horiz-3.svg": Svg.Ornament_Horiz_3,"Ornament-Horiz-4.svg": Svg.Ornament_Horiz_4,"Ornament-Horiz-5.svg": Svg.Ornament_Horiz_5,"Ornament-Horiz-6.svg": Svg.Ornament_Horiz_6,"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"back.svg": Svg.back,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"circle.svg": Svg.circle,"clock.svg": Svg.clock,"close.svg": Svg.close,"compass.svg": Svg.compass,"cross_bottom_right.svg": Svg.cross_bottom_right,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"phone.svg": Svg.phone,"pin.svg": Svg.pin,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"ring.svg": Svg.ring,"search.svg": Svg.search,"send_email.svg": Svg.send_email,"share.svg": Svg.share,"square.svg": Svg.square,"star.svg": Svg.star,"star_half.svg": Svg.star_half,"star_outline.svg": Svg.star_outline,"star_outline_half.svg": Svg.star_outline_half,"statistics.svg": Svg.statistics,"translate.svg": Svg.translate,"up.svg": Svg.up,"wikidata.svg": Svg.wikidata,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};} diff --git a/UI/Base/Img.ts b/UI/Base/Img.ts index 6a019ca..76d00c5 100644 --- a/UI/Base/Img.ts +++ b/UI/Base/Img.ts @@ -12,8 +12,8 @@ export default class Img { return `data:image/svg+xml;base64,${(btoa(source))}`; } - static AsImageElement(source: string, css_class: string = ""): string{ - return ``; + static AsImageElement(source: string, css_class: string = "", style=""): string{ + return ``; } } diff --git a/UI/BigComponents/MoreScreen.ts b/UI/BigComponents/MoreScreen.ts index e2a59fd..6fe0524 100644 --- a/UI/BigComponents/MoreScreen.ts +++ b/UI/BigComponents/MoreScreen.ts @@ -98,8 +98,7 @@ export default class MoreScreen extends UIElement { linkButton.push(this.createLinkButton(layout)); } - els.push(new Combine(linkButton)) - + els.push(new VariableUiElement( State.state.osmConnection.userDetails.map(userDetails => { if (userDetails.csCount < Constants.userJourney.themeGeneratorReadOnlyUnlock) { @@ -112,6 +111,9 @@ export default class MoreScreen extends UIElement { }) )); + els.push(new Combine(linkButton)) + + const customThemesNames = State.state.installedThemes.data ?? []; if (customThemesNames.length > 0) { diff --git a/UI/BigComponents/ShareScreen.ts b/UI/BigComponents/ShareScreen.ts index 4301894..4408178 100644 --- a/UI/BigComponents/ShareScreen.ts +++ b/UI/BigComponents/ShareScreen.ts @@ -156,7 +156,7 @@ export default class ShareScreen extends UIElement { let hash = ""; if (layoutDefinition !== undefined) { literalText = `https://${host}${path}/` - if (layout.id.startsWith("wiki:")) { + if (layout.id.startsWith("http")) { parts.push("userlayout=" + encodeURIComponent(layout.id)) } else { hash = ("#" + layoutDefinition) diff --git a/UI/BigComponents/UserBadge.ts b/UI/BigComponents/UserBadge.ts index d96ec00..acb5dfb 100644 --- a/UI/BigComponents/UserBadge.ts +++ b/UI/BigComponents/UserBadge.ts @@ -25,7 +25,7 @@ export default class UserBadge extends UIElement { super(State.state.osmConnection.userDetails); this._userDetails = State.state.osmConnection.userDetails; this._languagePicker = (LanguagePicker.CreateLanguagePicker(State.state.layoutToUse.data.language) ?? new FixedUiElement("")) - .SetStyle("display:inline-block;width:min-content;"); + .SetStyle("width:min-content;"); this._loginButton = Translations.t.general.loginWithOpenStreetMap .Clone() @@ -70,15 +70,23 @@ export default class UserBadge extends UIElement { return this._loginButton.Render(); } + const linkStyle = "flex items-baseline" let messageSpan: UIElement = new Link( - new Combine([Svg.envelope, "" + user.totalMessages]), + new Combine([Svg.envelope, "" + user.totalMessages]).SetClass(linkStyle), 'https://www.openstreetmap.org/messages/inbox', true ) + const csCount = + new Link( + new Combine([Svg.star, "" + user.csCount]).SetClass(linkStyle), + `https://www.openstreetmap.org/user/${user.name}/history`, + true); + + if (user.unreadMessages > 0) { messageSpan = new Link( new Combine([Svg.envelope, "" + user.unreadMessages]), @@ -111,20 +119,14 @@ export default class UserBadge extends UIElement { true); - const csCount = - new Link( - new Combine([Svg.star, "" + user.csCount]), - `https://www.openstreetmap.org/user/${user.name}/history`, - true); - - const userStats = new Combine([ this._homeButton, settings, messageSpan, csCount, - this._logout, - this._languagePicker]) + this._languagePicker, + this._logout + ]) .SetClass("userstats") const usertext = new Combine([ diff --git a/UI/Input/DropDown.ts b/UI/Input/DropDown.ts index 625d985..0bf0ec8 100644 --- a/UI/Input/DropDown.ts +++ b/UI/Input/DropDown.ts @@ -62,7 +62,7 @@ export class DropDown extends InputElement { options += "" } - return `
` + + return `` + `` + `