Removed js files

This commit is contained in:
Pieter Vander Vennet 2020-07-20 19:53:35 +02:00
parent 7b80e945bb
commit b20be9e132
86 changed files with 0 additions and 5800 deletions

View file

@ -1,51 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllKnownLayouts = void 0;
var Groen_1 = require("./Layouts/Groen");
var GRB_1 = require("./Layouts/GRB");
var Bookcases_1 = require("./Layouts/Bookcases");
var Cyclofix_1 = require("./Layouts/Cyclofix");
var WalkByBrussels_1 = require("./Layouts/WalkByBrussels");
var All_1 = require("./Layouts/All");
var MetaMap_1 = require("./Layouts/MetaMap");
var StreetWidth_1 = require("./Layouts/StreetWidth");
var Natuurpunt_1 = require("./Layouts/Natuurpunt");
var AllKnownLayouts = /** @class */ (function () {
function AllKnownLayouts() {
}
AllKnownLayouts.AllLayouts = function () {
var all = new All_1.All();
var layouts = [
new Groen_1.Groen(),
new GRB_1.GRB(),
new Cyclofix_1.default(),
new Bookcases_1.Bookcases(),
new WalkByBrussels_1.WalkByBrussels(),
new MetaMap_1.MetaMap(),
new StreetWidth_1.StreetWidth(),
new Natuurpunt_1.Natuurpunt(),
all
/*new Toilets(),
new Statues(),
*/
];
var allSets = {};
for (var _i = 0, layouts_1 = layouts; _i < layouts_1.length; _i++) {
var layout = layouts_1[_i];
allSets[layout.name] = layout;
all.layers = all.layers.concat(layout.layers);
}
return allSets;
};
AllKnownLayouts.GetSets = function (layoutNames) {
var all = new All_1.All();
for (var _i = 0, layoutNames_1 = layoutNames; _i < layoutNames_1.length; _i++) {
var name_1 = layoutNames_1[_i];
all.layers = all.layers.concat(AllKnownLayouts.allSets[name_1].layers);
}
return all;
};
AllKnownLayouts.allSets = AllKnownLayouts.AllLayouts();
return AllKnownLayouts;
}());
exports.AllKnownLayouts = AllKnownLayouts;

View file

@ -1,33 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LayerDefinition = void 0;
var FilteredLayer_1 = require("../Logic/FilteredLayer");
var LayerDefinition = /** @class */ (function () {
function LayerDefinition(options) {
if (options === void 0) { options = undefined; }
var _a;
/**
* If an object of the next layer is contained for this many percent in this feature, it is eaten and not shown
*/
this.maxAllowedOverlapPercentage = undefined;
if (options === undefined) {
console.log("No options!");
return;
}
this.name = options.name;
this.maxAllowedOverlapPercentage = (_a = options.maxAllowedOverlapPercentage) !== null && _a !== void 0 ? _a : 0;
this.newElementTags = options.newElementTags;
this.icon = options.icon;
this.minzoom = options.minzoom;
this.overpassFilter = options.overpassFilter;
this.title = options.title;
this.elementsToShow = options.elementsToShow;
this.style = options.style;
console.log(this);
}
LayerDefinition.prototype.asLayer = function (basemap, allElements, changes, userDetails, selectedElement, showOnPopup) {
return new FilteredLayer_1.FilteredLayer(this.name, basemap, allElements, changes, this.overpassFilter, this.maxAllowedOverlapPercentage, this.style, selectedElement, showOnPopup);
};
return LayerDefinition;
}());
exports.LayerDefinition = LayerDefinition;

View file

@ -1,87 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Artwork = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var Question_1 = require("../../Logic/Question");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var leaflet_1 = require("leaflet");
var Artwork = /** @class */ (function (_super) {
__extends(Artwork, _super);
function Artwork() {
var _this = _super.call(this) || this;
_this.name = "artwork";
_this.newElementTags = [new TagsFilter_1.Tag("tourism", "artwork")];
_this.icon = "./assets/statue.svg";
_this.overpassFilter = new TagsFilter_1.Tag("tourism", "artwork");
_this.minzoom = 13;
_this.questions = [
Question_1.QuestionDefinition.radioAndTextQuestion("What kind of artwork is this?", 10, "artwork_type", [
{ text: "A statue", value: "statue" },
{ text: "A bust (thus a statue, but only of the head and shoulders)", value: "bust" },
{ text: "A sculpture", value: "sculpture" },
{ text: "A mural painting", value: "mural" },
{ text: "A painting", value: "painting" },
{ text: "A graffiti", value: "graffiti" },
{ text: "A relief", value: "relief" },
{ text: "An installation", value: "installation" }
]),
Question_1.QuestionDefinition.textQuestion("Whom or what is depicted in this statue?", "subject", 20).addUnrequiredTag("subject:wikidata", "*"),
Question_1.QuestionDefinition.textQuestion("Is there an inscription on this artwork?", "inscription", 16),
Question_1.QuestionDefinition.textQuestion("What is the name of this artwork? If there is no explicit name, skip the question", "name", 15),
];
_this.style = function (tags) {
return {
icon: new leaflet_1.default.icon({
iconUrl: "assets/statue.svg",
iconSize: [40, 40],
text: "hi"
}),
color: "#0000ff"
};
};
_this.elementsToShow = [
new TagMappingOptions({
key: "name",
template: "<h2>Artwork '{name}'</h2>",
missing: "Artwork"
}),
new TagMappingOptions({
key: "artwork_type",
template: "This artwork is a {artwork_type}"
}),
new TagMappingOptions({
key: "artist_name",
template: "This artwork was made by {artist_name}"
}),
new TagMappingOptions({
key: "subject",
template: "This artwork depicts {subject}"
}),
new TagMappingOptions({
key: "subject:wikidata",
template: "<a href='https://www.wikidata.org/wiki/{subject:wikidata}' target='_blank'>See more data about the subject</a>"
}),
new TagMappingOptions({
key: "website",
template: "<a href='{website}' target='_blank'>Website of the statue</a>"
}),
new TagMappingOptions({ key: "image", template: "<img class='popupImg' alt='image' src='{image}' />" })
];
return _this;
}
return Artwork;
}(LayerDefinition_1.LayerDefinition));
exports.Artwork = Artwork;

View file

@ -1,58 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var OperatorTag_1 = require("../Questions/OperatorTag");
var L = require("leaflet");
var FixedText_1 = require("../Questions/FixedText");
var ParkingType_1 = require("../Questions/bike/ParkingType");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var BikeParkings = /** @class */ (function (_super) {
__extends(BikeParkings, _super);
function BikeParkings() {
var _this = _super.call(this) || this;
_this.name = "bike_parking";
_this.icon = "./assets/bike/parking.svg";
_this.overpassFilter = new TagsFilter_1.Tag("amenity", "bicycle_parking");
_this.newElementTags = [
new TagsFilter_1.Tag("amenity", "bicycle_parking"),
];
_this.maxAllowedOverlapPercentage = 10;
_this.minzoom = 13;
_this.style = _this.generateStyleFunction();
_this.title = new FixedText_1.default("Fietsparking");
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new OperatorTag_1.OperatorTag(),
new ParkingType_1.default()
];
return _this;
}
BikeParkings.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
return {
color: "#00bb00",
icon: L.icon({
iconUrl: self.icon,
iconSize: [50, 50]
})
};
};
};
return BikeParkings;
}(LayerDefinition_1.LayerDefinition));
exports.default = BikeParkings;

View file

@ -1,97 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var L = require("leaflet");
var StationChain_1 = require("../Questions/bike/StationChain");
var StationPumpTools_1 = require("../Questions/bike/StationPumpTools");
var StationStand_1 = require("../Questions/bike/StationStand");
var PumpManual_1 = require("../Questions/bike/PumpManual");
var StationOperator_1 = require("../Questions/bike/StationOperator");
var FixedText_1 = require("../Questions/FixedText");
var PumpManometer_1 = require("../Questions/bike/PumpManometer");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var PumpOperational_1 = require("../Questions/bike/PumpOperational");
var PumpValves_1 = require("../Questions/bike/PumpValves");
var BikeStations = /** @class */ (function (_super) {
__extends(BikeStations, _super);
function BikeStations() {
var _this = _super.call(this) || this;
_this.pump = new TagsFilter_1.Tag("service:bicycle:pump", "yes");
_this.pumpOperationalAny = new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "yes");
_this.pumpOperationalOk = new TagsFilter_1.Or([new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "yes"), new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "operational"), new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "ok"), new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "")]);
_this.tools = new TagsFilter_1.Tag("service:bicycle:tools", "yes");
_this.name = "bike station or pump";
_this.icon = "./assets/wrench.svg";
_this.overpassFilter = new TagsFilter_1.And([
new TagsFilter_1.Tag("amenity", "bicycle_repair_station")
]);
_this.newElementTags = [
new TagsFilter_1.Tag("amenity", "bicycle_repair_station")
];
_this.maxAllowedOverlapPercentage = 10;
_this.minzoom = 13;
_this.style = _this.generateStyleFunction();
_this.title = new FixedText_1.default("Bike station");
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new StationPumpTools_1.default(),
new StationChain_1.default().OnlyShowIf(_this.tools),
new StationStand_1.default().OnlyShowIf(_this.tools),
new PumpManual_1.default().OnlyShowIf(_this.pump),
new PumpManometer_1.default().OnlyShowIf(_this.pump),
new PumpValves_1.default().OnlyShowIf(_this.pump),
new PumpOperational_1.default().OnlyShowIf(_this.pump),
new StationOperator_1.default(),
];
return _this;
}
BikeStations.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
var hasPump = self.pump.matchesProperties(properties);
var isOperational = self.pumpOperationalOk.matchesProperties(properties);
var hasTools = self.tools.matchesProperties(properties);
var iconName = "";
if (hasPump) {
if (hasTools) {
iconName = "repair_station_pump.svg";
}
else {
if (isOperational) {
iconName = "pump.svg";
}
else {
iconName = "pump_broken.svg";
}
}
}
else {
iconName = "repair_station.svg";
}
var iconUrl = "./assets/bike/" + iconName;
return {
color: "#00bb00",
icon: L.icon({
iconUrl: iconUrl,
iconSize: [50, 50]
})
};
};
};
return BikeStations;
}(LayerDefinition_1.LayerDefinition));
exports.default = BikeStations;

View file

@ -1,145 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Birdhide = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var FixedText_1 = require("../Questions/FixedText");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var leaflet_1 = require("leaflet");
var Birdhide = /** @class */ (function (_super) {
__extends(Birdhide, _super);
function Birdhide() {
var _this = _super.call(this, {
name: "vogelkijkplaats",
overpassFilter: Birdhide.birdhide,
elementsToShow: [new FixedText_1.default("hi")],
icon: "assets/nature/birdhide.svg",
minzoom: 12,
newElementTags: [Birdhide.birdhide],
style: function (tags) {
return { color: "", icon: undefined };
},
}) || this;
function rmStart(toRemove, title) {
if (title.toLowerCase().indexOf(toRemove.toLowerCase()) == 0) {
return title.substr(toRemove.length).trim();
}
return title;
}
function rmStarts(toRemove, title) {
for (var _i = 0, toRemove_1 = toRemove; _i < toRemove_1.length; _i++) {
var toRm = toRemove_1[_i];
title = rmStart(toRm, title);
}
return title;
}
_this.title = new TagRendering_1.TagRenderingOptions({
tagsPreprocessor: function (tags) {
if (tags.name) {
var nm = rmStarts(["Vogelkijkhut", "Vogelkijkwand", "Kijkwand", "Kijkhut"], tags.name);
tags.name = " '" + nm + "'";
}
else {
tags.name = "";
}
},
mappings: [
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("shelter", "no"), new TagsFilter_1.Tag("building", "")]),
txt: "Vogelkijkwand{name}"
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("amenity", "shelter"), new TagsFilter_1.Tag("building", "yes")]),
txt: "Vogelijkhut{name}"
},
{
k: new TagsFilter_1.Tag("amenity", "shelter"),
txt: "Vogelijkhut{name}"
},
{
k: new TagsFilter_1.Tag("building", "yes"),
txt: "Vogelijkhut{name}"
},
{ k: null, txt: "Vogelkijkplaats{name}" }
]
});
_this.style = function (properties) {
var icon = "assets/nature/birdhide.svg";
if (new TagsFilter_1.Or([new TagsFilter_1.Tag("amenity", "shelter"), new TagsFilter_1.Tag("building", "yes"), new TagsFilter_1.Tag("shelter", "yes")]).matchesProperties(properties)) {
icon = "assets/nature/birdshelter.svg";
}
return {
color: "#0000bb",
icon: leaflet_1.default.icon({
iconUrl: icon,
iconSize: [40, 40],
iconAnchor: [20, 20]
})
};
};
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "Is dit een kijkwand of kijkhut?",
mappings: [
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("shelter", "no"), new TagsFilter_1.Tag("building", ""), new TagsFilter_1.Tag("amenity", "")]),
txt: "Vogelkijkwand"
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("amenity", "shelter"), new TagsFilter_1.Tag("building", "yes"), new TagsFilter_1.Tag("shelter", "yes")]),
txt: "Vogelijkhut"
}
]
}),
new TagRendering_1.TagRenderingOptions({
question: "Is ze rolstoeltoegankelijk?",
mappings: [
{
k: new TagsFilter_1.Tag("wheelchair", "no"),
txt: "Niet rolstoeltoegankelijk"
},
{
k: new TagsFilter_1.Tag("wheelchair", "limited"),
txt: "Een rolstoel raakt er, maar het is niet makkelijk"
},
{
k: new TagsFilter_1.Tag("wheelchair", "yes"),
txt: "Een rolstoel raakt er gemakkelijk"
}
]
}),
new TagRendering_1.TagRenderingOptions({
question: "Wie beheert deze?",
freeform: {
key: "operator",
template: "Beheer door $$$",
renderTemplate: "Beheer door {operator}",
placeholder: "organisatie"
},
mappings: [
{ k: new TagsFilter_1.Tag("operator", "Natuurpunt"), txt: "Natuurpunt" },
{ k: new TagsFilter_1.Tag("operator", "Agentschap Natuur en Bos"), txt: "het Agentschap Natuur en Bos (ANB)" },
]
})
];
return _this;
}
Birdhide.birdhide = new TagsFilter_1.Tag("leisure", "bird_hide");
return Birdhide;
}(LayerDefinition_1.LayerDefinition));
exports.Birdhide = Birdhide;

View file

@ -1,167 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bookcases = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var leaflet_1 = require("leaflet");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var NameInline_1 = require("../Questions/NameInline");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var Bookcases = /** @class */ (function (_super) {
__extends(Bookcases, _super);
function Bookcases() {
var _this = _super.call(this) || this;
_this.name = "boekenkast";
_this.newElementTags = [new TagsFilter_1.Tag("amenity", "public_bookcase")];
_this.icon = "./assets/bookcase.svg";
_this.overpassFilter = new TagsFilter_1.Tag("amenity", "public_bookcase");
_this.minzoom = 11;
_this.title = new NameInline_1.NameInline("ruilboekenkastje");
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "Heeft dit boekenruilkastje een naam?",
freeform: {
key: "name",
template: "De naam is $$$",
renderTemplate: "",
placeholder: "",
extraTags: new TagsFilter_1.Tag("noname", "")
},
mappings: [
{ k: new TagsFilter_1.Tag("noname", "yes"), txt: "Neen, er is geen naam aangeduid op het boekenruilkastje" },
]
}),
new TagRendering_1.TagRenderingOptions({
question: "Hoeveel boeken passen in dit boekenruilkastje?",
freeform: {
renderTemplate: "Er passen {capacity} boeken in dit boekenruilkastje",
template: "Er passen $$$ boeken in dit boekenruilkastje",
key: "capacity",
placeholder: "aantal"
},
}),
new TagRendering_1.TagRenderingOptions({
question: "Wat voor soort boeken heeft dit boekenruilkastje?",
mappings: [
{ k: new TagsFilter_1.Tag("books", "children"), txt: "Voornamelijk kinderboeken" },
{ k: new TagsFilter_1.Tag("books", "adults"), txt: "Voornamelijk boeken voor volwassenen" },
{ k: new TagsFilter_1.Tag("books", "children;adults"), txt: "Zowel kinderboeken als boeken voor volwassenen" }
],
}),
new TagRendering_1.TagRenderingOptions({
question: "Staat dit boekenruilkastje binnen of buiten?",
mappings: [
{ k: new TagsFilter_1.Tag("indoor", "yes"), txt: "Dit boekenruilkastje staat binnen" },
{ k: new TagsFilter_1.Tag("indoor", "no"), txt: "Dit boekenruilkastje staat buiten" },
{ k: new TagsFilter_1.Tag("indoor", ""), txt: "Dit boekenruilkastje staat buiten" }
]
}),
new TagRendering_1.TagRenderingOptions({
question: "Is dit boekenruilkastje vrij toegankelijk?",
mappings: [
{ k: new TagsFilter_1.Tag("access", "yes"), txt: "Ja, vrij toegankelijk" },
{ k: new TagsFilter_1.Tag("access", "customers"), txt: "Enkel voor klanten" },
]
}).OnlyShowIf(new TagsFilter_1.Tag("indoor", "yes")),
new TagRendering_1.TagRenderingOptions({
question: "Wie (welke organisatie) beheert dit boekenruilkastje?",
freeform: {
key: "opeartor",
renderTemplate: "Dit boekenruilkastje wordt beheerd door {operator}",
template: "Dit boekenruilkastje wordt beheerd door $$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Zijn er openingsuren voor dit boekenruilkastje?",
mappings: [
{ k: new TagsFilter_1.Tag("opening_hours", "24/7"), txt: "Dag en nacht toegankelijk" },
{ k: new TagsFilter_1.Tag("opening_hours", ""), txt: "Dag en nacht toegankelijk" },
{ k: new TagsFilter_1.Tag("opening_hours", "sunrise-sunset"), txt: "Van zonsopgang tot zonsondergang" },
],
freeform: {
key: "opening_hours",
renderTemplate: "De openingsuren zijn {opening_hours}",
template: "De openingsuren zijn $$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Is dit boekenruilkastje deel van een netwerk?",
freeform: {
key: "brand",
renderTemplate: "Deel van het netwerk {brand}",
template: "Deel van het netwerk $$$"
},
mappings: [{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("brand", "Little Free Library"), new TagsFilter_1.Tag("nobrand", "")]),
txt: "Little Free Library"
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("brand", ""), new TagsFilter_1.Tag("nobrand", "yes")]),
txt: "Maakt geen deel uit van een groter netwerk"
}]
}).OnlyShowIf(new TagsFilter_1.Or([
new TagsFilter_1.Tag("ref", ""),
new TagsFilter_1.And([new TagsFilter_1.Tag("ref", "*"), new TagsFilter_1.Tag("brand", "")])
])),
new TagRendering_1.TagRenderingOptions({
question: "Wat is het referentienummer van dit boekenruilkastje?",
freeform: {
key: "ref",
template: "Het referentienummer is $$$",
renderTemplate: "Gekend als {brand} <b>{ref}</b>"
}
}).OnlyShowIf(new TagsFilter_1.Tag("brand", "*")),
new TagRendering_1.TagRenderingOptions({
question: "Wanneer werd dit boekenruilkastje geinstalleerd?",
priority: -1,
freeform: {
key: "start_date",
renderTemplate: "Geplaatst op {start_date}",
template: "Geplaatst op $$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Is er een website waar we er meer informatie is over dit boekenruilkastje?",
freeform: {
key: "website",
renderTemplate: "<a href='{website}' target='_blank'>Meer informatie over dit boekenruilkastje</a>",
template: "$$$",
placeholder: "website"
}
}),
new TagRendering_1.TagRenderingOptions({
freeform: {
key: "description",
renderTemplate: "<b>Beschrijving door de uitbater:</b><br>{description}",
template: "$$$",
}
})
];
_this.style = function (tags) {
return {
icon: new leaflet_1.default.icon({
iconUrl: "assets/bookcase.svg",
iconSize: [40, 40]
}),
color: "#0000ff"
};
};
return _this;
}
return Bookcases;
}(LayerDefinition_1.LayerDefinition));
exports.Bookcases = Bookcases;

View file

@ -1,85 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bos = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var AccessTag_1 = require("../Questions/AccessTag");
var OperatorTag_1 = require("../Questions/OperatorTag");
var NameQuestion_1 = require("../Questions/NameQuestion");
var NameInline_1 = require("../Questions/NameInline");
var DescriptionQuestion_1 = require("../Questions/DescriptionQuestion");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var Bos = /** @class */ (function (_super) {
__extends(Bos, _super);
function Bos() {
var _this = _super.call(this) || this;
_this.name = "bos";
_this.icon = "./assets/tree_white_background.svg";
_this.overpassFilter = new TagsFilter_1.Or([
new TagsFilter_1.Tag("natural", "wood"),
new TagsFilter_1.Tag("landuse", "forest"),
new TagsFilter_1.Tag("natural", "scrub")
]);
_this.newElementTags = [
new TagsFilter_1.Tag("landuse", "forest"),
new TagsFilter_1.Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")
];
_this.maxAllowedOverlapPercentage = 10;
_this.minzoom = 13;
_this.style = _this.generateStyleFunction();
_this.title = new NameInline_1.NameInline("bos");
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new NameQuestion_1.NameQuestion(),
new AccessTag_1.AccessTag(),
new OperatorTag_1.OperatorTag(),
new DescriptionQuestion_1.DescriptionQuestion("bos")
];
return _this;
}
Bos.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
var questionSeverity = 0;
for (var _i = 0, _a = self.elementsToShow; _i < _a.length; _i++) {
var qd = _a[_i];
if (qd instanceof DescriptionQuestion_1.DescriptionQuestion) {
continue;
}
if (qd.IsQuestioning(properties)) {
questionSeverity = Math.max(questionSeverity, qd.Priority());
}
}
var colormapping = {
0: "#00bb00",
1: "#00ff00",
10: "#dddd00",
20: "#ff0000"
};
var colour = colormapping[questionSeverity];
while (colour == undefined) {
questionSeverity--;
colour = colormapping[questionSeverity];
}
return {
color: colour,
icon: undefined
};
};
};
return Bos;
}(LayerDefinition_1.LayerDefinition));
exports.Bos = Bos;

View file

