Fix build
This commit is contained in:
parent
b36b103ed3
commit
79f8940898
64 changed files with 277 additions and 249 deletions
|
@ -1,17 +1,17 @@
|
||||||
import {All} from "./Layouts/All";
|
|
||||||
import {StreetWidth} from "./Layouts/StreetWidth";
|
|
||||||
import {LayerDefinition} from "./LayerDefinition";
|
import {LayerDefinition} from "./LayerDefinition";
|
||||||
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
|
import {Layout} from "./Layout";
|
||||||
import {Smoothness} from "./Layouts/Smoothness";
|
import {All} from "./Layouts/All";
|
||||||
import {Natuurpunt} from "./Layouts/Natuurpunt";
|
import {CustomLayout} from "../Logic/CustomLayers";
|
||||||
import {Groen} from "./Layouts/Groen";
|
import {Groen} from "./Layouts/Groen";
|
||||||
import Cyclofix from "./Layouts/Cyclofix";
|
import Cyclofix from "./Layouts/Cyclofix";
|
||||||
import {Layout} from "./Layout";
|
import {StreetWidth} from "./Layouts/StreetWidth";
|
||||||
import {CustomLayout} from "../Logic/CustomLayers";
|
|
||||||
import {GRB} from "./Layouts/GRB";
|
import {GRB} from "./Layouts/GRB";
|
||||||
import {Artworks} from "./Layouts/Artworks";
|
import {Artworks} from "./Layouts/Artworks";
|
||||||
|
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
|
||||||
import {WalkByBrussels} from "./Layouts/WalkByBrussels";
|
import {WalkByBrussels} from "./Layouts/WalkByBrussels";
|
||||||
|
import {Smoothness} from "./Layouts/Smoothness";
|
||||||
import {MetaMap} from "./Layouts/MetaMap";
|
import {MetaMap} from "./Layouts/MetaMap";
|
||||||
|
import {Natuurpunt} from "./Layouts/Natuurpunt";
|
||||||
import {Bookcases} from "./Layouts/Bookcases";
|
import {Bookcases} from "./Layouts/Bookcases";
|
||||||
|
|
||||||
export class AllKnownLayouts {
|
export class AllKnownLayouts {
|
||||||
|
@ -31,7 +31,8 @@ export class AllKnownLayouts {
|
||||||
new ClimbingTrees(),
|
new ClimbingTrees(),
|
||||||
new Artworks(),
|
new Artworks(),
|
||||||
new Smoothness(),
|
new Smoothness(),
|
||||||
/*new Toilets(),
|
/*
|
||||||
|
new Toilets(),
|
||||||
*/
|
*/
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Tag, TagsFilter} from "../Logic/TagsFilter";
|
import {Tag, TagsFilter} from "../Logic/TagsFilter";
|
||||||
import {UIElement} from "../UI/UIElement";
|
import {UIElement} from "../UI/UIElement";
|
||||||
import {TagRenderingOptions} from "./TagRendering";
|
|
||||||
import {TagDependantUIElementConstructor} from "./UIElementConstructor";
|
import {TagDependantUIElementConstructor} from "./UIElementConstructor";
|
||||||
|
import {TagRenderingOptions} from "./TagRenderingOptions";
|
||||||
|
|
||||||
export interface Preset {
|
export interface Preset {
|
||||||
tags: Tag[],
|
tags: Tag[],
|
||||||
|
|
|
@ -3,9 +3,9 @@ import {Tag} from "../../Logic/TagsFilter";
|
||||||
import L from "leaflet";
|
import L from "leaflet";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import Website from "../Questions/Website";
|
import Website from "../Questions/Website";
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Artwork extends LayerDefinition {
|
export class Artwork extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ import ShopRepair from "../Questions/bike/ShopRepair";
|
||||||
import ShopDiy from "../Questions/bike/ShopDiy";
|
import ShopDiy from "../Questions/bike/ShopDiy";
|
||||||
import ShopName from "../Questions/bike/ShopName";
|
import ShopName from "../Questions/bike/ShopName";
|
||||||
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
||||||
import { TagRenderingOptions } from "../TagRendering";
|
|
||||||
import { PhoneNumberQuestion } from "../Questions/PhoneNumberQuestion";
|
import { PhoneNumberQuestion } from "../Questions/PhoneNumberQuestion";
|
||||||
import Website from "../Questions/Website";
|
import Website from "../Questions/Website";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeOtherShops extends LayerDefinition {
|
export default class BikeOtherShops extends LayerDefinition {
|
||||||
|
|
|
@ -10,10 +10,10 @@ import ShopRepair from "../Questions/bike/ShopRepair";
|
||||||
import ShopDiy from "../Questions/bike/ShopDiy";
|
import ShopDiy from "../Questions/bike/ShopDiy";
|
||||||
import ShopName from "../Questions/bike/ShopName";
|
import ShopName from "../Questions/bike/ShopName";
|
||||||
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
||||||
import { TagRenderingOptions } from "../TagRendering";
|
|
||||||
import {PhoneNumberQuestion} from "../Questions/PhoneNumberQuestion";
|
import {PhoneNumberQuestion} from "../Questions/PhoneNumberQuestion";
|
||||||
import Website from "../Questions/Website";
|
import Website from "../Questions/Website";
|
||||||
import {EmailQuestion} from "../Questions/EmailQuestion";
|
import {EmailQuestion} from "../Questions/EmailQuestion";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeShops extends LayerDefinition {
|
export default class BikeShops extends LayerDefinition {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWi
|
||||||
import PumpOperational from "../Questions/bike/PumpOperational";
|
import PumpOperational from "../Questions/bike/PumpOperational";
|
||||||
import PumpValves from "../Questions/bike/PumpValves";
|
import PumpValves from "../Questions/bike/PumpValves";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
import { TagRenderingOptions } from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeStations extends LayerDefinition {
|
export default class BikeStations extends LayerDefinition {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Birdhide extends LayerDefinition {
|
export class Birdhide extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {NameInline} from "../Questions/NameInline";
|
import {NameInline} from "../Questions/NameInline";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
import T from "../../UI/i18n/Translation";
|
import T from "../../UI/i18n/Translation";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Bookcases extends LayerDefinition {
|
export class Bookcases extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ import {And, Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {OperatorTag} from "../Questions/OperatorTag";
|
import {OperatorTag} from "../Questions/OperatorTag";
|
||||||
import * as L from "leaflet";
|
import * as L from "leaflet";
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class DrinkingWater extends LayerDefinition {
|
export class DrinkingWater extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {Tag} from "../../Logic/TagsFilter";
|
import {Tag} from "../../Logic/TagsFilter";
|
||||||
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
|
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import L from "leaflet";
|
import L from "leaflet";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class GhostBike extends LayerDefinition {
|
export class GhostBike extends LayerDefinition {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Regex, Tag} from "../../Logic/TagsFilter";
|
import {And, Regex, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class GrbToFix extends LayerDefinition {
|
export class GrbToFix extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {And, Tag} from "../../Logic/TagsFilter";
|
import {And, Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class InformationBoard extends LayerDefinition {
|
export class InformationBoard extends LayerDefinition {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {And, Tag} from "../../Logic/TagsFilter";
|
import {And, Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Map extends LayerDefinition {
|
export class Map extends LayerDefinition {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {Or, Tag} from "../../Logic/TagsFilter";
|
import {Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {AccessTag} from "../Questions/AccessTag";
|
import {AccessTag} from "../Questions/AccessTag";
|
||||||
import {OperatorTag} from "../Questions/OperatorTag";
|
import {OperatorTag} from "../Questions/OperatorTag";
|
||||||
import {NameQuestion} from "../Questions/NameQuestion";
|
import {NameQuestion} from "../Questions/NameQuestion";
|
||||||
import {NameInline} from "../Questions/NameInline";
|
import {NameInline} from "../Questions/NameInline";
|
||||||
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class NatureReserves extends LayerDefinition {
|
export class NatureReserves extends LayerDefinition {
|
||||||
|
|
||||||
|
@ -30,13 +30,6 @@ export class NatureReserves extends LayerDefinition {
|
||||||
this.style = this.generateStyleFunction();
|
this.style = this.generateStyleFunction();
|
||||||
this.elementsToShow = [
|
this.elementsToShow = [
|
||||||
new ImageCarouselWithUploadConstructor(),
|
new ImageCarouselWithUploadConstructor(),
|
||||||
/* new TagRenderingOptions({
|
|
||||||
freeform: {
|
|
||||||
key: "_surface",
|
|
||||||
renderTemplate: "{_surface}m²",
|
|
||||||
template: "$$$"
|
|
||||||
}
|
|
||||||
}),*/
|
|
||||||
new NameQuestion(),
|
new NameQuestion(),
|
||||||
new AccessTag(),
|
new AccessTag(),
|
||||||
new OperatorTag(),
|
new OperatorTag(),
|
||||||
|
@ -111,9 +104,9 @@ export class NatureReserves extends LayerDefinition {
|
||||||
return function (properties: any) {
|
return function (properties: any) {
|
||||||
let questionSeverity = 0;
|
let questionSeverity = 0;
|
||||||
for (const qd of self.elementsToShow) {
|
for (const qd of self.elementsToShow) {
|
||||||
if(qd instanceof DescriptionQuestion){
|
//if(qd instanceof DescriptionQuestion){
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
if (qd.IsQuestioning(properties)) {
|
if (qd.IsQuestioning(properties)) {
|
||||||
questionSeverity = Math.max(questionSeverity, qd.Priority() ?? 0);
|
questionSeverity = Math.max(questionSeverity, qd.Priority() ?? 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@ import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {AccessTag} from "../Questions/AccessTag";
|
import {AccessTag} from "../Questions/AccessTag";
|
||||||
import {OperatorTag} from "../Questions/OperatorTag";
|
import {OperatorTag} from "../Questions/OperatorTag";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {NameQuestion} from "../Questions/NameQuestion";
|
import {NameQuestion} from "../Questions/NameQuestion";
|
||||||
import {NameInline} from "../Questions/NameInline";
|
import {NameInline} from "../Questions/NameInline";
|
||||||
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Park extends LayerDefinition {
|
export class Park extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {FixedUiElement} from "../../UI/Base/FixedUiElement";
|
||||||
import FixedText from "../Questions/FixedText";
|
import FixedText from "../Questions/FixedText";
|
||||||
import {Tag} from "../../Logic/TagsFilter";
|
import {Tag} from "../../Logic/TagsFilter";
|
||||||
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Viewpoint extends LayerDefinition {
|
export class Viewpoint extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Not, Or, Tag} from "../../Logic/TagsFilter";
|
import {And, Not, Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIEventSource} from "../../UI/UIEventSource";
|
import {UIEventSource} from "../../UI/UIEventSource";
|
||||||
import {Park} from "./Park";
|
import {Park} from "./Park";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class Widths extends LayerDefinition {
|
export class Widths extends LayerDefinition {
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import {Layout} from "../Layout";
|
import {Layout} from "../Layout";
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {Or, Tag} from "../../Logic/TagsFilter";
|
import {Or, Tag} from "../../Logic/TagsFilter";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class SmoothnessLayer extends LayerDefinition {
|
export class SmoothnessLayer extends LayerDefinition {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super("smoothness");
|
||||||
this.name = "smoothness";
|
this.name = "smoothness";
|
||||||
this.minzoom = 17;
|
this.minzoom = 17;
|
||||||
this.overpassFilter = new Or([
|
this.overpassFilter = new Or([
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIEventSource} from "../../UI/UIEventSource";
|
import {UIEventSource} from "../../UI/UIEventSource";
|
||||||
import {Changes} from "../../Logic/Osm/Changes";
|
import {Changes} from "../../Logic/Osm/Changes";
|
||||||
import {And, Tag} from "../../Logic/TagsFilter";
|
import {And, Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class AccessTag extends TagRenderingOptions {
|
export class AccessTag extends TagRenderingOptions {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class DescriptionQuestion extends TagRenderingOptions{
|
export class DescriptionQuestion extends TagRenderingOptions{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIElement} from "../../UI/UIElement";
|
import {UIElement} from "../../UI/UIElement";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class EmailQuestion extends TagRenderingOptions {
|
export class EmailQuestion extends TagRenderingOptions {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TagRenderingOptions } from "../TagRendering";
|
|
||||||
import {UIElement} from "../../UI/UIElement";
|
import {UIElement} from "../../UI/UIElement";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export default class FixedText extends TagRenderingOptions {
|
export default class FixedText extends TagRenderingOptions {
|
||||||
constructor(category: string | UIElement) {
|
constructor(category: string | UIElement) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {And, Tag} from "../../Logic/TagsFilter";
|
import {And, Tag} from "../../Logic/TagsFilter";
|
||||||
import {UIElement} from "../../UI/UIElement";
|
import {UIElement} from "../../UI/UIElement";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class NameInline extends TagRenderingOptions{
|
export class NameInline extends TagRenderingOptions{
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
* One is a big 'name-question', the other is the 'edit name' in the title.
|
* One is a big 'name-question', the other is the 'edit name' in the title.
|
||||||
* THis one is the big question
|
* THis one is the big question
|
||||||
*/
|
*/
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {Tag} from "../../Logic/TagsFilter";
|
import {Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class NameQuestion extends TagRenderingOptions{
|
export class NameQuestion extends TagRenderingOptions{
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIEventSource} from "../../UI/UIEventSource";
|
import {UIEventSource} from "../../UI/UIEventSource";
|
||||||
import {Changes} from "../../Logic/Osm/Changes";
|
import {Changes} from "../../Logic/Osm/Changes";
|
||||||
import {Tag} from "../../Logic/TagsFilter";
|
import {Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class OperatorTag extends TagRenderingOptions {
|
export class OperatorTag extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {Img} from "../../UI/Img";
|
import {Img} from "../../UI/Img";
|
||||||
import {Tag} from "../../Logic/TagsFilter";
|
import {Tag} from "../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class OsmLink extends TagRenderingOptions {
|
export class OsmLink extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIElement} from "../../UI/UIElement";
|
import {UIElement} from "../../UI/UIElement";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
export class PhoneNumberQuestion extends TagRenderingOptions {
|
export class PhoneNumberQuestion extends TagRenderingOptions {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
|
||||||
import {UIElement} from "../../UI/UIElement";
|
import {UIElement} from "../../UI/UIElement";
|
||||||
import Translations from "../../UI/i18n/Translations";
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class Website extends TagRenderingOptions {
|
export default class Website extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class WikipediaLink extends TagRenderingOptions {
|
export class WikipediaLink extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class CafeDiy extends TagRenderingOptions {
|
export default class CafeDiy extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class CafeName extends TagRenderingOptions {
|
export default class CafeName extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class CafePump extends TagRenderingOptions {
|
export default class CafePump extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class CafeRepair extends TagRenderingOptions {
|
export default class CafeRepair extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TagRenderingOptions } from "../../TagRendering";
|
|
||||||
import { Tag } from "../../../Logic/TagsFilter";
|
import { Tag } from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ParkingAccessCargo extends TagRenderingOptions {
|
export default class ParkingAccessCargo extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
import { TagRenderingOptions } from "../../TagRendering";
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ParkingCapacity extends TagRenderingOptions {
|
export default class ParkingCapacity extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
import { TagRenderingOptions } from "../../TagRendering";
|
|
||||||
import Combine from "../../../UI/Base/Combine";
|
import Combine from "../../../UI/Base/Combine";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ParkingCapacityCargo extends TagRenderingOptions {
|
export default class ParkingCapacityCargo extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TagRenderingOptions } from "../../TagRendering";
|
|
||||||
import { Tag } from "../../../Logic/TagsFilter";
|
import { Tag } from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ParkingCovered extends TagRenderingOptions {
|
export default class ParkingCovered extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag, And} from "../../../Logic/TagsFilter";
|
import {Tag, And} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ParkingOperator extends TagRenderingOptions {
|
export default class ParkingOperator extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
import Combine from "../../../UI/Base/Combine";
|
import Combine from "../../../UI/Base/Combine";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
class ParkingTypeHelper {
|
class ParkingTypeHelper {
|
||||||
static GenerateMappings() {
|
static GenerateMappings() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class PumpManometer extends TagRenderingOptions {
|
export default class PumpManometer extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class PumpManual extends TagRenderingOptions {
|
export default class PumpManual extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class PumpOperational extends TagRenderingOptions {
|
export default class PumpOperational extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class PumpValves extends TagRenderingOptions{
|
export default class PumpValves extends TagRenderingOptions{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopDiy extends TagRenderingOptions {
|
export default class ShopDiy extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopPump extends TagRenderingOptions {
|
export default class ShopPump extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopPump extends TagRenderingOptions {
|
export default class ShopPump extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopRental extends TagRenderingOptions {
|
export default class ShopRental extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopRepair extends TagRenderingOptions {
|
export default class ShopRepair extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopRetail extends TagRenderingOptions {
|
export default class ShopRetail extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class ShopPump extends TagRenderingOptions {
|
export default class ShopPump extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class StationChain extends TagRenderingOptions {
|
export default class StationChain extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeStationOperator extends TagRenderingOptions {
|
export default class BikeStationOperator extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag, And} from "../../../Logic/TagsFilter";
|
import {Tag, And} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeStationPumpTools extends TagRenderingOptions {
|
export default class BikeStationPumpTools extends TagRenderingOptions {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {TagRenderingOptions} from "../../TagRendering";
|
|
||||||
import {Tag} from "../../../Logic/TagsFilter";
|
import {Tag} from "../../../Logic/TagsFilter";
|
||||||
import Translations from "../../../UI/i18n/Translations";
|
import Translations from "../../../UI/i18n/Translations";
|
||||||
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeStationStand extends TagRenderingOptions {
|
export default class BikeStationStand extends TagRenderingOptions {
|
||||||
|
|
|
@ -3,11 +3,8 @@ import {UIEventSource} from "../UI/UIEventSource";
|
||||||
import {And, Tag, TagsFilter, TagUtils} from "../Logic/TagsFilter";
|
import {And, Tag, TagsFilter, TagUtils} from "../Logic/TagsFilter";
|
||||||
import {FixedUiElement} from "../UI/Base/FixedUiElement";
|
import {FixedUiElement} from "../UI/Base/FixedUiElement";
|
||||||
import {SaveButton} from "../UI/SaveButton";
|
import {SaveButton} from "../UI/SaveButton";
|
||||||
import {Changes} from "../Logic/Osm/Changes";
|
|
||||||
import {VariableUiElement} from "../UI/Base/VariableUIElement";
|
import {VariableUiElement} from "../UI/Base/VariableUIElement";
|
||||||
import {Dependencies, TagDependantUIElement, TagDependantUIElementConstructor} from "./UIElementConstructor";
|
import {TagDependantUIElement} from "./UIElementConstructor";
|
||||||
import {OnlyShowIfConstructor} from "./OnlyShowIf";
|
|
||||||
import {UserDetails} from "../Logic/Osm/OsmConnection";
|
|
||||||
import {TextField} from "../UI/Input/TextField";
|
import {TextField} from "../UI/Input/TextField";
|
||||||
import {InputElement} from "../UI/Input/InputElement";
|
import {InputElement} from "../UI/Input/InputElement";
|
||||||
import {InputElementWrapper} from "../UI/Input/InputElementWrapper";
|
import {InputElementWrapper} from "../UI/Input/InputElementWrapper";
|
||||||
|
@ -15,151 +12,11 @@ import {FixedInputElement} from "../UI/Input/FixedInputElement";
|
||||||
import {RadioButton} from "../UI/Input/RadioButton";
|
import {RadioButton} from "../UI/Input/RadioButton";
|
||||||
import Translations from "../UI/i18n/Translations";
|
import Translations from "../UI/i18n/Translations";
|
||||||
import Locale from "../UI/i18n/Locale";
|
import Locale from "../UI/i18n/Locale";
|
||||||
import * as EmailValidator from 'email-validator';
|
|
||||||
import {parsePhoneNumberFromString} from 'libphonenumber-js'
|
|
||||||
import {State} from "../State";
|
import {State} from "../State";
|
||||||
|
import {TagRenderingOptions} from "./TagRenderingOptions";
|
||||||
|
|
||||||
|
|
||||||
export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
export class TagRendering extends UIElement implements TagDependantUIElement {
|
||||||
|
|
||||||
|
|
||||||
public static inputValidation = {
|
|
||||||
"$": (str) => true,
|
|
||||||
"string": (str) => true,
|
|
||||||
"int": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)),
|
|
||||||
"nat": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) > 0,
|
|
||||||
"float": (str) => !isNaN(Number(str)),
|
|
||||||
"pfloat": (str) => !isNaN(Number(str)) && Number(str) > 0,
|
|
||||||
"email": (str) => EmailValidator.validate(str),
|
|
||||||
"phone": (str, country) => {
|
|
||||||
return parsePhoneNumberFromString(str, country.toUpperCase())?.isValid() ?? false;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
public static formatting = {
|
|
||||||
"phone": (str, country) => {
|
|
||||||
console.log("country formatting", country)
|
|
||||||
return parsePhoneNumberFromString(str, country.toUpperCase()).formatInternational()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: by not giving a 'question', one disables the question form alltogether
|
|
||||||
*/
|
|
||||||
|
|
||||||
public options: {
|
|
||||||
priority?: number;
|
|
||||||
question?: string | UIElement;
|
|
||||||
freeform?: {
|
|
||||||
key: string;
|
|
||||||
tagsPreprocessor?: (tags: any) => any;
|
|
||||||
template: string | UIElement;
|
|
||||||
renderTemplate: string | UIElement;
|
|
||||||
placeholder?: string | UIElement;
|
|
||||||
extraTags?: TagsFilter
|
|
||||||
};
|
|
||||||
mappings?: { k: TagsFilter; txt: string | UIElement; priority?: number, substitute?: boolean }[]
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
constructor(options: {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the string that is shown in the popup if this tag is missing.
|
|
||||||
*
|
|
||||||
* If 'question' is undefined, then the question is never asked at all
|
|
||||||
* If the question is "" (empty string) then the question is
|
|
||||||
*/
|
|
||||||
question?: UIElement | string,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What is the priority of the question.
|
|
||||||
* By default, in the popup of a feature, only one question is shown at the same time. If multiple questions are unanswered, the question with the highest priority is asked first
|
|
||||||
*/
|
|
||||||
priority?: number,
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mappings convert a well-known tag combination into a user friendly text.
|
|
||||||
* It converts e.g. 'access=yes' into 'this area can be accessed'
|
|
||||||
*
|
|
||||||
* If there are multiple tags that should be matched, And can be used. All tags in AND will be added when the question is picked (and the corresponding text will only be shown if all tags are present).
|
|
||||||
* If AND is used, it is best practice to make sure every used tag is in every option (with empty string) to erase extra tags.
|
|
||||||
*
|
|
||||||
* If a 'k' is null, then this one is shown by default. It can be used to force a default value, e.g. to show that the name of a POI is not (yet) known .
|
|
||||||
* A mapping where 'k' is null will not be shown as option in the radio buttons.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
mappings?: { k: TagsFilter, txt: UIElement | string, priority?: number, substitute?: boolean }[],
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If one wants to render a freeform tag (thus no predefined key/values) or if there are a few well-known tags with a freeform object,
|
|
||||||
* use this.
|
|
||||||
* In the question, it'll offer a textfield
|
|
||||||
*/
|
|
||||||
freeform?: {
|
|
||||||
key: string,
|
|
||||||
template: string | UIElement,
|
|
||||||
renderTemplate: string | UIElement
|
|
||||||
placeholder?: string | UIElement,
|
|
||||||
extraTags?: TagsFilter,
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* In some very rare cases, tags have to be rewritten before displaying
|
|
||||||
* This function can be used for that.
|
|
||||||
* This function is ran on a _copy_ of the original properties
|
|
||||||
*/
|
|
||||||
tagsPreprocessor?: ((tags: any) => void)
|
|
||||||
}) {
|
|
||||||
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnlyShowIf(tagsFilter: TagsFilter): TagDependantUIElementConstructor {
|
|
||||||
return new OnlyShowIfConstructor(tagsFilter, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IsQuestioning(tags: any): boolean {
|
|
||||||
const tagsKV = TagUtils.proprtiesToKV(tags);
|
|
||||||
|
|
||||||
for (const oneOnOneElement of this.options.mappings ?? []) {
|
|
||||||
if (oneOnOneElement.k === null || oneOnOneElement.k.matches(tagsKV)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.options.freeform !== undefined && tags[this.options.freeform.key] !== undefined) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.options.question === undefined) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
construct(dependencies: Dependencies): TagDependantUIElement {
|
|
||||||
return new TagRendering(dependencies.tags, this.options);
|
|
||||||
}
|
|
||||||
|
|
||||||
IsKnown(properties: any): boolean {
|
|
||||||
return !this.IsQuestioning(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
Priority(): number {
|
|
||||||
return this.options.priority ?? 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class TagRendering extends UIElement implements TagDependantUIElement {
|
|
||||||
|
|
||||||
|
|
||||||
private _priority: number;
|
private _priority: number;
|
||||||
|
@ -189,6 +46,13 @@ class TagRendering extends UIElement implements TagDependantUIElement {
|
||||||
private readonly _editMode: UIEventSource<boolean> = new UIEventSource<boolean>(false);
|
private readonly _editMode: UIEventSource<boolean> = new UIEventSource<boolean>(false);
|
||||||
|
|
||||||
|
|
||||||
|
private static injected = TagRendering.injectFunction();
|
||||||
|
static injectFunction() {
|
||||||
|
// This is a workaround as not to import tagrendering into TagREnderingOptions
|
||||||
|
TagRenderingOptions.tagRendering = (tags, options) => new TagRendering(tags, options);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(tags: UIEventSource<any>, options: {
|
constructor(tags: UIEventSource<any>, options: {
|
||||||
priority?: number
|
priority?: number
|
||||||
|
|
||||||
|
|
146
Customizations/TagRenderingOptions.ts
Normal file
146
Customizations/TagRenderingOptions.ts
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
import {Dependencies, TagDependantUIElement, TagDependantUIElementConstructor} from "./UIElementConstructor";
|
||||||
|
import * as EmailValidator from "email-validator";
|
||||||
|
import {parsePhoneNumberFromString} from "libphonenumber-js";
|
||||||
|
import {UIElement} from "../UI/UIElement";
|
||||||
|
import {TagsFilter, TagUtils} from "../Logic/TagsFilter";
|
||||||
|
import {OnlyShowIfConstructor} from "./OnlyShowIf";
|
||||||
|
import {UIEventSource} from "../UI/UIEventSource";
|
||||||
|
|
||||||
|
export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
||||||
|
|
||||||
|
|
||||||
|
public static inputValidation = {
|
||||||
|
"$": (str) => true,
|
||||||
|
"string": (str) => true,
|
||||||
|
"int": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)),
|
||||||
|
"nat": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) > 0,
|
||||||
|
"float": (str) => !isNaN(Number(str)),
|
||||||
|
"pfloat": (str) => !isNaN(Number(str)) && Number(str) > 0,
|
||||||
|
"email": (str) => EmailValidator.validate(str),
|
||||||
|
"phone": (str, country) => {
|
||||||
|
return parsePhoneNumberFromString(str, country.toUpperCase())?.isValid() ?? false;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
public static formatting = {
|
||||||
|
"phone": (str, country) => {
|
||||||
|
console.log("country formatting", country)
|
||||||
|
return parsePhoneNumberFromString(str, country.toUpperCase()).formatInternational()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: by not giving a 'question', one disables the question form alltogether
|
||||||
|
*/
|
||||||
|
|
||||||
|
public options: {
|
||||||
|
priority?: number;
|
||||||
|
question?: string | UIElement;
|
||||||
|
freeform?: {
|
||||||
|
key: string;
|
||||||
|
tagsPreprocessor?: (tags: any) => any;
|
||||||
|
template: string | UIElement;
|
||||||
|
renderTemplate: string | UIElement;
|
||||||
|
placeholder?: string | UIElement;
|
||||||
|
extraTags?: TagsFilter
|
||||||
|
};
|
||||||
|
mappings?: { k: TagsFilter; txt: string | UIElement; priority?: number, substitute?: boolean }[]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
constructor(options: {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the string that is shown in the popup if this tag is missing.
|
||||||
|
*
|
||||||
|
* If 'question' is undefined, then the question is never asked at all
|
||||||
|
* If the question is "" (empty string) then the question is
|
||||||
|
*/
|
||||||
|
question?: UIElement | string,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What is the priority of the question.
|
||||||
|
* By default, in the popup of a feature, only one question is shown at the same time. If multiple questions are unanswered, the question with the highest priority is asked first
|
||||||
|
*/
|
||||||
|
priority?: number,
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mappings convert a well-known tag combination into a user friendly text.
|
||||||
|
* It converts e.g. 'access=yes' into 'this area can be accessed'
|
||||||
|
*
|
||||||
|
* If there are multiple tags that should be matched, And can be used. All tags in AND will be added when the question is picked (and the corresponding text will only be shown if all tags are present).
|
||||||
|
* If AND is used, it is best practice to make sure every used tag is in every option (with empty string) to erase extra tags.
|
||||||
|
*
|
||||||
|
* If a 'k' is null, then this one is shown by default. It can be used to force a default value, e.g. to show that the name of a POI is not (yet) known .
|
||||||
|
* A mapping where 'k' is null will not be shown as option in the radio buttons.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
mappings?: { k: TagsFilter, txt: UIElement | string, priority?: number, substitute?: boolean }[],
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If one wants to render a freeform tag (thus no predefined key/values) or if there are a few well-known tags with a freeform object,
|
||||||
|
* use this.
|
||||||
|
* In the question, it'll offer a textfield
|
||||||
|
*/
|
||||||
|
freeform?: {
|
||||||
|
key: string,
|
||||||
|
template: string | UIElement,
|
||||||
|
renderTemplate: string | UIElement
|
||||||
|
placeholder?: string | UIElement,
|
||||||
|
extraTags?: TagsFilter,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In some very rare cases, tags have to be rewritten before displaying
|
||||||
|
* This function can be used for that.
|
||||||
|
* This function is ran on a _copy_ of the original properties
|
||||||
|
*/
|
||||||
|
tagsPreprocessor?: ((tags: any) => void)
|
||||||
|
}) {
|
||||||
|
|
||||||
|
this.options = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
OnlyShowIf(tagsFilter: TagsFilter): TagDependantUIElementConstructor {
|
||||||
|
return new OnlyShowIfConstructor(tagsFilter, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IsQuestioning(tags: any): boolean {
|
||||||
|
const tagsKV = TagUtils.proprtiesToKV(tags);
|
||||||
|
|
||||||
|
for (const oneOnOneElement of this.options.mappings ?? []) {
|
||||||
|
if (oneOnOneElement.k === null || oneOnOneElement.k.matches(tagsKV)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.options.freeform !== undefined && tags[this.options.freeform.key] !== undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.options.question === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static tagRendering : (tags: UIEventSource<any>, options: { priority?: number; question?: string | UIElement; freeform?: { key: string; tagsPreprocessor?: (tags: any) => any; template: string | UIElement; renderTemplate: string | UIElement; placeholder?: string | UIElement; extraTags?: TagsFilter }; mappings?: { k: TagsFilter; txt: string | UIElement; priority?: number; substitute?: boolean }[] }) => TagDependantUIElement;
|
||||||
|
construct(dependencies: Dependencies): TagDependantUIElement {
|
||||||
|
return TagRenderingOptions.tagRendering(dependencies.tags, this.options);
|
||||||
|
}
|
||||||
|
|
||||||
|
IsKnown(properties: any): boolean {
|
||||||
|
return !this.IsQuestioning(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
Priority(): number {
|
||||||
|
return this.options.priority ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
import {UIEventSource} from "../UI/UIEventSource";
|
import {UIEventSource} from "../UI/UIEventSource";
|
||||||
import {Changes} from "../Logic/Osm/Changes";
|
|
||||||
import {UIElement} from "../UI/UIElement";
|
import {UIElement} from "../UI/UIElement";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ import {LayerSelection} from "./UI/LayerSelection";
|
||||||
import {CustomLayersPanel} from "./Logic/CustomLayersPanel";
|
import {CustomLayersPanel} from "./Logic/CustomLayersPanel";
|
||||||
import {CustomLayout} from "./Logic/CustomLayers";
|
import {CustomLayout} from "./Logic/CustomLayers";
|
||||||
import {Preset} from "./Customizations/LayerDefinition";
|
import {Preset} from "./Customizations/LayerDefinition";
|
||||||
|
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
||||||
|
import {LayerUpdater} from "./Logic/LayerUpdater";
|
||||||
|
|
||||||
export class InitUiElements {
|
export class InitUiElements {
|
||||||
|
|
||||||
|
@ -124,6 +126,26 @@ export class InitUiElements {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static InitBaseMap(){
|
||||||
|
State.state.bm = new Basemap("leafletDiv", State.state.locationControl, new VariableUiElement(
|
||||||
|
State.state.locationControl.map((location) => {
|
||||||
|
const mapComplete = "<a href='https://github.com/pietervdvn/MapComplete' target='_blank'>Mapcomple</a> " +
|
||||||
|
" " +
|
||||||
|
"<a href='https://github.com/pietervdvn/MapComplete/issues' target='_blank'><img src='./assets/bug.svg' alt='Report bug' class='small-userbadge-icon'></a>";
|
||||||
|
let editHere = "";
|
||||||
|
if (location !== undefined) {
|
||||||
|
editHere = " | " +
|
||||||
|
"<a href='https://www.openstreetmap.org/edit?editor=id#map=" + location.zoom + "/" + location.lat + "/" + location.lon + "' target='_blank'>" +
|
||||||
|
"<img src='./assets/pencil.svg' alt='edit here' class='small-userbadge-icon'>" +
|
||||||
|
"</a>"
|
||||||
|
}
|
||||||
|
return mapComplete + editHere;
|
||||||
|
|
||||||
|
})
|
||||||
|
));
|
||||||
|
State.state.layerUpdater = new LayerUpdater(State.state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static InitLayers() {
|
static InitLayers() {
|
||||||
|
|
||||||
|
|
19
State.ts
19
State.ts
|
@ -7,7 +7,6 @@ import {Utils} from "./Utils";
|
||||||
import {LayerDefinition, Preset} from "./Customizations/LayerDefinition";
|
import {LayerDefinition, Preset} from "./Customizations/LayerDefinition";
|
||||||
import {ElementStorage} from "./Logic/ElementStorage";
|
import {ElementStorage} from "./Logic/ElementStorage";
|
||||||
import {Changes} from "./Logic/Osm/Changes";
|
import {Changes} from "./Logic/Osm/Changes";
|
||||||
import {Basemap} from "./Logic/Leaflet/Basemap";
|
|
||||||
import {OsmConnection} from "./Logic/Osm/OsmConnection";
|
import {OsmConnection} from "./Logic/Osm/OsmConnection";
|
||||||
import Locale from "./UI/i18n/Locale";
|
import Locale from "./UI/i18n/Locale";
|
||||||
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
||||||
|
@ -43,7 +42,7 @@ export class State {
|
||||||
/**
|
/**
|
||||||
THe basemap with leaflet instance
|
THe basemap with leaflet instance
|
||||||
*/
|
*/
|
||||||
public bm: Basemap;
|
public bm;
|
||||||
/**
|
/**
|
||||||
The user crednetials
|
The user crednetials
|
||||||
*/
|
*/
|
||||||
|
@ -188,23 +187,7 @@ export class State {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bm = new Basemap("leafletDiv", this.locationControl, new VariableUiElement(
|
|
||||||
this.locationControl.map((location) => {
|
|
||||||
const mapComplete = "<a href='https://github.com/pietervdvn/MapComplete' target='_blank'>Mapcomple</a> " +
|
|
||||||
" " +
|
|
||||||
"<a href='https://github.com/pietervdvn/MapComplete/issues' target='_blank'><img src='./assets/bug.svg' alt='Report bug' class='small-userbadge-icon'></a>";
|
|
||||||
let editHere = "";
|
|
||||||
if (location !== undefined) {
|
|
||||||
editHere = " | " +
|
|
||||||
"<a href='https://www.openstreetmap.org/edit?editor=id#map=" + location.zoom + "/" + location.lat + "/" + location.lon + "' target='_blank'>" +
|
|
||||||
"<img src='./assets/pencil.svg' alt='edit here' class='small-userbadge-icon'>" +
|
|
||||||
"</a>"
|
|
||||||
}
|
|
||||||
return mapComplete + editHere;
|
|
||||||
|
|
||||||
})
|
|
||||||
));
|
|
||||||
this.layerUpdater = new LayerUpdater(this);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import {UIElement} from "./UIElement";
|
||||||
import {UIEventSource} from "./UIEventSource";
|
import {UIEventSource} from "./UIEventSource";
|
||||||
import {ImageCarousel} from "./Image/ImageCarousel";
|
import {ImageCarousel} from "./Image/ImageCarousel";
|
||||||
import {VerticalCombine} from "./Base/VerticalCombine";
|
import {VerticalCombine} from "./Base/VerticalCombine";
|
||||||
import {TagRenderingOptions} from "../Customizations/TagRendering";
|
|
||||||
import {OsmLink} from "../Customizations/Questions/OsmLink";
|
import {OsmLink} from "../Customizations/Questions/OsmLink";
|
||||||
import {WikipediaLink} from "../Customizations/Questions/WikipediaLink";
|
import {WikipediaLink} from "../Customizations/Questions/WikipediaLink";
|
||||||
import {And} from "../Logic/TagsFilter";
|
import {And} from "../Logic/TagsFilter";
|
||||||
|
@ -12,6 +11,7 @@ import {Changes} from "../Logic/Osm/Changes";
|
||||||
import {UserDetails} from "../Logic/Osm/OsmConnection";
|
import {UserDetails} from "../Logic/Osm/OsmConnection";
|
||||||
import {FixedUiElement} from "./Base/FixedUiElement";
|
import {FixedUiElement} from "./Base/FixedUiElement";
|
||||||
import {State} from "../State";
|
import {State} from "../State";
|
||||||
|
import {TagRenderingOptions} from "../Customizations/TagRenderingOptions";
|
||||||
|
|
||||||
export class FeatureInfoBox extends UIElement {
|
export class FeatureInfoBox extends UIElement {
|
||||||
|
|
||||||
|
|
|
@ -956,7 +956,7 @@ export default class Translations {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
favourite: {
|
favourite: {
|
||||||
title: "Custom",
|
title: new T({en: "Custom"}),
|
||||||
description: new T({
|
description: new T({
|
||||||
en: "<h3>Your custom theme</h3>In your custom theme, you can add some favourite layers from other themes to create a custom theme."
|
en: "<h3>Your custom theme</h3>In your custom theme, you can add some favourite layers from other themes to create a custom theme."
|
||||||
}),
|
}),
|
||||||
|
@ -982,6 +982,8 @@ export default class Translations {
|
||||||
const item = queue.pop();
|
const item = queue.pop();
|
||||||
if (item instanceof Translation || item.translations !== undefined) {
|
if (item instanceof Translation || item.translations !== undefined) {
|
||||||
tr.push(item);
|
tr.push(item);
|
||||||
|
} else if (typeof (item) === "string") {
|
||||||
|
console.warn("Got single string in translationgs file: ", item);
|
||||||
} else {
|
} else {
|
||||||
for (const t in item) {
|
for (const t in item) {
|
||||||
const x = item[t];
|
const x = item[t];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {UIElement} from "./UI/UIElement";
|
import {UIElement} from "./UI/UIElement";
|
||||||
UIElement.runningFromConsole = true;
|
UIElement.runningFromConsole = true;
|
||||||
|
|
||||||
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
|
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
|
||||||
import {Layout} from "./Customizations/Layout";
|
import {Layout} from "./Customizations/Layout";
|
||||||
import {readFileSync, writeFile, writeFileSync} from "fs";
|
import {readFileSync, writeFile, writeFileSync} from "fs";
|
||||||
|
@ -7,7 +8,22 @@ import svg2img from 'promise-svg2img';
|
||||||
import Translation from "./UI/i18n/Translation";
|
import Translation from "./UI/i18n/Translation";
|
||||||
import Locale from "./UI/i18n/Locale";
|
import Locale from "./UI/i18n/Locale";
|
||||||
import Translations from "./UI/i18n/Translations";
|
import Translations from "./UI/i18n/Translations";
|
||||||
|
|
||||||
|
import {All} from "./Customizations/Layouts/All";
|
||||||
|
import {StreetWidth} from "./Customizations/Layouts/StreetWidth";
|
||||||
import {LayerDefinition} from"./Customizations/LayerDefinition";
|
import {LayerDefinition} from"./Customizations/LayerDefinition";
|
||||||
|
import {ClimbingTrees} from "./Customizations/Layouts/ClimbingTrees";
|
||||||
|
import {Smoothness} from "./Customizations/Layouts/Smoothness";
|
||||||
|
import {Natuurpunt} from "./Customizations/Layouts/Natuurpunt";
|
||||||
|
import {Groen} from "./Customizations/Layouts/Groen";
|
||||||
|
import Cyclofix from "./Customizations/Layouts/Cyclofix";
|
||||||
|
import {CustomLayout} from "./Logic/CustomLayers";
|
||||||
|
import {GRB} from "./Customizations/Layouts/GRB";
|
||||||
|
import {Artworks} from "./Customizations/Layouts/Artworks";
|
||||||
|
import {WalkByBrussels} from "./Customizations/Layouts/WalkByBrussels";
|
||||||
|
import {MetaMap} from "./Customizations/Layouts/MetaMap";
|
||||||
|
import {Bookcases} from "./Customizations/Layouts/Bookcases";
|
||||||
|
|
||||||
console.log("Building the layouts")
|
console.log("Building the layouts")
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +32,7 @@ function enc(str: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate(layout: Layout) {
|
function validate(layout: Layout) {
|
||||||
|
console.log("Validationg ", layout.name)
|
||||||
const translations: Translation[] = [];
|
const translations: Translation[] = [];
|
||||||
const queue: any[] = [layout]
|
const queue: any[] = [layout]
|
||||||
|
|
||||||
|
@ -162,7 +178,6 @@ function createLandingPage(layout: Layout) {
|
||||||
|
|
||||||
const blacklist = ["", "test", ".", "..", "manifest", "index", "land", "preferences", "account", "openstreetmap"]
|
const blacklist = ["", "test", ".", "..", "manifest", "index", "land", "preferences", "account", "openstreetmap"]
|
||||||
const all = AllKnownLayouts.allSets;
|
const all = AllKnownLayouts.allSets;
|
||||||
/*
|
|
||||||
for (const layoutName in all) {
|
for (const layoutName in all) {
|
||||||
if (blacklist.indexOf(layoutName.toLowerCase()) >= 0) {
|
if (blacklist.indexOf(layoutName.toLowerCase()) >= 0) {
|
||||||
console.log(`Skipping a layout with name${layoutName}, it is on the blacklist`);
|
console.log(`Skipping a layout with name${layoutName}, it is on the blacklist`);
|
||||||
|
@ -175,15 +190,17 @@ for (const layoutName in all) {
|
||||||
};
|
};
|
||||||
const layout = all[layoutName];
|
const layout = all[layoutName];
|
||||||
validate(layout)
|
validate(layout)
|
||||||
|
console.log("Generating manifest")
|
||||||
const manif = JSON.stringify(createManifest(layout, "/MapComplete"));
|
const manif = JSON.stringify(createManifest(layout, "/MapComplete"));
|
||||||
|
|
||||||
const manifestLocation = encodeURIComponent(layout.name.toLowerCase()) + ".webmanifest";
|
const manifestLocation = encodeURIComponent(layout.name.toLowerCase()) + ".webmanifest";
|
||||||
writeFile(manifestLocation, manif, err);
|
writeFile(manifestLocation, manif, err);
|
||||||
|
|
||||||
const landing = createLandingPage(layout);
|
const landing = createLandingPage(layout);
|
||||||
|
console.log("Generating html-file for ",layout.name)
|
||||||
writeFile(enc(layout.name) + ".html", landing, err)
|
writeFile(enc(layout.name) + ".html", landing, err)
|
||||||
|
console.log("done")
|
||||||
}
|
}
|
||||||
|
console.log("COunting all translations")
|
||||||
Translations.CountTranslations();
|
Translations.CountTranslations();
|
||||||
|
console.log("All done!")
|
||||||
*/
|
|
1
index.ts
1
index.ts
|
@ -71,6 +71,7 @@ if (layoutToUse === undefined) {
|
||||||
console.log("Using layout: ", layoutToUse.name);
|
console.log("Using layout: ", layoutToUse.name);
|
||||||
|
|
||||||
State.state = new State(layoutToUse);
|
State.state = new State(layoutToUse);
|
||||||
|
InitUiElements.InitBaseMap();
|
||||||
|
|
||||||
function setupAllLayerElements() {
|
function setupAllLayerElements() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue