Add binoculars theme, auto reformat everything

This commit is contained in:
Pieter Vander Vennet 2021-09-09 00:05:51 +02:00
parent 38dea806c5
commit 78d6482c88
586 changed files with 115573 additions and 111842 deletions

View file

@ -8,5 +8,5 @@ export default interface BaseLayer {
min_zoom: number;
feature: any,
isBest?: boolean,
category?: "map" | "osmbasedmap" | "photo" | "historicphoto" | string
category?: "map" | "osmbasedmap" | "photo" | "historicphoto" | string
}

View file

@ -1,7 +1,7 @@
import { Utils } from "../Utils";
import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.9.6";
// The user journey states thresholds when a new feature gets unlocked
@ -12,13 +12,13 @@ export default class Constants {
deletePointsOfOthersUnlock: 20,
tagsVisibleAt: 25,
tagsVisibleAndWikiLinked: 30,
mapCompleteHelpUnlock: 50,
themeGeneratorReadOnlyUnlock: 50,
themeGeneratorFullUnlock: 500,
addNewPointWithUnreadMessagesUnlock: 500,
minZoomLevelToAddNewPoints: (Constants.isRetina() ? 18 : 19),
};
/**
* Used by 'PendingChangesUploader', which waits this amount of seconds to upload changes.
@ -34,5 +34,5 @@ export default class Constants {
// See https://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript
return ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx), only screen and (min-resolution: 75.6dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min--moz-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2)').matches)) || (window.devicePixelRatio && window.devicePixelRatio >= 2));
}
}

View file

@ -6,8 +6,8 @@ export class Denomination {
public readonly canonical: string;
readonly default: boolean;
readonly prefix: boolean;
private readonly _human: Translation;
public readonly alternativeDenominations: string [];
private readonly _human: Translation;
constructor(json: UnitConfigJson, context: string) {
context = `${context}.unit(${json.canonicalDenomination})`

View file

@ -1,5 +1,4 @@
import {UIEventSource} from "../Logic/UIEventSource";
import {TagsFilter} from "../Logic/Tags/TagsFilter";
import LayerConfig from "./ThemeConfig/LayerConfig";
import {And} from "../Logic/Tags/And";

View file

@ -11,14 +11,14 @@ export default class FilterConfig {
}[];
constructor(json: FilterConfigJson, context: string) {
if(json.options === undefined){
if (json.options === undefined) {
throw `A filter without options was given at ${context}`
}
if(json.options.map === undefined){
if (json.options.map === undefined) {
throw `A filter was given where the options aren't a list at ${context}`
}
this.options = json.options.map((option, i) => {
const question = Translations.T(
option.question,
@ -28,7 +28,7 @@ export default class FilterConfig {
option.osmTags ?? {and: []},
`${context}.options-[${i}].osmTags`
);
if(question === undefined){
if (question === undefined) {
throw `Invalid filter: no question given at ${context}[${i}]`
}

View file

@ -53,10 +53,9 @@ export default class LayoutConfig {
*/
public readonly cacheTimeout?: number;
public readonly units: Unit[] = []
private readonly _official: boolean;
public readonly overpassUrl: string;
public readonly overpassTimeout: number;
private readonly _official: boolean;
constructor(json: LayoutConfigJson, official = true, context?: string) {
this._official = official;

View file

@ -6,7 +6,6 @@ import {TagUtils} from "../../Logic/Tags/TagUtils";
import {And} from "../../Logic/Tags/And";
import ValidatedTextField from "../../UI/Input/ValidatedTextField";
import {Utils} from "../../Utils";
import {SubstitutedTranslation} from "../../UI/SubstitutedTranslation";
/***
* The parsed version of TagRenderingConfigJSON