@ -1,71 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DrinkingWater = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var OperatorTag_1 = require("../Questions/OperatorTag");
var L = require("leaflet");
var FixedText_1 = require("../Questions/FixedText");
var TagRendering_1 = require("../TagRendering");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var DrinkingWater = /** @class */ (function (_super) {
__extends(DrinkingWater, _super);
function DrinkingWater() {
var _this = _super.call(this) || this;
_this.name = "drinking_water";
_this.icon = "./assets/bug.svg";
_this.overpassFilter = new TagsFilter_1.Or([
new TagsFilter_1.And([
new TagsFilter_1.Tag("amenity", "drinking_water")
])
]);
_this.newElementTags = [
new TagsFilter_1.Tag("amenity", "drinking_water"),
];
_this.maxAllowedOverlapPercentage = 10;
_this.minzoom = 13;
_this.style = _this.generateStyleFunction();
_this.title = new FixedText_1.default("Drinking water");
_this.elementsToShow = [
new OperatorTag_1.OperatorTag(),
];
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "How easy is it to fill water bottles?",
mappings: [
{ k: new TagsFilter_1.Tag("bottle", "yes"), txt: "It is easy to refill water bottles" },
{ k: new TagsFilter_1.Tag("bottle", "no"), txt: "Water bottles may not fit" }
],
})
];
return _this;
}
DrinkingWater.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
return {
color: "#00bb00",
icon: new L.icon({
iconUrl: self.icon,
iconSize: [40, 40]
})
};
};
};
return DrinkingWater;
}(LayerDefinition_1.LayerDefinition));
exports.DrinkingWater = DrinkingWater;

View file

@ -1,80 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GhostBike = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var FixedText_1 = require("../Questions/FixedText");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var leaflet_1 = require("leaflet");
var GhostBike = /** @class */ (function (_super) {
__extends(GhostBike, _super);
function GhostBike() {
var _this = _super.call(this) || this;
_this.name = "ghost bike";
_this.overpassFilter = new TagsFilter_1.Tag("memorial", "ghost_bike");
_this.title = new FixedText_1.default("Ghost bike");
_this.elementsToShow = [
new FixedText_1.default("A <b>ghost bike</b> is a memorial for a cyclist who died in a traffic accident," +
" in the form of a white bicycle placed permanently near the accident location."),
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "Whom is remembered by this ghost bike?" +
"<span class='question-subtext'>" +
"<br/>" +
"Please respect privacy - only fill out the name if it is widely published or marked on the cycle." +
"</span>",
mappings: [{ k: new TagsFilter_1.Tag("noname", "yes"), txt: "There is no name marked on the bike" },],
freeform: {
key: "name",
extraTags: new TagsFilter_1.Tag("noname", ""),
template: "$$$",
renderTemplate: "In the remembrance of <b>{name}</b>",
}
}),
new TagRendering_1.TagRenderingOptions({
question: "When was the ghost bike installed?",
freeform: {
key: "start_date",
template: "The ghost bike was placed on $$$",
renderTemplate: "The ghost bike was placed on <b>{start_date}</b>",
}
}),
new TagRendering_1.TagRenderingOptions({
question: "On what URL can more information be found?" +
"<span class='question-subtext'>If available, add a link to a news report about the accident or about the placing of the ghost bike</span>",
freeform: {
key: "source",
template: "More information available on $$$",
renderTemplate: "<a href='{source}' target='_blank'>More information</a>",
}
}),
];
_this.style = function (tags) {
return {
color: "#000000",
icon: leaflet_1.default.icon({
iconUrl: 'assets/bike/ghost.svg',
iconSize: [40, 40],
iconAnchor: [20, 20],
})
};
};
return _this;
}
return GhostBike;
}(LayerDefinition_1.LayerDefinition));
exports.GhostBike = GhostBike;

View file

@ -1,90 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GrbToFix = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var leaflet_1 = require("leaflet");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var GrbToFix = /** @class */ (function (_super) {
__extends(GrbToFix, _super);
function GrbToFix() {
var _this = _super.call(this) || this;
_this.name = "grb";
_this.newElementTags = undefined;
_this.icon = "./assets/star.svg";
_this.overpassFilter = new TagsFilter_1.Regex("fixme", "GRB");
_this.minzoom = 13;
_this.style = function (tags) {
return {
icon: new leaflet_1.default.icon({
iconUrl: "assets/star.svg",
iconSize: [40, 40],
text: "hi"
}),
color: "#ff0000"
};
};
_this.title = new TagRendering_1.TagRenderingOptions({
freeform: {
key: "fixme",
renderTemplate: "{fixme}",
template: "Fixme $$$"
}
});
_this.elementsToShow = [
new TagRendering_1.TagRenderingOptions({
freeform: {
key: "addr:street",
renderTemplate: "Het adres is {addr:street} <b>{addr:housenumber}</b>",
template: "Straat? $$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Wat is het huisnummer?",
tagsPreprocessor: function (tags) {
var telltale = "GRB thinks that this has number ";
var index = tags.fixme.indexOf(telltale);
if (index >= 0) {
var housenumber = tags.fixme.slice(index + telltale.length);
tags["grb:housenumber:human"] = housenumber;
tags["grb:housenumber"] = housenumber == "no number" ? "" : housenumber;
}
},
freeform: {
key: "addr:housenumber",
template: "Het huisnummer is $$$",
renderTemplate: "Het huisnummer is <b>{addr:housenumber}</b>, GRB denkt <i>{grb:housenumber:human}</i>",
extraTags: new TagsFilter_1.Tag("fixme", "")
},
mappings: [
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("addr:housenumber", "{grb:housenumber}"), new TagsFilter_1.Tag("fixme", "")]),
txt: "Volg GRB: <b>{grb:housenumber:human}</b>",
substitute: true
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("addr:housenumber", "{addr:housenumber}"), new TagsFilter_1.Tag("fixme", "")]),
txt: "Volg OSM: <b>{addr:housenumber}</b>",
substitute: true
}
]
})
];
return _this;
}
return GrbToFix;
}(LayerDefinition_1.LayerDefinition));
exports.GrbToFix = GrbToFix;

View file

@ -1,122 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InformationBoard = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var leaflet_1 = require("leaflet");
var InformationBoard = /** @class */ (function (_super) {
__extends(InformationBoard, _super);
function InformationBoard() {
var _this = _super.call(this, {
name: "Informatiebord",
minzoom: 12,
overpassFilter: new TagsFilter_1.Tag("tourism", "information"),
newElementTags: [new TagsFilter_1.Tag("tourism", "information")],
maxAllowedOverlapPercentage: 0,
icon: "assets/nature/info.png",
}) || this;
var isMap = new TagsFilter_1.Tag("information", "map");
var isOsmSource = new TagsFilter_1.Tag("map_source", "OpenStreetMap");
_this.title = new TagRendering_1.TagRenderingOptions({
mappings: [
{ k: isMap, txt: "Kaart" },
{ k: null, txt: "Informatiebord" }
]
});
_this.style = function (properties) {
var icon = "assets/nature/info.png";
if (isMap.matchesProperties(properties)) {
icon = "assets/map.svg";
if (isOsmSource.matchesProperties(properties)) {
icon = "assets/osm-logo-white-bg.svg";
var attr = properties["map_source:attribution"];
if (attr == "sticker") {
icon = "assets/map-stickered.svg";
}
else if (attr == "no") {
icon = "assets/osm-logo-buggy-attr.svg";
}
}
}
return {
color: "#000000",
icon: leaflet_1.default.icon({
iconUrl: icon,
iconSize: [50, 50]
})
};
};
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "Heeft dit informatiebord een kaart?",
mappings: [
{ k: new TagsFilter_1.Tag("information", "board"), txt: "Dit is een informatiebord" },
{ k: isMap, txt: "Dit is een kaart" }
]
}),
new TagRendering_1.TagRenderingOptions({
question: "Is this map based on OpenStreetMap?",
mappings: [
{
k: isOsmSource,
txt: "This map is based on OpenStreetMap"
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("map_source:attribution", ""), new TagsFilter_1.Tag("map_source", "")]),
txt: "Unknown"
},
],
freeform: {
key: "map_source",
extraTags: new TagsFilter_1.Tag("map_source:attribution", ""),
renderTemplate: "The map data is based on {map_source}",
template: "The map data is based on $$$"
}
}).OnlyShowIf(isMap),
new TagRendering_1.TagRenderingOptions({
question: "Is the attribution present?",
mappings: [
{
k: new TagsFilter_1.Tag("map_source:attribution", "yes"),
txt: "OpenStreetMap is clearly attribute, including the ODBL-license"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "incomplete"),
txt: "OpenStreetMap is clearly attribute, but the license is not mentioned"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "sticker"),
txt: "OpenStreetMap wasn't mentioned, but someone put an OpenStreetMap-sticker on it"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "no"),
txt: "There is no attribution at all"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "none"),
txt: "There is no attribution at all"
}
]
}).OnlyShowIf(new TagsFilter_1.Tag("map_source", "OpenStreetMap"))
];
return _this;
}
return InformationBoard;
}(LayerDefinition_1.LayerDefinition));
exports.InformationBoard = InformationBoard;

View file

@ -1,99 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Map = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var FixedText_1 = require("../Questions/FixedText");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var leaflet_1 = require("leaflet");
var Map = /** @class */ (function (_super) {
__extends(Map, _super);
function Map() {
var _this = _super.call(this) || this;
_this.name = "Map";
_this.title = new FixedText_1.default("Map");
_this.minzoom = 12;
_this.overpassFilter = new TagsFilter_1.Tag("information", "map");
_this.newElementTags = [new TagsFilter_1.Tag("tourism", "information"), new TagsFilter_1.Tag("information", "map")];
var isOsmSource = new TagsFilter_1.Tag("map_source", "OpenStreetMap");
_this.style = function (properties) {
var icon = "assets/map.svg";
if (isOsmSource.matchesProperties(properties)) {
icon = "assets/osm-logo-white-bg.svg";
var attr = properties["map_source:attribution"];
if (attr == "sticker") {
icon = "assets/map-stickered.svg";
}
else if (attr == "no") {
icon = "assets/osm-logo-buggy-attr.svg";
}
}
return {
color: "#000000",
icon: leaflet_1.default.icon({
iconUrl: icon,
iconSize: [50, 50]
})
};
};
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new TagRendering_1.TagRenderingOptions({
question: "Is this map based on OpenStreetMap?",
mappings: [
{
k: isOsmSource,
txt: "This map is based on OpenStreetMap"
},
],
freeform: {
key: "map_source",
renderTemplate: "The map data is based on {map_source}",
template: "The map data is based on $$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Is the attribution present?",
mappings: [
{
k: new TagsFilter_1.Tag("map_source:attribution", "yes"),
txt: "OpenStreetMap is clearly attribute, including the ODBL-license"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "incomplete"),
txt: "OpenStreetMap is clearly attribute, but the license is not mentioned"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "sticker"),
txt: "OpenStreetMap wasn't mentioned, but someone put an OpenStreetMap-sticker on it"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "no"),
txt: "There is no attribution at all"
},
{
k: new TagsFilter_1.Tag("map_source:attribution", "none"),
txt: "There is no attribution at all"
}
]
}).OnlyShowIf(new TagsFilter_1.Tag("map_source", "OpenStreetMap"))
];
return _this;
}
return Map;
}(LayerDefinition_1.LayerDefinition));
exports.Map = Map;

View file

@ -1,134 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.NatureReserves = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var AccessTag_1 = require("../Questions/AccessTag");
var OperatorTag_1 = require("../Questions/OperatorTag");
var NameQuestion_1 = require("../Questions/NameQuestion");
var NameInline_1 = require("../Questions/NameInline");
var DescriptionQuestion_1 = require("../Questions/DescriptionQuestion");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var NatureReserves = /** @class */ (function (_super) {
__extends(NatureReserves, _super);
function NatureReserves(moreQuests) {
if (moreQuests === void 0) { moreQuests = false; }
var _this = _super.call(this) || this;
_this.name = "natuurgebied";
_this.icon = "./assets/tree_white_background.svg";
_this.overpassFilter =
new TagsFilter_1.Or([new TagsFilter_1.Tag("leisure", "nature_reserve"), new TagsFilter_1.Tag("boundary", "protected_area")]);
_this.maxAllowedOverlapPercentage = 10;
_this.newElementTags = [new TagsFilter_1.Tag("leisure", "nature_reserve"),
new TagsFilter_1.Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")];
_this.minzoom = 13;
_this.title = new NameInline_1.NameInline("natuurreservaat");
_this.style = _this.generateStyleFunction();
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new NameQuestion_1.NameQuestion(),
new AccessTag_1.AccessTag(),
new OperatorTag_1.OperatorTag(),
new DescriptionQuestion_1.DescriptionQuestion("natuurgebied")
];
var extraRenderings = [
new TagRendering_1.TagRenderingOptions({
question: "Mogen honden in dit natuurgebied?",
mappings: [
{ k: new TagsFilter_1.Tag("dog", "leashed"), txt: "Honden moeten aan de leiband" },
{ k: new TagsFilter_1.Tag("dog", "no"), txt: "Honden zijn niet toegestaan" },
{ k: new TagsFilter_1.Tag("dog", "yes"), txt: "Honden zijn welkom" },
]
}).OnlyShowIf(new TagsFilter_1.Tag("access", "yes")),
new TagRendering_1.TagRenderingOptions({
question: "Op welke website kunnen we meer informatie vinden over dit natuurgebied?",
freeform: {
key: "website",
renderTemplate: "<a href='{website}' target='_blank'>Meer informatie</a>",
template: "$$$"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Wie is de conservator van dit gebied?<br>" +
"<span class='question-subtext'>Geef de naam van de conservator énkel als die duidelijk online staat gepubliceerd.</span>",
freeform: {
renderTemplate: "De conservator van dit gebied is {curator}",
template: "$$$",
key: "curator"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Wat is het email-adres van de beheerder?<br>" +
"<span class='question-subtext'>Geef bij voorkeur het emailadres van de Natuurpunt-afdeling; geef enkel een email-adres van de conservator als dit duidelijk is gepubliceerd</span>",
freeform: {
renderTemplate: "Bij problemen of vragen, de conservator kan bereikt worden via " +
"<a href='mailto:{email}'>{email}</a>",
template: "$$$",
key: "email"
}
}),
new TagRendering_1.TagRenderingOptions({
question: "Wat is het telefoonnummer van de beheerder?<br>" +
"<span class='question-subtext'>Geef bij voorkeur het telefoonnummer van de Natuurpunt-afdeling; geef enkel een email-adres van de conservator als dit duidelijk is gepubliceerd</span>",
freeform: {
renderTemplate: "Bij problemen of vragen, de {conservator} kan bereikt worden via " +
"<a href='tel:{phone}'>{phone}</a>",
template: "$$$",
key: "phone"
}
}),
];
if (moreQuests) {
_this.elementsToShow =
_this.elementsToShow.concat(extraRenderings);
}
return _this;
}
NatureReserves.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
var _a;
var questionSeverity = 0;
for (var _i = 0, _b = self.elementsToShow; _i < _b.length; _i++) {
var qd = _b[_i];
if (qd instanceof DescriptionQuestion_1.DescriptionQuestion) {
continue;
}
if (qd.IsQuestioning(properties)) {
questionSeverity = Math.max(questionSeverity, (_a = qd.Priority()) !== null && _a !== void 0 ? _a : 0);
}
}
var colormapping = {
0: "#00bb00",
1: "#00ff00",
10: "#dddd00",
20: "#ff0000"
};
var colour = colormapping[questionSeverity];
while (colour == undefined) {
questionSeverity--;
colour = colormapping[questionSeverity];
}
return {
color: colour,
icon: undefined
};
};
};
return NatureReserves;
}(LayerDefinition_1.LayerDefinition));
exports.NatureReserves = NatureReserves;

View file

@ -1,108 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Park = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var NameQuestion_1 = require("../Questions/NameQuestion");
var NameInline_1 = require("../Questions/NameInline");
var DescriptionQuestion_1 = require("../Questions/DescriptionQuestion");
var ImageCarouselWithUpload_1 = require("../../UI/Image/ImageCarouselWithUpload");
var Park = /** @class */ (function (_super) {
__extends(Park, _super);
function Park() {
var _this = _super.call(this) || this;
_this.accessByDefault = new TagRendering_1.TagRenderingOptions({
question: "Is dit park publiek toegankelijk?",
mappings: [
{ k: new TagsFilter_1.Tag("access", "yes"), txt: "Publiek toegankelijk" },
{ k: new TagsFilter_1.Tag("access", ""), txt: "Publiek toegankelijk" },
{ k: new TagsFilter_1.Tag("access", "no"), txt: "Niet publiek toegankelijk" },
{ k: new TagsFilter_1.Tag("access", "private"), txt: "Niet publiek toegankelijk, want privaat" },
{ k: new TagsFilter_1.Tag("access", "guided"), txt: "Enkel toegankelijk met een gids of op een activiteit" },
],
freeform: {
key: "access",
renderTemplate: "Dit park is niet toegankelijk: {access}",
template: "De toegankelijkheid van dit park is: $$$"
},
priority: 20
});
_this.operatorByDefault = new TagRendering_1.TagRenderingOptions({
question: "Wie beheert dit park?",
freeform: {
key: "operator",
renderTemplate: "Dit park wordt beheerd door {operator}",
template: "$$$",
},
mappings: [{
k: null, txt: "De gemeente beheert dit park"
}],
priority: 15
});
_this.name = "park";
_this.icon = "./assets/tree_white_background.svg";
_this.overpassFilter =
new TagsFilter_1.Or([new TagsFilter_1.Tag("leisure", "park"), new TagsFilter_1.Tag("landuse", "village_green")]);
_this.newElementTags = [new TagsFilter_1.Tag("leisure", "park"),
new TagsFilter_1.Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")];
_this.maxAllowedOverlapPercentage = 25;
_this.minzoom = 13;
_this.style = _this.generateStyleFunction();
_this.title = new NameInline_1.NameInline("park");
_this.elementsToShow = [
new ImageCarouselWithUpload_1.ImageCarouselWithUploadConstructor(),
new NameQuestion_1.NameQuestion(),
_this.accessByDefault,
_this.operatorByDefault,
new DescriptionQuestion_1.DescriptionQuestion("park"),
];
return _this;
}
Park.prototype.generateStyleFunction = function () {
var self = this;
return function (properties) {
var _a;
var questionSeverity = 0;
for (var _i = 0, _b = self.elementsToShow; _i < _b.length; _i++) {
var qd = _b[_i];
if (qd instanceof DescriptionQuestion_1.DescriptionQuestion) {
continue;
}
if (qd.IsQuestioning(properties)) {
questionSeverity = Math.max(questionSeverity, (_a = qd.Priority()) !== null && _a !== void 0 ? _a : 0);
}
}
var colormapping = {
0: "#00bb00",
1: "#00ff00",
10: "#dddd00",
20: "#ff0000"
};
var colour = colormapping[questionSeverity];
while (colour == undefined) {
questionSeverity--;
colour = colormapping[questionSeverity];
}
return {
color: colour,
icon: undefined
};
};
};
return Park;
}(LayerDefinition_1.LayerDefinition));
exports.Park = Park;

View file

@ -1,94 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Toilets = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var Quests_1 = require("../../Quests");
var FixedUiElement_1 = require("../../UI/Base/FixedUiElement");
var leaflet_1 = require("leaflet");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var Toilets = /** @class */ (function (_super) {
__extends(Toilets, _super);
function Toilets() {
var _a, _b;
var _this = _super.call(this) || this;
_this.name = "toilet";
_this.newElementTags = [new TagsFilter_1.Tag("amenity", "toilets")];
_this.icon = "./assets/toilets.svg";
_this.overpassFilter = new TagsFilter_1.Tag("amenity", "toilets");
_this.minzoom = 13;
_this.questions = [Quests_1.Quests.hasFee,
Quests_1.Quests.toiletsWheelChairs,
Quests_1.Quests.toiletsChangingTable,
Quests_1.Quests.toiletsChangingTableLocation,
Quests_1.Quests.toiletsPosition];
_this.style = function (tags) {
if (tags.wheelchair == "yes") {
return { icon: new leaflet_1.default.icon({
iconUrl: "assets/wheelchair.svg",
iconSize: [40, 40]
}) };
}
return { icon: new leaflet_1.default.icon({
iconUrl: "assets/toilets.svg",
iconSize: [40, 40]
}) };
};
_this.elementsToShow = [
new FixedUiElement_1.FixedUiElement("Toiletten"),
new TagMappingOptions({
key: "access",
mapping: {
yes: "Toegankelijk",
no: "Niet toegankelijk",
private: "Niet toegankelijk",
customers: "Enkel voor klanten",
}
}),
new TagMappingOptions({
key: "fee",
mapping: (_a = {
yes: "Betalend",
no: "Gratis"
},
_a["0"] = "Gratis",
_a),
template: "Betalend, men vraagt {fee}"
}),
new TagMappingOptions({
key: "toilets:position",
mapping: (_b = {
seated: 'Gewone zittoiletten',
urinal: 'Een enkele urinoir',
urinals: 'Urinoirs'
},
_b['urinals;seated'] = "Urinoirs en gewone toiletten",
_b['seated;urinals'] = "Urinoirs en gewone toiletten",
_b)
}),
new TagMappingOptions({
key: "wheelchair",
mapping: {
yes: "Rolstoeltoegankelijk",
no: "Niet Rolstoeltoegankelijk",
limited: "Beperkt rolstoeltoegankelijk",
}
}),
];
return _this;
}
return Toilets;
}(LayerDefinition_1.LayerDefinition));
exports.Toilets = Toilets;

View file

@ -1,270 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Widths = void 0;
var LayerDefinition_1 = require("../LayerDefinition");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var TagRendering_1 = require("../TagRendering");
var Widths = /** @class */ (function (_super) {
__extends(Widths, _super);
function Widths(carWidth, cyclistWidth, pedestrianWidth) {
var _this = _super.call(this) || this;
_this._bothSideParking = new TagsFilter_1.Tag("parking:lane:both", "parallel");
_this._noSideParking = new TagsFilter_1.Tag("parking:lane:both", "no_parking");
_this._otherParkingMode = new TagsFilter_1.Or([
new TagsFilter_1.Tag("parking:lane:both", "perpendicular"),
new TagsFilter_1.Tag("parking:lane:left", "perpendicular"),
new TagsFilter_1.Tag("parking:lane:right", "perpendicular"),
new TagsFilter_1.Tag("parking:lane:both", "diagonal"),
new TagsFilter_1.Tag("parking:lane:left", "diagonal"),
new TagsFilter_1.Tag("parking:lane:right", "diagonal"),
]);
_this._leftSideParking = new TagsFilter_1.And([new TagsFilter_1.Tag("parking:lane:left", "parallel"), new TagsFilter_1.Tag("parking:lane:right", "no_parking")]);
_this._rightSideParking = new TagsFilter_1.And([new TagsFilter_1.Tag("parking:lane:right", "parallel"), new TagsFilter_1.Tag("parking:lane:left", "no_parking")]);
_this._sidewalkBoth = new TagsFilter_1.Tag("sidewalk", "both");
_this._sidewalkLeft = new TagsFilter_1.Tag("sidewalk", "left");
_this._sidewalkRight = new TagsFilter_1.Tag("sidewalk", "right");
_this._sidewalkNone = new TagsFilter_1.Tag("sidewalk", "none");
_this._oneSideParking = new TagsFilter_1.Or([_this._leftSideParking, _this._rightSideParking]);
_this._carfree = new TagsFilter_1.Or([new TagsFilter_1.Tag("highway", "pedestrian"), new TagsFilter_1.Tag("highway", "living_street")]);
_this._notCarFree = new TagsFilter_1.Not(_this._carfree);
_this.carWidth = carWidth;
_this.cyclistWidth = cyclistWidth;
_this.pedestrianWidth = pedestrianWidth;
_this.minzoom = 12;
function r(n) {
var pre = Math.floor(n);
var post = Math.floor((n * 10) % 10);
return "" + pre + "." + post;
}
_this.name = "widths";
_this.overpassFilter = new TagsFilter_1.Tag("width:carriageway", "*");
_this.title = new TagRendering_1.TagRenderingOptions({
freeform: {
renderTemplate: "{name}",
template: "$$$",
key: "name"
}
});
var self = _this;
_this.style = function (properties) {
var c = "#f00";
var props = self.calcProps(properties);
if (props.pedestrianFlowNeeded > 0) {
c = "#fa0";
}
if (props.width >= props.targetWidth || !props.cyclingAllowed) {
c = "#0c0";
}
if (!props.parkingStateKnown && properties["note:width:carriageway"] === undefined) {
c = "#f0f";
}
if (_this._carfree.matchesProperties(properties)) {
c = "#aaa";
}
// Mark probably wrong data
if (props.width > 15) {
c = "#f0f";
}
var dashArray = undefined;
if (props.onewayBike) {
dashArray = [20, 8];
}
return {
icon: null,
color: c,
weight: 7,
dashArray: dashArray
};
};
_this.elementsToShow = [
new TagRendering_1.TagRenderingOptions({
question: "Mogen auto's hier parkeren?",
mappings: [
{
k: _this._bothSideParking,
txt: "Auto's kunnen langs beide zijden parkeren.<br+>Dit gebruikt <b>" + r(_this.carWidth * 2) + "m</b><br/>"
},
{
k: _this._oneSideParking,
txt: "Auto's kunnen langs één kant parkeren.<br/>Dit gebruikt <b>" + r(_this.carWidth) + "m</b><br/>"
},
{
k: _this._otherParkingMode,
txt: "Deze straat heeft dwarsparkeren of diagonaalparkeren aan minstens één zijde. Deze parkeerruimte is niet opgenomen in de straatbreedte."
},
{ k: _this._noSideParking, txt: "Auto's mogen hier niet parkeren" },
],
freeform: {
key: "note:width:carriageway",
renderTemplate: "{note:width:carriageway}",
template: "$$$",
}
}).OnlyShowIf(_this._notCarFree),
new TagRendering_1.TagRenderingOptions({
mappings: [
{
k: _this._sidewalkNone,
txt: "Deze straat heeft geen voetpaden. Voetgangers hebben hier <b>" + r(_this.pedestrianWidth * 2) + "m</b> nodig"
},
{
k: new TagsFilter_1.Or([_this._sidewalkLeft, _this._sidewalkRight]),
txt: "Deze straat heeft een voetpad aan één kant. Voetgangers hebben hier <b>" + r(_this.pedestrianWidth) + "m</b> nodig"
},
{ k: _this._sidewalkBoth, txt: "Deze straat heeft voetpad aan beide zijden." },
],
freeform: {
key: "note:width:carriageway",
renderTemplate: "{note:width:carriageway}",
template: "$$$",
}
}).OnlyShowIf(_this._notCarFree),
new TagRendering_1.TagRenderingOptions({
mappings: [
{
k: new TagsFilter_1.Tag("bicycle", "use_sidepath"),
txt: "Er is een afgescheiden, verplicht te gebruiken fietspad. Fietsen op dit wegsegment hoeft dus niet"
},
{
k: new TagsFilter_1.Tag("bicycle", "no"),
txt: "Fietsen is hier niet toegestaan"
},
{
k: new TagsFilter_1.Tag("oneway:bicycle", "yes"),
txt: "Eenrichtingsverkeer, óók voor fietsers. Dit gebruikt <b>" + r(_this.carWidth + _this.cyclistWidth) + "m</b>"
},
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("oneway", "yes"), new TagsFilter_1.Tag("oneway:bicycle", "no")]),
txt: "Tweerichtingverkeer voor fietsers, eenrichting voor auto's Dit gebruikt <b>" + r(_this.carWidth + 2 * _this.cyclistWidth) + "m</b>"
},
{
k: new TagsFilter_1.Tag("oneway", "yes"),
txt: "Eenrichtingsverkeer voor iedereen. Dit gebruikt <b>" + (_this.carWidth + _this.cyclistWidth) + "m</b>"
},
{
k: null,
txt: "Tweerichtingsverkeer voor iedereen. Dit gebruikt <b>" + r(2 * _this.carWidth + 2 * _this.cyclistWidth) + "m</b>"
}
]
}).OnlyShowIf(_this._notCarFree),
new TagRendering_1.TagRenderingOptions({
tagsPreprocessor: function (tags) {
var props = self.calcProps(tags);
tags.targetWidth = r(props.targetWidth);
tags.short = "";
if (props.width < props.targetWidth) {
tags.short = "Er is dus <b class='alert'>" + r(props.targetWidth - props.width) + "m</b> te weinig";
}
},
freeform: {
key: "width:carriageway",
renderTemplate: "De totale nodige ruimte voor vlot en veilig verkeer is dus <b>{targetWidth}m</b><br>" +
"{short}",
template: "$$$",
}
}).OnlyShowIf(_this._notCarFree),
new TagRendering_1.TagRenderingOptions({
mappings: [
{ k: new TagsFilter_1.Tag("highway", "living_street"), txt: "Dit is een woonerf" },
{ k: new TagsFilter_1.Tag("highway", "pedestrian"), txt: "Deze weg is autovrij" }
]
}),
new TagRendering_1.TagRenderingOptions({
mappings: [
{
k: new TagsFilter_1.Tag("sidewalk", "none"),
txt: "De afstand van huis tot huis is <b>{width:carriageway}m</b>"
},
{
k: new TagsFilter_1.Tag("sidewalk", "left"),
txt: "De afstand van huis tot voetpad is <b>{width:carriageway}m</b>"
},
{
k: new TagsFilter_1.Tag("sidewalk", "right"),
txt: "De afstand van huis tot voetpad is <b>{width:carriageway}m</b>"
},
{
k: new TagsFilter_1.Tag("sidewalk", "both"),
txt: "De afstand van voetpad tot voetpad is <b>{width:carriageway}m</b>"
},
{
k: new TagsFilter_1.Tag("sidewalk", ""),
txt: "De straatbreedte is <b>{width:carriageway}m</b>"
}
]
})
];
return _this;
}
Widths.prototype.calcProps = function (properties) {
var parkingStateKnown = true;
var parallelParkingCount = 0;
if (this._oneSideParking.matchesProperties(properties)) {
parallelParkingCount = 1;
}
else if (this._bothSideParking.matchesProperties(properties)) {
parallelParkingCount = 2;
}
else if (this._noSideParking.matchesProperties(properties)) {
parallelParkingCount = 0;
}
else if (this._otherParkingMode.matchesProperties(properties)) {
parallelParkingCount = 0;
}
else {
parkingStateKnown = false;
console.log("No parking data for ", properties.name, properties.id, properties);
}
var pedestrianFlowNeeded = 0;
if (this._sidewalkBoth.matchesProperties(properties)) {
pedestrianFlowNeeded = 0;
}
else if (this._sidewalkNone.matchesProperties(properties)) {
pedestrianFlowNeeded = 2;
}
else if (this._sidewalkLeft.matchesProperties(properties) || this._sidewalkRight.matches(properties)) {
pedestrianFlowNeeded = 1;
}
else {
pedestrianFlowNeeded = -1;
}
var onewayCar = properties.oneway === "yes";
var onewayBike = properties["oneway:bicycle"] === "yes" ||
(onewayCar && properties["oneway:bicycle"] === undefined);
var cyclingAllowed = !(properties.bicycle === "use_sidepath"
|| properties.bicycle === "no");
var carWidth = (onewayCar ? 1 : 2) * this.carWidth;
var cyclistWidth = 0;
if (cyclingAllowed) {
cyclistWidth = (onewayBike ? 1 : 2) * this.cyclistWidth;
}
var width = parseFloat(properties["width:carriageway"]);
var targetWidth = carWidth +
cyclistWidth +
Math.max(0, pedestrianFlowNeeded) * this.pedestrianWidth +
parallelParkingCount * this.carWidth;
return {
parkingLanes: parallelParkingCount,
parkingStateKnown: parkingStateKnown,
width: width,
targetWidth: targetWidth,
onewayBike: onewayBike,
pedestrianFlowNeeded: pedestrianFlowNeeded,
cyclingAllowed: cyclingAllowed
};
};
return Widths;
}(LayerDefinition_1.LayerDefinition));
exports.Widths = Widths;

View file

@ -1,38 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Layout = void 0;
/**
* A layout is a collection of settings of the global view (thus: welcome text, title, selection of layers).
*/
var Layout = /** @class */ (function () {
/**
*
* @param name: The name used in the query string. If in the query "quests=<name>" is defined, it will select this layout
* @param title: Will be used in the <title> of the page
* @param layers: The layers to show, a list of LayerDefinitions
* @param startzoom: The initial starting zoom of the map
* @param startLat:The initial starting latitude of the map
* @param startLon: the initial starting longitude of the map
* @param welcomeMessage: This message is shown in the collapsable box on the left
* @param gettingStartedPlzLogin: This is shown below the welcomemessage and wrapped in a login link.
* @param welcomeBackMessage: This is shown when the user is logged in
* @param welcomeTail: This text is shown below the login message. It is ideal for extra help
*/
function Layout(name, title, layers, startzoom, startLat, startLon, welcomeMessage, gettingStartedPlzLogin, welcomeBackMessage, welcomeTail) {
if (gettingStartedPlzLogin === void 0) { gettingStartedPlzLogin = "Please login to get started"; }
if (welcomeBackMessage === void 0) { welcomeBackMessage = "You are logged in. Welcome back!"; }
if (welcomeTail === void 0) { welcomeTail = ""; }
this.title = title;
this.startLon = startLon;
this.startLat = startLat;
this.startzoom = startzoom;
this.name = name;
this.layers = layers;
this.welcomeMessage = welcomeMessage;
this.gettingStartedPlzLogin = gettingStartedPlzLogin;
this.welcomeBackMessage = welcomeBackMessage;
this.welcomeTail = welcomeTail;
}
return Layout;
}());
exports.Layout = Layout;

View file

@ -1,26 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.All = void 0;
var Layout_1 = require("../Layout");
var All = /** @class */ (function (_super) {
__extends(All, _super);
function All() {
return _super.call(this, "all", "All quest layers", [], 15, 51.2, 3.2, "<h3>All quests of MapComplete</h3>" +
"This is a mixed bag. Some quests might be hard or for experts to answer only", "Please log in", "") || this;
}
return All;
}(Layout_1.Layout));
exports.All = All;

View file

@ -1,36 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bookcases = void 0;
var Layout_1 = require("../Layout");
var Layer = require("../Layers/Bookcases");
var Bookcases = /** @class */ (function (_super) {
__extends(Bookcases, _super);
function Bookcases() {
var _this = _super.call(this, "bookcases", "Open Bookcase Map", [new Layer.Bookcases()], 14, 51.2, 3.2, " <h3>Open BoekenkastjesKaart</h3>\n" +
"\n" +
"<p>" +
"Help mee met het creëeren van een volledige kaart met alle boekenruilkastjes!" +
"Een boekenruilkastje is een vaste plaats in publieke ruimte waar iedereen een boek in kan zetten of uit kan meenemen." +
"Meestal een klein kastje of doosje dat op straat staat, maar ook een oude telefooncellen of een schap in een station valt hieronder." +
"</p>", " <p>Begin met <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">het aanmaken van een account\n" +
" </a> of door je " +
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">aan te melden</span>.</p>", "Klik op een boekenruilkastje om vragen te beantwoorden") || this;
_this.locationContains = ["Bookcases.html", "Bookcase.html", "bookcase"];
return _this;
}
return Bookcases;
}(Layout_1.Layout));
exports.Bookcases = Bookcases;

View file

@ -1,35 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Layout_1 = require("../Layout");
var BikeParkings_1 = require("../Layers/BikeParkings");
var BikeStations_1 = require("../Layers/BikeStations");
var GhostBike_1 = require("../Layers/GhostBike");
var DrinkingWater_1 = require("../Layers/DrinkingWater");
var Cyclofix = /** @class */ (function (_super) {
__extends(Cyclofix, _super);
function Cyclofix() {
return _super.call(this, "pomp", "Cyclofix bicycle infrastructure", [new GhostBike_1.GhostBike(), new BikeStations_1.default(), new BikeParkings_1.default(), new DrinkingWater_1.DrinkingWater()], 16, 50.8465573, 4.3516970, "<h3>Cyclofix bicycle infrastructure</h3>\n" +
"\n" +
"<p><b>EN&gt;</b> On this map we want to collect data about the whereabouts of bicycle pumps and public racks in Brussels." +
"As a result, cyclists will be able to quickly find the nearest infrastructure for their needs.</p>" +
"<p><b>NL&gt;</b> Op deze kaart willen we gegevens verzamelen over de locatie van fietspompen en openbare stelplaatsen in Brussel." +
"Hierdoor kunnen fietsers snel de dichtstbijzijnde infrastructuur vinden die voldoet aan hun behoeften.</p>" +
"<p><b>FR&gt;</b> Sur cette carte, nous voulons collecter des données sur la localisation des pompes à vélo et des supports publics à Bruxelles." +
"Les cyclistes pourront ainsi trouver rapidement l'infrastructure la plus proche de leurs besoins.</p>", "", "") || this;
}
return Cyclofix;
}(Layout_1.Layout));
exports.default = Cyclofix;

View file

@ -1,28 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GRB = void 0;
var Layout_1 = require("../Layout");
var GrbToFix_1 = require("../Layers/GrbToFix");
var GRB = /** @class */ (function (_super) {
__extends(GRB, _super);
function GRB() {
return _super.call(this, "grb", "Grb import fix tool", [new GrbToFix_1.GrbToFix()], 15, 51.2083, 3.2279, "<h3>GRB Fix tool</h3>\n" +
"\n" +
"Expert use only", "", "") || this;
}
return GRB;
}(Layout_1.Layout));
exports.GRB = GRB;

View file

@ -1,56 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Groen = void 0;
var NatureReserves_1 = require("../Layers/NatureReserves");
var Park_1 = require("../Layers/Park");
var Bos_1 = require("../Layers/Bos");
var Layout_1 = require("../Layout");
var Groen = /** @class */ (function (_super) {
__extends(Groen, _super);
function Groen() {
var _this = _super.call(this, "buurtnatuur", "Buurtnatuur", [new NatureReserves_1.NatureReserves(), new Park_1.Park(), new Bos_1.Bos()], 10, 50.8435, 4.3688, "\n" +
"<img src='assets/groen.svg' alt='logo-groen' class='logo'> <br />" +
"<h3>Breng jouw buurtnatuur in kaart</h3>" +
"<b>Natuur maakt gelukkig.</b> Aan de hand van deze website willen we de natuur dicht bij ons beter inventariseren. Met als doel meer mensen te laten genieten van toegankelijke natuur én te strijden voor meer natuur in onze buurten. \n" +
"<ul>" +
"<li>In welke natuurgebieden kan jij terecht? Hoe toegankelijk zijn ze?</li>" +
"<li>In welke bossen kan een gezin in jouw gemeente opnieuw op adem komen?</li>" +
"<li>Op welke onbekende plekjes is het zalig spelen?</li>" +
"</ul>" +
"<p>Samen kleuren we heel Vlaanderen en Brussel groen.</p>" +
"<p>Blijf op de hoogte van de resultaten van buurtnatuur.be: <a href=\"https://www.groen.be/buurtnatuur\" target='_blank'>meld je aan voor e-mailupdates</a>.</p> \n", "<b>Begin meteen door <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">een account te maken\n" +
" te maken</a> of\n" +
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">in te loggen</span>.</b>", "", "<h4>Tips</h4>" +
"<ul>" +
"<li>Over groen ingekleurde gebieden weten we alles wat we willen weten.</li>" +
"<li>Bij rood ingekleurde gebieden ontbreekt nog heel wat info: klik een gebied aan en beantwoord de vragen.</li>" +
"<li>Je kan altijd een vraag overslaan als je het antwoord niet weet of niet zeker bent</li>" +
"<li>Je kan altijd een foto toevoegen</li>" +
"<li>Je kan ook zelf een gebied toevoegen door op de kaart te klikken</li>" +
"</ul>" +
"<small>" +
"<p>" +
"De oorspronkelijke data komt van <b>OpenStreetMap</b> en je antwoorden worden daar bewaard.<br/> Omdat iedereen vrij kan meewerken aan dit project, kunnen we niet garanderen dat er geen fouten opduiken." +
"</p>" +
"Je privacy is belangrijk. We tellen wel hoeveel gebruikers deze website bezoeken. We plaatsen een cookie waar geen persoonlijke informatie in bewaard wordt. " +
"Als je inlogt, komt er een tweede cookie bij met je inloggegevens." +
"</small>") || this;
_this.locationContains = ["buurtnatuur.be"];
return _this;
}
return Groen;
}(Layout_1.Layout));
exports.Groen = Groen;

View file

@ -1,27 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetaMap = void 0;
var Layout_1 = require("../Layout");
var Map_1 = require("../Layers/Map");
var MetaMap = /** @class */ (function (_super) {
__extends(MetaMap, _super);
function MetaMap() {
return _super.call(this, "metamap", "Open Map Map", [new Map_1.Map()], 1, 0, 0, " <h3>Open Map Map</h3>\n" +
"This map is a map of physical maps, as known by OpenStreetMap.") || this;
}
return MetaMap;
}(Layout_1.Layout));
exports.MetaMap = MetaMap;

View file

@ -1,28 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Natuurpunt = void 0;
var Layout_1 = require("../Layout");
var Birdhide_1 = require("../Layers/Birdhide");
var InformationBoard_1 = require("../Layers/InformationBoard");
var NatureReserves_1 = require("../Layers/NatureReserves");
var Natuurpunt = /** @class */ (function (_super) {
__extends(Natuurpunt, _super);
function Natuurpunt() {
return _super.call(this, "natuurpunt", "De natuur in", [new Birdhide_1.Birdhide(), new InformationBoard_1.InformationBoard(), new NatureReserves_1.NatureReserves(true)], 12, 51.20875, 3.22435, "<h3>Natuurpuntstuff</h3>", "", "") || this;
}
return Natuurpunt;
}(Layout_1.Layout));
exports.Natuurpunt = Natuurpunt;

View file

@ -1,31 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Statues = void 0;
var Layout_1 = require("../Layout");
var Artwork_1 = require("../Layers/Artwork");
var Statues = /** @class */ (function (_super) {
__extends(Statues, _super);
function Statues() {
return _super.call(this, "statues", "Open Artwork Map", [new Artwork_1.Artwork()], 10, 50.8435, 4.3688, " <h3>Open Statue Map</h3>\n" +
"\n" +
"<p>" +
"Help with creating a map of all statues all over the world!", " <p>Start by <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">creating an account\n" +
" </a> or by " +
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">logging in</span>.</p>", "Start by clicking a pin and answering the questions") || this;
}
return Statues;
}(Layout_1.Layout));
exports.Statues = Statues;

View file

@ -1,37 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreetWidth = void 0;
var Layout_1 = require("../Layout");
var Widths_1 = require("../Layers/Widths");
var StreetWidth = /** @class */ (function (_super) {
__extends(StreetWidth, _super);
function StreetWidth() {
return _super.call(this, "width", "Straatbreedtes in Brugge", [new Widths_1.Widths(2, 1.5, 0.75)], 15, 51.20875, 3.22435, "<h3>De straat is opgebruikt</h3>" +
"<p>Er is steeds meer druk op de openbare ruimte. Voetgangers, fietsers, steps, auto's, bussen, bestelwagens, buggies, cargobikes, ... willen allemaal hun deel van de openbare ruimte.</p>" +
"" +
"<p>In deze studie nemen we Brugge onder de loep en kijken we hoe breed elke straat is én hoe breed elke straat zou moeten zijn voor een veilig én vlot verkeer.</p>" +
"Verschillende ingrepen kunnen de stad teruggeven aan de inwoners en de stad leefbaarder en levendiger maken.<br/>" +
"Denk aan:" +
"<ul>" +
"<li>De autovrije zone's uitbreiden</li>" +
"<li>De binnenstad fietszone maken</li>" +
"<li>Het aantal woonerven uitbreiden</li>" +
"<li>Grotere auto's meer belasten - ze nemen immers meer parkeerruimte in.</li>" +
"</ul>", "", "") || this;
}
return StreetWidth;
}(Layout_1.Layout));
exports.StreetWidth = StreetWidth;

View file

@ -1,31 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Toilets = void 0;
var Layout_1 = require("../Layout");
var Layer = require("../Layers/Toilets");
var Toilets = /** @class */ (function (_super) {
__extends(Toilets, _super);
function Toilets() {
return _super.call(this, "toilets", "Open Toilet Map", [new Layer.Toilets()], 12, 51.2, 3.2, " <h3>Open Toilet Map</h3>\n" +
"\n" +
"<p>Help us to create the most complete map about <i>all</i> the toilets in the world, based on openStreetMap." +
"One can answer questions here, which help users all over the world to find an accessible toilet, close to them.</p>", " <p>Start by <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">creating an account\n" +
" </a> or by " +
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">logging in</span>.</p>", "Start by clicking a pin and answering the questions") || this;
}
return Toilets;
}(Layout_1.Layout));
exports.Toilets = Toilets;

View file

@ -1,33 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.WalkByBrussels = void 0;
var Layout_1 = require("../Layout");
var DrinkingWater_1 = require("../Layers/DrinkingWater");
var NatureReserves_1 = require("../Layers/NatureReserves");
var Park_1 = require("../Layers/Park");
var WalkByBrussels = /** @class */ (function (_super) {
__extends(WalkByBrussels, _super);
function WalkByBrussels() {
return _super.call(this, "walkbybrussels", "Drinking Water Spots", [new DrinkingWater_1.DrinkingWater(), new Park_1.Park(), new NatureReserves_1.NatureReserves()], 10, 50.8435, 4.3688, " <h3>Drinking water</h3>\n" +
"\n" +
"<p>" +
"Help with creating a map of drinking water points!", " <p>Start by <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">creating an account\n" +
" </a> or by " +
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">logging in</span>.</p>", "Start by clicking a pin and answering the questions") || this;
}
return WalkByBrussels;
}(Layout_1.Layout));
exports.WalkByBrussels = WalkByBrussels;

View file

@ -1,89 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OnlyShowIfConstructor = void 0;
var TagsFilter_1 = require("../Logic/TagsFilter");
var UIElement_1 = require("../UI/UIElement");
var OnlyShowIfConstructor = /** @class */ (function () {
function OnlyShowIfConstructor(tagsFilter, embedded) {
this._tagsFilter = tagsFilter;
this._embedded = embedded;
}
OnlyShowIfConstructor.prototype.construct = function (dependencies) {
return new OnlyShowIf(dependencies.tags, this._embedded.construct(dependencies), this._tagsFilter);
};
OnlyShowIfConstructor.prototype.IsKnown = function (properties) {
if (!this.Matches(properties)) {
return true;
}
return this._embedded.IsKnown(properties);
};
OnlyShowIfConstructor.prototype.IsQuestioning = function (properties) {
if (!this.Matches(properties)) {
return false;
}
return this._embedded.IsQuestioning(properties);
};
OnlyShowIfConstructor.prototype.Priority = function () {
return this._embedded.Priority();
};
OnlyShowIfConstructor.prototype.Matches = function (properties) {
return this._tagsFilter.matches(TagsFilter_1.TagUtils.proprtiesToKV(properties));
};
return OnlyShowIfConstructor;
}());
exports.OnlyShowIfConstructor = OnlyShowIfConstructor;
var OnlyShowIf = /** @class */ (function (_super) {
__extends(OnlyShowIf, _super);
function OnlyShowIf(tags, embedded, filter) {
var _this = _super.call(this, tags) || this;
_this._filter = filter;
_this._embedded = embedded;
return _this;
}
OnlyShowIf.prototype.Matches = function () {
return this._filter.matches(TagsFilter_1.TagUtils.proprtiesToKV(this._source.data));
};
OnlyShowIf.prototype.InnerRender = function () {
if (this.Matches()) {
return this._embedded.Render();
}
else {
return "";
}
};
OnlyShowIf.prototype.Priority = function () {
return this._embedded.Priority();
};
OnlyShowIf.prototype.IsKnown = function () {
if (!this.Matches()) {
return false;
}
return this._embedded.IsKnown();
};
OnlyShowIf.prototype.IsQuestioning = function () {
if (!this.Matches()) {
return false;
}
return this._embedded.IsQuestioning();
};
OnlyShowIf.prototype.Activate = function () {
this._embedded.Activate();
};
OnlyShowIf.prototype.Update = function () {
this._embedded.Update();
};
return OnlyShowIf;
}(UIElement_1.UIElement));

View file

@ -1,50 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccessTag = void 0;
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var AccessTag = /** @class */ (function (_super) {
__extends(AccessTag, _super);
function AccessTag() {
return _super.call(this, AccessTag.options) || this;
}
AccessTag.options = {
priority: 20,
question: "Is dit gebied toegankelijk?",
primer: "Dit gebied is ",
freeform: {
key: "access:description",
template: "Iets anders: $$$",
renderTemplate: "De toegankelijkheid van dit gebied is: {access:description}",
placeholder: "Specifieer"
},
mappings: [
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "yes"), new TagsFilter_1.Tag("fee", "")]), txt: "publiek toegankelijk" },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "no"), new TagsFilter_1.Tag("fee", "")]), txt: "niet toegankelijk" },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "private"), new TagsFilter_1.Tag("fee", "")]), txt: "niet toegankelijk, want privegebied" },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "permissive"), new TagsFilter_1.Tag("fee", "")]), txt: "toegankelijk, maar het is privegebied" },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "guided"), new TagsFilter_1.Tag("fee", "")]), txt: "enkel met gids of op activiteit" },
{
k: new TagsFilter_1.And([new TagsFilter_1.Tag("access", "yes"),
new TagsFilter_1.Tag("fee", "yes")]),
txt: "toegankelijk mits betaling",
priority: 10
},
]
};
return AccessTag;
}(TagRendering_1.TagRenderingOptions));
exports.AccessTag = AccessTag;

View file

@ -1,36 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DescriptionQuestion = void 0;
var TagRendering_1 = require("../TagRendering");
var DescriptionQuestion = /** @class */ (function (_super) {
__extends(DescriptionQuestion, _super);
function DescriptionQuestion(category) {
return _super.call(this, {
question: "Zijn er bijzonderheden die we moeten weten over dit " + category + "?<br>" +
"<span class='question-subtext'>Je hoeft niet te herhalen wat je net hebt aangeduid.<br/>" +
"Een <i>naam</i> wordt in de volgende stap gevraagd.<br/>" +
"Voel je vrij om dit veld over te slaan.</span>",
freeform: {
key: "description:0",
renderTemplate: "{description:0}",
template: "$$$"
},
priority: 14
}) || this;
}
return DescriptionQuestion;
}(TagRendering_1.TagRenderingOptions));
exports.DescriptionQuestion = DescriptionQuestion;

View file

@ -1,30 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../TagRendering");
var FixedText = /** @class */ (function (_super) {
__extends(FixedText, _super);
function FixedText(category) {
return _super.call(this, {
mappings: [
{
k: null, txt: category
}
]
}) || this;
}
return FixedText;
}(TagRendering_1.TagRenderingOptions));
exports.default = FixedText;

View file

@ -1,41 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.NameInline = void 0;
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var NameInline = /** @class */ (function (_super) {
__extends(NameInline, _super);
function NameInline(category) {
return _super.call(this, {
question: "",
freeform: {
renderTemplate: "{name}",
template: "De naam van dit " + category + " is $$$",
key: "name",
extraTags: new TagsFilter_1.Tag("noname", "") // Remove 'noname=yes'
},
mappings: [
{ k: new TagsFilter_1.Tag("noname", "yes"), txt: NameInline.Upper(category) + " zonder naam" },
{ k: null, txt: NameInline.Upper(category) }
]
}) || this;
}
NameInline.Upper = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};
return NameInline;
}(TagRendering_1.TagRenderingOptions));
exports.NameInline = NameInline;

View file

@ -1,48 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.NameQuestion = void 0;
/**
* There are two ways to ask for names:
* One is a big 'name-question', the other is the 'edit name' in the title.
* THis one is the big question
*/
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var NameQuestion = /** @class */ (function (_super) {
__extends(NameQuestion, _super);
function NameQuestion() {
return _super.call(this, NameQuestion.options) || this;
}
NameQuestion.options = {
priority: 10,
question: "Wat is de <i>officiële</i> naam van dit gebied?<br><span class='question-subtext'>" +
"Zelf een naam bedenken wordt afgeraden.<br/>" +
"Een beschrijving van het gebied geven kan in een volgende stap.<br/>" +
"</span>",
freeform: {
key: "name",
template: "De naam is $$$",
renderTemplate: "",
placeholder: "",
extraTags: new TagsFilter_1.Tag("noname", "")
},
mappings: [
{ k: new TagsFilter_1.Tag("noname", "yes"), txt: "Dit gebied heeft geen naam" },
]
};
return NameQuestion;
}(TagRendering_1.TagRenderingOptions));
exports.NameQuestion = NameQuestion;

View file

@ -1,41 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperatorTag = void 0;
var TagRendering_1 = require("../TagRendering");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var OperatorTag = /** @class */ (function (_super) {
__extends(OperatorTag, _super);
function OperatorTag() {
return _super.call(this, OperatorTag.options) || this;
}
OperatorTag.options = {
priority: 15,
question: "Wie beheert dit gebied?",
freeform: {
key: "operator",
template: "Dit gebied wordt beheerd door $$$",
renderTemplate: "Dit gebied wordt beheerd door {operator}",
placeholder: "organisatie"
},
mappings: [
{ k: new TagsFilter_1.Tag("operator", "Natuurpunt"), txt: "Natuurpunt" },
{ k: new TagsFilter_1.Tag("operator", "Agentschap Natuur en Bos"), txt: "het Agentschap Natuur en Bos (ANB)" },
{ k: new TagsFilter_1.Tag("operator", "private"), txt: "Beheer door een privépersoon" }
]
};
return OperatorTag;
}(TagRendering_1.TagRenderingOptions));
exports.OperatorTag = OperatorTag;

View file

@ -1,40 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OsmLink = void 0;
var TagRendering_1 = require("../TagRendering");
var Img_1 = require("../../UI/Img");
var TagsFilter_1 = require("../../Logic/TagsFilter");
var OsmLink = /** @class */ (function (_super) {
__extends(OsmLink, _super);
function OsmLink() {
return _super.call(this, OsmLink.options) || this;
}
OsmLink.options = {
freeform: {
key: "id",
template: "$$$",
renderTemplate: "<span class='osmlink'><a href='https://osm.org/{id}' target='_blank'>" +
Img_1.Img.osmAbstractLogo +
"</a></span>",
placeholder: "",
},
mappings: [
{ k: new TagsFilter_1.Tag("id", "node/-1"), txt: "<span class='alert'>Uploading</span>" }
]
};
return OsmLink;
}(TagRendering_1.TagRenderingOptions));
exports.OsmLink = OsmLink;

View file

@ -1,59 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.WikipediaLink = void 0;
var TagRendering_1 = require("../TagRendering");
var WikipediaLink = /** @class */ (function (_super) {
__extends(WikipediaLink, _super);
function WikipediaLink() {
return _super.call(this, WikipediaLink.options) || this;
}
WikipediaLink.FixLink = function (value) {
if (value === undefined) {
return undefined;
}
// @ts-ignore
if (value.startsWith("https")) {
return value;
}
else {
var splitted = value.split(":");
var language = splitted[0];
splitted.shift();
var page = splitted.join(":");
return 'https://' + language + '.wikipedia.org/wiki/' + page;
}
};
WikipediaLink.options = {
priority: 10,
// question: "Wat is het overeenstemmende wkipedia-artikel?",
tagsPreprocessor: function (tags) {
if (tags.wikipedia !== undefined) {
tags.wikipedia = WikipediaLink.FixLink(tags.wikipedia);
}
},
freeform: {
key: "wikipedia",
template: "$$$",
renderTemplate: "<span class='wikipedialink'>" +
"<a href='{wikipedia}' target='_blank'>" +
"<img width='64px' src='./assets/wikipedia.svg' alt='wikipedia'>" +
"</a></span>",
placeholder: ""
},
};
return WikipediaLink;
}(TagRendering_1.TagRenderingOptions));
exports.WikipediaLink = WikipediaLink;

View file

@ -1,52 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var ParkingType = /** @class */ (function (_super) {
__extends(ParkingType, _super);
function ParkingType() {
return _super.call(this, {
priority: 5,
question: "Van welk type is deze fietsenparking?",
freeform: {
key: "bicycle_parking",
extraTags: new TagsFilter_1.Tag("fixme", "Freeform bicycle_parking= tag used: possibly a wrong value"),
template: "Iets anders: $$$",
renderTemplate: "Dit is een fietsenparking van het type: {bicycle_parking}",
placeholder: "Specifieer"
},
mappings: [
{ k: new TagsFilter_1.Tag("bicycle_parking", "stands"), txt: ParkingType.toImgTxt(ParkingType.images.stands) },
{ k: new TagsFilter_1.Tag("bicycle_parking", "wall_loops"), txt: ParkingType.toImgTxt(ParkingType.images.wall_loops) },
{ k: new TagsFilter_1.Tag("bicycle_parking", "handlebar_holder"), txt: ParkingType.toImgTxt(ParkingType.images.handlebar_holder) },
{ k: new TagsFilter_1.Tag("bicycle_parking", "shed"), txt: ParkingType.toImgTxt(ParkingType.images.shed) },
{ k: new TagsFilter_1.Tag("bicycle_parking", "two-tier"), txt: ParkingType.toImgTxt(ParkingType.images["two-tier"]) }
]
}) || this;
}
ParkingType.toImgTxt = function (url) {
return "<img src=" + url + ">";
};
ParkingType.images = {
stands: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Bike_racks_at_north-west_of_Westfield_-_geograph.org.uk_-_1041057.jpg/100px-Bike_racks_at_north-west_of_Westfield_-_geograph.org.uk_-_1041057.jpg",
wall_loops: "https://wiki.openstreetmap.org/w/images/thumb/c/c2/Bike-parking-wheelbender.jpg/100px-Bike-parking-wheelbender.jpg",
handlebar_holder: "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Bicycle_parking_handlebar_holder.jpg/100px-Bicycle_parking_handlebar_holder.jpg",
shed: "https://wiki.openstreetmap.org/w/images/thumb/b/b2/Bike-shelter.jpg/100px-Bike-shelter.jpg",
"two-tier": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Bicis_a_l%27estaci%C3%B3_de_Leiden.JPG/100px-Bicis_a_l%27estaci%C3%B3_de_Leiden.JPG"
};
return ParkingType;
}(TagRendering_1.TagRenderingOptions));
exports.default = ParkingType;

View file

@ -1,32 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var PumpManometer = /** @class */ (function (_super) {
__extends(PumpManometer, _super);
function PumpManometer() {
return _super.call(this, {
question: "Does the pump have a pressure indicator or manometer?",
mappings: [
{ k: new TagsFilter_1.Tag("manometer", "yes"), txt: "Yes, there is a manometer" },
{ k: new TagsFilter_1.Tag("manometer", "broken"), txt: "Yes, but it is broken" },
{ k: new TagsFilter_1.Tag("manometer", "yes"), txt: "No" }
]
}) || this;
}
return PumpManometer;
}(TagRendering_1.TagRenderingOptions));
exports.default = PumpManometer;

View file

@ -1,32 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var PumpManual = /** @class */ (function (_super) {
__extends(PumpManual, _super);
function PumpManual() {
return _super.call(this, {
priority: 5,
question: "Is this an electric bike pump?",
mappings: [
{ k: new TagsFilter_1.Tag("manual", "yes"), txt: "Manual pump" },
{ k: new TagsFilter_1.Tag("manual", "no"), txt: "Electric pump" }
]
}) || this;
}
return PumpManual;
}(TagRendering_1.TagRenderingOptions));
exports.default = PumpManual;

View file

@ -1,31 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var PumpOperational = /** @class */ (function (_super) {
__extends(PumpOperational, _super);
function PumpOperational() {
return _super.call(this, {
question: "Is the bicycle pump still operational?",
mappings: [
{ k: new TagsFilter_1.Tag("service:bicycle:pump:operational_status", "broken"), txt: "This pump is broken" },
{ k: new TagsFilter_1.Tag("service:bicycle:pump:operational_status", ""), txt: "This pump is operational" }
]
}) || this;
}
return PumpOperational;
}(TagRendering_1.TagRenderingOptions));
exports.default = PumpOperational;

View file

@ -1,41 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var PumpValves = /** @class */ (function (_super) {
__extends(PumpValves, _super);
function PumpValves() {
return _super.call(this, {
question: "What valves are supported?",
mappings: [
{
k: new TagsFilter_1.Tag("valves", " sclaverand;schrader;dunlop"),
txt: "There is a default head, so Presta, Dunlop and Auto"
},
{ k: new TagsFilter_1.Tag("valves", "dunlop"), txt: "Only dunlop" },
{ k: new TagsFilter_1.Tag("valves", "sclaverand"), txt: "Only Sclaverand (also known as Dunlop)" },
{ k: new TagsFilter_1.Tag("valves", "auto"), txt: "Only auto" },
],
freeform: {
key: "valves",
template: "Supported valves are $$$",
renderTemplate: "Supported valves are {valves}"
}
}) || this;
}
return PumpValves;
}(TagRendering_1.TagRenderingOptions));
exports.default = PumpValves;

View file

@ -1,44 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
/**
* Currently not used in Cyclofix because it's a little vague
*/
var BikeStationBrand = /** @class */ (function (_super) {
__extends(BikeStationBrand, _super);
function BikeStationBrand() {
var _this = this;
throw Error('BikeStationBrand disabled');
_this = _super.call(this, BikeStationBrand.options) || this;
return _this;
}
BikeStationBrand.options = {
priority: 15,
question: "What is the brand of this bike station (name of university, shop, city...)?",
freeform: {
key: "brand",
template: "The brand of this bike station is $$$",
renderTemplate: "The brand of this bike station is {operator}",
placeholder: "brand"
},
mappings: [
{ k: new TagsFilter_1.Tag("brand", "Velo Fix Station"), txt: "Velo Fix Station" }
]
};
return BikeStationBrand;
}(TagRendering_1.TagRenderingOptions));
exports.default = BikeStationBrand;

View file

@ -1,32 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var StationChain = /** @class */ (function (_super) {
__extends(StationChain, _super);
function StationChain() {
return _super.call(this, {
priority: 5,
question: "Does this bike station have a special tool to repair your bike chain?",
mappings: [
{ k: new TagsFilter_1.Tag("service:bicycle:chain_tool", "yes"), txt: "There is a chain tool." },
{ k: new TagsFilter_1.Tag("service:bicycle:chain_tool", "no"), txt: "There is no chain tool." },
]
}) || this;
}
return StationChain;
}(TagRendering_1.TagRenderingOptions));
exports.default = StationChain;

View file

@ -1,41 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var BikeStationOperator = /** @class */ (function (_super) {
__extends(BikeStationOperator, _super);
function BikeStationOperator() {
return _super.call(this, {
priority: 15,
question: "Who operates this bike station (name of university, shop, city...)?",
freeform: {
key: "operator",
template: "This bike station is operated by $$$",
renderTemplate: "This bike station is operated by {operator}",
placeholder: "organisatie"
},
mappings: [
{ k: new TagsFilter_1.Tag("operator", "KU Leuven"), txt: "KU Leuven" },
{ k: new TagsFilter_1.Tag("operator", "Stad Halle"), txt: "Stad Halle" },
{ k: new TagsFilter_1.Tag("operator", "Saint Gilles - Sint Gillis"), txt: "Saint Gilles - Sint Gillis" },
{ k: new TagsFilter_1.Tag("operator", "Jette"), txt: "Jette" },
{ k: new TagsFilter_1.Tag("operator", "private"), txt: "Beheer door een privépersoon" }
]
}) || this;
}
return BikeStationOperator;
}(TagRendering_1.TagRenderingOptions));
exports.default = BikeStationOperator;

View file

@ -1,33 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var BikeStationPumpTools = /** @class */ (function (_super) {
__extends(BikeStationPumpTools, _super);
function BikeStationPumpTools() {
return _super.call(this, {
priority: 15,
question: "Which services are available at this bike station?",
mappings: [
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("service:bicycle:tools", "no"), new TagsFilter_1.Tag("service:bicycle:pump", "yes")]), txt: "There is only a pump available." },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("service:bicycle:tools", "yes"), new TagsFilter_1.Tag("service:bicycle:pump", "no")]), txt: "There are only tools (screwdrivers, pliers...) available." },
{ k: new TagsFilter_1.And([new TagsFilter_1.Tag("service:bicycle:tools", "yes"), new TagsFilter_1.Tag("service:bicycle:pump", "yes")]), txt: "There are both tools and a pump available." }
]
}) || this;
}
return BikeStationPumpTools;
}(TagRendering_1.TagRenderingOptions));
exports.default = BikeStationPumpTools;

View file

@ -1,32 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var TagRendering_1 = require("../../TagRendering");
var TagsFilter_1 = require("../../../Logic/TagsFilter");
var BikeStationStand = /** @class */ (function (_super) {
__extends(BikeStationStand, _super);
function BikeStationStand() {
return _super.call(this, {
priority: 10,
question: "Does this bike station have a hook to suspend your bike with or a stand to elevate it?",
mappings: [
{ k: new TagsFilter_1.Tag("service:bicycle:stand", "yes"), txt: "There is a hook or stand." },
{ k: new TagsFilter_1.Tag("service:bicycle:stand", "no"), txt: "There is no hook or stand" },
]
}) || this;
}
return BikeStationStand;
}(TagRendering_1.TagRenderingOptions));
exports.default = BikeStationStand;

View file

@ -1,321 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TagRenderingOptions = void 0;
var UIElement_1 = require("../UI/UIElement");
var UIEventSource_1 = require("../UI/UIEventSource");
var TagsFilter_1 = require("../Logic/TagsFilter");
var FixedUiElement_1 = require("../UI/Base/FixedUiElement");
var SaveButton_1 = require("../UI/SaveButton");
var VariableUIElement_1 = require("../UI/Base/VariableUIElement");
var OnlyShowIf_1 = require("./OnlyShowIf");
var TextField_1 = require("../UI/Input/TextField");
var InputElementWrapper_1 = require("../UI/Input/InputElementWrapper");
var FixedInputElement_1 = require("../UI/Input/FixedInputElement");
var RadioButton_1 = require("../UI/Input/RadioButton");
var TagRenderingOptions = /** @class */ (function () {
function TagRenderingOptions(options) {
this.options = options;
}
TagRenderingOptions.prototype.OnlyShowIf = function (tagsFilter) {
return new OnlyShowIf_1.OnlyShowIfConstructor(tagsFilter, this);
};
TagRenderingOptions.prototype.IsQuestioning = function (tags) {
var _a;
var tagsKV = TagsFilter_1.TagUtils.proprtiesToKV(tags);
for (var _i = 0, _b = (_a = this.options.mappings) !== null && _a !== void 0 ? _a : []; _i < _b.length; _i++) {
var oneOnOneElement = _b[_i];
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;
};
TagRenderingOptions.prototype.construct = function (dependencies) {
return new TagRendering(dependencies.tags, dependencies.changes, this.options);
};
TagRenderingOptions.prototype.IsKnown = function (properties) {
return !this.IsQuestioning(properties);
};
TagRenderingOptions.prototype.Priority = function () {
var _a;
return (_a = this.options.priority) !== null && _a !== void 0 ? _a : 0;
};
return TagRenderingOptions;
}());
exports.TagRenderingOptions = TagRenderingOptions;
var TagRendering = /** @class */ (function (_super) {
__extends(TagRendering, _super);
function TagRendering(tags, changes, options) {
var _a, _b, _c;
var _this = _super.call(this, tags) || this;
_this._questionSkipped = new UIEventSource_1.UIEventSource(false);
_this._editMode = new UIEventSource_1.UIEventSource(false);
var self = _this;
_this.ListenTo(_this._questionSkipped);
_this.ListenTo(_this._editMode);
_this._userDetails = changes.login.userDetails;
_this.ListenTo(_this._userDetails);
_this._question = options.question;
_this._priority = (_a = options.priority) !== null && _a !== void 0 ? _a : 0;
_this._primer = (_b = options.primer) !== null && _b !== void 0 ? _b : "";
_this._tagsPreprocessor = function (properties) {
if (options.tagsPreprocessor === undefined) {
return properties;
}
var newTags = {};
for (var k in properties) {
newTags[k] = properties[k];
}
options.tagsPreprocessor(newTags);
return newTags;
};
_this._mapping = [];
_this._renderMapping = [];
_this._freeform = options.freeform;
// Prepare the choices for the Radio buttons
var choices = [];
var usedChoices = [];
for (var _i = 0, _d = (_c = options.mappings) !== null && _c !== void 0 ? _c : []; _i < _d.length; _i++) {
var choice = _d[_i];
if (choice.k === null) {
_this._mapping.push(choice);
continue;
}
var choiceSubbed = choice;
if (choice.substitute) {
choiceSubbed = {
k: choice.k.substituteValues(options.tagsPreprocessor(_this._source.data)),
txt: _this.ApplyTemplate(choice.txt),
substitute: false,
priority: choice.priority
};
}
var txt = choiceSubbed.txt;
// Choices is what is shown in the radio buttons
if (usedChoices.indexOf(txt) < 0) {
choices.push(new FixedUiElement_1.FixedUiElement(txt));
usedChoices.push(txt);
// This is used to convert the radio button index into tags needed to add
_this._mapping.push(choiceSubbed);
}
else {
_this._renderMapping.push(choiceSubbed); // only used while rendering
}
}
// Prepare the actual input element -> pick an appropriate implementation
_this._questionElement = _this.InputElementFor(options);
var save = function () {
var selection = self._questionElement.GetValue().data;
if (selection) {
changes.addTag(tags.data.id, selection);
}
self._editMode.setData(false);
};
var cancel = function () {
self._questionSkipped.setData(true);
self._editMode.setData(false);
self._source.ping(); // Send a ping upstream to render the next question
};
// Setup the save button and it's action
_this._saveButton = new SaveButton_1.SaveButton(_this._questionElement.GetValue())
.onClick(save);
_this._editButton = new FixedUiElement_1.FixedUiElement("");
if (_this._question !== undefined) {
_this._editButton = new FixedUiElement_1.FixedUiElement("<img class='editbutton' src='./assets/pencil.svg' alt='edit'>")
.onClick(function () {
self._questionElement.GetValue().setData(self.CurrentValue());
self._editMode.setData(true);
});
}
var cancelContents = _this._editMode.map(function (isEditing) {
if (isEditing) {
return "<span class='skip-button'>Annuleren</span>";
}
else {
return "<span class='skip-button'>Overslaan (Ik weet het niet zeker...)</span>";
}
});
// And at last, set up the skip button
_this._skipButton = new VariableUIElement_1.VariableUiElement(cancelContents).onClick(cancel);
return _this;
}
TagRendering.prototype.InputElementFor = function (options) {
var elements = [];
if (options.mappings !== undefined) {
for (var _i = 0, _a = options.mappings; _i < _a.length; _i++) {
var mapping = _a[_i];
elements.push(this.InputElementForMapping(mapping));
}
}
if (options.freeform !== undefined) {
elements.push(this.InputForFreeForm(options.freeform));
}
if (elements.length == 0) {
throw "NO TAGRENDERINGS!";
}
if (elements.length == 1) {
return elements[0];
}
return new RadioButton_1.RadioButton(elements, false);
};
TagRendering.prototype.InputElementForMapping = function (mapping) {
return new FixedInputElement_1.FixedInputElement(mapping.txt, mapping.k);
};
TagRendering.prototype.InputForFreeForm = function (freeform) {
if (freeform === undefined) {
return undefined;
}
var pickString = function (string) {
if (string === "" || string === undefined) {
return undefined;
}
var tag = new TagsFilter_1.Tag(freeform.key, string);
if (freeform.extraTags === undefined) {
return tag;
}
return new TagsFilter_1.And([
freeform.extraTags,
tag
]);
};
var toString = function (tag) {
if (tag instanceof TagsFilter_1.And) {
return toString(tag.and[0]);
}
else if (tag instanceof TagsFilter_1.Tag) {
return tag.value;
}
return undefined;
};
var inputElement;
var textField = new TextField_1.TextField({
placeholder: this._freeform.placeholder,
fromString: pickString,
toString: toString
});
var prepost = freeform.template.split("$$$");
return new InputElementWrapper_1.InputElementWrapper(prepost[0], textField, prepost[1]);
};
TagRendering.prototype.IsKnown = function () {
var tags = TagsFilter_1.TagUtils.proprtiesToKV(this._source.data);
for (var _i = 0, _a = this._mapping.concat(this._renderMapping); _i < _a.length; _i++) {
var oneOnOneElement = _a[_i];
if (oneOnOneElement.k === null || oneOnOneElement.k.matches(tags)) {
return true;
}
}
return this._freeform !== undefined && this._source.data[this._freeform.key] !== undefined;
};
TagRendering.prototype.CurrentValue = function () {
var tags = TagsFilter_1.TagUtils.proprtiesToKV(this._source.data);
for (var _i = 0, _a = this._mapping.concat(this._renderMapping); _i < _a.length; _i++) {
var oneOnOneElement = _a[_i];
if (oneOnOneElement.k === null || oneOnOneElement.k.matches(tags)) {
return oneOnOneElement.k;
}
}
if (this._freeform === undefined) {
return undefined;
}
return new TagsFilter_1.Tag(this._freeform.key, this._source.data[this._freeform.key]);
};
TagRendering.prototype.IsQuestioning = function () {
if (this.IsKnown()) {
return false;
}
if (this._question === undefined) {
// We don't ask this question in the first place
return false;
}
if (this._questionSkipped.data) {
// We don't ask for this question anymore, skipped by user
return false;
}
return true;
};
TagRendering.prototype.RenderAnwser = function () {
var _a;
var tags = TagsFilter_1.TagUtils.proprtiesToKV(this._source.data);
var freeform = "";
var freeformScore = -10;
if (this._freeform !== undefined && this._source.data[this._freeform.key] !== undefined) {
freeform = this.ApplyTemplate(this._freeform.renderTemplate);
freeformScore = 0;
}
var highestScore = -100;
var highestTemplate = undefined;
for (var _i = 0, _b = this._mapping.concat(this._renderMapping); _i < _b.length; _i++) {
var oneOnOneElement = _b[_i];
if (oneOnOneElement.k == null ||
oneOnOneElement.k.matches(tags)) {
// We have found a matching key -> we use the template, but only if it scores better
var score = (_a = oneOnOneElement.priority) !== null && _a !== void 0 ? _a : (oneOnOneElement.k === null ? -1 : 0);
if (score > highestScore) {
highestScore = score;
highestTemplate = oneOnOneElement.txt;
}
}
}
if (freeformScore > highestScore) {
return freeform;
}
if (highestTemplate !== undefined) {
// we render the found template
return this._primer + this.ApplyTemplate(highestTemplate);
}
};
TagRendering.prototype.InnerRender = function () {
if (this.IsQuestioning() || this._editMode.data) {
// Not yet known or questioning, we have to ask a question
return "<div class='question'>" +
"<span class='question-text'>" + this._question + "</span>" +
(this._question !== "" ? "<br/>" : "") +
this._questionElement.Render() +
this._skipButton.Render() +
this._saveButton.Render() +
"</div>";
}
if (this.IsKnown()) {
var html = this.RenderAnwser();
if (html == "") {
return "";
}
var editButton = "";
if (this._userDetails.data.loggedIn) {
editButton = this._editButton.Render();
}
return "<span class='answer'>" +
"<span class='answer-text'>" + html + "</span>" +
editButton +
"</span>";
}
return "";
};
TagRendering.prototype.Priority = function () {
return this._priority;
};
TagRendering.prototype.ApplyTemplate = function (template) {
var tags = this._tagsPreprocessor(this._source.data);
return TagsFilter_1.TagUtils.ApplyTemplate(template, tags);
};
return TagRendering;
}(UIElement_1.UIElement));

View file

@ -1,25 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TagDependantUIElement = void 0;
var UIElement_1 = require("../UI/UIElement");
var TagDependantUIElement = /** @class */ (function (_super) {
__extends(TagDependantUIElement, _super);
function TagDependantUIElement() {
return _super !== null && _super.apply(this, arguments) || this;
}
return TagDependantUIElement;
}(UIElement_1.UIElement));
exports.TagDependantUIElement = TagDependantUIElement;

View file

@ -1,57 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Helpers = void 0;
var Helpers = /** @class */ (function () {
function Helpers() {
}
Helpers.DoEvery = function (millis, f) {
window.setTimeout(function () {
f();
Helpers.DoEvery(millis, f);
}, millis);
};
Helpers.SetupAutoSave = function (changes, millisTillChangesAreSaved, saveAfterXMillis) {
changes.pendingChangesES.addCallback(function () {
var c = changes.pendingChangesES.data;
if (c > 10) {
millisTillChangesAreSaved.setData(0);
changes.uploadAll(undefined);
return;
}
if (c > 0) {
millisTillChangesAreSaved.setData(saveAfterXMillis);
}
});
millisTillChangesAreSaved.addCallback(function (time) {
if (time <= 0 && changes.pendingChangesES.data > 0) {
changes.uploadAll(undefined);
}
});
Helpers.DoEvery(1000, function () {
millisTillChangesAreSaved
.setData(millisTillChangesAreSaved.data - 1000);
});
};
/*
* Registers an action that:
* -> Upload everything to OSM
* -> Asks the user not to close. The 'not to close' dialog should profide enough time to upload
* -> WHen uploading is done, the window is closed anyway
*/
Helpers.LastEffortSave = function (changes) {
window.addEventListener("beforeunload", function (e) {
// Quickly save everyting!
if (changes.pendingChangesES.data == 0) {
return "";
}
changes.uploadAll(function () {
window.close();
});
var confirmationMessage = "Nog even geduld - je laatset wijzigingen worden opgeslaan!";
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
return confirmationMessage; //Webkit, Safari, Chrome
});
};
return Helpers;
}());
exports.Helpers = Helpers;

View file

@ -1,40 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Quests = void 0;
var Question_1 = require("./Logic/Question");
var Quests = /** @class */ (function () {
function Quests() {
}
Quests.nameOf = function (name) {
return Question_1.QuestionDefinition.noNameOrNameQuestion("<b>Wat is de <i>officiële</i> naam van dit " + name + "?</b><br />" +
"Veel gebieden hebben geen naam. Duid dit dan ook zo aan.", "Dit " + name + " heeft geen naam", 20);
};
Quests.hasFee = Question_1.QuestionDefinition.radioQuestionSimple("Moet men betalen om deze toiletten te gebruiken?", 10, "fee", [{ text: "ja", value: "yes" }, { text: "nee", value: "no" }]);
Quests.toiletsWheelChairs = Question_1.QuestionDefinition.radioQuestionSimple("Zijn deze toiletten rolstoeltoegankelijk?", 20, "wheelchair", [{ text: "ja", value: "yes" }, { text: "nee", value: "no" }]).addUnrequiredTag("toilets:position", "urinals");
Quests.toiletsChangingTable = Question_1.QuestionDefinition.radioQuestionSimple("Is er een luiertafel beschikbaar?", 20, "changing_table", [{ text: "ja", value: "yes" }, { text: "nee", value: "no" }])
// Urinals are often a pitlatrine/something very poor where no changing table is
.addUnrequiredTag("toilets:position", "urinals").addUnrequiredTag("toilets:position", "urinal");
Quests.toiletsChangingTableLocation = Question_1.QuestionDefinition.radioAndTextQuestion("Waar bevindt de luiertafel zich?", 5, "changing_table", [{ text: "In de vrouwentoiletten", value: "female_toilet" },
{ text: "In de mannentoiletten", value: "male_toilet" },
{ text: "In de rolstoeltoegangkelijke toiletten", value: "wheelchair_toilet" },
{ text: "In de aparte, speciaal voorziene ruimte", value: "dedicated_room" },
{ text: "In de genderneutrale toiletten", value: "unisex_toilet" }])
.addRequiredTag("changing_table", "yes");
Quests.toiletsPosition = Question_1.QuestionDefinition.radioQuestionSimple("Wat voor toiletten zijn dit?", 1, "toilets:position", [{ text: "Enkel urinoirs", value: "urinals" },
{ text: "Enkel 'gewone' toiletten waar men op gaat zitten", value: "seated" },
{ text: "Er zijn zowel urinoirs als zittoiletten", value: "seated;urinals" }]);
Quests.accessNatureReserve = Question_1.QuestionDefinition.radioQuestionSimple("Is dit gebied toegankelijk voor het publiek?", 10, "access", [
{ text: "Nee, dit is afgesloten", value: "no" },
{ text: "Nee, dit is een privaat terrein", value: "no" },
{ text: "Hoewel het een privebos is, kan men er toch in", value: "permissive" },
{ text: "Enkel tijdens activiteiten of met een gids", value: "guided" },
{ text: "Ja, het is gewoon toegankelijk", value: "yes" }
]).addUnrequiredTag("seamark:type", "restricted_area");
Quests.operator = Question_1.QuestionDefinition.radioAndTextQuestion("Wie is de beheerder van dit gebied?", 1, "operator", [{ text: "Natuurpunt", value: "Natuurpunt" },
{ text: "Het Agenschap voor Natuur en Bos", value: "Agentschap Natuur en Bos" },
{ text: "Een prive-eigenaar", value: "private" }
]).addUnrequiredTag("access", "private")
.addUnrequiredTag("access", "no");
return Quests;
}());
exports.Quests = Quests;

View file

@ -1,129 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddButton = void 0;
var UIEventSource_1 = require("./UIEventSource");
var UIElement_1 = require("./UIElement");
var AddButton = /** @class */ (function (_super) {
__extends(AddButton, _super);
function AddButton(basemap, changes, options) {
var _this = _super.call(this, undefined) || this;
_this.curentAddSelection = new UIEventSource_1.UIEventSource("");
_this.SELECTING_POI = "selecting_POI";
_this.PLACING_POI = "placing_POI";
/*State is one of:
* "": the default stated
* "select_POI": show a 'select which POI to add' query (skipped if only one option exists)
* "placing_point": shown while adding a point
* ""
*/
_this.state = new UIEventSource_1.UIEventSource("");
_this.zoomlevel = basemap.Location;
_this.ListenTo(_this.zoomlevel);
_this._options = options;
_this.ListenTo(_this.curentAddSelection);
_this.ListenTo(_this.state);
_this.state.setData(_this.SELECTING_POI);
_this.changes = changes;
var self = _this;
basemap.map.on("click", function (e) {
var location = e.latlng;
console.log("Clicked at ", location);
self.HandleClick(location.lat, location.lng);
});
basemap.map.on("mousemove", function () {
if (self.state.data === self.PLACING_POI) {
var icon = "crosshair";
for (var _i = 0, _a = self._options; _i < _a.length; _i++) {
var option = _a[_i];
if (option.name === self.curentAddSelection.data && option.icon !== undefined) {
icon = 'url("' + option.icon + '") 32 32 ,crosshair';
console.log("Cursor icon: ", icon);
}
}
document.getElementById('leafletDiv').style.cursor = icon;
}
else {
// @ts-ignore
document.getElementById('leafletDiv').style.cursor = '';
}
});
return _this;
}
AddButton.prototype.HandleClick = function (lat, lon) {
this.state.setData(this.SELECTING_POI);
console.log("Handling click", lat, lon, this.curentAddSelection.data);
for (var _i = 0, _a = this._options; _i < _a.length; _i++) {
var option = _a[_i];
if (this.curentAddSelection.data === option.name) {
console.log("PLACING a ", option);
var feature = this.changes.createElement(option.tags, lat, lon);
option.layerToAddTo.AddNewElement(feature);
return;
}
}
};
AddButton.prototype.InnerRender = function () {
if (this.zoomlevel.data.zoom < 19) {
return "Zoom in om een punt toe te voegen";
}
if (this.state.data === this.SELECTING_POI) {
var html = "<form>";
for (var _i = 0, _a = this._options; _i < _a.length; _i++) {
var option = _a[_i];
// <button type='button'> looks SO retarded
// the default type of button is 'submit', which performs a POST and page reload
html += "<button type='button' class='addPOIoption' value='" + option.name + "'>Voeg een " + option.name + " toe</button><br/>";
}
html += "</form>";
return html;
}
if (this.state.data === this.PLACING_POI) {
return "<div id='clickOnMapInstruction'>Klik op de kaart om een nieuw punt toe te voegen<div>" +
"<div id='cancelInstruction'>Klik hier om toevoegen te annuleren</div>";
}
if (this.curentAddSelection.data === "") {
return "<span onclick>Voeg een punt toe...</span>";
}
return "Annuleer";
};
AddButton.prototype.InnerUpdate = function (htmlElement) {
var self = this;
htmlElement.onclick = function (event) {
// @ts-ignore
if (event.consumed) {
return;
}
if (self.state.data === self.PLACING_POI) {
self.state.setData(self.SELECTING_POI);
}
};
var buttons = htmlElement.getElementsByClassName('addPOIoption');
var _loop_1 = function (button) {
button.onclick = function (event) {
self.curentAddSelection.setData(button.value);
self.state.setData(self.PLACING_POI);
event.consumed = true;
};
};
// @ts-ignore
for (var _i = 0, buttons_1 = buttons; _i < buttons_1.length; _i++) {
var button = buttons_1[_i];
_loop_1(button);
}
};
return AddButton;
}(UIElement_1.UIElement));
exports.AddButton = AddButton;

View file

@ -1,49 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Button = void 0;
var UIElement_1 = require("../UIElement");
var Button = /** @class */ (function (_super) {
__extends(Button, _super);
function Button(text, onclick, clss) {
if (clss === void 0) { clss = ""; }
var _this = _super.call(this, undefined) || this;
_this._text = text;
_this._onclick = onclick;
if (clss !== "") {
_this._clss = "class='" + clss + "'";
}
else {
_this._clss = "";
}
return _this;
}
Button.prototype.InnerRender = function () {
return "<form>" +
"<button id='button-" + this.id + "' type='button' " + this._clss + ">" + this._text.Render() + "</button>" +
"</form>";
};
Button.prototype.InnerUpdate = function (htmlElement) {
_super.prototype.InnerUpdate.call(this, htmlElement);
var self = this;
console.log("Update for ", htmlElement);
document.getElementById("button-" + this.id).onclick = function () {
console.log("Clicked");
self._onclick();
};
};
return Button;
}(UIElement_1.UIElement));
exports.Button = Button;

View file

@ -1,57 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollapseButton = void 0;
var UIElement_1 = require("../UIElement");
var UIEventSource_1 = require("../UIEventSource");
var CollapseButton = /** @class */ (function (_super) {
__extends(CollapseButton, _super);
function CollapseButton(idToCollapse) {
var _this = _super.call(this, undefined) || this;
_this.isCollapsed = new UIEventSource_1.UIEventSource(false);
_this.ListenTo(_this.isCollapsed);
_this.isCollapsed.addCallback(function (collapse) {
var el = document.getElementById(idToCollapse);
if (el === undefined || el === null) {
console.log("Element not found");
return;
}
if (collapse) {
el.style.height = "3.5em";
el.style.width = "15em";
}
else {
el.style.height = "auto";
el.style.width = "auto";
}
});
var self = _this;
_this.onClick(function () {
self.isCollapsed.setData(!self.isCollapsed.data);
});
return _this;
}
CollapseButton.prototype.InnerRender = function () {
var up = './assets/arrow-up.svg';
var down = './assets/arrow-down.svg';
var arrow = up;
if (this.isCollapsed.data) {
arrow = down;
}
return "<img class='collapse-button' src='" + arrow + "' alt='collapse'>";
};
return CollapseButton;
}(UIElement_1.UIElement));
exports.CollapseButton = CollapseButton;

View file

@ -1,30 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.FixedUiElement = void 0;
var UIElement_1 = require("../UIElement");
var FixedUiElement = /** @class */ (function (_super) {
__extends(FixedUiElement, _super);
function FixedUiElement(html) {
var _this = _super.call(this, undefined) || this;
_this._html = html !== null && html !== void 0 ? html : "";
return _this;
}
FixedUiElement.prototype.InnerRender = function () {
return this._html;
};
return FixedUiElement;
}(UIElement_1.UIElement));
exports.FixedUiElement = FixedUiElement;

View file

@ -1,38 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.VariableUiElement = void 0;
var UIElement_1 = require("../UIElement");
var VariableUiElement = /** @class */ (function (_super) {
__extends(VariableUiElement, _super);
function VariableUiElement(html, innerUpdate) {
if (innerUpdate === void 0) { innerUpdate = undefined; }
var _this = _super.call(this, html) || this;
_this._html = html;
_this._innerUpdate = innerUpdate;
return _this;
}
VariableUiElement.prototype.InnerRender = function () {
return this._html.data;
};
VariableUiElement.prototype.InnerUpdate = function (htmlElement) {
_super.prototype.InnerUpdate.call(this, htmlElement);
if (this._innerUpdate !== undefined) {
this._innerUpdate(htmlElement);
}
};
return VariableUiElement;
}(UIElement_1.UIElement));
exports.VariableUiElement = VariableUiElement;

View file

@ -1,45 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerticalCombine = void 0;
var UIElement_1 = require("../UIElement");
var VerticalCombine = /** @class */ (function (_super) {
__extends(VerticalCombine, _super);
function VerticalCombine(elements, className) {
if (className === void 0) { className = undefined; }
var _this = _super.call(this, undefined) || this;
_this._elements = elements;
_this._className = className;
return _this;
}
VerticalCombine.prototype.InnerRender = function () {
var html = "";
for (var _i = 0, _a = this._elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!element.IsEmpty()) {
html += "<div>" + element.Render() + "</div>";
}
}
if (html === "") {
return "";
}
if (this._className === undefined) {
return html;
}
return "<div class='" + this._className + "'>" + html + "</div>";
};
return VerticalCombine;
}(UIElement_1.UIElement));
exports.VerticalCombine = VerticalCombine;

View file

@ -1,72 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CenterMessageBox = void 0;
var UIElement_1 = require("./UIElement");
var UIEventSource_1 = require("./UIEventSource");
var CenterMessageBox = /** @class */ (function (_super) {
__extends(CenterMessageBox, _super);
function CenterMessageBox(startZoom, centermessage, osmConnection, location, queryRunning) {
var _this = _super.call(this, centermessage) || this;
_this._zoomInMore = new UIEventSource_1.UIEventSource(true);
_this._centermessage = centermessage;
_this._location = location;
_this._osmConnection = osmConnection;
_this._queryRunning = queryRunning;
_this.ListenTo(queryRunning);
var self = _this;
location.addCallback(function () {
self._zoomInMore.setData(location.data.zoom < startZoom);
});
_this.ListenTo(_this._zoomInMore);
return _this;
}
CenterMessageBox.prototype.InnerRender = function () {
if (this._centermessage.data != "") {
return this._centermessage.data;
}
if (this._queryRunning.data) {
return "Data wordt geladen...";
}
else if (this._zoomInMore.data) {
return "Zoom in om de data te zien en te bewerken";
}
return "Klaar!";
};
CenterMessageBox.prototype.ShouldShowSomething = function () {
if (this._queryRunning.data) {
return true;
}
return this._zoomInMore.data;
};
CenterMessageBox.prototype.InnerUpdate = function (htmlElement) {
var pstyle = htmlElement.parentElement.style;
if (this._centermessage.data != "") {
pstyle.opacity = "1";
pstyle.pointerEvents = "all";
this._osmConnection.registerActivateOsmAUthenticationClass();
return;
}
pstyle.pointerEvents = "none";
if (this.ShouldShowSomething()) {
pstyle.opacity = "0.5";
}
else {
pstyle.opacity = "0";
}
};
return CenterMessageBox;
}(UIElement_1.UIElement));
exports.CenterMessageBox = CenterMessageBox;

View file

@ -1,67 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmDialog = void 0;
var UIElement_1 = require("./UIElement");
var UIEventSource_1 = require("./UIEventSource");
var FixedUiElement_1 = require("./Base/FixedUiElement");
var VariableUIElement_1 = require("./Base/VariableUIElement");
var ConfirmDialog = /** @class */ (function (_super) {
__extends(ConfirmDialog, _super);
function ConfirmDialog(show, question, optionA, optionB, executeA, executeB, classA, classB) {
if (classA === void 0) { classA = ""; }
if (classB === void 0) { classB = ""; }
var _this = _super.call(this, show) || this;
_this._showOptions = new UIEventSource_1.UIEventSource(false);
_this.ListenTo(_this._showOptions);
var self = _this;
show.addCallback(function () {
self._showOptions.setData(false);
});
_this._question = new FixedUiElement_1.FixedUiElement("<span class='ui-question'>" + question + "</span>")
.onClick(function () {
self._showOptions.setData(!self._showOptions.data);
});
_this._optionA = new VariableUIElement_1.VariableUiElement(_this._showOptions.map(function (show) { return show ? "<div class='" + classA + "'>" + optionA + "</div>" : ""; }))
.onClick(function () {
self._showOptions.setData(false);
executeA();
});
_this._optionB = new VariableUIElement_1.VariableUiElement(_this._showOptions.map(function (show) {
return show ? "<div class='" + classB + "'>" + optionB + "</div>" : "";
}))
.onClick(function () {
self._showOptions.setData(false);
executeB();
});
return _this;
}
ConfirmDialog.prototype.InnerRender = function () {
if (!this._source.data) {
return "";
}
return this._question.Render() +
this._optionA.Render() +
this._optionB.Render();
};
ConfirmDialog.prototype.Update = function () {
_super.prototype.Update.call(this);
this._question.Update();
this._optionA.Update();
this._optionB.Update();
};
return ConfirmDialog;
}(UIElement_1.UIElement));
exports.ConfirmDialog = ConfirmDialog;

View file

@ -1,89 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeatureInfoBox = void 0;
var UIElement_1 = require("./UIElement");
var VerticalCombine_1 = require("./Base/VerticalCombine");
var TagRendering_1 = require("../Customizations/TagRendering");
var OsmLink_1 = require("../Customizations/Questions/OsmLink");
var WikipediaLink_1 = require("../Customizations/Questions/WikipediaLink");
var TagsFilter_1 = require("../Logic/TagsFilter");
var FeatureInfoBox = /** @class */ (function (_super) {
__extends(FeatureInfoBox, _super);
function FeatureInfoBox(tagsES, title, elementsToShow, changes, userDetails) {
var _this = _super.call(this, tagsES) || this;
_this._tagsES = tagsES;
_this._changes = changes;
_this._userDetails = userDetails;
_this.ListenTo(userDetails);
var deps = { tags: _this._tagsES, changes: _this._changes };
_this._infoboxes = [];
elementsToShow = elementsToShow !== null && elementsToShow !== void 0 ? elementsToShow : [];
for (var _i = 0, elementsToShow_1 = elementsToShow; _i < elementsToShow_1.length; _i++) {
var tagRenderingOption = elementsToShow_1[_i];
_this._infoboxes.push(tagRenderingOption.construct(deps));
}
title = title !== null && title !== void 0 ? title : new TagRendering_1.TagRenderingOptions({
mappings: [{ k: new TagsFilter_1.And([]), txt: "" }]
});
_this._title = new TagRendering_1.TagRenderingOptions(title.options).construct(deps);
_this._osmLink = new OsmLink_1.OsmLink().construct(deps);
_this._wikipedialink = new WikipediaLink_1.WikipediaLink().construct(deps);
return _this;
}
FeatureInfoBox.prototype.InnerRender = function () {
var info = [];
var questions = [];
for (var _i = 0, _a = this._infoboxes; _i < _a.length; _i++) {
var infobox = _a[_i];
if (infobox.IsKnown()) {
info.push(infobox);
}
else if (infobox.IsQuestioning()) {
questions.push(infobox);
}
}
var questionsHtml = "";
if (this._userDetails.data.loggedIn && questions.length > 0) {
// We select the most important question and render that one
var mostImportantQuestion = void 0;
var score = -1000;
for (var _b = 0, questions_1 = questions; _b < questions_1.length; _b++) {
var question = questions_1[_b];
if (mostImportantQuestion === undefined || question.Priority() > score) {
mostImportantQuestion = question;
score = question.Priority();
}
}
questionsHtml = mostImportantQuestion.Render();
}
return "<div class='featureinfobox'>" +
"<div class='featureinfoboxtitle'>" +
"<span>" +
this._title.Render() +
"</span>" +
this._wikipedialink.Render() +
this._osmLink.Render() +
"</div>" +
"<div class='infoboxcontents'>" +
new VerticalCombine_1.VerticalCombine(info, "infobox-information ").Render() +
questionsHtml +
"</div>" +
"" +
"</div>";
};
return FeatureInfoBox;
}(UIElement_1.UIElement));
exports.FeatureInfoBox = FeatureInfoBox;

View file

@ -1,112 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageCarousel = exports.ImageCarouselConstructor = void 0;
var ImageSearcher_1 = require("../../Logic/ImageSearcher");
var SlideShow_1 = require("../SlideShow");
var FixedUiElement_1 = require("../Base/FixedUiElement");
var VariableUIElement_1 = require("../Base/VariableUIElement");
var ConfirmDialog_1 = require("../ConfirmDialog");
var UIElementConstructor_1 = require("../../Customizations/UIElementConstructor");
var ImageCarouselConstructor = /** @class */ (function () {
function ImageCarouselConstructor() {
}
ImageCarouselConstructor.prototype.IsKnown = function (properties) {
return true;
};
ImageCarouselConstructor.prototype.IsQuestioning = function (properties) {
return false;
};
ImageCarouselConstructor.prototype.Priority = function () {
return 0;
};
ImageCarouselConstructor.prototype.construct = function (tags, changes) {
return new ImageCarousel(tags, changes);
};
return ImageCarouselConstructor;
}());
exports.ImageCarouselConstructor = ImageCarouselConstructor;
var ImageCarousel = /** @class */ (function (_super) {
__extends(ImageCarousel, _super);
function ImageCarousel(tags, changes) {
var _this = _super.call(this, tags) || this;
_this._userDetails = changes.login.userDetails;
var self = _this;
_this.searcher = new ImageSearcher_1.ImageSearcher(tags, changes);
_this._uiElements = _this.searcher.map(function (imageURLS) {
var uiElements = [];
for (var _i = 0, imageURLS_1 = imageURLS; _i < imageURLS_1.length; _i++) {
var url = imageURLS_1[_i];
var image = ImageSearcher_1.ImageSearcher.CreateImageElement(url);
uiElements.push(image);
}
return uiElements;
});
_this.slideshow = new SlideShow_1.SlideShow(_this._uiElements, new FixedUiElement_1.FixedUiElement("")).HideOnEmpty(true);
var showDeleteButton = _this.slideshow._currentSlide.map(function (i) {
if (!self._userDetails.data.loggedIn) {
return false;
}
return self.searcher.IsDeletable(self.searcher.data[i]);
}, [_this.searcher, _this._userDetails]);
_this.slideshow._currentSlide.addCallback(function () {
showDeleteButton.ping(); // This pings the showDeleteButton, which indicates that it has to hide it's subbuttons
});
var deleteCurrent = function () {
self.searcher.Delete(self.searcher.data[self.slideshow._currentSlide.data]);
};
_this._deleteButton = new ConfirmDialog_1.ConfirmDialog(showDeleteButton, "<img src='assets/delete.svg' alt='Afbeelding verwijderen' class='delete-image'>", "<span>Afbeelding verwijderen</span>", "<span>Terug</span>", deleteCurrent, function () { }, 'delete-image-confirm', 'delete-image-cancel');
var mapping = _this.slideshow._currentSlide.map(function (i) {
if (_this.searcher._deletedImages.data.indexOf(_this.searcher.data[i]) >= 0) {
return "<div class='image-is-removed'>Deze afbeelding is verwijderd</div>";
}
return "";
});
_this._isDeleted = new VariableUIElement_1.VariableUiElement(mapping);
_this.searcher._deletedImages.addCallback(function () {
_this.slideshow._currentSlide.ping();
});
return _this;
}
ImageCarousel.prototype.InnerRender = function () {
return "<span class='image-carousel-container'>" +
"<div class='image-delete-container'>" +
this._deleteButton.Render() +
this._isDeleted.Render() +
"</div>" +
this.slideshow.Render() +
"</span>";
};
ImageCarousel.prototype.IsKnown = function () {
return true;
};
ImageCarousel.prototype.IsQuestioning = function () {
return false;
};
ImageCarousel.prototype.Priority = function () {
return 0;
};
ImageCarousel.prototype.InnerUpdate = function (htmlElement) {
_super.prototype.InnerUpdate.call(this, htmlElement);
this._deleteButton.Update();
this._isDeleted.Update();
};
ImageCarousel.prototype.Activate = function () {
_super.prototype.Activate.call(this);
this.searcher.Activate();
};
return ImageCarousel;
}(UIElementConstructor_1.TagDependantUIElement));
exports.ImageCarousel = ImageCarousel;

View file

@ -1,74 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageCarouselWithUploadConstructor = void 0;
var UIElementConstructor_1 = require("../../Customizations/UIElementConstructor");
var ImageCarousel_1 = require("./ImageCarousel");
var OsmImageUploadHandler_1 = require("../../Logic/OsmImageUploadHandler");
var ImageCarouselWithUploadConstructor = /** @class */ (function () {
function ImageCarouselWithUploadConstructor() {
}
ImageCarouselWithUploadConstructor.prototype.IsKnown = function (properties) {
return true;
};
ImageCarouselWithUploadConstructor.prototype.IsQuestioning = function (properties) {
return false;
};
ImageCarouselWithUploadConstructor.prototype.Priority = function () {
return 0;
};
ImageCarouselWithUploadConstructor.prototype.construct = function (dependencies) {
return new ImageCarouselWithUpload(dependencies);
};
return ImageCarouselWithUploadConstructor;
}());
exports.ImageCarouselWithUploadConstructor = ImageCarouselWithUploadConstructor;
var ImageCarouselWithUpload = /** @class */ (function (_super) {
__extends(ImageCarouselWithUpload, _super);
function ImageCarouselWithUpload(dependencies) {
var _this = _super.call(this, dependencies.tags) || this;
var tags = dependencies.tags;
var changes = dependencies.changes;
_this._imageElement = new ImageCarousel_1.ImageCarousel(tags, changes);
var userDetails = changes.login.userDetails;
var license = changes.login.GetPreference("mapcomplete-pictures-license");
_this._pictureUploader = new OsmImageUploadHandler_1.OsmImageUploadHandler(tags, userDetails, license, changes, _this._imageElement.slideshow).getUI();
return _this;
}
ImageCarouselWithUpload.prototype.InnerRender = function () {
return this._imageElement.Render() +
this._pictureUploader.Render();
};
ImageCarouselWithUpload.prototype.Activate = function () {
_super.prototype.Activate.call(this);
this._imageElement.Activate();
this._pictureUploader.Activate();
};
ImageCarouselWithUpload.prototype.Update = function () {
_super.prototype.Update.call(this);
this._imageElement.Update();
this._pictureUploader.Update();
};
ImageCarouselWithUpload.prototype.IsKnown = function () {
return true;
};
ImageCarouselWithUpload.prototype.IsQuestioning = function () {
return false;
};
ImageCarouselWithUpload.prototype.Priority = function () {
return 0;
};
return ImageCarouselWithUpload;
}(UIElementConstructor_1.TagDependantUIElement));

View file

@ -1,59 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImgurImage = void 0;
var UIEventSource_1 = require("../UIEventSource");
var UIElement_1 = require("../UIElement");
var Imgur_1 = require("../../Logic/Imgur");
var ImgurImage = /** @class */ (function (_super) {
__extends(ImgurImage, _super);
function ImgurImage(source) {
var _this = _super.call(this, undefined) || this;
_this._imageLocation = source;
if (ImgurImage.allLicenseInfos[source] !== undefined) {
_this._imageMeta = ImgurImage.allLicenseInfos[source];
}
else {
_this._imageMeta = new UIEventSource_1.UIEventSource(null);
ImgurImage.allLicenseInfos[source] = _this._imageMeta;
var self_1 = _this;
Imgur_1.Imgur.getDescriptionOfImage(source, function (license) {
self_1._imageMeta.setData(license);
});
}
_this.ListenTo(_this._imageMeta);
return _this;
}
ImgurImage.prototype.InnerRender = function () {
var _a, _b;
var image = "<img src='" + this._imageLocation + "' " + "alt='' >";
if (this._imageMeta.data === null) {
return image;
}
var attribution = "<span class='attribution-author'><b>" + ((_a = this._imageMeta.data.artist) !== null && _a !== void 0 ? _a : "") + "</b></span>" + " <span class='license'>" + ((_b = this._imageMeta.data.licenseShortName) !== null && _b !== void 0 ? _b : "") + "</span>";
return "<div class='imgWithAttr'>" +
image +
"<div class='attribution'>" +
attribution +
"</div>" +
"</div>";
};
/***
* Dictionary from url to alreayd known license info
*/
ImgurImage.allLicenseInfos = {};
return ImgurImage;
}(UIElement_1.UIElement));
exports.ImgurImage = ImgurImage;

View file

@ -1,28 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleImageElement = void 0;
var UIElement_1 = require("../UIElement");
var SimpleImageElement = /** @class */ (function (_super) {
__extends(SimpleImageElement, _super);
function SimpleImageElement(source) {
return _super.call(this, source) || this;
}
SimpleImageElement.prototype.InnerRender = function () {
return "<img src='" + this._source.data + "' alt='img'>";
};
return SimpleImageElement;
}(UIElement_1.UIElement));
exports.SimpleImageElement = SimpleImageElement;

View file

@ -1,59 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.WikimediaImage = void 0;
var UIEventSource_1 = require("../UIEventSource");
var UIElement_1 = require("../UIElement");
var Wikimedia_1 = require("../../Logic/Wikimedia");
var WikimediaImage = /** @class */ (function (_super) {
__extends(WikimediaImage, _super);
function WikimediaImage(source) {
var _this = _super.call(this, undefined) || this;
_this._imageLocation = source;
if (WikimediaImage.allLicenseInfos[source] !== undefined) {
_this._imageMeta = WikimediaImage.allLicenseInfos[source];
}
else {
_this._imageMeta = new UIEventSource_1.UIEventSource(new Wikimedia_1.LicenseInfo());
WikimediaImage.allLicenseInfos[source] = _this._imageMeta;
var self_1 = _this;
Wikimedia_1.Wikimedia.LicenseData(source, function (info) {
self_1._imageMeta.setData(info);
});
}
_this.ListenTo(_this._imageMeta);
return _this;
}
WikimediaImage.prototype.InnerRender = function () {
var _a, _b;
var url = Wikimedia_1.Wikimedia.ImageNameToUrl(this._imageLocation, 500, 400);
url = url.replace(/'/g, '%27');
var wikimediaLink = "<a href='https://commons.wikimedia.org/wiki/" + this._imageLocation + "' target='_blank'>" +
"<img class='wikimedia-link' src='./assets/wikimedia-commons-white.svg' alt='Wikimedia Commons Logo'/>" +
"</a> ";
var attribution = "<span class='attribution-author'>" + ((_a = this._imageMeta.data.artist) !== null && _a !== void 0 ? _a : "") + "</span>" + " <span class='license'>" + ((_b = this._imageMeta.data.licenseShortName) !== null && _b !== void 0 ? _b : "") + "</span>";
var image = "<img src='" + url + "' " + "alt='" + this._imageMeta.data.description + "' >";
return "<div class='imgWithAttr'>" +
image +
"<div class='attribution'>" +
wikimediaLink +
attribution +
"</div>" +
"</div>";
};
WikimediaImage.allLicenseInfos = {};
return WikimediaImage;
}(UIElement_1.UIElement));
exports.WikimediaImage = WikimediaImage;

View file

@ -1,107 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageUploadFlow = void 0;
var UIElement_1 = require("./UIElement");
var UIEventSource_1 = require("./UIEventSource");
var jquery_1 = require("jquery");
var Imgur_1 = require("../Logic/Imgur");
var DropDown_1 = require("./Input/DropDown");
var VariableUIElement_1 = require("./Base/VariableUIElement");
var ImageUploadFlow = /** @class */ (function (_super) {
__extends(ImageUploadFlow, _super);
function ImageUploadFlow(userInfo, preferedLicense, uploadOptions) {
var _this = _super.call(this, undefined) || this;
_this._isUploading = new UIEventSource_1.UIEventSource(0);
_this._userdetails = userInfo;
_this.ListenTo(userInfo);
_this._uploadOptions = uploadOptions;
_this.ListenTo(_this._isUploading);
var licensePicker = new DropDown_1.DropDown("Jouw foto wordt gepubliceerd ", [
{ value: "CC0", shown: "in het publiek domein" },
{ value: "CC-BY-SA 4.0", shown: "onder een CC-BY-SA-licentie" },
{ value: "CC-BY 4.0", shown: "onder een CC-BY-licentie" }
], preferedLicense);
_this._licensePicker = licensePicker;
_this._selectedLicence = licensePicker.selectedElement;
var licenseExplanations = {
"CC-BY-SA 4.0": "<b>Creative Commonse met naamsvermelding en gelijk delen</b><br/>" +
"Je foto mag door iedereen gratis gebruikt worden, als ze je naam vermelden én ze afgeleide werken met deze licentie en attributie delen.",
"CC-BY 4.0": "<b>Creative Commonse met naamsvermelding</b> <br/>" +
"Je foto mag door iedereen gratis gebruikt worden, als ze je naam vermelden",
"CC0": "<b>Geen copyright</b><br/> Je foto mag door iedereen voor alles gebruikt worden"
};
_this._licenseExplanation = new VariableUIElement_1.VariableUiElement(_this._selectedLicence.map(function (license) {
return licenseExplanations[license];
}));
return _this;
}
ImageUploadFlow.prototype.InnerRender = function () {
if (!this._userdetails.data.loggedIn) {
return "<div class='activate-osm-authentication'>Gelieve je aan te melden om een foto toe te voegen of vragen te beantwoorden</div>";
}
if (this._isUploading.data == 1) {
return "<b>Bezig met een foto te uploaden...</b>";
}
if (this._isUploading.data > 0) {
return "<b>Bezig met uploaden, nog " + this._isUploading.data + " foto's te gaan...</b>";
}
return "" +
"<div class='imageflow'>" +
"<label for='fileselector-" + this.id + "'>" +
"<div class='imageflow-file-input-wrapper'>" +
"<img src='./assets/camera-plus.svg' alt='upload image'/> " +
"<span class='imageflow-add-picture'>Voeg foto toe</span>" +
"<div class='break'></div>" +
"</div>" +
this._licensePicker.Render() +
"</label>" +
"<input id='fileselector-" + this.id + "' " +
"type='file' " +
"class='imageflow-file-input' " +
"accept='image/*' name='picField' size='24' multiple='multiple' alt=''" +
"/>" +
"</div>";
};
ImageUploadFlow.prototype.InnerUpdate = function (htmlElement) {
_super.prototype.InnerUpdate.call(this, htmlElement);
var user = this._userdetails.data;
htmlElement.onclick = function () {
if (!user.loggedIn) {
user.osmConnection.AttemptLogin();
}
};
this._licensePicker.Update();
var selector = document.getElementById('fileselector-' + this.id);
var self = this;
if (selector != null) {
selector.onchange = function () {
var files = jquery_1.default(this).get(0).files;
self._isUploading.setData(files.length);
var opts = self._uploadOptions(self._selectedLicence.data);
Imgur_1.Imgur.uploadMultiple(opts.title, opts.description, files, function (url) {
console.log("File saved at", url);
self._isUploading.setData(self._isUploading.data - 1);
opts.handleURL(url);
}, function () {
console.log("All uploads completed");
opts.allDone();
});
};
}
};
return ImageUploadFlow;
}(UIElement_1.UIElement));
exports.ImageUploadFlow = ImageUploadFlow;

View file

@ -1,16 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Img = void 0;
var Img = /** @class */ (function () {
function Img() {
}
Img.osmAbstractLogo = "<svg class='osm-logo' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" width=\"24px\" version=\"1.1\" viewBox=\"0 0 66 64\">" +
" <g transform=\"translate(-0.849, -61)\">\n" +
" <path d=\"M0.849,61 L6.414,75.609 L0.849,90.217 L6.414,104.826 L0.849,119.435 L4.266,120.739 L22.831,102.183 L26.162,102.696 L30.205,98.652 C27.819,95.888 26.033,92.59 25.057,88.948 L26.953,87.391 C26.627,85.879 26.449,84.313 26.449,82.704 C26.449,74.67 30.734,67.611 37.136,63.696 L30.066,61 L15.457,66.565 L0.849,61 z\"></path>" +
" <path d=\"M48.71,64.617 C48.406,64.617 48.105,64.629 47.805,64.643 C47.52,64.657 47.234,64.677 46.953,64.704 C46.726,64.726 46.499,64.753 46.275,64.783 C46.039,64.814 45.811,64.847 45.579,64.887 C45.506,64.9 45.434,64.917 45.362,64.93 C45.216,64.958 45.072,64.987 44.927,65.017 C44.812,65.042 44.694,65.06 44.579,65.087 C44.442,65.119 44.307,65.156 44.17,65.191 C43.943,65.25 43.716,65.315 43.492,65.383 C43.323,65.433 43.155,65.484 42.988,65.539 C42.819,65.595 42.65,65.652 42.483,65.713 C42.475,65.716 42.466,65.719 42.457,65.722 C35.819,68.158 31.022,74.369 30.649,81.774 C30.633,82.083 30.622,82.391 30.622,82.704 C30.622,83.014 30.631,83.321 30.649,83.626 C30.649,83.629 30.648,83.632 30.649,83.635 C30.662,83.862 30.681,84.088 30.701,84.313 C31.466,93.037 38.377,99.948 47.101,100.713 C47.326,100.733 47.552,100.754 47.779,100.765 C47.782,100.765 47.785,100.765 47.788,100.765 C48.093,100.783 48.399,100.791 48.709,100.791 C53.639,100.791 58.096,98.833 61.353,95.652 C61.532,95.477 61.712,95.304 61.883,95.122 C61.913,95.09 61.941,95.058 61.97,95.026 C61.98,95.015 61.987,95.002 61.996,94.991 C62.132,94.845 62.266,94.698 62.396,94.548 C62.449,94.487 62.501,94.426 62.553,94.365 C62.594,94.316 62.634,94.267 62.675,94.217 C62.821,94.04 62.961,93.861 63.101,93.678 C63.279,93.444 63.456,93.199 63.622,92.956 C63.956,92.471 64.267,91.97 64.553,91.452 C64.661,91.257 64.757,91.06 64.857,90.861 C64.89,90.796 64.93,90.735 64.962,90.67 C64.98,90.633 64.996,90.594 65.014,90.556 C65.125,90.324 65.234,90.09 65.336,89.852 C65.349,89.82 65.365,89.789 65.379,89.756 C65.48,89.517 65.575,89.271 65.666,89.026 C65.678,88.994 65.689,88.962 65.701,88.93 C65.792,88.679 65.881,88.43 65.962,88.174 C65.97,88.148 65.98,88.122 65.988,88.096 C66.069,87.832 66.144,87.564 66.214,87.296 C66.219,87.275 66.226,87.255 66.231,87.235 C66.301,86.962 66.365,86.686 66.423,86.409 C66.426,86.391 66.428,86.374 66.431,86.356 C66.445,86.291 66.453,86.223 66.466,86.156 C66.511,85.925 66.552,85.695 66.588,85.461 C66.632,85.169 66.671,84.878 66.701,84.583 C66.701,84.574 66.701,84.565 66.701,84.556 C66.731,84.258 66.755,83.955 66.77,83.652 C66.77,83.646 66.77,83.641 66.77,83.635 C66.786,83.326 66.797,83.017 66.797,82.704 C66.797,72.69 58.723,64.617 48.71,64.617 z\"></path>" +
" <path d=\"M62.936,99.809 C59.074,103.028 54.115,104.965 48.71,104.965 C47.101,104.965 45.535,104.787 44.023,104.461 L42.466,106.357 C39.007,105.43 35.855,103.781 33.179,101.574 L28.996,105.765 L29.51,108.861 L13.953,124.426 L15.457,125 L30.066,119.435 L44.675,125 L59.283,119.435 L64.849,104.826 L62.936,99.809 z\"></path>" +
" </g>" +
"</svg>";
return Img;
}());
exports.Img = Img;

View file

@ -1,69 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DropDown = void 0;
var UIEventSource_1 = require("../UIEventSource");
var UIElement_1 = require("../UIElement");
var DropDown = /** @class */ (function (_super) {
__extends(DropDown, _super);
function DropDown(label, values, selectedElement) {
if (selectedElement === void 0) { selectedElement = undefined; }
var _this = _super.call(this, undefined) || this;
_this._label = label;
_this._values = values;
_this.selectedElement = selectedElement !== null && selectedElement !== void 0 ? selectedElement : new UIEventSource_1.UIEventSource(values[0].value);
if (selectedElement.data === undefined) {
_this.selectedElement.setData(values[0].value);
}
var self = _this;
_this.selectedElement.addCallback(function () {
self.InnerUpdate();
});
return _this;
}
DropDown.prototype.InnerRender = function () {
var options = "";
for (var _i = 0, _a = this._values; _i < _a.length; _i++) {
var value = _a[_i];
options += "<option value='" + value.value + "'>" + value.shown + "</option>";
}
return "<form>" +
"<label for='dropdown-" + this.id + "'>" + this._label + "</label>" +
"<select name='dropdown-" + this.id + "' id='dropdown-" + this.id + "'>" +
options +
"</select>" +
"</form>";
};
DropDown.prototype.InnerUpdate = function () {
var self = this;
var e = document.getElementById("dropdown-" + this.id);
if (e === null) {
return;
}
// @ts-ignore
if (this.selectedElement.data !== e.value) {
// @ts-ignore
e.value = this.selectedElement.data;
}
e.onchange = function () {
// @ts-ignore
var selectedValue = e.options[e.selectedIndex].value;
console.log("Putting data", selectedValue);
self.selectedElement.setData(selectedValue);
};
};
return DropDown;
}(UIElement_1.UIElement));
exports.DropDown = DropDown;

View file

@ -1,39 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.FixedInputElement = void 0;
var InputElement_1 = require("./InputElement");
var UIEventSource_1 = require("../UIEventSource");
var FixedUiElement_1 = require("../Base/FixedUiElement");
var FixedInputElement = /** @class */ (function (_super) {
__extends(FixedInputElement, _super);
function FixedInputElement(rendering, value) {
var _this = _super.call(this, undefined) || this;
_this.value = new UIEventSource_1.UIEventSource(value);
_this.rendering = typeof (rendering) === 'string' ? new FixedUiElement_1.FixedUiElement(rendering) : rendering;
return _this;
}
FixedInputElement.prototype.GetValue = function () {
return this.value;
};
FixedInputElement.prototype.InnerRender = function () {
return this.rendering.Render();
};
FixedInputElement.prototype.IsValid = function (t) {
return t === this.value.data;
};
return FixedInputElement;
}(InputElement_1.InputElement));
exports.FixedInputElement = FixedInputElement;

View file

@ -1,25 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputElement = void 0;
var UIElement_1 = require("../UIElement");
var InputElement = /** @class */ (function (_super) {
__extends(InputElement, _super);
function InputElement() {
return _super !== null && _super.apply(this, arguments) || this;
}
return InputElement;
}(UIElement_1.UIElement));
exports.InputElement = InputElement;

View file

@ -1,39 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputElementWrapper = void 0;
var InputElement_1 = require("./InputElement");
var UIElement_1 = require("../UIElement");
var InputElementWrapper = /** @class */ (function (_super) {
__extends(InputElementWrapper, _super);
function InputElementWrapper(pre, input, post) {
var _this = _super.call(this, undefined) || this;
_this.post = UIElement_1.UIElement.Fix(post);
_this.input = input;
_this.pre = UIElement_1.UIElement.Fix(pre);
return _this;
}
InputElementWrapper.prototype.GetValue = function () {
return this.input.GetValue();
};
InputElementWrapper.prototype.InnerRender = function () {
return this.pre.Render() + this.input.Render() + this.post.Render();
};
InputElementWrapper.prototype.IsValid = function (t) {
return this.input.IsValid(t);
};
return InputElementWrapper;
}(InputElement_1.InputElement));
exports.InputElementWrapper = InputElementWrapper;

View file

@ -1,122 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RadioButton = void 0;
var UIEventSource_1 = require("../UIEventSource");
var InputElement_1 = require("./InputElement");
var RadioButton = /** @class */ (function (_super) {
__extends(RadioButton, _super);
function RadioButton(elements, selectFirstAsDefault) {
if (selectFirstAsDefault === void 0) { selectFirstAsDefault = true; }
var _this = _super.call(this, undefined) || this;
_this._selectedElementIndex = new UIEventSource_1.UIEventSource(null);
_this._elements = elements;
_this._selectFirstAsDefault = selectFirstAsDefault;
var self = _this;
_this.value =
UIEventSource_1.UIEventSource.flatten(_this._selectedElementIndex.map(function (selectedIndex) {
if (selectedIndex !== undefined && selectedIndex !== null) {
return elements[selectedIndex].GetValue();
}
}), elements.map(function (e) { return e.GetValue(); }));
_this.value.addCallback(function (t) {
self.SetCorrectValue(t);
});
var _loop_1 = function (i) {
// If an element is clicked, the radio button corresponding with it should be selected as well
elements[i].onClick(function () {
self._selectedElementIndex.setData(i);
});
};
for (var i = 0; i < elements.length; i++) {
_loop_1(i);
}
return _this;
}
RadioButton.prototype.IsValid = function (t) {
for (var _i = 0, _a = this._elements; _i < _a.length; _i++) {
var inputElement = _a[_i];
if (inputElement.IsValid(t)) {
return true;
}
}
return false;
};
RadioButton.prototype.GetValue = function () {
return this.value;
};
RadioButton.prototype.IdFor = function (i) {
return 'radio-' + this.id + '-' + i;
};
RadioButton.prototype.InnerRender = function () {
var body = "";
var i = 0;
for (var _i = 0, _a = this._elements; _i < _a.length; _i++) {
var el = _a[_i];
var htmlElement = '<input type="radio" id="' + this.IdFor(i) + '" name="radiogroup-' + this.id + '">' +
'<label for="' + this.IdFor(i) + '">' + el.Render() + '</label>' +
'<br>';
body += htmlElement;
i++;
}
return "<form id='" + this.id + "-form'>" + body + "</form>";
};
RadioButton.prototype.SetCorrectValue = function (t) {
if (t === undefined) {
return;
}
// We check that what is selected matches the previous rendering
for (var i = 0; i < this._elements.length; i++) {
var e = this._elements[i];
if (e.IsValid(t)) {
this._selectedElementIndex.setData(i);
e.GetValue().setData(t);
// @ts-ignore
document.getElementById(this.IdFor(i)).checked = true;
return;
}
}
};
RadioButton.prototype.InnerUpdate = function (htmlElement) {
var self = this;
function checkButtons() {
for (var i = 0; i < self._elements.length; i++) {
var el_1 = document.getElementById(self.IdFor(i));
// @ts-ignore
if (el_1.checked) {
self._selectedElementIndex.setData(i);
}
}
}
var el = document.getElementById(this.id);
el.addEventListener("change", function () {
checkButtons();
});
if (this._selectFirstAsDefault) {
this.SetCorrectValue(this.value.data);
if (this._selectedElementIndex.data === null || this._selectedElementIndex.data === undefined) {
var el_2 = document.getElementById(this.IdFor(0));
if (el_2) {
// @ts-ignore
el_2.checked = true;
checkButtons();
}
}
}
};
;
return RadioButton;
}(InputElement_1.InputElement));
exports.RadioButton = RadioButton;

View file

@ -1,94 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextField = void 0;
var UIEventSource_1 = require("../UIEventSource");
var InputElement_1 = require("./InputElement");
var FixedUiElement_1 = require("../Base/FixedUiElement");
var TextField = /** @class */ (function (_super) {
__extends(TextField, _super);
function TextField(options) {
var _a, _b, _c, _d;
var _this = _super.call(this, undefined) || this;
/**
* Pings and has the value data
*/
_this.enterPressed = new UIEventSource_1.UIEventSource(undefined);
_this.value = new UIEventSource_1.UIEventSource("");
_this.mappedValue = (_a = options === null || options === void 0 ? void 0 : options.value) !== null && _a !== void 0 ? _a : new UIEventSource_1.UIEventSource(undefined);
// @ts-ignore
_this._fromString = (_b = options.fromString) !== null && _b !== void 0 ? _b : (function (str) { return (str); });
_this.value.addCallback(function (str) { return _this.mappedValue.setData(options.fromString(str)); });
_this.mappedValue.addCallback(function (t) { return _this.value.setData(options.toString(t)); });
_this._placeholder =
typeof (options.placeholder) === "string" ? new FixedUiElement_1.FixedUiElement(options.placeholder) :
((_c = options.placeholder) !== null && _c !== void 0 ? _c : new FixedUiElement_1.FixedUiElement(""));
_this._toString = (_d = options.toString) !== null && _d !== void 0 ? _d : (function (t) { return ("" + t); });
var self = _this;
_this.mappedValue.addCallback(function (t) {
if (t === undefined && t === null) {
return;
}
var field = document.getElementById('text-' + _this.id);
if (field === undefined || field === null) {
return;
}
// @ts-ignore
field.value = options.toString(t);
});
return _this;
}
TextField.prototype.GetValue = function () {
return this.mappedValue;
};
TextField.prototype.InnerRender = function () {
return "<form onSubmit='return false' class='form-text-field'>" +
"<input type='text' placeholder='" + this._placeholder.InnerRender() + "' id='text-" + this.id + "'>" +
"</form>";
};
TextField.prototype.InnerUpdate = function (htmlElement) {
var field = document.getElementById('text-' + this.id);
if (field === null) {
return;
}
var self = this;
field.oninput = function () {
// @ts-ignore
self.value.setData(field.value);
};
field.addEventListener("keyup", function (event) {
if (event.key === "Enter") {
// @ts-ignore
self.enterPressed.setData(field.value);
}
});
};
TextField.prototype.IsValid = function (t) {
if (t === undefined || t === null) {
return false;
}
var result = this._toString(t);
return result !== undefined && result !== null;
};
TextField.prototype.Clear = function () {
var field = document.getElementById('text-' + this.id);
if (field !== undefined) {
// @ts-ignore
field.value = "";
}
};
return TextField;
}(InputElement_1.InputElement));
exports.TextField = TextField;

View file

@ -1,56 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageBoxHandler = void 0;
/**
* Keeps 'messagebox' and 'messageboxmobile' in sync, shows a 'close' button on the latter one
*/
var UIEventSource_1 = require("./UIEventSource");
var VariableUIElement_1 = require("./Base/VariableUIElement");
var MessageBoxHandler = /** @class */ (function () {
function MessageBoxHandler(uielement, onClear) {
this._uielement = uielement;
this.listenTo(uielement);
this.update();
window.onhashchange = function () {
if (location.hash === "") {
// No more element: back to the map!
uielement.setData(undefined);
onClear();
}
};
new VariableUIElement_1.VariableUiElement(new UIEventSource_1.UIEventSource("<h2>Naar de kaart</h2>"), function () {
document.getElementById("to-the-map").onclick = function () {
uielement.setData(undefined);
onClear();
};
}).AttachTo("to-the-map");
}
MessageBoxHandler.prototype.listenTo = function (uiEventSource) {
var self = this;
uiEventSource.addCallback(function () {
self.update();
});
};
MessageBoxHandler.prototype.update = function () {
var _a, _b, _c;
var wrapper = document.getElementById("messagesboxmobilewrapper");
var gen = this._uielement.data;
console.log("Generator: ", gen);
if (gen === undefined) {
wrapper.classList.add("hidden");
if (location.hash !== "") {
location.hash = "";
}
return;
}
location.hash = "#element";
wrapper.classList.remove("hidden");
/* gen()
?.HideOnEmpty(true)
?.AttachTo("messagesbox")
?.Activate();*/
(_c = (_b = (_a = gen()) === null || _a === void 0 ? void 0 : _a.HideOnEmpty(true)) === null || _b === void 0 ? void 0 : _b.AttachTo("messagesboxmobile")) === null || _c === void 0 ? void 0 : _c.Activate();
};
return MessageBoxHandler;
}());
exports.MessageBoxHandler = MessageBoxHandler;

View file

@ -1,49 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PendingChanges = void 0;
var UIElement_1 = require("./UIElement");
var PendingChanges = /** @class */ (function (_super) {
__extends(PendingChanges, _super);
function PendingChanges(changes, countdown) {
var _this = _super.call(this, changes.pendingChangesES) || this;
_this.ListenTo(changes.isSaving);
_this.ListenTo(countdown);
_this._pendingChangesCount = changes.pendingChangesES;
_this._countdown = countdown;
_this._isSaving = changes.isSaving;
_this.onClick(function () {
changes.uploadAll();
});
return _this;
}
PendingChanges.prototype.InnerRender = function () {
if (this._isSaving.data) {
return "<span class='alert'>Saving</span>";
}
if (this._pendingChangesCount.data == 0) {
return "";
}
var restingSeconds = this._countdown.data / 1000;
var dots = "";
while (restingSeconds > 0) {
dots += ".";
restingSeconds = restingSeconds - 1;
}
return "Saving " + this._pendingChangesCount.data;
};
return PendingChanges;
}(UIElement_1.UIElement));
exports.PendingChanges = PendingChanges;

View file

@ -1,51 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuestionPicker = void 0;
var UIElement_1 = require("./UIElement");
var QuestionPicker = /** @class */ (function (_super) {
__extends(QuestionPicker, _super);
function QuestionPicker(questions, tags) {
var _this = _super.call(this, tags) || this;
_this._questions = questions;
_this.tags = tags.data;
_this.source = tags;
return _this;
}
QuestionPicker.prototype.InnerRender = function () {
var t = this.tags;
var highestPriority = Number.MIN_VALUE;
var highestQ;
for (var _i = 0, _a = this._questions; _i < _a.length; _i++) {
var q = _a[_i];
if (!q.Applicable(t)) {
continue;
}
var priority = q.question.severity;
if (priority > highestPriority) {
highestPriority = priority;
highestQ = q;
}
}
if (highestQ === undefined) {
return "Er zijn geen vragen meer!";
}
return "<div class='question'>" +
highestQ.CreateHtml(this.source).Render() +
"</div>";
};
return QuestionPicker;
}(UIElement_1.UIElement));
exports.QuestionPicker = QuestionPicker;

View file

@ -1,38 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SaveButton = void 0;
var UIElement_1 = require("./UIElement");
var SaveButton = /** @class */ (function (_super) {
__extends(SaveButton, _super);
function SaveButton(value) {
var _this = _super.call(this, value) || this;
if (value === undefined) {
throw "No event source for savebutton, something is wrong";
}
_this._value = value;
return _this;
}
SaveButton.prototype.InnerRender = function () {
if (this._value.data === undefined ||
this._value.data === null
|| this._value.data === "") {
return "<span class='save-non-active'>Opslaan</span>";
}
return "<span class='save'>Opslaan</span>";
};
return SaveButton;
}(UIElement_1.UIElement));
exports.SaveButton = SaveButton;

View file

@ -1,83 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchAndGo = void 0;
var UIElement_1 = require("./UIElement");
var TextField_1 = require("./Input/TextField");
var UIEventSource_1 = require("./UIEventSource");
var FixedUiElement_1 = require("./Base/FixedUiElement");
var Geocoding_1 = require("../Logic/Geocoding");
var SearchAndGo = /** @class */ (function (_super) {
__extends(SearchAndGo, _super);
function SearchAndGo(map) {
var _this = _super.call(this, undefined) || this;
_this._placeholder = new UIEventSource_1.UIEventSource("Zoek naar een locatie...");
_this._searchField = new TextField_1.TextField({
placeholder: _this._placeholder
});
_this._foundEntries = new UIEventSource_1.UIEventSource([]);
_this._goButton = new FixedUiElement_1.FixedUiElement("<img class='search-go' src='./assets/search.svg' alt='GO'>");
_this._map = map;
_this.ListenTo(_this._foundEntries);
var self = _this;
_this._searchField.enterPressed.addCallback(function () {
self.RunSearch();
});
_this._goButton.onClick(function () {
self.RunSearch();
});
return _this;
}
// Triggered by 'enter' or onclick
SearchAndGo.prototype.RunSearch = function () {
var _this = this;
var searchString = this._searchField.GetValue().data;
this._searchField.Clear();
this._placeholder.setData("Bezig met zoeken...");
var self = this;
Geocoding_1.Geocoding.Search(searchString, this._map, function (result) {
if (result.length == 0) {
_this._placeholder.setData("Niets gevonden");
return;
}
var bb = result[0].boundingbox;
var bounds = [
[bb[0], bb[2]],
[bb[1], bb[3]]
];
self._map.map.fitBounds(bounds);
_this._placeholder.setData("Zoek naar een locatie...");
}, function () {
_this._placeholder.setData("Niets gevonden: er ging iets mis");
});
};
SearchAndGo.prototype.InnerRender = function () {
// "<img class='search' src='./assets/search.svg' alt='Search'> " +
return this._searchField.Render() +
this._goButton.Render();
};
SearchAndGo.prototype.Update = function () {
_super.prototype.Update.call(this);
this._searchField.Update();
this._goButton.Update();
};
SearchAndGo.prototype.Activate = function () {
_super.prototype.Activate.call(this);
this._searchField.Activate();
this._goButton.Activate();
};
return SearchAndGo;
}(UIElement_1.UIElement));
exports.SearchAndGo = SearchAndGo;

View file

@ -1,84 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleAddUI = void 0;
var UIElement_1 = require("./UIElement");
var FixedUiElement_1 = require("./Base/FixedUiElement");
var Button_1 = require("./Base/Button");
/**
* Asks to add a feature at the last clicked location, at least if zoom is sufficient
*/
var SimpleAddUI = /** @class */ (function (_super) {
__extends(SimpleAddUI, _super);
function SimpleAddUI(zoomlevel, lastClickLocation, changes, selectedElement, dataIsLoading, userDetails, addButtons) {
var _this = _super.call(this, zoomlevel) || this;
_this._zoomlevel = zoomlevel;
_this._lastClickLocation = lastClickLocation;
_this._changes = changes;
_this._selectedElement = selectedElement;
_this._dataIsLoading = dataIsLoading;
_this._userDetails = userDetails;
_this.ListenTo(userDetails);
_this.ListenTo(dataIsLoading);
_this._addButtons = [];
for (var _i = 0, addButtons_1 = addButtons; _i < addButtons_1.length; _i++) {
var option = addButtons_1[_i];
// <button type='button'> looks SO retarded
// the default type of button is 'submit', which performs a POST and page reload
var button = new Button_1.Button(new FixedUiElement_1.FixedUiElement("Voeg hier een " + option.name + " toe"), _this.CreatePoint(option));
_this._addButtons.push(button);
}
return _this;
}
SimpleAddUI.prototype.CreatePoint = function (option) {
var self = this;
return function () {
console.log("Creating a new ", option.name, " at last click location");
var loc = self._lastClickLocation.data;
var feature = self._changes.createElement(option.tags, loc.lat, loc.lon);
option.layerToAddTo.AddNewElement(feature);
self._selectedElement.setData(feature.properties);
};
};
SimpleAddUI.prototype.InnerRender = function () {
var header = "<h2>Geen selectie</h2>" +
"Je klikte ergens waar er nog geen gezochte data is.<br/>";
if (!this._userDetails.data.loggedIn) {
return header + "<a class='activate-osm-authentication'>Gelieve je aan te melden om een nieuw punt toe te voegen</a>";
}
if (this._zoomlevel.data.zoom < 19) {
return header + "Zoom verder in om een element toe te voegen.";
}
if (this._dataIsLoading.data) {
return header + "De data is nog aan het laden. Nog even geduld, dan kan je een punt toevoegen";
}
var html = "";
for (var _i = 0, _a = this._addButtons; _i < _a.length; _i++) {
var button = _a[_i];
html += button.Render();
}
return header + html;
};
SimpleAddUI.prototype.InnerUpdate = function (htmlElement) {
_super.prototype.InnerUpdate.call(this, htmlElement);
for (var _i = 0, _a = this._addButtons; _i < _a.length; _i++) {
var button = _a[_i];
button.Update();
}
this._userDetails.data.osmConnection.registerActivateOsmAUthenticationClass();
};
return SimpleAddUI;
}(UIElement_1.UIElement));
exports.SimpleAddUI = SimpleAddUI;

View file

@ -1,92 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlideShow = void 0;
var UIElement_1 = require("./UIElement");
var UIEventSource_1 = require("./UIEventSource");
var FixedUiElement_1 = require("./Base/FixedUiElement");
var SlideShow = /** @class */ (function (_super) {
__extends(SlideShow, _super);
function SlideShow(embeddedElements, noImages) {
var _this = _super.call(this, embeddedElements) || this;
_this._currentSlide = new UIEventSource_1.UIEventSource(0);
_this._embeddedElements = embeddedElements;
_this.ListenTo(_this._currentSlide);
_this._noimages = noImages;
var self = _this;
_this._prev = new FixedUiElement_1.FixedUiElement("<div class='prev-button'>" +
"<div class='vspan'></div>" +
"<img src='assets/arrow-left-smooth.svg' alt='Prev'/>" +
"</div>")
.onClick(function () {
var current = self._currentSlide.data;
self.MoveTo(current - 1);
});
_this._next = new FixedUiElement_1.FixedUiElement("<div class='next-button'>" +
"<div class='vspan'></div>" +
"<img src='assets/arrow-right-smooth.svg' alt='Next'/>" +
"</div>")
.onClick(function () {
var current = self._currentSlide.data;
self.MoveTo(current + 1);
});
return _this;
}
SlideShow.prototype.InnerRender = function () {
if (this._embeddedElements.data.length == 0) {
return this._noimages.Render();
}
if (this._embeddedElements.data.length == 1) {
return "<div class='image-slideshow'><div class='slides'><div class='slide'>" +
this._embeddedElements.data[0].Render() +
"</div></div></div>";
}
var slides = "";
for (var i = 0; i < this._embeddedElements.data.length; i++) {
var embeddedElement = this._embeddedElements.data[i];
var state = "hidden";
if (this._currentSlide.data === i) {
state = "active-slide";
}
slides += " <div class=\"slide " + state + "\">" + embeddedElement.Render() + "</div>\n";
}
return "<div class='image-slideshow'>"
+ this._prev.Render()
+ "<div class='slides'>" + slides + "</div>"
+ this._next.Render()
+ "</div>";
};
SlideShow.prototype.MoveTo = function (index) {
if (index < 0) {
index = this._embeddedElements.data.length - 1;
}
index = index % this._embeddedElements.data.length;
this._currentSlide.setData(index);
};
SlideShow.prototype.InnerUpdate = function (htmlElement) {
this._next.Update();
this._prev.Update();
};
SlideShow.prototype.Activate = function () {
for (var _i = 0, _a = this._embeddedElements.data; _i < _a.length; _i++) {
var embeddedElement = _a[_i];
embeddedElement.Activate();
}
this._next.Update();
this._prev.Update();
};
return SlideShow;
}(UIElement_1.UIElement));
exports.SlideShow = SlideShow;

View file

@ -1,115 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UIElement = void 0;
var FixedUiElement_1 = require("./Base/FixedUiElement");
var UIElement = /** @class */ (function () {
function UIElement(source) {
this._hideIfEmpty = false;
this.id = "ui-element-" + UIElement.nextId;
this._source = source;
UIElement.nextId++;
this.ListenTo(source);
}
UIElement.prototype.ListenTo = function (source) {
if (source === undefined) {
return;
}
var self = this;
source.addCallback(function () {
self.Update();
});
};
UIElement.prototype.onClick = function (f) {
this._onClick = f;
this.Update();
return this;
};
UIElement.Fix = function (element) {
if (typeof (element) === 'string') {
return new FixedUiElement_1.FixedUiElement(element);
}
return element;
};
UIElement.prototype.Update = function () {
var element = document.getElementById(this.id);
if (element === null || element === undefined) {
// The element is not painted
return;
}
element.innerHTML = this.InnerRender();
if (this._hideIfEmpty) {
if (element.innerHTML === "") {
element.parentElement.style.display = "none";
}
else {
element.parentElement.style.display = undefined;
}
}
if (this._onClick !== undefined) {
var self_1 = this;
element.onclick = function () {
self_1._onClick();
};
element.style.pointerEvents = "all";
element.style.cursor = "pointer";
}
this.InnerUpdate(element);
for (var i in this) {
var child = this[i];
if (child instanceof UIElement) {
child.Update();
}
else if (child instanceof Array) {
for (var _i = 0, child_1 = child; _i < child_1.length; _i++) {
var ch = child_1[_i];
if (ch instanceof UIElement) {
ch.Update();
}
}
}
}
};
UIElement.prototype.HideOnEmpty = function (hide) {
this._hideIfEmpty = hide;
this.Update();
return this;
};
// Called after the HTML has been replaced. Can be used for css tricks
UIElement.prototype.InnerUpdate = function (htmlElement) { };
UIElement.prototype.Render = function () {
return "<span class='uielement' id='" + this.id + "'>" + this.InnerRender() + "</span>";
};
UIElement.prototype.AttachTo = function (divId) {
var element = document.getElementById(divId);
if (element === null) {
console.log("SEVERE: could not attach UIElement to ", divId);
return;
}
element.innerHTML = this.Render();
this.Update();
return this;
};
UIElement.prototype.Activate = function () {
for (var i in this) {
var child = this[i];
if (child instanceof UIElement) {
child.Activate();
}
else if (child instanceof Array) {
for (var _i = 0, child_2 = child; _i < child_2.length; _i++) {
var ch = child_2[_i];
if (ch instanceof UIElement) {
ch.Activate();
}
}
}
}
};
;
UIElement.prototype.IsEmpty = function () {
return this.InnerRender() === "";
};
UIElement.nextId = 0;
return UIElement;
}());
exports.UIElement = UIElement;

View file

@ -1,58 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UIEventSource = void 0;
var UIEventSource = /** @class */ (function () {
function UIEventSource(data) {
this._callbacks = [];
this.data = data;
}
UIEventSource.prototype.addCallback = function (callback) {
this._callbacks.push(callback);
return this;
};
UIEventSource.prototype.setData = function (t) {
if (this.data === t) {
return;
}
this.data = t;
this.ping();
};
UIEventSource.prototype.ping = function () {
for (var _i = 0, _a = this._callbacks; _i < _a.length; _i++) {
var callback = _a[_i];
callback(this.data);
}
};
UIEventSource.flatten = function (source, possibleSources) {
var _a;
var sink = new UIEventSource((_a = source.data) === null || _a === void 0 ? void 0 : _a.data);
source.addCallback(function (latestData) {
sink.setData(latestData === null || latestData === void 0 ? void 0 : latestData.data);
});
for (var _i = 0, possibleSources_1 = possibleSources; _i < possibleSources_1.length; _i++) {
var possibleSource = possibleSources_1[_i];
possibleSource.addCallback(function () {
var _a;
sink.setData((_a = source.data) === null || _a === void 0 ? void 0 : _a.data);
});
}
return sink;
};
UIEventSource.prototype.map = function (f, extraSources) {
if (extraSources === void 0) { extraSources = []; }
var self = this;
var update = function () {
newSource.setData(f(self.data));
newSource.ping();
};
this.addCallback(update);
for (var _i = 0, extraSources_1 = extraSources; _i < extraSources_1.length; _i++) {
var extraSource = extraSources_1[_i];
extraSource.addCallback(update);
}
var newSource = new UIEventSource(f(this.data));
return newSource;
};
return UIEventSource;
}());
exports.UIEventSource = UIEventSource;

View file

@ -1,112 +0,0 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserBadge = void 0;
var UIElement_1 = require("./UIElement");
var leaflet_1 = require("leaflet");
var FixedUiElement_1 = require("./Base/FixedUiElement");
var VariableUIElement_1 = require("./Base/VariableUIElement");
/**
* Handles and updates the user badge
*/
var UserBadge = /** @class */ (function (_super) {
__extends(UserBadge, _super);
function UserBadge(userDetails, pendingChanges, basemap) {
var _this = _super.call(this, userDetails) || this;
_this._userDetails = userDetails;
_this._pendingChanges = pendingChanges;
_this._basemap = basemap;
_this._logout = new FixedUiElement_1.FixedUiElement("<img src='assets/logout.svg' class='small-userbadge-icon' alt='logout'>")
.onClick(function () {
userDetails.data.osmConnection.LogOut();
});
userDetails.addCallback(function () {
var profilePic = document.getElementById("profile-pic");
if (profilePic) {
profilePic.onload = function () {
profilePic.style.opacity = "1";
};
}
});
_this._homeButton = new VariableUIElement_1.VariableUiElement(userDetails.map(function (userinfo) {
if (userinfo.home) {
return "<img id='home' src='./assets/home.svg' alt='home' class='small-userbadge-icon'> ";
}
return "";
})).onClick(function () {
var _a;
var home = (_a = userDetails.data) === null || _a === void 0 ? void 0 : _a.home;
if (home === undefined) {
return;
}
basemap.map.flyTo([home.lat, home.lon], 18);
});
return _this;
}
UserBadge.prototype.InnerRender = function () {
var user = this._userDetails.data;
if (!user.loggedIn) {
return "<div class='activate-osm-authentication'>Klik hier om aan te melden bij OSM</div>";
}
var messageSpan = "<span id='messages'>" +
" <a href='https://www.openstreetmap.org/messages/inbox' target='_blank'><img class='small-userbadge-icon' src='./assets/envelope.svg' alt='msgs'>" +
user.totalMessages +
"</a></span>";
if (user.unreadMessages > 0) {
messageSpan = "<span id='messages' class='alert'>" +
" <a href='https://www.openstreetmap.org/messages/inbox' target='_blank'><img class='small-userbadge-icon' src='./assets/envelope.svg' alt='msgs'/>" +
" " +
"" +
user.unreadMessages.toString() +
"</a></span>";
}
var dryrun = "";
if (user.dryRun) {
dryrun = " <span class='alert'>TESTING</span>";
}
if (user.home !== undefined) {
var icon = leaflet_1.default.icon({
iconUrl: 'assets/home.svg',
iconSize: [20, 20],
iconAnchor: [10, 10]
});
leaflet_1.default.marker([user.home.lat, user.home.lon], { icon: icon }).addTo(this._basemap.map);
}
var settings = "<a href='https://www.openstreetmap.org/user/" + encodeURIComponent(user.name) + "/account' target='_blank'>" +
"<img class='small-userbadge-icon' src='./assets/gear.svg' alt='settings'>" +
"</a> ";
return "<a href='https://www.openstreetmap.org/user/" + encodeURIComponent(user.name) + "' target='_blank'>" +
"<img id='profile-pic' src='" + user.img + "' alt='profile-pic'/> " +
"</a>" +
"<div id='usertext'>" +
"<p id='username'>" +
"<a href='https://www.openstreetmap.org/user/" + user.name + "' target='_blank'>" + user.name + "</a>" +
dryrun +
"</p> " +
"<p id='userstats'>" +
this._homeButton.Render() +
settings +
messageSpan +
"<span id='csCount'> " +
" <a href='https://www.openstreetmap.org/user/" + user.name + "/history' target='_blank'><img class='small-userbadge-icon' src='./assets/star.svg' alt='star'/> " + user.csCount +
"</a></span> " +
this._logout.Render() +
this._pendingChanges.Render() +
"</p>" +
"</div>";
};
return UserBadge;
}(UIElement_1.UIElement));
exports.UserBadge = UserBadge;

187
index.js
View file

@ -1,187 +0,0 @@
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var OsmConnection_1 = require("./Logic/OsmConnection");
var Changes_1 = require("./Logic/Changes");
var ElementStorage_1 = require("./Logic/ElementStorage");
var UIEventSource_1 = require("./UI/UIEventSource");
var UserBadge_1 = require("./UI/UserBadge");
var Basemap_1 = require("./Logic/Basemap");
var PendingChanges_1 = require("./UI/PendingChanges");
var CenterMessageBox_1 = require("./UI/CenterMessageBox");
var Helpers_1 = require("./Helpers");
var TagsFilter_1 = require("./Logic/TagsFilter");
var LayerUpdater_1 = require("./Logic/LayerUpdater");
var MessageBoxHandler_1 = require("./UI/MessageBoxHandler");
var FeatureInfoBox_1 = require("./UI/FeatureInfoBox");
var GeoLocationHandler_1 = require("./Logic/GeoLocationHandler");
var StrayClickHandler_1 = require("./Logic/StrayClickHandler");
var SimpleAddUI_1 = require("./UI/SimpleAddUI");
var VariableUIElement_1 = require("./UI/Base/VariableUIElement");
var SearchAndGo_1 = require("./UI/SearchAndGo");
var CollapseButton_1 = require("./UI/Base/CollapseButton");
var AllKnownLayouts_1 = require("./Customizations/AllKnownLayouts");
// --------------------- Read the URL parameters -----------------
// @ts-ignore
if (location.href.startsWith("http://buurtnatuur.be")) {
// Reload the https version. This is important for the 'locate me' button
window.location.replace("https://buurtnatuur.be");
}
var dryRun = false;
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
// Set to true if testing and changes should NOT be saved
dryRun = true;
// If you have a testfile somewhere, enable this to spoof overpass
// This should be hosted independantly, e.g. with `cd assets; webfsd -p 8080` + a CORS plugin to disable cors rules
//Overpass.testUrl = "http://127.0.0.1:8080/streetwidths.geojson";
}
// ----------------- SELECT THE RIGHT QUESTSET -----------------
var defaultLayout = "buurtnatuur";
// Run over all questsets. If a part of the URL matches a searched-for part in the layout, it'll take that as the default
for (var k in AllKnownLayouts_1.AllKnownLayouts.allSets) {
var layout = AllKnownLayouts_1.AllKnownLayouts.allSets[k];
var possibleParts = (_a = layout.locationContains) !== null && _a !== void 0 ? _a : [];
for (var _i = 0, possibleParts_1 = possibleParts; _i < possibleParts_1.length; _i++) {
var locationMatch = possibleParts_1[_i];
if (locationMatch === "") {
continue;
}
if (window.location.href.toLowerCase().indexOf(locationMatch.toLowerCase()) >= 0) {
defaultLayout = layout.name;
}
}
}
// Read the query string to grap settings
var paramDict = {};
if (window.location.search) {
var params = window.location.search.substr(1).split("&");
for (var _b = 0, params_1 = params; _b < params_1.length; _b++) {
var param = params_1[_b];
var kv = param.split("=");
paramDict[kv[0]] = kv[1];
}
}
if (paramDict.layout) {
defaultLayout = paramDict.layout;
}
if (paramDict.test) {
dryRun = paramDict.test === "true";
}
var layoutToUse = AllKnownLayouts_1.AllKnownLayouts.allSets[defaultLayout];
console.log("Using layout: ", layoutToUse.name);
document.title = layoutToUse.title;
// ----------------- Setup a few event sources -------------
// The message that should be shown at the center of the screen
var centerMessage = new UIEventSource_1.UIEventSource("");
// The countdown: if set to e.g. ten, it'll start counting down. When reaching zero, changes will be saved. NB: this is implemented later, not in the eventSource
var secondsTillChangesAreSaved = new UIEventSource_1.UIEventSource(0);
var leftMessage = new UIEventSource_1.UIEventSource(undefined);
var selectedElement = new UIEventSource_1.UIEventSource(undefined);
var locationControl = new UIEventSource_1.UIEventSource({
zoom: layoutToUse.startzoom,
lat: layoutToUse.startLat,
lon: layoutToUse.startLon
});
// ----------------- Prepare the important objects -----------------
var saveTimeout = 30000; // After this many milliseconds without changes, saves are sent of to OSM
var allElements = new ElementStorage_1.ElementStorage();
var osmConnection = new OsmConnection_1.OsmConnection(dryRun);
var changes = new Changes_1.Changes("Beantwoorden van vragen met #MapComplete voor vragenset #" + layoutToUse.name, osmConnection, allElements);
var bm = new Basemap_1.Basemap("leafletDiv", locationControl, new VariableUIElement_1.VariableUiElement(locationControl.map(function (location) {
var 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>";
var 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;
})));
// ------------- Setup the layers -------------------------------
var controls = {};
var addButtons = [];
var flayers = [];
var minZoom = 0;
var _loop_1 = function (layer) {
var generateInfo = function (tagsES) {
return new FeatureInfoBox_1.FeatureInfoBox(tagsES, layer.title, layer.elementsToShow, changes, osmConnection.userDetails);
};
minZoom = Math.max(minZoom, layer.minzoom);
var flayer = layer.asLayer(bm, allElements, changes, osmConnection.userDetails, selectedElement, generateInfo);
controls[layer.name] = flayer.isDisplayed;
var addButton = {
name: layer.name,
icon: layer.icon,
tags: layer.newElementTags,
layerToAddTo: flayer
};
addButtons.push(addButton);
flayers.push(flayer);
};
for (var _c = 0, _d = layoutToUse.layers; _c < _d.length; _c++) {
var layer = _d[_c];
_loop_1(layer);
}
var layerUpdater = new LayerUpdater_1.LayerUpdater(bm, minZoom, flayers);
// ------------------ Setup various UI elements ------------
new StrayClickHandler_1.StrayClickHandler(bm, selectedElement, leftMessage, function () {
return new SimpleAddUI_1.SimpleAddUI(bm.Location, bm.LastClickLocation, changes, selectedElement, layerUpdater.runningQuery, osmConnection.userDetails, addButtons);
});
/**
* Show the questions and information for the selected element on the leftMessage
*/
selectedElement.addCallback(function (data) {
var _loop_2 = function (layer) {
var applicable = layer.overpassFilter.matches(TagsFilter_1.TagUtils.proprtiesToKV(data));
if (applicable) {
// This layer is the layer that gives the questions
leftMessage.setData(function () {
return new FeatureInfoBox_1.FeatureInfoBox(allElements.getElement(data.id), layer.title, layer.elementsToShow, changes, osmConnection.userDetails);
});
return "break";
}
};
// Which is the applicable set?
for (var _i = 0, _a = layoutToUse.layers; _i < _a.length; _i++) {
var layer = _a[_i];
var state_1 = _loop_2(layer);
if (state_1 === "break")
break;
}
});
var pendingChanges = new PendingChanges_1.PendingChanges(changes, secondsTillChangesAreSaved);
new UserBadge_1.UserBadge(osmConnection.userDetails, pendingChanges, bm)
.AttachTo('userbadge');
new SearchAndGo_1.SearchAndGo(bm).AttachTo("searchbox");
new CollapseButton_1.CollapseButton("messagesbox")
.AttachTo("collapseButton");
var welcomeMessage = function () {
return new VariableUIElement_1.VariableUiElement(osmConnection.userDetails.map(function (userdetails) {
var login = layoutToUse.gettingStartedPlzLogin;
if (userdetails.loggedIn) {
login = layoutToUse.welcomeBackMessage;
}
return "<div id='welcomeMessage'>" +
layoutToUse.welcomeMessage + login + layoutToUse.welcomeTail +
"</div>";
}), function () {
osmConnection.registerActivateOsmAUthenticationClass();
});
};
leftMessage.setData(welcomeMessage);
welcomeMessage().AttachTo("messagesbox");
var messageBox = new MessageBoxHandler_1.MessageBoxHandler(leftMessage, function () {
selectedElement.setData(undefined);
});
new CenterMessageBox_1.CenterMessageBox(minZoom, centerMessage, osmConnection, locationControl, layerUpdater.runningQuery)
.AttachTo("centermessage");
Helpers_1.Helpers.SetupAutoSave(changes, secondsTillChangesAreSaved, saveTimeout);
Helpers_1.Helpers.LastEffortSave(changes);
osmConnection.registerActivateOsmAUthenticationClass();
new GeoLocationHandler_1.GeoLocationHandler(bm).AttachTo("geolocate-button");
// --------------- Send a ping to start various action --------
locationControl.ping();
messageBox.update();

12
test.js
View file

@ -1,12 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var TextField_1 = require("./UI/Input/TextField");
var FixedInputElement_1 = require("./UI/Input/FixedInputElement");
var RadioButton_1 = require("./UI/Input/RadioButton");
var buttons = new RadioButton_1.RadioButton([new FixedInputElement_1.FixedInputElement("Five", 5),
new FixedInputElement_1.FixedInputElement("Ten", 10), new TextField_1.TextField({
fromString: function (str) { return parseInt(str); },
toString: function (i) { return ("" + i); },
})
], false).AttachTo("maindiv");
buttons.GetValue().addCallback(console.log);